aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/endian.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys/endian.h')
-rw-r--r--sys/sys/endian.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/sys/endian.h b/sys/sys/endian.h
index 01af50670a48..35a43804b92c 100644
--- a/sys/sys/endian.h
+++ b/sys/sys/endian.h
@@ -94,7 +94,7 @@ typedef __uint64_t uint64_t;
static __inline uint16_t
be16dec(const void *pp)
{
- unsigned char const *p = pp;
+ unsigned char const *p = (unsigned char const *)pp;
return ((p[0] << 8) | p[1]);
}
@@ -102,7 +102,7 @@ be16dec(const void *pp)
static __inline uint32_t
be32dec(const void *pp)
{
- unsigned char const *p = pp;
+ unsigned char const *p = (unsigned char const *)pp;
return ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
}
@@ -110,7 +110,7 @@ be32dec(const void *pp)
static __inline uint64_t
be64dec(const void *pp)
{
- unsigned char const *p = pp;
+ unsigned char const *p = (unsigned char const *)pp;
return (((uint64_t)be32dec(p) << 32) | be32dec(p + 4));
}
@@ -118,7 +118,7 @@ be64dec(const void *pp)
static __inline uint16_t
le16dec(const void *pp)
{
- unsigned char const *p = pp;
+ unsigned char const *p = (unsigned char const *)pp;
return ((p[1] << 8) | p[0]);
}
@@ -126,7 +126,7 @@ le16dec(const void *pp)
static __inline uint32_t
le32dec(const void *pp)
{
- unsigned char const *p = pp;
+ unsigned char const *p = (unsigned char const *)pp;
return ((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]);
}
@@ -134,7 +134,7 @@ le32dec(const void *pp)
static __inline uint64_t
le64dec(const void *pp)
{
- unsigned char const *p = pp;
+ unsigned char const *p = (unsigned char const *)pp;
return (((uint64_t)le32dec(p + 4) << 32) | le32dec(p));
}
@@ -142,7 +142,7 @@ le64dec(const void *pp)
static __inline void
be16enc(void *pp, uint16_t u)
{
- unsigned char *p = pp;
+ unsigned char *p = (unsigned char *)pp;
p[0] = (u >> 8) & 0xff;
p[1] = u & 0xff;
@@ -151,7 +151,7 @@ be16enc(void *pp, uint16_t u)
static __inline void
be32enc(void *pp, uint32_t u)
{
- unsigned char *p = pp;
+ unsigned char *p = (unsigned char *)pp;
p[0] = (u >> 24) & 0xff;
p[1] = (u >> 16) & 0xff;
@@ -162,7 +162,7 @@ be32enc(void *pp, uint32_t u)
static __inline void
be64enc(void *pp, uint64_t u)
{
- unsigned char *p = pp;
+ unsigned char *p = (unsigned char *)pp;
be32enc(p, u >> 32);
be32enc(p + 4, u & 0xffffffff);
@@ -171,7 +171,7 @@ be64enc(void *pp, uint64_t u)
static __inline void
le16enc(void *pp, uint16_t u)
{
- unsigned char *p = pp;
+ unsigned char *p = (unsigned char *)pp;
p[0] = u & 0xff;
p[1] = (u >> 8) & 0xff;
@@ -180,7 +180,7 @@ le16enc(void *pp, uint16_t u)
static __inline void
le32enc(void *pp, uint32_t u)
{
- unsigned char *p = pp;
+ unsigned char *p = (unsigned char *)pp;
p[0] = u & 0xff;
p[1] = (u >> 8) & 0xff;
@@ -191,7 +191,7 @@ le32enc(void *pp, uint32_t u)
static __inline void
le64enc(void *pp, uint64_t u)
{
- unsigned char *p = pp;
+ unsigned char *p = (unsigned char *)pp;
le32enc(p, u & 0xffffffff);
le32enc(p + 4, u >> 32);