From 3105ee542f89cd986d0f81d2cd70ce385021d1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Mayer?= Date: Fri, 2 Aug 2002 21:29:45 +0000 Subject: Replace the types from sys/types.h and netinet/in.h by their glib.h equivalents for the epan/ directory but leave winsock2.h in inet_pton.c and inet_ntop.c for now (can't estimate the consequences). svn path=/trunk/; revision=5928 --- epan/inet_pton.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'epan/inet_pton.c') diff --git a/epan/inet_pton.c b/epan/inet_pton.c index 07d7c1af7c..47df162d96 100644 --- a/epan/inet_pton.c +++ b/epan/inet_pton.c @@ -20,17 +20,13 @@ #endif #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$Id: inet_pton.c,v 1.2 2002/06/23 10:32:32 guy Exp $"; +static char rcsid[] = "$Id: inet_pton.c,v 1.3 2002/08/02 21:29:39 jmayer Exp $"; #endif /* LIBC_SCCS and not lint */ #ifdef HAVE_SYS_PARAM_H #include #endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif - #ifdef HAVE_WINSOCK2_H #include #define EAFNOSUPPORT WSAEAFNOSUPPORT @@ -40,10 +36,6 @@ static char rcsid[] = "$Id: inet_pton.c,v 1.2 2002/06/23 10:32:32 guy Exp $"; #include #endif -#ifdef HAVE_NETINET_IN_H -#include -#endif - #ifdef HAVE_ARPA_INET_H #include #endif @@ -73,10 +65,10 @@ static char rcsid[] = "$Id: inet_pton.c,v 1.2 2002/06/23 10:32:32 guy Exp $"; */ #ifdef AF_INET -static int inet_pton4 __P((const char *src, u_char *dst)); +static int inet_pton4 __P((const char *src, guchar *dst)); #endif #ifdef AF_INET6 -static int inet_pton6 __P((const char *src, u_char *dst)); +static int inet_pton6 __P((const char *src, guchar *dst)); #endif /* int @@ -126,11 +118,11 @@ inet_pton(af, src, dst) static int inet_pton4(src, dst) const char *src; - u_char *dst; + guchar *dst; { static const char digits[] = "0123456789"; int saw_digit, octets, ch; - u_char tmp[NS_INADDRSZ], *tp; + guchar tmp[NS_INADDRSZ], *tp; saw_digit = 0; octets = 0; @@ -139,7 +131,7 @@ inet_pton4(src, dst) const char *pch; if ((pch = strchr(digits, ch)) != NULL) { - u_int new = *tp * 10 + (pch - digits); + guint new = *tp * 10 + (pch - digits); if (new > 255) return (0); @@ -181,14 +173,14 @@ inet_pton4(src, dst) static int inet_pton6(src, dst) const char *src; - u_char *dst; + guchar *dst; { static const char xdigits_l[] = "0123456789abcdef", xdigits_u[] = "0123456789ABCDEF"; - u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; + guchar tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; const char *xdigits, *curtok; int ch, saw_xdigit; - u_int val; + guint val; memset((tp = tmp), '\0', NS_IN6ADDRSZ); endp = tp + NS_IN6ADDRSZ; @@ -225,8 +217,8 @@ inet_pton6(src, dst) } if (tp + NS_INT16SZ > endp) return (0); - *tp++ = (u_char) (val >> 8) & 0xff; - *tp++ = (u_char) val & 0xff; + *tp++ = (guchar) (val >> 8) & 0xff; + *tp++ = (guchar) val & 0xff; saw_xdigit = 0; val = 0; continue; @@ -242,8 +234,8 @@ inet_pton6(src, dst) if (saw_xdigit) { if (tp + NS_INT16SZ > endp) return (0); - *tp++ = (u_char) (val >> 8) & 0xff; - *tp++ = (u_char) val & 0xff; + *tp++ = (guchar) (val >> 8) & 0xff; + *tp++ = (guchar) val & 0xff; } if (colonp != NULL) { /* -- cgit v1.2.1