Cleaned up compile warnings.

This commit is contained in:
skarg
2007-06-15 22:50:25 +00:00
parent 0b86feeff7
commit 3656c352ce
+16 -16
View File
@@ -55,10 +55,10 @@ static long gethostaddr(void)
if ((host_ent = gethostbyname(host_name)) == NULL) if ((host_ent = gethostbyname(host_name)) == NULL)
return -1; return -1;
#ifdef BIP_DEBUG #ifdef BIP_DEBUG
printf("host: %s at %u.%u.%u.%u\n", host_name, printf("host: %s at %u.%u.%u.%u\n", host_name,
((uint8_t*)host_ent->h_addr)[0], ((uint8_t*)host_ent->h_addr)[0],
((uint8_t*)host_ent->h_addr)[1], ((uint8_t*)host_ent->h_addr)[1],
((uint8_t*)host_ent->h_addr)[2], ((uint8_t*)host_ent->h_addr)[2],
((uint8_t*)host_ent->h_addr)[3]); ((uint8_t*)host_ent->h_addr)[3]);
#endif #endif
/* note: network byte order */ /* note: network byte order */
@@ -67,15 +67,15 @@ static long gethostaddr(void)
static void set_broadcast_address(uint32_t net_address) static void set_broadcast_address(uint32_t net_address)
{ {
long broadcast_address = 0; #if USE_INADDR
long mask = 0;
/* Note: sometimes INADDR_BROADCAST does not let me get /* Note: sometimes INADDR_BROADCAST does not let me get
any unicast messages. Not sure why... */ any unicast messages. Not sure why... */
#if USE_INADDR
(void) net_address; (void) net_address;
bip_set_broadcast_addr(INADDR_BROADCAST); bip_set_broadcast_addr(INADDR_BROADCAST);
#else #else
long broadcast_address = 0;
long mask = 0;
if (IN_CLASSA(ntohl(net_address))) if (IN_CLASSA(ntohl(net_address)))
broadcast_address = broadcast_address =
(ntohl(net_address) & ~IN_CLASSA_HOST) | IN_CLASSA_HOST; (ntohl(net_address) & ~IN_CLASSA_HOST) | IN_CLASSA_HOST;
@@ -125,19 +125,19 @@ static char *winsock_error_code_text(int code)
switch (code) { switch (code) {
case WSAEACCES: case WSAEACCES:
return "Permission denied."; return "Permission denied.";
case WSAEINTR: case WSAEINTR:
return "Interrupted system call."; return "Interrupted system call.";
case WSAEBADF: case WSAEBADF:
return "Bad file number."; return "Bad file number.";
case WSAEFAULT: case WSAEFAULT:
return "Bad address."; return "Bad address.";
case WSAEINVAL: case WSAEINVAL:
return "Invalid argument."; return "Invalid argument.";
case WSAEMFILE: case WSAEMFILE:
return "Too many open files."; return "Too many open files.";
case WSAEWOULDBLOCK: case WSAEWOULDBLOCK:
return "Operation would block."; return "Operation would block.";
case WSAEINPROGRESS: case WSAEINPROGRESS:
return "Operation now in progress. This error is returned if any Windows Sockets API function is called while a blocking function is in progress."; return "Operation now in progress. This error is returned if any Windows Sockets API function is called while a blocking function is in progress.";
case WSAENOTSOCK: case WSAENOTSOCK:
return "Socket operation on nonsocket."; return "Socket operation on nonsocket.";
@@ -251,7 +251,7 @@ bool bip_init(char *ifname)
exit(1); exit(1);
} }
atexit(cleanup); atexit(cleanup);
if (ifname) if (ifname)
bip_set_interface(ifname); bip_set_interface(ifname);
/* has address been set? */ /* has address been set? */