aboutsummaryrefslogtreecommitdiff
path: root/ares
diff options
context:
space:
mode:
authorDominick Meglio <dcm5151@esu.edu>2005-04-09 23:46:31 +0000
committerDominick Meglio <dcm5151@esu.edu>2005-04-09 23:46:31 +0000
commitbee198def5f63d42c7d6395d0637939df799cc77 (patch)
tree16a9380ef91cbf0fbd848a0c36d6ee43a9d14bec /ares
parentf09e479fd62e62f7f81f6219c02b14c96cff6120 (diff)
Removed usage of u_int and u_char
Diffstat (limited to 'ares')
-rw-r--r--ares/bitncmp.c6
-rw-r--r--ares/inet_net_pton.c30
2 files changed, 18 insertions, 18 deletions
diff --git a/ares/bitncmp.c b/ares/bitncmp.c
index 3986dc6c8..0da540fff 100644
--- a/ares/bitncmp.c
+++ b/ares/bitncmp.c
@@ -36,7 +36,7 @@
*/
int
ares_bitncmp(const void *l, const void *r, int n) {
- u_int lb, rb;
+ unsigned int lb, rb;
int x, b;
b = n / 8;
@@ -44,8 +44,8 @@ ares_bitncmp(const void *l, const void *r, int n) {
if (x)
return (x);
- lb = ((const u_char *)l)[b];
- rb = ((const u_char *)r)[b];
+ lb = ((const unsigned char *)l)[b];
+ rb = ((const unsigned char *)r)[b];
for (b = n % 8; b > 0; b--) {
if ((lb & 0x80) != (rb & 0x80)) {
if (lb & 0x80)
diff --git a/ares/inet_net_pton.c b/ares/inet_net_pton.c
index 6aeb620a9..e1135b07b 100644
--- a/ares/inet_net_pton.c
+++ b/ares/inet_net_pton.c
@@ -67,11 +67,11 @@
* Paul Vixie (ISC), June 1996
*/
static int
-inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) {
+inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size) {
static const char xdigits[] = "0123456789abcdef";
static const char digits[] = "0123456789";
int n, ch, tmp = 0, dirty, bits;
- const u_char *odst = dst;
+ const unsigned char *odst = dst;
ch = *src++;
if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
@@ -93,14 +93,14 @@ inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) {
if (++dirty == 2) {
if (size-- <= 0U)
goto emsgsize;
- *dst++ = (u_char) tmp;
+ *dst++ = (unsigned char) tmp;
dirty = 0;
}
}
if (dirty) { /* Odd trailing nybble? */
if (size-- <= 0U)
goto emsgsize;
- *dst++ = (u_char) (tmp << 4);
+ *dst++ = (unsigned char) (tmp << 4);
}
} else if (isascii(ch) && isdigit(ch)) {
/* Decimal: eat dotted digit string. */
@@ -116,7 +116,7 @@ inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) {
isascii(ch) && isdigit(ch));
if (size-- <= 0U)
goto emsgsize;
- *dst++ = (u_char) tmp;
+ *dst++ = (unsigned char) tmp;
if (ch == '\0' || ch == '/')
break;
if (ch != '.')
@@ -222,11 +222,11 @@ getbits(const char *src, int *bitsp) {
}
static int
-getv4(const char *src, u_char *dst, int *bitsp) {
+getv4(const char *src, unsigned char *dst, int *bitsp) {
static const char digits[] = "0123456789";
- u_char *odst = dst;
+ unsigned char *odst = dst;
int n;
- u_int val;
+ unsigned int val;
char ch;
val = 0;
@@ -265,13 +265,13 @@ getv4(const char *src, u_char *dst, int *bitsp) {
}
static int
-inet_net_pton_ipv6(const char *src, u_char *dst, size_t size) {
+inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size) {
static const char xdigits_l[] = "0123456789abcdef",
xdigits_u[] = "0123456789ABCDEF";
- u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
+ unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
const char *xdigits, *curtok;
int ch, saw_xdigit;
- u_int val;
+ unsigned int val;
int digits;
int bits;
size_t bytes;
@@ -315,8 +315,8 @@ inet_net_pton_ipv6(const char *src, u_char *dst, size_t size) {
goto enoent;
if (tp + NS_INT16SZ > endp)
return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
+ *tp++ = (unsigned char) (val >> 8) & 0xff;
+ *tp++ = (unsigned char) val & 0xff;
saw_xdigit = 0;
digits = 0;
val = 0;
@@ -336,8 +336,8 @@ inet_net_pton_ipv6(const char *src, u_char *dst, size_t size) {
if (saw_xdigit) {
if (tp + NS_INT16SZ > endp)
goto enoent;
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
+ *tp++ = (unsigned char) (val >> 8) & 0xff;
+ *tp++ = (unsigned char) val & 0xff;
}
if (bits == -1)
bits = 128;