1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Use "unsigned char" instead of "u_char" to avoid trouble.

This commit is contained in:
Poul-Henning Kamp 2003-04-03 10:21:58 +00:00
parent 8f24aac6b9
commit 43e7e03ae6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113007

View File

@ -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);