diff options
author | phk <phk@FreeBSD.org> | 2003-04-03 10:21:58 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-04-03 10:21:58 +0000 |
commit | 310472fea77e66f7a0415d5130c87da11d8a8adf (patch) | |
tree | 1ba50a4c6f94c1ebe9a10e171a0df6824feaa200 | |
parent | ef3342b1dcebbb7a509bb4cac415809087908be5 (diff) | |
download | FreeBSD-src-310472fea77e66f7a0415d5130c87da11d8a8adf.zip FreeBSD-src-310472fea77e66f7a0415d5130c87da11d8a8adf.tar.gz |
Use "unsigned char" instead of "u_char" to avoid trouble.
-rw-r--r-- | sys/sys/endian.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/sys/endian.h b/sys/sys/endian.h index 0458ffd..8ffa66c 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); |