aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/endian.h
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2003-04-03 10:21:58 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2003-04-03 10:21:58 +0000
commit43e7e03ae693185fc03c130d81565c97300ec67c (patch)
tree1ba50a4c6f94c1ebe9a10e171a0df6824feaa200 /sys/sys/endian.h
parent8f24aac6b93c2bf25b4d4c772e3a18ad709e6948 (diff)
downloadsrc-43e7e03ae693185fc03c130d81565c97300ec67c.tar.gz
src-43e7e03ae693185fc03c130d81565c97300ec67c.zip
Use "unsigned char" instead of "u_char" to avoid trouble.
Notes
Notes: svn path=/head/; revision=113007
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 0458ffddae4d..8ffa66c94c09 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)
{
- u_char const *p = pp;
+ unsigned char const *p = pp;
return ((p[0] << 8) | p[1]);
}
@@ -102,7 +102,7 @@ be16dec(const void *pp)
static __inline uint32_t
be32dec(const void *pp)
{
- u_char const *p = pp;
+ unsigned char const *p = 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)
{
- u_char const *p = pp;
+ unsigned char const *p = 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)
{
- u_char const *p = pp;
+ unsigned char const *p = pp;
return ((p[1] << 8) | p[0]);
}
@@ -126,7 +126,7 @@ le16dec(const void *pp)
static __inline uint32_t
le32dec(const void *pp)
{
- u_char const *p = pp;
+ unsigned char const *p = 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)
{
- u_char const *p = pp;
+ unsigned char const *p = pp;
return (((uint64_t)be32dec(p + 4) << 32) | be32dec(p));
}
@@ -142,7 +142,7 @@ le64dec(const void *pp)
static __inline void
be16enc(void *pp, uint16_t u)
{
- u_char *p = pp;
+ unsigned char *p = 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)
{
- u_char *p = pp;
+ unsigned char *p = 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)
{
- u_char *p = pp;
+ unsigned char *p = 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)
{
- u_char *p = pp;
+ unsigned char *p = 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)
{
- u_char *p = pp;
+ unsigned char *p = 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)
{
- u_char *p = pp;
+ unsigned char *p = pp;
be32enc(p, u & 0xffffffff);
be32enc(p + 4, u >> 32);