From 3656c352ce6303720256a5167efb2362cac53dc5 Mon Sep 17 00:00:00 2001 From: skarg Date: Fri, 15 Jun 2007 22:50:25 +0000 Subject: [PATCH] Cleaned up compile warnings. --- bacnet-stack/ports/win32/bip-init.c | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/bacnet-stack/ports/win32/bip-init.c b/bacnet-stack/ports/win32/bip-init.c index 0bd71bb6..972f9f25 100644 --- a/bacnet-stack/ports/win32/bip-init.c +++ b/bacnet-stack/ports/win32/bip-init.c @@ -55,10 +55,10 @@ static long gethostaddr(void) if ((host_ent = gethostbyname(host_name)) == NULL) return -1; #ifdef BIP_DEBUG - printf("host: %s at %u.%u.%u.%u\n", host_name, - ((uint8_t*)host_ent->h_addr)[0], - ((uint8_t*)host_ent->h_addr)[1], - ((uint8_t*)host_ent->h_addr)[2], + printf("host: %s at %u.%u.%u.%u\n", host_name, + ((uint8_t*)host_ent->h_addr)[0], + ((uint8_t*)host_ent->h_addr)[1], + ((uint8_t*)host_ent->h_addr)[2], ((uint8_t*)host_ent->h_addr)[3]); #endif /* note: network byte order */ @@ -67,15 +67,15 @@ static long gethostaddr(void) static void set_broadcast_address(uint32_t net_address) { - long broadcast_address = 0; - long mask = 0; - +#if USE_INADDR /* Note: sometimes INADDR_BROADCAST does not let me get any unicast messages. Not sure why... */ -#if USE_INADDR (void) net_address; bip_set_broadcast_addr(INADDR_BROADCAST); #else + long broadcast_address = 0; + long mask = 0; + if (IN_CLASSA(ntohl(net_address))) broadcast_address = (ntohl(net_address) & ~IN_CLASSA_HOST) | IN_CLASSA_HOST; @@ -125,19 +125,19 @@ static char *winsock_error_code_text(int code) switch (code) { case WSAEACCES: return "Permission denied."; - case WSAEINTR: + case WSAEINTR: return "Interrupted system call."; - case WSAEBADF: + case WSAEBADF: return "Bad file number."; - case WSAEFAULT: + case WSAEFAULT: return "Bad address."; - case WSAEINVAL: + case WSAEINVAL: return "Invalid argument."; - case WSAEMFILE: + case WSAEMFILE: return "Too many open files."; - case WSAEWOULDBLOCK: + case WSAEWOULDBLOCK: 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."; case WSAENOTSOCK: return "Socket operation on nonsocket."; @@ -251,7 +251,7 @@ bool bip_init(char *ifname) exit(1); } atexit(cleanup); - + if (ifname) bip_set_interface(ifname); /* has address been set? */