1
0
mirror of https://github.com/yarrick/iodine.git synced 2024-11-22 21:16:07 +03:00

Fix signedness warnings

This commit is contained in:
Erik Ekman 2007-01-28 12:58:23 +00:00
parent 4f1c123c8e
commit fa2ca99b8a

View File

@ -87,7 +87,7 @@ readshort(char *packet, char **src, short *dst)
{ {
unsigned char *p; unsigned char *p;
p = *src; p = (unsigned char *) *src;
*dst = (p[0] << 8) | p[1]; *dst = (p[0] << 8) | p[1];
(*src) += sizeof(short); (*src) += sizeof(short);
@ -100,7 +100,7 @@ readlong(char *packet, char **src, uint32_t *dst)
// A long as described in dns protocol is always 32 bits // A long as described in dns protocol is always 32 bits
unsigned char *p; unsigned char *p;
p = *src; p = (unsigned char *) *src;
*dst = ((uint32_t)p[0] << 24) *dst = ((uint32_t)p[0] << 24)
| ((uint32_t)p[1] << 16) | ((uint32_t)p[1] << 16)
@ -138,12 +138,12 @@ putshort(char **dst, short value)
{ {
unsigned char *p; unsigned char *p;
p = *dst; p = (unsigned char *) *dst;
*p++ = (value >> 8); *p++ = (value >> 8);
*p++ = value; *p++ = value;
(*dst) = p; (*dst) = (char *) p;
return sizeof(short); return sizeof(short);
} }
@ -153,14 +153,14 @@ putlong(char **dst, uint32_t value)
// A long as described in dns protocol is always 32 bits // A long as described in dns protocol is always 32 bits
unsigned char *p; unsigned char *p;
p = *dst; p = (unsigned char *) *dst;
*p++ = (value >> 24); *p++ = (value >> 24);
*p++ = (value >> 16); *p++ = (value >> 16);
*p++ = (value >> 8); *p++ = (value >> 8);
*p++ = (value); *p++ = (value);
(*dst) = p; (*dst) = (char *) p;
return sizeof(uint32_t); return sizeof(uint32_t);
} }