* inet_aton.c (inet_aton): Add prototype, to remove compiler
authorJim Blandy <jimb@red-bean.com>
Sat, 3 Oct 1998 09:12:12 +0000 (09:12 +0000)
committerJim Blandy <jimb@red-bean.com>
Sat, 3 Oct 1998 09:12:12 +0000 (09:12 +0000)
warning. (Thanks to Robert Pluim.)
* inet_aton.c (inet_aton): Reassure the compiler that the
arguments to the <ctype.h> macros are all unsigned characters, not
signed characters.

libguile/inet_aton.c

index 1d02af5..88c5d8a 100644 (file)
@@ -60,21 +60,26 @@ inet_addr(cp)
 
 #endif
 
+/* We provide this prototype to avoid compiler warnings.  If this ever
+   conflicts with a declaration in a system header file, we'll find
+   out, because we should include that header file here.  */
+int inet_aton (const char *cp, struct in_addr *addr);
+
 /* 
  * Check whether "cp" is a valid ascii representation
  * of an Internet address and convert to a binary address.
  * Returns 1 if the address is valid, 0 if not.
  * This replaces inet_addr, the return value from which
- * cannot distinguish between failure and a local broadcast address.
- */
+ * cannot distinguish between failure and a local broadcast address.  */
 int
-inet_aton(cp, addr)
-       register const char *cp;
+inet_aton(cp_arg, addr)
+       const char *cp_arg;
        struct in_addr *addr;
 {
        register unsigned long val;
        register int base, n;
-       register char c;
+       register unsigned char c;
+       register unsigned const char *cp = cp_arg;
        unsigned int parts[4];
        register unsigned int *pp = parts;