int value;
int part;
- if (cp == NULL) { /* check for NULL arg */
- return 0;
+ if (cp == NULL) {
+ return 0;
}
addr = 0;
} else {
char c = *cp++;
if (c != '\0' && !isspace(c))
- return 0;
+ return 0;
}
addr <<= 8;
q = 0;
p = buf + INET_NTOA_MAX_LEN - 1; /* cannot use sizeof(buf) here */
- for (i=0 ; i < 4 ; i++ ) {
+ for (i = 0; i < 4; i++ ) {
p = _int10tostr(p, addr & 0xff) - 1;
addr >>= 8;
if (q) {
char *inet_ntoa(struct in_addr in)
{
static char buf[INET_NTOA_MAX_LEN];
- return(inet_ntoa_r(in, buf));
+ return inet_ntoa_r(in, buf);
}
libc_hidden_def(inet_ntoa)
#endif
else
addr = net | host;
addr = htonl(addr);
- return (*(struct in_addr *)&addr);
+ return *(struct in_addr *)&addr;
}
libc_hidden_def(inet_makeaddr)
#endif
in_addr_t i = ntohl(in.s_addr);
if (IN_CLASSA(i))
- return ((i)&IN_CLASSA_HOST);
+ return (i & IN_CLASSA_HOST);
else if (IN_CLASSB(i))
- return ((i)&IN_CLASSB_HOST);
+ return (i & IN_CLASSB_HOST);
else
- return ((i)&IN_CLASSC_HOST);
+ return (i & IN_CLASSC_HOST);
}
#endif
in_addr_t i = ntohl(in.s_addr);
if (IN_CLASSA(i))
- return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
+ return ((i & IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
else if (IN_CLASSB(i))
- return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
+ return ((i & IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
else
- return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
+ return ((i & IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
}
libc_hidden_def(inet_netof)
#endif