1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 07:38:49 -05:00

Replaced nonstandard u_char and u_int types

This commit is contained in:
Dan Fandrich 2005-12-08 22:59:58 +00:00
parent 6a0ed81e67
commit df03d5a8b2
2 changed files with 7 additions and 7 deletions

View 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);

View 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;