From 7859a834b58df8ba5cf9d86e83095c93e16f1daf Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Mon, 2 Mar 2015 21:50:28 +0000 Subject: [PATCH] Support: Use const pointers for reads. Fixes tons of const-cast warnings. Signed-off-by: Jan Vesely Reviewed-by: Rui Ueyama llvm-svn: 231021 --- llvm/include/llvm/Support/Endian.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/llvm/include/llvm/Support/Endian.h b/llvm/include/llvm/Support/Endian.h index db85c65..17ae651 100644 --- a/llvm/include/llvm/Support/Endian.h +++ b/llvm/include/llvm/Support/Endian.h @@ -197,12 +197,12 @@ typedef detail::packed_endian_specific_integral unaligned_int64_t; namespace endian { -inline uint16_t read16le(const void *p) { return *(ulittle16_t *)p; } -inline uint32_t read32le(const void *p) { return *(ulittle32_t *)p; } -inline uint64_t read64le(const void *p) { return *(ulittle64_t *)p; } -inline uint16_t read16be(const void *p) { return *(ubig16_t *)p; } -inline uint32_t read32be(const void *p) { return *(ubig32_t *)p; } -inline uint64_t read64be(const void *p) { return *(ubig64_t *)p; } +inline uint16_t read16le(const void *p) { return *(const ulittle16_t *)p; } +inline uint32_t read32le(const void *p) { return *(const ulittle32_t *)p; } +inline uint64_t read64le(const void *p) { return *(const ulittle64_t *)p; } +inline uint16_t read16be(const void *p) { return *(const ubig16_t *)p; } +inline uint32_t read32be(const void *p) { return *(const ubig32_t *)p; } +inline uint64_t read64be(const void *p) { return *(const ubig64_t *)p; } inline void write16le(void *p, uint16_t v) { *(ulittle16_t *)p = v; } inline void write32le(void *p, uint32_t v) { *(ulittle32_t *)p = v; } -- 2.7.4