Replaced nonstandard u_char and u_int types
authorDan Fandrich <dan@coneharvesters.com>
Thu, 8 Dec 2005 22:59:58 +0000 (22:59 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Thu, 8 Dec 2005 22:59:58 +0000 (22:59 +0000)
lib/inet_ntop.c
lib/inet_pton.c

index bbe8376..c3b55c0 100644 (file)
@@ -68,9 +68,9 @@
  * Returns `dst' (as a const)
  * Note:
  *  - uses no statics
- *  - takes a u_char* not an in_addr as input
+ *  - takes a unsigned char* not an in_addr as input
  */
-static char *inet_ntop4 (const u_char *src, char *dst, size_t size)
+static char *inet_ntop4 (const unsigned char *src, char *dst, size_t size)
 {
 #if defined(HAVE_INET_NTOA_R_2_ARGS)
   const char *ptr;
@@ -97,7 +97,7 @@ static char *inet_ntop4 (const u_char *src, char *dst, size_t size)
 /*
  * Convert IPv6 binary address into presentation (printable) format.
  */
-static char *inet_ntop6 (const u_char *src, char *dst, size_t size)
+static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size)
 {
   /*
    * Note that int32_t and int16_t need only be "at least" large enough
@@ -208,10 +208,10 @@ char *Curl_inet_ntop(int af, const void *src, char *buf, size_t size)
 {
   switch (af) {
   case AF_INET:
-    return inet_ntop4((const u_char*)src, buf, size);
+    return inet_ntop4((const unsigned char*)src, buf, size);
 #ifdef ENABLE_IPV6
   case AF_INET6:
-    return inet_ntop6((const u_char*)src, buf, size);
+    return inet_ntop6((const unsigned char*)src, buf, size);
 #endif
   default:
     SET_ERRNO(EAFNOSUPPORT);
index 35eef49..c290330 100644 (file)
@@ -114,7 +114,7 @@ inet_pton4(const char *src, unsigned char *dst)
     const char *pch;
 
     if ((pch = strchr(digits, ch)) != NULL) {
-      u_int val = *tp * 10 + (u_int)(pch - digits);
+      unsigned int val = *tp * 10 + (unsigned int)(pch - digits);
 
       if (val > 255)
         return (0);
@@ -161,7 +161,7 @@ inet_pton6(const char *src, unsigned char *dst)
   unsigned char tmp[IN6ADDRSZ], *tp, *endp, *colonp;
   const char *xdigits, *curtok;
   int ch, saw_xdigit;
-  u_int val;
+  unsigned int val;
 
   memset((tp = tmp), 0, IN6ADDRSZ);
   endp = tp + IN6ADDRSZ;