llvm.org GIT mirror llvm / ef20302
Support: Use const pointers for reads. Fixes tons of const-cast warnings. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Rui Ueyama <ruiu@google.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231021 91177308-0d34-0410-b5e6-96231b3b80d8 Jan Vesely 5 years ago
1 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
196196 unaligned_int64_t;
197197
198198 namespace endian {
199 inline uint16_t read16le(const void *p) { return *(ulittle16_t *)p; }
200 inline uint32_t read32le(const void *p) { return *(ulittle32_t *)p; }
201 inline uint64_t read64le(const void *p) { return *(ulittle64_t *)p; }
202 inline uint16_t read16be(const void *p) { return *(ubig16_t *)p; }
203 inline uint32_t read32be(const void *p) { return *(ubig32_t *)p; }
204 inline uint64_t read64be(const void *p) { return *(ubig64_t *)p; }
199 inline uint16_t read16le(const void *p) { return *(const ulittle16_t *)p; }
200 inline uint32_t read32le(const void *p) { return *(const ulittle32_t *)p; }
201 inline uint64_t read64le(const void *p) { return *(const ulittle64_t *)p; }
202 inline uint16_t read16be(const void *p) { return *(const ubig16_t *)p; }
203 inline uint32_t read32be(const void *p) { return *(const ubig32_t *)p; }
204 inline uint64_t read64be(const void *p) { return *(const ubig64_t *)p; }
205205
206206 inline void write16le(void *p, uint16_t v) { *(ulittle16_t *)p = v; }
207207 inline void write32le(void *p, uint32_t v) { *(ulittle32_t *)p = v; }