aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-02-26 22:42:41 -0800
committerMarcel Holtmann <marcel@holtmann.org>2012-03-01 17:50:41 -0800
commit615e1aa0af9c3b3e181c350e81491920df6dca43 (patch)
tree66e2d1e65b3b566b82fd068c38452e54fda7ddfe
parent9cfe086f8607bcb9c3d0bc191f1d94357325a4c8 (diff)
downloadbluez-hcidump-615e1aa0af9c3b3e181c350e81491920df6dca43.tar.gz
bluez-hcidump-615e1aa0af9c3b3e181c350e81491920df6dca43.tar.xz
bluez-hcidump-615e1aa0af9c3b3e181c350e81491920df6dca43.zip
lib: Make unaligned access functions const
-rw-r--r--lib/bluetooth.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index 52606e6..ea7373d 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -154,64 +154,64 @@ do { \
} while(0)
#if __BYTE_ORDER == __LITTLE_ENDIAN
-static inline uint64_t bt_get_le64(void *ptr)
+static inline uint64_t bt_get_le64(const void *ptr)
{
- return bt_get_unaligned((uint64_t *) ptr);
+ return bt_get_unaligned((const uint64_t *) ptr);
}
-static inline uint64_t bt_get_be64(void *ptr)
+static inline uint64_t bt_get_be64(const void *ptr)
{
- return bswap_64(bt_get_unaligned((uint64_t *) ptr));
+ return bswap_64(bt_get_unaligned((const uint64_t *) ptr));
}
-static inline uint32_t bt_get_le32(void *ptr)
+static inline uint32_t bt_get_le32(const void *ptr)
{
- return bt_get_unaligned((uint32_t *) ptr);
+ return bt_get_unaligned((const uint32_t *) ptr);
}
-static inline uint32_t bt_get_be32(void *ptr)
+static inline uint32_t bt_get_be32(const void *ptr)
{
- return bswap_32(bt_get_unaligned((uint32_t *) ptr));
+ return bswap_32(bt_get_unaligned((const uint32_t *) ptr));
}
-static inline uint16_t bt_get_le16(void *ptr)
+static inline uint16_t bt_get_le16(const void *ptr)
{
- return bt_get_unaligned((uint16_t *) ptr);
+ return bt_get_unaligned((const uint16_t *) ptr);
}
-static inline uint16_t bt_get_be16(void *ptr)
+static inline uint16_t bt_get_be16(const void *ptr)
{
- return bswap_16(bt_get_unaligned((uint16_t *) ptr));
+ return bswap_16(bt_get_unaligned((const uint16_t *) ptr));
}
#elif __BYTE_ORDER == __BIG_ENDIAN
-static inline uint64_t bt_get_le64(void *ptr)
+static inline uint64_t bt_get_le64(const void *ptr)
{
- return bswap_64(bt_get_unaligned((uint64_t *) ptr));
+ return bswap_64(bt_get_unaligned((const uint64_t *) ptr));
}
-static inline uint64_t bt_get_be64(void *ptr)
+static inline uint64_t bt_get_be64(const void *ptr)
{
- return bt_get_unaligned((uint64_t *) ptr);
+ return bt_get_unaligned((const uint64_t *) ptr);
}
-static inline uint32_t bt_get_le32(void *ptr)
+static inline uint32_t bt_get_le32(const void *ptr)
{
- return bswap_32(bt_get_unaligned((uint32_t *) ptr));
+ return bswap_32(bt_get_unaligned((const uint32_t *) ptr));
}
-static inline uint32_t bt_get_be32(void *ptr)
+static inline uint32_t bt_get_be32(const void *ptr)
{
- return bt_get_unaligned((uint32_t *) ptr);
+ return bt_get_unaligned((const uint32_t *) ptr);
}
-static inline uint16_t bt_get_le16(void *ptr)
+static inline uint16_t bt_get_le16(const void *ptr)
{
- return bswap_16(bt_get_unaligned((uint16_t *) ptr));
+ return bswap_16(bt_get_unaligned((const uint16_t *) ptr));
}
-static inline uint16_t bt_get_be16(void *ptr)
+static inline uint16_t bt_get_be16(const void *ptr)
{
- return bt_get_unaligned((uint16_t *) ptr);
+ return bt_get_unaligned((const uint16_t *) ptr);
}
#else
#error "Unknown byte order"