[NeoStats-Devel] [Commits] r2636 - in trunk: . include lib/curl lib/event modules/statserv/geoip src src/protocol

[email protected]
Newsgroups gmane.comp.neostats.devel
Message-ID <[email protected]>
Author: Fish
Date: Fri Jul  1 16:18:15 2005
New Revision: 2636

Modified:
   trunk/ChangeLog
   trunk/include/neostats.h
   trunk/lib/curl/url.c
   trunk/lib/event/buffer.c
   trunk/modules/statserv/geoip/GeoIP.c
   trunk/modules/statserv/geoip/GeoIPCity.c
   trunk/src/adnscheck.c   (props changed)
   trunk/src/adnsevent.c   (contents, props changed)
   trunk/src/adnsgeneral.c   (contents, props changed)
   trunk/src/adnsparse.c   (contents, props changed)
   trunk/src/adnsquery.c   (contents, props changed)
   trunk/src/adnsreply.c   (contents, props changed)
   trunk/src/adnssetup.c   (contents, props changed)
   trunk/src/adnstransmit.c   (contents, props changed)
   trunk/src/adnstypes.c   (contents, props changed)
   trunk/src/auth.c   (props changed)
   trunk/src/bans.c   (props changed)
   trunk/src/base64.c   (props changed)
   trunk/src/botinfo.c   (props changed)
   trunk/src/bots.c   (props changed)
   trunk/src/channels.c   (props changed)
   trunk/src/commands.c   (props changed)
   trunk/src/conf.c   (props changed)
   trunk/src/confuse.c   (props changed)
   trunk/src/confuselexer.c   (props changed)
   trunk/src/ctcp.c   (props changed)
   trunk/src/dcc.c   (props changed)
   trunk/src/dl.c   (props changed)
   trunk/src/dns.c   (props changed)
   trunk/src/exclude.c   (props changed)
   trunk/src/hash.c   (props changed)
   trunk/src/helpstrings.c   (props changed)
   trunk/src/ircprotocol.c   (props changed)
   trunk/src/ircrecv.c   (props changed)
   trunk/src/ircsend.c   (contents, props changed)
   trunk/src/ircstring.c   (props changed)
   trunk/src/keeper.c   (props changed)
   trunk/src/lang.c   (props changed)
   trunk/src/list.c   (props changed)
   trunk/src/log.c   (props changed)
   trunk/src/main.c   (contents, props changed)
   trunk/src/match.c   (props changed)
   trunk/src/misc.c   (props changed)
   trunk/src/modes.c   (props changed)
   trunk/src/modules.c   (props changed)
   trunk/src/nsdba.c   (props changed)
   trunk/src/nsmemory.c   (props changed)
   trunk/src/numerics.c   (props changed)
   trunk/src/oscalls.c   (props changed)
   trunk/src/osfile.c   (props changed)
   trunk/src/ossocket.c   (contents, props changed)
   trunk/src/protocol/unreal32.c
   trunk/src/servers.c   (props changed)
   trunk/src/services.c   (props changed)
   trunk/src/settings.c   (props changed)
   trunk/src/signals.c   (props changed)
   trunk/src/sock.c   (contents, props changed)
   trunk/src/support.c   (props changed)
   trunk/src/timer.c   (props changed)
   trunk/src/transfer.c   (props changed)
   trunk/src/users.c   (props changed)
Log:
sush my little GCC 4.0 annoying compiler

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	(original)
+++ trunk/ChangeLog	Fri Jul  1 16:18:15 2005
@@ -4,6 +4,7 @@
 Fish (F), Mark (M), DeadNotBuried (D)
 ===============================================================================
 * NeoStats * Version 3.0.a3-dev
+ - Fix warnings that GCC 4.0 generates (F)
  - LimitServ: set minimum limit settable by LimitServ to Users + 1 (D)
  - LimitServ: fix paramter order being passed to ManageLimits (D)
  - Move Config file over to confuse engine, and redo makeconf to work with

Modified: trunk/include/neostats.h
==============================================================================
--- trunk/include/neostats.h	(original)
+++ trunk/include/neostats.h	Fri Jul  1 16:18:15 2005
@@ -1135,7 +1135,7 @@
 EXPORTFUNC Bot *FindBot( const char *bot_name );
 
 /* main.c */
-EXPORTFUNC void fatal_error( char *file, int line, char *func, char *error_text) __attribute__((noreturn));;
+EXPORTFUNC void fatal_error( char *file, int line, const char *func, char *error_text) __attribute__((noreturn));;
 #define FATAL_ERROR(error_text) fatal_error(__FILE__, __LINE__, __PRETTY_FUNCTION__,(error_text) ); 
 
 /* nsmemory.c */
@@ -1498,7 +1498,7 @@
 EXPORTFUNC int os_sock_write( OS_SOCKET s, const char *buf, int len );
 EXPORTFUNC int os_sock_sendto( OS_SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to, int tolen );
 EXPORTFUNC int os_sock_read( OS_SOCKET s, char *buf, int len );
-EXPORTFUNC int os_sock_recvfrom( OS_SOCKET s, char* buf, int len, int flags, struct sockaddr* from, int* fromlen );
+EXPORTFUNC int os_sock_recvfrom( OS_SOCKET s, char* buf, int len, int flags, struct sockaddr* from, int *fromlen );
 EXPORTFUNC int os_sock_set_nonblocking( OS_SOCKET s );
 EXPORTFUNC int os_sock_connect( OS_SOCKET s, const struct sockaddr* name, int namelen );
 EXPORTFUNC OS_SOCKET os_sock_socket( int socket_family, int socket_type, int protocol );

Modified: trunk/lib/curl/url.c
==============================================================================
--- trunk/lib/curl/url.c	(original)
+++ trunk/lib/curl/url.c	Fri Jul  1 16:18:15 2005
@@ -1907,7 +1907,7 @@
   CURLcode result=CURLE_OK;
   char resumerange[40]="";
   struct connectdata *conn;
-  struct connectdata *conn_temp;
+  struct connectdata *conn_temp = NULL;
   int urllen;
   struct Curl_dns_entry *hostaddr;
 #ifdef HAVE_ALARM

Modified: trunk/lib/event/buffer.c
==============================================================================
--- trunk/lib/event/buffer.c	(original)
+++ trunk/lib/event/buffer.c	Fri Jul  1 16:18:15 2005
@@ -25,6 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#define _GNU_SOURCE
 #include <sys/types.h>
 
 #ifdef HAVE_CONFIG_H
@@ -42,7 +43,6 @@
 #endif
 
 #include <errno.h>
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>

Modified: trunk/modules/statserv/geoip/GeoIP.c
==============================================================================
--- trunk/modules/statserv/geoip/GeoIP.c	(original)
+++ trunk/modules/statserv/geoip/GeoIP.c	Fri Jul  1 16:18:15 2005
@@ -718,7 +718,7 @@
 		org_buf = malloc(sizeof(char) * (strlen(buf)+1));
 		strcpy(org_buf, buf);
 	} else {
-		buf_pointer = gi->cache + (long)record_pointer;
+		buf_pointer = (char *)gi->cache + (long)record_pointer;
 		org_buf = malloc(sizeof(char) * (strlen(buf_pointer)+1));
 		strcpy(org_buf, buf_pointer);
 	}

Modified: trunk/modules/statserv/geoip/GeoIPCity.c
==============================================================================
--- trunk/modules/statserv/geoip/GeoIPCity.c	(original)
+++ trunk/modules/statserv/geoip/GeoIPCity.c	Fri Jul  1 16:18:15 2005
@@ -76,7 +76,7 @@
 		str_length++;
 	if (str_length > 0) {
 		record->region = malloc(str_length+1);
-		strncpy(record->region, record_buf, str_length+1);
+		strncpy(record->region, (char *)record_buf, str_length+1);
 	}
 	record_buf += str_length + 1;
 	str_length = 0;
@@ -86,7 +86,7 @@
 		str_length++;
 	if (str_length > 0) {
 		record->city = malloc(str_length+1);
-		strncpy(record->city, record_buf, str_length+1);
+		strncpy(record->city, (char *)record_buf, str_length+1);
 	}
 	record_buf += (str_length + 1);
 	str_length = 0;
@@ -96,7 +96,7 @@
 		str_length++;
 	if (str_length > 0) {
 		record->postal_code = malloc(str_length+1);
-		strncpy(record->postal_code, record_buf, str_length+1);
+		strncpy(record->postal_code, (char *)record_buf, str_length+1);
 	}
 	record_buf += (str_length + 1);
 

Modified: trunk/src/adnsevent.c
==============================================================================
--- trunk/src/adnsevent.c	(original)
+++ trunk/src/adnsevent.c	Fri Jul  1 16:18:15 2005
@@ -31,7 +31,7 @@
  * - user-visible check/wait and event-loop-related functions
  */
 
-#include "adnsinternal.h"
+#include "adnsinternal.h"
 #include "adnstvarith.h"
 
 /* TCP connection management. */
@@ -90,10 +90,10 @@
 	}
 }
 
-void adns__tcp_tryconnect(adns_state ads, struct timeval now) 
-{
-	int r, tries;
-	OS_SOCKET fd;
+void adns__tcp_tryconnect(adns_state ads, struct timeval now) 
+{
+	int r, tries;
+	OS_SOCKET fd;
 	struct sockaddr_in addr;
 	struct protoent *proto;
 
@@ -116,11 +116,11 @@
 		assert(!ads->tcprecv_skip);
 
 		proto = getprotobyname("tcp");
-		if (!proto) 
-		{ 
-			adns__diag(ads,-1,0,"unable to find protocol no. for TCP !"); 
-			return; 
-		}
+		if (!proto) 
+		{ 
+			adns__diag(ads,-1,0,"unable to find protocol no. for TCP !"); 
+			return; 
+		}
 		fd = os_sock_socket( AF_INET, SOCK_STREAM, proto->p_proto );
 		if( fd < 0 ) 
 		{
@@ -137,7 +137,7 @@
 		addr.sin_family = AF_INET;
 		addr.sin_port = htons(DNS_PORT);
 		addr.sin_addr = ads->servers[ads->tcpserver].addr;
-		r = os_sock_connect( fd, ( const struct sockaddr* ) &addr, sizeof( addr ) );
+		r = os_sock_connect( fd, ( const struct sockaddr* ) &addr, sizeof( addr ) );
 		ads->tcpsocket = fd;
 		ads->tcpstate = server_connecting;
 		if (r == 0) 
@@ -395,8 +395,8 @@
 	return 2;
 }
 
-int adns_processreadable(adns_state ads, OS_SOCKET fd, const struct timeval *now) 
-{
+int adns_processreadable(adns_state ads, OS_SOCKET fd, const struct timeval *now) 
+{
 	int want, dgramlen, r, udpaddrlen, serv, old_skip;
 	byte udpbuf[DNS_MAXUDP];
 	struct sockaddr_in udpaddr;
@@ -448,7 +448,7 @@
 				if (ads->tcprecv.used == ads->tcprecv.avail)
 					continue;
 				r = os_sock_read(ads->tcpsocket,
-					ads->tcprecv.buf + ads->tcprecv.used,
+					(char *)ads->tcprecv.buf + ads->tcprecv.used,
 					ads->tcprecv.avail - ads->tcprecv.used);
 				if (r > 0) {
 					ads->tcprecv.used += r;
@@ -476,8 +476,8 @@
 	if (fd == ads->udpsocket) {
 		for (;;) {
 			udpaddrlen = sizeof(udpaddr);
-			r = os_sock_recvfrom( ads->udpsocket, udpbuf, sizeof( udpbuf ), 0,
-				( struct sockaddr* ) &udpaddr, &udpaddrlen );
+			r = os_sock_recvfrom( ads->udpsocket, (char *)udpbuf, sizeof( udpbuf ), 0,
+				( struct sockaddr* ) &udpaddr, &udpaddrlen );
 			if (r < 0) {
 				if (os_sock_errno == EAGAIN || os_sock_errno == OS_SOCK_EWOULDBLOCK) 
 				{
@@ -551,16 +551,16 @@
 		assert(ads->tcprecv.used == 0);
 		assert(ads->tcprecv_skip == 0);
 		for (;;) {
-			if (!adns__vbuf_ensure(&ads->tcprecv,1))
-			{ 
-				r= ENOMEM; 
-				goto xit; 
-			}
+			if (!adns__vbuf_ensure(&ads->tcprecv,1))
+			{ 
+				r= ENOMEM; 
+				goto xit; 
+			}
 			/* Is & intended? cast to fix warning but that is how the original 
 			 * references the buffer. Mighty suspicious 
 			 */
 			r = os_sock_read(ads->tcpsocket, (char *)&ads->tcprecv.buf, 1);
-			if (r==0 || (r<0 && (os_sock_errno==EAGAIN || os_sock_errno==OS_SOCK_EWOULDBLOCK))) {
+			if (r==0 || (r<0 && (os_sock_errno==EAGAIN || os_sock_errno==OS_SOCK_EWOULDBLOCK))) {
 				tcp_connected(ads, *now);
 				r = 0;
 				goto xit;
@@ -585,7 +585,7 @@
 			break;
 		while (ads->tcpsend.used) {
 			adns__sigpipe_protect(ads);
-			r = os_sock_write(ads->tcpsocket,ads->tcpsend.buf,ads->tcpsend.used);
+			r = os_sock_write(ads->tcpsocket,(char *)ads->tcpsend.buf,ads->tcpsend.used);
 			adns__sigpipe_unprotect(ads);
 			if (r < 0) {
 				if (os_sock_errno == OS_SOCK_EINTR)
@@ -645,9 +645,9 @@
 
 static void fd_event(adns_state ads, OS_SOCKET fd, int revent, int pollflag,
 		     int maxfd, const fd_set * fds, 
-		     int (*func)(adns_state, OS_SOCKET fd, const struct timeval *now),
-		     struct timeval now, int *r_r) 
-{
+		     int (*func)(adns_state, OS_SOCKET fd, const struct timeval *now),
+		     struct timeval now, int *r_r) 
+{
 	int r;
 
 	if (!(revent & pollflag))
@@ -667,10 +667,10 @@
 
 void adns__fdevents(adns_state ads, const struct pollfd *pollfds, int npollfds,
 		    int maxfd, const fd_set * readfds, const fd_set * writefds, 
-			const fd_set * exceptfds, struct timeval now, int *r_r) 
-{
-	int i, revents;
-	OS_SOCKET fd;
+			const fd_set * exceptfds, struct timeval now, int *r_r) 
+{
+	int i, revents;
+	OS_SOCKET fd;
 
 	for (i = 0; i < npollfds; i++) {
 		fd = pollfds[i].fd;
@@ -695,8 +695,8 @@
 {
 	struct timeval tv_nowbuf;
 	struct pollfd pollfds[MAX_POLLFDS];
-	int i, maxfd, npollfds;
-	OS_SOCKET fd;
+	int i, maxfd, npollfds;
+	OS_SOCKET fd;
 
 	adns__consistency(ads, 0, cc_entex);
 
@@ -716,10 +716,10 @@
 	maxfd = *maxfd_io;
 	for (i = 0; i < npollfds; i++) {
 		fd = pollfds[i].fd;
-    if ((int)fd >= maxfd) maxfd= fd+1;
-    if (pollfds[i].events & POLLIN) FD_SET(fd,readfds_io);
-    if (pollfds[i].events & POLLOUT) FD_SET(fd,writefds_io);
-    if (pollfds[i].events & POLLPRI) FD_SET(fd,exceptfds_io);
+    if ((int)fd >= maxfd) maxfd= fd+1;
+    if (pollfds[i].events & POLLIN) FD_SET(fd,readfds_io);
+    if (pollfds[i].events & POLLOUT) FD_SET(fd,writefds_io);
+    if (pollfds[i].events & POLLPRI) FD_SET(fd,exceptfds_io);
 	}
 	*maxfd_io = maxfd;
 	adns__consistency(ads, 0, cc_entex);
@@ -789,7 +789,7 @@
 
 	/* We just use adns__fdevents to loop over the fd's trying them.
 	 * This seems more sensible than calling select, since we're most
-	 * likely just to want to do a adns_socket_read on one or two fds anyway.
+	 * likely just to want to do a adns_socket_read on one or two fds anyway.
 	 */
 	npollfds = adns__pollfds(ads, pollfds);
 	for (i = 0; i < npollfds; i++)
@@ -830,7 +830,7 @@
 	if (context_r)
 		*context_r = qu->ctx.ext;
 	*query_io = qu;
-	ns_free(qu);
+	ns_free(qu);
 	return 0;
 }
 

Modified: trunk/src/adnsgeneral.c
==============================================================================
--- trunk/src/adnsgeneral.c	(original)
+++ trunk/src/adnsgeneral.c	Fri Jul  1 16:18:15 2005
@@ -30,7 +30,7 @@
  * - vbuf handling
  */
 
-#include "adnsinternal.h"
+#include "adnsinternal.h"
 
 /* Core diagnostic functions */
 
@@ -172,7 +172,7 @@
 {
 	int l;
 	l = strlen(data);
-	return adns__vbuf_append(vb, data, l);
+	return adns__vbuf_append(vb, (const byte *)data, l);
 }
 
 void adns__vbuf_free(vbuf * vb)
@@ -198,16 +198,16 @@
 		if (!(adns__vbuf_appendstr(vb, "<bad format... ") &&
 		      adns__vbuf_appendstr(vb, adns_strerror(st)) &&
 		      adns__vbuf_appendstr(vb, ">") &&
-		      adns__vbuf_append(vb, "", 1))) {
+		      adns__vbuf_append(vb, (const byte *)"", 1))) {
 			return
 			    "<cannot report bad format... out of memory>";
 		}
 	}
 	if (!vb->used) {
 		adns__vbuf_appendstr(vb, "<truncated ...>");
-		adns__vbuf_append(vb, "", 1);
+		adns__vbuf_append(vb, (const byte *)"", 1);
 	}
-	return vb->buf;
+	return (const char *)vb->buf;
 }
 
 adns_status adns_rr_info(adns_rrtype type,
@@ -236,14 +236,14 @@
 	st = typei->convstring(&vb, datap);
 	if (st)
 		goto x_freevb;
-	if (!adns__vbuf_append(&vb, "", 1)) {
+	if (!adns__vbuf_append(&vb, (const byte *)"", 1)) {
 		st = adns_s_nomemory;
 		goto x_freevb;
 	}
-	assert(strlen(vb.buf) == vb.used - 1);
+	nassert(strlen((char *)vb.buf) == vb.used - 1);
 	*data_r = ns_realloc(vb.buf, vb.used);
 	if (!*data_r)
-		*data_r = vb.buf;
+		*data_r = (char *)vb.buf;
 	return adns_s_ok;
 
       x_freevb:
@@ -270,18 +270,18 @@
 	SINFO(unknownformat,		"Nameserver used unknown format"),
 	SINFO(rcodeservfail,		"Nameserver reports failure"),
 	SINFO(rcodeformaterror,		"Query not understood by nameserver"),
-	SINFO(rcodenotimplemented,	"Query not implemented by nameserver"),
+	SINFO(rcodenotimplemented,	"Query not implemented by nameserver"),
 	SINFO(rcoderefused,			"Query refused by nameserver"),
 	SINFO(rcodeunknown,			"Nameserver sent unknown response code"),
 	SINFO(inconsistent,			"Inconsistent resource records in DNS"),
-	SINFO(prohibitedcname,		"DNS alias found where canonical name wanted"),
-	SINFO(answerdomaininvalid,	"Found syntactically invalid domain name"),
+	SINFO(prohibitedcname,		"DNS alias found where canonical name wanted"),
+	SINFO(answerdomaininvalid,	"Found syntactically invalid domain name"),
 	SINFO(answerdomaintoolong,	"Found overly-long domain name"),
 	SINFO(invaliddata,			"Found invalid DNS data"),
-	SINFO(querydomainwrong,		"Domain invalid for particular DNS query type"),
-	SINFO(querydomaininvalid,	"Domain name is syntactically invalid"),
-	SINFO(querydomaintoolong,	"Domain name or component is too long"),
-	SINFO(nxdomain,				"No such domain"),
+	SINFO(querydomainwrong,		"Domain invalid for particular DNS query type"),
+	SINFO(querydomaininvalid,	"Domain name is syntactically invalid"),
+	SINFO(querydomaintoolong,	"Domain name or component is too long"),
+	SINFO(nxdomain,				"No such domain"),
 	SINFO(nodata,				"No such data")
 };
 
@@ -322,13 +322,13 @@
 	adns_status stmax;
 	const char *abbrev;
 } stinfos[] = {
-  { adns_s_ok, "ok" },
+  { adns_s_ok, "ok" },
 	STINFO(localfail),
 	STINFO(remotefail),
 	STINFO(tempfail),
-	STINFO(misconfig),
-	STINFO(misquery),
-	STINFO(permfail)
+	STINFO(misconfig),
+	STINFO(misquery),
+	STINFO(permfail)
 };
 
 static int sti_compar(const void *key, const void *elem)
@@ -376,11 +376,11 @@
 }
 
 /* SIGPIPE protection. */
-/* Not required under Win32 with MSVC */
+/* Not required under Win32 with MSVC */
 
-void adns__sigpipe_protect(adns_state ads) 
-{
-#ifndef WIN32
+void adns__sigpipe_protect(adns_state ads) 
+{
+#ifndef WIN32
 	sigset_t toblock;
 	struct sigaction sa;
 	int r;
@@ -399,12 +399,12 @@
 	assert(!r);
 	r = sigaction(SIGPIPE, &sa, &ads->stdsigpipe);
 	assert(!r);
-#endif
+#endif
 }
-
-void adns__sigpipe_unprotect(adns_state ads)
+
+void adns__sigpipe_unprotect(adns_state ads)
 {
-#ifndef WIN32
+#ifndef WIN32
 	int r;
 
 	if (ads->iflags & adns_if_nosigpipe)

Modified: trunk/src/adnsparse.c
==============================================================================
--- trunk/src/adnsparse.c	(original)
+++ trunk/src/adnsparse.c	Fri Jul  1 16:18:15 2005
@@ -49,7 +49,7 @@
 			}
 		}
 		if (!adns__vbuf_append(vb, buf, i)
-		    || !adns__vbuf_append(vb, qbuf, strlen(qbuf)))
+		    || !adns__vbuf_append(vb, (const byte *)qbuf, strlen(qbuf)))
 			return 0;
 		if (i < len)
 			i++;
@@ -81,7 +81,7 @@
 	int lablen, jumpto;
 	const char *dgram;
 
-	dgram = fls->dgram;
+	dgram = (const char *)fls->dgram;
 	for (;;) {
 		if (fls->cbyte >= fls->dglen)
 			goto x_truncated;
@@ -169,7 +169,7 @@
 		if (first) {
 			first = 0;
 		} else {
-			if (!adns__vbuf_append(vb, ".", 1))
+			if (!adns__vbuf_append(vb, (const byte *)".", 1))
 				return adns_s_nomemory;
 		}
 		if (flags & pdf_quoteok) {
@@ -191,7 +191,7 @@
 				return adns_s_nomemory;
 		}
 	}
-	if (!adns__vbuf_append(vb, "", 1))
+	if (!adns__vbuf_append(vb, (const byte *)"", 1))
 		return adns_s_nomemory;
 	return adns_s_ok;
 }

Modified: trunk/src/adnsquery.c
==============================================================================
--- trunk/src/adnsquery.c	(original)
+++ trunk/src/adnsquery.c	Fri Jul  1 16:18:15 2005
@@ -185,7 +185,7 @@
 
 	qu->search_vb.used = qu->search_origlen;
 	if (nextentry) {
-		if (!adns__vbuf_append(&qu->search_vb, ".", 1) ||
+		if (!adns__vbuf_append(&qu->search_vb, (const byte *)".", 1) ||
 		    !adns__vbuf_appendstr(&qu->search_vb, nextentry)) {
 			stat = adns_s_nomemory;
 			goto x_fail;
@@ -196,7 +196,7 @@
 	qu->query_dgram = 0;
 	qu->query_dglen = 0;
 
-	query_simple(ads, qu, qu->search_vb.buf, qu->search_vb.used,
+	query_simple(ads, qu, (const char *)qu->search_vb.buf, qu->search_vb.used,
 		     qu->typei, qu->flags, now);
 	return;
 
@@ -268,7 +268,7 @@
 	}
 
 	if (flags & adns_qf_search) {
-		r = adns__vbuf_append(&qu->search_vb, owner, ol);
+		r = adns__vbuf_append(&qu->search_vb, (const byte *)owner, ol);
 		if (!r) {
 			stat = adns_s_nomemory;
 			goto x_adnsfail;
@@ -577,7 +577,7 @@
 
 	if (qu->flags & adns_qf_owner && qu->flags & adns_qf_search &&
 	    ans->status != adns_s_nomemory) {
-		if (!save_owner(qu, qu->search_vb.buf, qu->search_vb.used)) {
+		if (!save_owner(qu, (const char *)qu->search_vb.buf, qu->search_vb.used)) {
 			adns__query_fail(qu, adns_s_nomemory);
 			return;
 		}

Modified: trunk/src/adnsreply.c
==============================================================================
--- trunk/src/adnsreply.c	(original)
+++ trunk/src/adnsreply.c	Fri Jul  1 16:18:15 2005
@@ -263,7 +263,7 @@
 					adns__query_fail(qu, st);
 					return;
 				}
-				l = strlen(qu->vb.buf) + 1;
+				l = strlen((char *)qu->vb.buf) + 1;
 				qu->answer->cname =
 				    adns__alloc_preserved(qu, l);
 				if (!qu->answer->cname) {

Modified: trunk/src/adnssetup.c
==============================================================================
--- trunk/src/adnssetup.c	(original)
+++ trunk/src/adnssetup.c	Fri Jul  1 16:18:15 2005
@@ -31,9 +31,9 @@
  */
 
 #include "adnsinternal.h"
-#ifdef WIN32
-#include <iphlpapi.h>
-#endif
+#ifdef WIN32
+#include <iphlpapi.h>
+#endif
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif /* HAVE_LIMITS_H */
@@ -41,7 +41,7 @@
 #include <fcntl.h> 
 #endif
 
-static void readconfig(adns_state ads, const char *filename, int warnmissing);
+static void readconfig(adns_state ads, const char *filename, int warnmissing);
 
 static void addserver(adns_state ads, struct in_addr addr)
 {
@@ -333,14 +333,14 @@
 	const char *name;
 	void (*fn) (adns_state ads, const char *fn, int lno, const char *buf);
 } configcommandinfos[] = {
-  { "nameserver",        ccf_nameserver  },
-  { "domain",            ccf_search      },
-  { "search",            ccf_search      },
-  { "sortlist",          ccf_sortlist    },
-  { "options",           ccf_options     },
-  { "clearnameservers",  ccf_clearnss    },
-  { "include",           ccf_include     },
-  {  0                                   }
+  { "nameserver",        ccf_nameserver  },
+  { "domain",            ccf_search      },
+  { "search",            ccf_search      },
+  { "sortlist",          ccf_sortlist    },
+  { "options",           ccf_options     },
+  { "clearnameservers",  ccf_clearnss    },
+  { "include",           ccf_include     },
+  {  0                                   }
 };
 
 typedef union {
@@ -555,9 +555,9 @@
 {
 	adns_state ads;
 
-	ads= ns_malloc( sizeof( *ads ) ); 
-	if( !ads ) 
-		return errno;
+	ads= ns_malloc( sizeof( *ads ) ); 
+	if( !ads ) 
+		return errno;
 
 	ads->iflags = flags;
 	ads->diagfile = diagfile;
@@ -598,7 +598,7 @@
 
 	proto = getprotobyname("udp");
 	if (!proto) {
-		adns__diag(ads,-1,0,"unable to find protocol no. for UDP !"); 
+		adns__diag(ads,-1,0,"unable to find protocol no. for UDP !"); 
 		r = ENOPROTOOPT;
 	}
 	else
@@ -624,18 +624,18 @@
 			}
 		}
 	}
-	
-	ns_free(ads);
+	
+	ns_free(ads);
 	return r;
 }
 
 static void init_abort(adns_state ads)
 {
 	if (ads->nsearchlist) {
-		ns_free(ads->searchlist[0]);
-		ns_free(ads->searchlist);
+		ns_free(ads->searchlist[0]);
+		ns_free(ads->searchlist);
 	}
-	ns_free(ads);
+	ns_free(ads);
 }
 
 int adns_init(adns_state * ads_r, adns_initflags flags, FILE * diagfile, fd_update func)
@@ -643,17 +643,17 @@
 	adns_state ads;
 	const char *res_options, *adns_res_options;
 	int r;
-#ifdef WIN32
-	#define SECURE_PATH_LEN (MAX_PATH - 64)
-	char PathBuf[MAX_PATH];
-	struct in_addr addr;
-	#define ADNS_PFIXED_INFO_BLEN (2048)
-	PFIXED_INFO network_info = (PFIXED_INFO)alloca(ADNS_PFIXED_INFO_BLEN);
-	ULONG network_info_blen = ADNS_PFIXED_INFO_BLEN;
-	DWORD network_info_result;
-	PIP_ADDR_STRING pip;
-	const char *network_err_str = "";
-#endif
+#ifdef WIN32
+	#define SECURE_PATH_LEN (MAX_PATH - 64)
+	char PathBuf[MAX_PATH];
+	struct in_addr addr;
+	#define ADNS_PFIXED_INFO_BLEN (2048)
+	PFIXED_INFO network_info = (PFIXED_INFO)alloca(ADNS_PFIXED_INFO_BLEN);
+	ULONG network_info_blen = ADNS_PFIXED_INFO_BLEN;
+	DWORD network_info_result;
+	PIP_ADDR_STRING pip;
+	const char *network_err_str = "";
+#endif
 
 	r = init_begin(&ads, flags, diagfile ? diagfile : stderr);
 	if (r)
@@ -664,53 +664,53 @@
 	ccf_options(ads, "RES_OPTIONS", -1, res_options);
 	ccf_options(ads, "ADNS_RES_OPTIONS", -1, adns_res_options);
 
-#ifdef WIN32
-	GetWindowsDirectory(PathBuf, SECURE_PATH_LEN);
-	strcat(PathBuf,"\\resolv.conf");
-	readconfig(ads,PathBuf,1);
-	GetWindowsDirectory(PathBuf, SECURE_PATH_LEN);
-	strcat(PathBuf,"\\resolv-adns.conf");
-	readconfig(ads,PathBuf,0);
-	GetWindowsDirectory(PathBuf, SECURE_PATH_LEN);
-	strcat(PathBuf,"\\System32\\Drivers\\etc\\resolv.conf");
-	readconfig(ads,PathBuf,1);
-	GetWindowsDirectory(PathBuf, SECURE_PATH_LEN);
-	strcat(PathBuf,"\\System32\\Drivers\\etc\\resolv-adns.conf");
-	readconfig(ads,PathBuf,0);
-	network_info_result = GetNetworkParams(network_info, &network_info_blen);
-	if (network_info_result != ERROR_SUCCESS)
-	{
-		switch(network_info_result) 
-		{
-			case ERROR_BUFFER_OVERFLOW: 
-				network_err_str = "ERROR_BUFFER_OVERFLOW"; 
-				break;
-			case ERROR_INVALID_PARAMETER: 
-				network_err_str = "ERROR_INVALID_PARAMETER"; 
-				break;
-			case ERROR_NO_DATA: 
-				network_err_str = "ERROR_NO_DATA"; 
-				break;
-			case ERROR_NOT_SUPPORTED: 
-				network_err_str = "ERROR_NOT_SUPPORTED"; 
-				break;
-		}
-		adns__diag(ads,-1,0,"GetNetworkParams() failed with error [%d] %s", network_info_result,network_err_str);
-	}
-	else 
-	{
-		for(pip = &(network_info->DnsServerList); pip; pip = pip->Next) 
-		{
-			addr.s_addr = inet_addr(pip->IpAddress.String);
-			if ((addr.s_addr != INADDR_ANY) && (addr.s_addr != INADDR_NONE))
-				addserver(ads, addr); 
-		}
-	}
-#else
+#ifdef WIN32
+	GetWindowsDirectory(PathBuf, SECURE_PATH_LEN);
+	strcat(PathBuf,"\\resolv.conf");
+	readconfig(ads,PathBuf,1);
+	GetWindowsDirectory(PathBuf, SECURE_PATH_LEN);
+	strcat(PathBuf,"\\resolv-adns.conf");
+	readconfig(ads,PathBuf,0);
+	GetWindowsDirectory(PathBuf, SECURE_PATH_LEN);
+	strcat(PathBuf,"\\System32\\Drivers\\etc\\resolv.conf");
+	readconfig(ads,PathBuf,1);
+	GetWindowsDirectory(PathBuf, SECURE_PATH_LEN);
+	strcat(PathBuf,"\\System32\\Drivers\\etc\\resolv-adns.conf");
+	readconfig(ads,PathBuf,0);
+	network_info_result = GetNetworkParams(network_info, &network_info_blen);
+	if (network_info_result != ERROR_SUCCESS)
+	{
+		switch(network_info_result) 
+		{
+			case ERROR_BUFFER_OVERFLOW: 
+				network_err_str = "ERROR_BUFFER_OVERFLOW"; 
+				break;
+			case ERROR_INVALID_PARAMETER: 
+				network_err_str = "ERROR_INVALID_PARAMETER"; 
+				break;
+			case ERROR_NO_DATA: 
+				network_err_str = "ERROR_NO_DATA"; 
+				break;
+			case ERROR_NOT_SUPPORTED: 
+				network_err_str = "ERROR_NOT_SUPPORTED"; 
+				break;
+		}
+		adns__diag(ads,-1,0,"GetNetworkParams() failed with error [%d] %s", network_info_result,network_err_str);
+	}
+	else 
+	{
+		for(pip = &(network_info->DnsServerList); pip; pip = pip->Next) 
+		{
+			addr.s_addr = inet_addr(pip->IpAddress.String);
+			if ((addr.s_addr != INADDR_ANY) && (addr.s_addr != INADDR_NONE))
+				addserver(ads, addr); 
+		}
+	}
+#else
 	readconfig(ads, "/etc/resolv.conf", 1);
 	readconfig(ads, "/etc/resolv-adns.conf", 0);
-#endif
-
+#endif
+
 	readconfigenv(ads, "RES_CONF");
 	readconfigenv(ads, "ADNS_RES_CONF");
 
@@ -782,9 +782,9 @@
 	/* EVNT delsocket */
     if (ads->fdfunc) 
 		ads->fdfunc(ads->udpsocket, -1);
-	os_sock_close(ads->udpsocket);
+	os_sock_close(ads->udpsocket);
 	if (ads->tcpsocket >= 0) {
-      
+      
 	    if (ads->fdfunc) 
 	        ads->fdfunc(ads->tcpsocket, -1);
 		os_sock_close(ads->tcpsocket);
@@ -792,7 +792,7 @@
 	adns__vbuf_free(&ads->tcpsend);
 	adns__vbuf_free(&ads->tcprecv);
 	freesearchlist(ads);
-	ns_free(ads);
+	ns_free(ads);
 }
 
 void adns_forallqueries_begin(adns_state ads)

Modified: trunk/src/adnstransmit.c
==============================================================================
--- trunk/src/adnstransmit.c	(original)
+++ trunk/src/adnstransmit.c	Fri Jul  1 16:18:15 2005
@@ -30,10 +30,10 @@
  * - send queries
  */
 
-#include "adnsinternal.h"
-#ifndef WIN32
+#include "adnsinternal.h"
+#ifndef WIN32
 #include <sys/uio.h>
-#endif
+#endif
 #include "adnstvarith.h"
 
 #define MKQUERY_START(vb) (rqp= (vb)->buf+(vb)->used)
@@ -221,14 +221,14 @@
 		wr = 0;
 	} else {
 #ifdef WIN32
-		char *buf = NULL;
-		
-		buf = (char *)ns_malloc((2 + qu->query_dglen));
-		os_memcpy(buf, length, 2);
-		os_memcpy((buf + 2), qu->query_dgram, qu->query_dglen);
-		wr = os_sock_write(qu->ads->tcpsocket, buf, (2 + qu->query_dglen));
-		errno = os_sock_errno;
-		ns_free(buf);
+		char *buf = NULL;
+		
+		buf = (char *)ns_malloc((2 + qu->query_dglen));
+		os_memcpy(buf, length, 2);
+		os_memcpy((buf + 2), qu->query_dgram, qu->query_dglen);
+		wr = os_sock_write(qu->ads->tcpsocket, buf, (2 + qu->query_dglen));
+		errno = os_sock_errno;
+		ns_free(buf);
 #else
 		iov[0].iov_base = length;
 		iov[0].iov_len = 2;
@@ -305,7 +305,7 @@
 	servaddr.sin_addr = ads->servers[serv].addr;
 	servaddr.sin_port = htons(DNS_PORT);
 
-	r = os_sock_sendto( ads->udpsocket, qu->query_dgram, qu->query_dglen, 0,
+	r = os_sock_sendto( ads->udpsocket, (char *)qu->query_dgram, qu->query_dglen, 0,
 		   ( const struct sockaddr * ) &servaddr, sizeof( servaddr ) );
 	if( r < 0 && os_sock_errno == OS_SOCK_EMSGSIZE ) 
 	{

Modified: trunk/src/adnstypes.c
==============================================================================
--- trunk/src/adnstypes.c	(original)
+++ trunk/src/adnstypes.c	Fri Jul  1 16:18:15 2005
@@ -29,7 +29,7 @@
  * - RR-type-specific code, and the machinery to call it
  */
 
-#include "adnsinternal.h"
+#include "adnsinternal.h"
 
 #define R_NOMEM           return adns_s_nomemory
 #define CSP_ADDSTR(s)     do { if (!adns__vbuf_appendstr(vb,(s))) R_NOMEM; } while (0)
@@ -1024,15 +1024,15 @@
 		r = adns__vbuf_ensure(vb, lablen + needquote + 4);
 		if (!r)
 			R_NOMEM;
-		adns__vbuf_appendq(vb, "\"", 1);
+		adns__vbuf_appendq(vb, (const byte *)"\"", 1);
 		for (i = 0, needquote = 0, p = pai->dgram + labstart;
 		     i < lablen; i++, p++) {
 			c = *p;
 			if (c == '"' || c == '\\')
-				adns__vbuf_appendq(vb, "\\", 1);
+				adns__vbuf_appendq(vb, (const byte *)"\\", 1);
 			adns__vbuf_appendq(vb, p, 1);
 		}
-		adns__vbuf_appendq(vb, "\"", 1);
+		adns__vbuf_appendq(vb, (const byte *)"\"", 1);
 	} else {
 		r = adns__vbuf_append(vb, pai->dgram + labstart, lablen);
 		if (!r)
@@ -1209,14 +1209,14 @@
 	DEEP_TYPE(soa_raw, "SOA", "raw", soa, pa_soa, 0, cs_soa),
 	DEEP_TYPE(ptr_raw, "PTR", "raw", str, pa_host_raw, 0, cs_domain),
 	DEEP_TYPE(hinfo, "HINFO", 0, intstrpair, pa_hinfo, 0, cs_hinfo),
-	DEEP_TYPE(mx_raw, "MX",   "raw",  intstr,     pa_mx_raw,  di_mx_raw,  cs_inthost    ),
+	DEEP_TYPE(mx_raw, "MX",   "raw",  intstr,     pa_mx_raw,  di_mx_raw,  cs_inthost    ),
 	DEEP_TYPE(txt, "TXT", 0, manyistr, pa_txt, 0, cs_txt),
 	DEEP_TYPE(rp_raw, "RP", "raw", strpair, pa_rp, 0, cs_rp),
 
 	FLAT_TYPE(addr, "A", "addr", addr, pa_addr, di_addr, cs_addr),
-	DEEP_TYPE(ns,     "NS", "+addr",  hostaddr,   pa_hostaddr,di_hostaddr,cs_hostaddr   ),
+	DEEP_TYPE(ns,     "NS", "+addr",  hostaddr,   pa_hostaddr,di_hostaddr,cs_hostaddr   ),
 	DEEP_TYPE(ptr, "PTR", "checked", str, pa_ptr, 0, cs_domain),
-	DEEP_TYPE(mx,     "MX", "+addr",  inthostaddr,pa_mx,      di_mx,      cs_inthostaddr),
+	DEEP_TYPE(mx,     "MX", "+addr",  inthostaddr,pa_mx,      di_mx,      cs_inthostaddr),
 
 	DEEP_TYPE(soa, "SOA", "822", soa, pa_soa, 0, cs_soa),
 	DEEP_TYPE(rp, "RP", "822", strpair, pa_rp, 0, cs_rp),

Modified: trunk/src/ircsend.c
==============================================================================
--- trunk/src/ircsend.c	(original)
+++ trunk/src/ircsend.c	Fri Jul  1 16:18:15 2005
@@ -145,9 +145,9 @@
 static void _send_svsmode( const char *source, const char *target, const char *modes );
 static void _send_svskill( const char *source, const char *target, const char *reason );
 
+#if 0 /* Work in progress */
 static void _send_akill( const char *source, const char *host, const char *ident, const char *setby, const unsigned long length, const char *reason, const unsigned long ts );
 static void _send_rakill( const char *source, const char *host, const char *ident );
-#if 0 /* Work in progress */
 static void _send_sqline( const char *source, const char *mask, const char *reason );
 static void _send_unsqline( const char *source, const char *mask );
 static void _send_sgline( const char *source, const char *mask, const char *reason );

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Fri Jul  1 16:18:15 2005
@@ -529,7 +529,7 @@
  *  @return none
  */
 
-void fatal_error( char *file, int line, char *func, char *error_text )
+void fatal_error( char *file, int line, const char *func, char *error_text )
 {
 	nlog( LOG_CRITICAL, "Fatal Error: %s %d %s %s", file, line, func, error_text );
 	do_exit( NS_EXIT_ERROR, "Fatal Error - check log file" );

Modified: trunk/src/ossocket.c
==============================================================================
--- trunk/src/ossocket.c	(original)
+++ trunk/src/ossocket.c	Fri Jul  1 16:18:15 2005
@@ -32,245 +32,245 @@
 /* local errno implementation */
 int os_sock_errno = 0;
 
-#ifdef WIN32
+#ifdef WIN32
 #define OS_SOCK_SET_ERRNO()	os_sock_errno = WSAGetLastError();
 #else /* WIN32 */
 #define OS_SOCK_SET_ERRNO() os_sock_errno = errno;
 #endif /* WIN32 */
 
-char *os_sock_strerror( const int sockerrno )
-{
-#ifdef WIN32
-	static char unknown[256];
-
-	switch( sockerrno )
-	{
-		case 0:
+char *os_sock_strerror( const int sockerrno )
+{
+#ifdef WIN32
+	static char unknown[256];
+
+	switch( sockerrno )
+	{
+		case 0:
 			return "No Error";
-		case WSAEINTR:
-			/* 10004 */
-			return "Interrupted function call.";
-			/* A blocking operation was interrupted by a call to WSACancelBlockingCall. */
-		case WSAEACCES:
-			/* 10013 */
-			return "Permission denied.";
-			/* An attempt was made to access a socket in a way forbidden by its access permissions. An example is using a broadcast address for sendto without broadcast permission being set using setsockopt(SO_BROADCAST). Another possible reason for the WSAEACCES error is that when the bind function is called (on Windows NT 4 SP4 or later), another application, service, or kernel mode driver is bound to the same address with exclusive access. Such exclusive access is a new feature of Windows NT 4 SP4 and later, and is implemented by using the SO_EXCLUSIVEADDRUSE option. */
-		case WSAEFAULT:
-			/* 10014 */
-			return "Bad address.";
-			/* The system detected an invalid pointer address in attempting to use a pointer argument of a call. This error occurs if an application passes an invalid pointer value, or if the length of the buffer is too small. For instance, if the length of an argument, which is a sockaddr structure, is smaller than the sizeof(sockaddr).  */
-		case WSAEINVAL:
-			/* 10022 */
-			return "Invalid argument.";
-			/* Some invalid argument was supplied (for example, specifying an invalid level to the setsockopt function). In some instances, it also refers to the current state of the socket—for instance, calling accept on a socket that is not listening.  */
-		case WSAEMFILE:
-			/* 10024 */
-			return "Too many open files.";
-			/* Too many open sockets. Each implementation may have a maximum number of socket handles available, either globally, per process, or per thread.  */
-		case WSAEWOULDBLOCK:
-			/* 10035 */
-			return "Resource temporarily unavailable.";
-			/* This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.  */
-		case WSAEINPROGRESS:
-			/* 10036 */
-			return "Operation now in progress.";
-			/* A blocking operation is currently executing. Windows Sockets only allows a single blocking operation—per- task or thread—to be outstanding, and if any other function call is made (whether or not it references that or any other socket) the function fails with the WSAEINPROGRESS error.  */
-		case WSAEALREADY:
-			/* 10037 */
-			return "Operation already in progress.";
-			/* An operation was attempted on a nonblocking socket with an operation already in progress—that is, calling connect a second time on a nonblocking socket that is already connecting, or canceling an asynchronous request (WSAAsyncGetXbyY) that has already been canceled or completed.  */
-		case WSAENOTSOCK:
-			/* 10038 */
-			return "Socket operation on nonsocket.";
-			/* An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for select, a member of an fd_set was not valid.  */
-		case WSAEDESTADDRREQ:
-			/* 10039 */
-			return "Destination address required.";
-			/* A required address was omitted from an operation on a socket. For example, this error is returned if sendto is called with the remote address of ADDR_ANY.  */
-		case WSAEMSGSIZE:
-			/* 10040 */
-			return "Message too long.";
-			/* A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself.  */
-		case WSAEPROTOTYPE:
-			/* 10041 */
-			return "Protocol wrong type for socket.";
-			/* A protocol was specified in the socket function call that does not support the semantics of the socket type requested. For example, the ARPA Internet UDP protocol cannot be specified with a socket type of SOCK_STREAM.  */
-		case WSAENOPROTOOPT:
-			/* 10042 */
-			return "Bad protocol option.";
-			/* An unknown, invalid or unsupported option or level was specified in a getsockopt or setsockopt call.  */
-		case WSAEPROTONOSUPPORT:
-			/* 10043 */
-			return "Protocol not supported.";
-			/* The requested protocol has not been configured into the system, or no implementation for it exists. For example, a socket call requests a SOCK_DGRAM socket, but specifies a stream protocol.  */
-		case WSAESOCKTNOSUPPORT:
-			/* 10044 */
-			return "Socket type not supported.";
-			/* The support for the specified socket type does not exist in this address family. For example, the optional type SOCK_RAW might be selected in a socket call, and the implementation does not support SOCK_RAW sockets at all.  */
-		case WSAEOPNOTSUPP:
-			/* 10045 */
-			return "Operation not supported.";
-			/* The attempted operation is not supported for the type of object referenced. Usually this occurs when a socket descriptor to a socket that cannot support this operation is trying to accept a connection on a datagram socket.  */
-		case WSAEPFNOSUPPORT:
-			/* 10046 */
-			return "Protocol family not supported.";
-			/* The protocol family has not been configured into the system or no implementation for it exists. This message has a slightly different meaning from WSAEAFNOSUPPORT. However, it is interchangeable in most cases, and all Windows Sockets functions that return one of these messages also specify WSAEAFNOSUPPORT.  */
-		case WSAEAFNOSUPPORT:
-			/* 10047 */
-			return "Address family not supported by protocol family.";
-			/* An address incompatible with the requested protocol was used. All sockets are created with an associated address family (that is, AF_INET for Internet Protocols) and a generic protocol type (that is, SOCK_STREAM). This error is returned if an incorrect protocol is explicitly requested in the socket call, or if an address of the wrong family is used for a socket, for example, in sendto.  */
-		case WSAEADDRINUSE:
-			/* 10048 */
-			return "Address already in use.";
-			/* Typically, only one usage of each socket address (protocol/IP address/port) is permitted. This error occurs if an application attempts to bind a socket to an IP address/port that has already been used for an existing socket, or a socket that was not closed properly, or one that is still in the process of closing. For server applications that need to bind multiple sockets to the same port number, consider using setsockopt (SO_REUSEADDR). Client applications usually need not call bind at all—connect chooses an unused port automatically. When bind is called with a wildcard address (involving ADDR_ANY), a WSAEADDRINUSE error could be delayed until the specific address is committed. This could happen with a call to another function later, including connect, listen, WSAConnect, or WSAJoinLeaf.  */
-		case WSAEADDRNOTAVAIL:
-			/* 10049 */
-			return "Cannot assign requested address.";
-			/* The requested address is not valid in its context. This normally results from an attempt to bind to an address that is not valid for the local computer. This can also result from connect, sendto, WSAConnect, WSAJoinLeaf, or WSASendTo when the remote address or port is not valid for a remote computer (for example, address or port 0).  */
-		case WSAENETDOWN:
-			/* 10050 */
-			return "Network is down.";
-			/* A socket operation encountered a dead network. This could indicate a serious failure of the network system (that is, the protocol stack that the Windows Sockets DLL runs over), the network interface, or the local network itself.  */
-		case WSAENETUNREACH:
-			/* 10051 */
-			return "Network is unreachable.";
-			/* A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host.  */
-		case WSAENETRESET:
-			/* 10052 */
-			return "Network dropped connection on reset.";
-			/* The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. It can also be returned by setsockopt if an attempt is made to set SO_KEEPALIVE on a connection that has already failed.  */
-		case WSAECONNABORTED:
-			/* 10053 */
-			return "Software caused connection abort.";
-			/* An established connection was aborted by the software in your host computer, possibly due to a data transmission time-out or protocol error.  */
-		case WSAECONNRESET:
-			/* 10054 */
-			return "Connection reset by peer.";
-			/* An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.  */
-		case WSAENOBUFS:
-			/* 10055 */
-			return "No buffer space available.";
-			/* An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.  */
-		case WSAEISCONN:
-			/* 10056 */
-			return "Socket is already connected.";
-			/* A connect request was made on an already-connected socket. Some implementations also return this error if sendto is called on a connected SOCK_DGRAM socket (for SOCK_STREAM sockets, the to parameter in sendto is ignored) although other implementations treat this as a legal occurrence.  */
-		case WSAENOTCONN:
-			/* 10057 */
-			return "Socket is not connected.";
-			/* A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using sendto) no address was supplied. Any other type of operation might also return this error—for example, setsockopt setting SO_KEEPALIVE if the connection has been reset.  */
-		case WSAESHUTDOWN:
-			/* 10058 */
-			return "Cannot send after socket shutdown.";
-			/* A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call. By calling shutdown a partial close of a socket is requested, which is a signal that sending or receiving, or both have been discontinued.  */
-		case WSAETIMEDOUT:
-			/* 10060 */
-			return "Connection timed out.";
-			/* A connection attempt failed because the connected party did not properly respond after a period of time, or the established connection failed because the connected host has failed to respond.  */
-		case WSAECONNREFUSED:
-			/* 10061 */
-			return "Connection refused.";
-			/* No connection could be made because the target computer actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host—that is, one with no server application running.  */
-		case WSAEHOSTDOWN:
-			/* 10064 */
-			return "Host is down.";
-			/* A socket operation failed because the destination host is down. A socket operation encountered a dead host. Networking activity on the local host has not been initiated. These conditions are more likely to be indicated by the error WSAETIMEDOUT.  */
-		case WSAEHOSTUNREACH:
-			/* 10065 */
-			return "No route to host.";
-			/* A socket operation was attempted to an unreachable host. See WSAENETUNREACH.  */
-		case WSAEPROCLIM:
-			/* 10067 */
-			return "Too many processes.";
-			/* A Windows Sockets implementation may have a limit on the number of applications that can use it simultaneously. WSAStartup may fail with this error if the limit has been reached.  */
-		case WSASYSNOTREADY:
-			/* 10091 */
-			return "Network subsystem is unavailable.";
-			/* This error is returned by WSAStartup if the Windows Sockets implementation cannot function at this time because the underlying system it uses to provide network services is currently unavailable. Users should check: 
-			That the appropriate Windows Sockets DLL file is in the current path. 
-			That they are not trying to use more than one Windows Sockets implementation simultaneously. If there is more than one Winsock DLL on your system, be sure the first one in the path is appropriate for the network subsystem currently loaded. 
-			The Windows Sockets implementation documentation to be sure all necessary components are currently installed and configured correctly. 
-			*/ 
-		case WSAVERNOTSUPPORTED:
-			/* 10092 */
-			return "Winsock.dll version out of range.";
-			/* The current Windows Sockets implementation does not support the Windows Sockets specification version requested by the application. Check that no old Windows Sockets DLL files are being accessed.  */
-		case WSANOTINITIALISED:
-			/* 10093 */
-			return "Successful WSAStartup not yet performed.";
-			/* Either the application has not called WSAStartup or WSAStartup failed. The application may be accessing a socket that the current active task does not own (that is, trying to share a socket between tasks), or WSACleanup has been called too many times.  */
-		case WSAEDISCON:
-			/* 10101 */
-			return "Graceful shutdown in progress.";
-			/* Returned by WSARecv and WSARecvFrom to indicate that the remote party has initiated a graceful shutdown sequence.  */
-		case WSATYPE_NOT_FOUND:
-			/* 10109 */
-			return "Class type not found.";
-			/* The specified class was not found.  */
-		case WSAHOST_NOT_FOUND:
-			/* 11001 */
-			return "Host not found.";
-			/* No such host is known. The name is not an official host name or alias, or it cannot be found in the database(s) being queried. This error may also be returned for protocol and service queries, and means that the specified name could not be found in the relevant database.  */
-		case WSATRY_AGAIN:
-			/* 11002 */
-			return "Nonauthoritative host not found.";
-			/* This is usually a temporary error during host name resolution and means that the local server did not receive a response from an authoritative server. A retry at some time later may be successful.  */
-		case WSANO_RECOVERY:
-			/* 11003 */
-			return "This is a nonrecoverable error.";
-			/* This indicates some sort of nonrecoverable error occurred during a database lookup. This may be because the database files (for example, BSD-compatible HOSTS, SERVICES, or PROTOCOLS files) could not be found, or a DNS request was returned by the server with a severe error.  */
-		case WSANO_DATA:
-			/* 11004 */
-			return "Valid name, no data record of requested type.";
-			/* The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for. The usual example for this is a host name-to-address translation attempt (using gethostbyname or WSAAsyncGetHostByName) which uses the DNS (Domain Name Server). An MX record is returned but no A record—indicating the host itself exists, but is not directly reachable.  */
-		case WSA_INVALID_HANDLE:
-			/* OS dependent */
-			return "Specified event object handle is invalid.";
-			/* An application attempts to use an event object, but the specified handle is not valid.  */
-		case WSA_INVALID_PARAMETER:
-			/* OS dependent */
-			return "One or more parameters are invalid.";
-			/* An application used a Windows Sockets function which directly maps to a Windows function. The Windows function is indicating a problem with one or more parameters.  */
-		case WSA_IO_INCOMPLETE:
-			/* OS dependent */
-			return "Overlapped I/O event object not in signaled state.";
-			/* The application has tried to determine the status of an overlapped operation which is not yet completed. Applications that use WSAGetOverlappedResult (with the fWait flag set to FALSE) in a polling mode to determine when an overlapped operation has completed, get this error code until the operation is complete.  */
-		case WSA_IO_PENDING:
-			/* OS dependent */
-			return "Overlapped operations will complete later.";
-			/* The application has initiated an overlapped operation that cannot be completed immediately. A completion indication will be given later when the operation has been completed.  */
-		case WSA_NOT_ENOUGH_MEMORY:
-			/* OS dependent */
-			return "Insufficient memory available.";
-			/* An application used a Windows Sockets function that directly maps to a Windows function. The Windows function is indicating a lack of required memory resources.  */
-		case WSA_OPERATION_ABORTED:
-			/* OS dependent */
-			return "Overlapped operation aborted.";
-			/* An overlapped operation was canceled due to the closure of the socket, or the execution of the SIO_FLUSH command in WSAIoctl.  */
-#ifdef WSAINVALIDPROCTABLE
-		case WSAINVALIDPROCTABLE:
-			/* OS dependent */
-			return "Invalid procedure table from service provider.";
-			/* A service provider returned a bogus procedure table to Ws2_32.dll. (Usually caused by one or more of the function pointers being null.)  */
-#endif /* WSAINVALIDPROCTABLE */
-#ifdef WSAINVALIDPROVIDER
-		case WSAINVALIDPROVIDER:
-			/* OS dependent */
-			return "Invalid service provider version number.";
-			/* A service provider returned a version number other than 2.0.  */
-#endif /* WSAINVALIDPROVIDER */
-#ifdef WSAPROVIDERFAILEDINIT
-		case WSAPROVIDERFAILEDINIT:
-			/* OS dependent */
-			return "Unable to initialize a service provider.";
-			/* Either a service provider's DLL could not be loaded (LoadLibrary failed) or the provider's WSPStartup/NSPStartup function failed.  */
-#endif /* WSAPROVIDERFAILEDINIT */
-		case WSASYSCALLFAILURE:
-			/* OS dependent */
-			return "System call failure.";
-			/* Generic error code, returned under various conditions. 
-			Returned when a system call that should never fail does fail. For example, if a call to WaitForMultipleEvents fails or one of the registry functions fails trying to manipulate the protocol/namespace catalogs.
-			Returned when a provider does not return SUCCESS and does not provide an extended error code. Can indicate a service provider implementation error.
+		case WSAEINTR:
+			/* 10004 */
+			return "Interrupted function call.";
+			/* A blocking operation was interrupted by a call to WSACancelBlockingCall. */
+		case WSAEACCES:
+			/* 10013 */
+			return "Permission denied.";
+			/* An attempt was made to access a socket in a way forbidden by its access permissions. An example is using a broadcast address for sendto without broadcast permission being set using setsockopt(SO_BROADCAST). Another possible reason for the WSAEACCES error is that when the bind function is called (on Windows NT 4 SP4 or later), another application, service, or kernel mode driver is bound to the same address with exclusive access. Such exclusive access is a new feature of Windows NT 4 SP4 and later, and is implemented by using the SO_EXCLUSIVEADDRUSE option. */
+		case WSAEFAULT:
+			/* 10014 */
+			return "Bad address.";
+			/* The system detected an invalid pointer address in attempting to use a pointer argument of a call. This error occurs if an application passes an invalid pointer value, or if the length of the buffer is too small. For instance, if the length of an argument, which is a sockaddr structure, is smaller than the sizeof(sockaddr).  */
+		case WSAEINVAL:
+			/* 10022 */
+			return "Invalid argument.";
+			/* Some invalid argument was supplied (for example, specifying an invalid level to the setsockopt function). In some instances, it also refers to the current state of the socket—for instance, calling accept on a socket that is not listening.  */
+		case WSAEMFILE:
+			/* 10024 */
+			return "Too many open files.";
+			/* Too many open sockets. Each implementation may have a maximum number of socket handles available, either globally, per process, or per thread.  */
+		case WSAEWOULDBLOCK:
+			/* 10035 */
+			return "Resource temporarily unavailable.";
+			/* This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.  */
+		case WSAEINPROGRESS:
+			/* 10036 */
+			return "Operation now in progress.";
+			/* A blocking operation is currently executing. Windows Sockets only allows a single blocking operation—per- task or thread—to be outstanding, and if any other function call is made (whether or not it references that or any other socket) the function fails with the WSAEINPROGRESS error.  */
+		case WSAEALREADY:
+			/* 10037 */
+			return "Operation already in progress.";
+			/* An operation was attempted on a nonblocking socket with an operation already in progress—that is, calling connect a second time on a nonblocking socket that is already connecting, or canceling an asynchronous request (WSAAsyncGetXbyY) that has already been canceled or completed.  */
+		case WSAENOTSOCK:
+			/* 10038 */
+			return "Socket operation on nonsocket.";
+			/* An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for select, a member of an fd_set was not valid.  */
+		case WSAEDESTADDRREQ:
+			/* 10039 */
+			return "Destination address required.";
+			/* A required address was omitted from an operation on a socket. For example, this error is returned if sendto is called with the remote address of ADDR_ANY.  */
+		case WSAEMSGSIZE:
+			/* 10040 */
+			return "Message too long.";
+			/* A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself.  */
+		case WSAEPROTOTYPE:
+			/* 10041 */
+			return "Protocol wrong type for socket.";
+			/* A protocol was specified in the socket function call that does not support the semantics of the socket type requested. For example, the ARPA Internet UDP protocol cannot be specified with a socket type of SOCK_STREAM.  */
+		case WSAENOPROTOOPT:
+			/* 10042 */
+			return "Bad protocol option.";
+			/* An unknown, invalid or unsupported option or level was specified in a getsockopt or setsockopt call.  */
+		case WSAEPROTONOSUPPORT:
+			/* 10043 */
+			return "Protocol not supported.";
+			/* The requested protocol has not been configured into the system, or no implementation for it exists. For example, a socket call requests a SOCK_DGRAM socket, but specifies a stream protocol.  */
+		case WSAESOCKTNOSUPPORT:
+			/* 10044 */
+			return "Socket type not supported.";
+			/* The support for the specified socket type does not exist in this address family. For example, the optional type SOCK_RAW might be selected in a socket call, and the implementation does not support SOCK_RAW sockets at all.  */
+		case WSAEOPNOTSUPP:
+			/* 10045 */
+			return "Operation not supported.";
+			/* The attempted operation is not supported for the type of object referenced. Usually this occurs when a socket descriptor to a socket that cannot support this operation is trying to accept a connection on a datagram socket.  */
+		case WSAEPFNOSUPPORT:
+			/* 10046 */
+			return "Protocol family not supported.";
+			/* The protocol family has not been configured into the system or no implementation for it exists. This message has a slightly different meaning from WSAEAFNOSUPPORT. However, it is interchangeable in most cases, and all Windows Sockets functions that return one of these messages also specify WSAEAFNOSUPPORT.  */
+		case WSAEAFNOSUPPORT:
+			/* 10047 */
+			return "Address family not supported by protocol family.";
+			/* An address incompatible with the requested protocol was used. All sockets are created with an associated address family (that is, AF_INET for Internet Protocols) and a generic protocol type (that is, SOCK_STREAM). This error is returned if an incorrect protocol is explicitly requested in the socket call, or if an address of the wrong family is used for a socket, for example, in sendto.  */
+		case WSAEADDRINUSE:
+			/* 10048 */
+			return "Address already in use.";
+			/* Typically, only one usage of each socket address (protocol/IP address/port) is permitted. This error occurs if an application attempts to bind a socket to an IP address/port that has already been used for an existing socket, or a socket that was not closed properly, or one that is still in the process of closing. For server applications that need to bind multiple sockets to the same port number, consider using setsockopt (SO_REUSEADDR). Client applications usually need not call bind at all—connect chooses an unused port automatically. When bind is called with a wildcard address (involving ADDR_ANY), a WSAEADDRINUSE error could be delayed until the specific address is committed. This could happen with a call to another function later, including connect, listen, WSAConnect, or WSAJoinLeaf.  */
+		case WSAEADDRNOTAVAIL:
+			/* 10049 */
+			return "Cannot assign requested address.";
+			/* The requested address is not valid in its context. This normally results from an attempt to bind to an address that is not valid for the local computer. This can also result from connect, sendto, WSAConnect, WSAJoinLeaf, or WSASendTo when the remote address or port is not valid for a remote computer (for example, address or port 0).  */
+		case WSAENETDOWN:
+			/* 10050 */
+			return "Network is down.";
+			/* A socket operation encountered a dead network. This could indicate a serious failure of the network system (that is, the protocol stack that the Windows Sockets DLL runs over), the network interface, or the local network itself.  */
+		case WSAENETUNREACH:
+			/* 10051 */
+			return "Network is unreachable.";
+			/* A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host.  */
+		case WSAENETRESET:
+			/* 10052 */
+			return "Network dropped connection on reset.";
+			/* The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. It can also be returned by setsockopt if an attempt is made to set SO_KEEPALIVE on a connection that has already failed.  */
+		case WSAECONNABORTED:
+			/* 10053 */
+			return "Software caused connection abort.";
+			/* An established connection was aborted by the software in your host computer, possibly due to a data transmission time-out or protocol error.  */
+		case WSAECONNRESET:
+			/* 10054 */
+			return "Connection reset by peer.";
+			/* An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.  */
+		case WSAENOBUFS:
+			/* 10055 */
+			return "No buffer space available.";
+			/* An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.  */
+		case WSAEISCONN:
+			/* 10056 */
+			return "Socket is already connected.";
+			/* A connect request was made on an already-connected socket. Some implementations also return this error if sendto is called on a connected SOCK_DGRAM socket (for SOCK_STREAM sockets, the to parameter in sendto is ignored) although other implementations treat this as a legal occurrence.  */
+		case WSAENOTCONN:
+			/* 10057 */
+			return "Socket is not connected.";
+			/* A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using sendto) no address was supplied. Any other type of operation might also return this error—for example, setsockopt setting SO_KEEPALIVE if the connection has been reset.  */
+		case WSAESHUTDOWN:
+			/* 10058 */
+			return "Cannot send after socket shutdown.";
+			/* A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call. By calling shutdown a partial close of a socket is requested, which is a signal that sending or receiving, or both have been discontinued.  */
+		case WSAETIMEDOUT:
+			/* 10060 */
+			return "Connection timed out.";
+			/* A connection attempt failed because the connected party did not properly respond after a period of time, or the established connection failed because the connected host has failed to respond.  */
+		case WSAECONNREFUSED:
+			/* 10061 */
+			return "Connection refused.";
+			/* No connection could be made because the target computer actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host—that is, one with no server application running.  */
+		case WSAEHOSTDOWN:
+			/* 10064 */
+			return "Host is down.";
+			/* A socket operation failed because the destination host is down. A socket operation encountered a dead host. Networking activity on the local host has not been initiated. These conditions are more likely to be indicated by the error WSAETIMEDOUT.  */
+		case WSAEHOSTUNREACH:
+			/* 10065 */
+			return "No route to host.";
+			/* A socket operation was attempted to an unreachable host. See WSAENETUNREACH.  */
+		case WSAEPROCLIM:
+			/* 10067 */
+			return "Too many processes.";
+			/* A Windows Sockets implementation may have a limit on the number of applications that can use it simultaneously. WSAStartup may fail with this error if the limit has been reached.  */
+		case WSASYSNOTREADY:
+			/* 10091 */
+			return "Network subsystem is unavailable.";
+			/* This error is returned by WSAStartup if the Windows Sockets implementation cannot function at this time because the underlying system it uses to provide network services is currently unavailable. Users should check: 
+			That the appropriate Windows Sockets DLL file is in the current path. 
+			That they are not trying to use more than one Windows Sockets implementation simultaneously. If there is more than one Winsock DLL on your system, be sure the first one in the path is appropriate for the network subsystem currently loaded. 
+			The Windows Sockets implementation documentation to be sure all necessary components are currently installed and configured correctly. 
+			*/ 
+		case WSAVERNOTSUPPORTED:
+			/* 10092 */
+			return "Winsock.dll version out of range.";
+			/* The current Windows Sockets implementation does not support the Windows Sockets specification version requested by the application. Check that no old Windows Sockets DLL files are being accessed.  */
+		case WSANOTINITIALISED:
+			/* 10093 */
+			return "Successful WSAStartup not yet performed.";
+			/* Either the application has not called WSAStartup or WSAStartup failed. The application may be accessing a socket that the current active task does not own (that is, trying to share a socket between tasks), or WSACleanup has been called too many times.  */
+		case WSAEDISCON:
+			/* 10101 */
+			return "Graceful shutdown in progress.";
+			/* Returned by WSARecv and WSARecvFrom to indicate that the remote party has initiated a graceful shutdown sequence.  */
+		case WSATYPE_NOT_FOUND:
+			/* 10109 */
+			return "Class type not found.";
+			/* The specified class was not found.  */
+		case WSAHOST_NOT_FOUND:
+			/* 11001 */
+			return "Host not found.";
+			/* No such host is known. The name is not an official host name or alias, or it cannot be found in the database(s) being queried. This error may also be returned for protocol and service queries, and means that the specified name could not be found in the relevant database.  */
+		case WSATRY_AGAIN:
+			/* 11002 */
+			return "Nonauthoritative host not found.";
+			/* This is usually a temporary error during host name resolution and means that the local server did not receive a response from an authoritative server. A retry at some time later may be successful.  */
+		case WSANO_RECOVERY:
+			/* 11003 */
+			return "This is a nonrecoverable error.";
+			/* This indicates some sort of nonrecoverable error occurred during a database lookup. This may be because the database files (for example, BSD-compatible HOSTS, SERVICES, or PROTOCOLS files) could not be found, or a DNS request was returned by the server with a severe error.  */
+		case WSANO_DATA:
+			/* 11004 */
+			return "Valid name, no data record of requested type.";
+			/* The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for. The usual example for this is a host name-to-address translation attempt (using gethostbyname or WSAAsyncGetHostByName) which uses the DNS (Domain Name Server). An MX record is returned but no A record—indicating the host itself exists, but is not directly reachable.  */
+		case WSA_INVALID_HANDLE:
+			/* OS dependent */
+			return "Specified event object handle is invalid.";
+			/* An application attempts to use an event object, but the specified handle is not valid.  */
+		case WSA_INVALID_PARAMETER:
+			/* OS dependent */
+			return "One or more parameters are invalid.";
+			/* An application used a Windows Sockets function which directly maps to a Windows function. The Windows function is indicating a problem with one or more parameters.  */
+		case WSA_IO_INCOMPLETE:
+			/* OS dependent */
+			return "Overlapped I/O event object not in signaled state.";
+			/* The application has tried to determine the status of an overlapped operation which is not yet completed. Applications that use WSAGetOverlappedResult (with the fWait flag set to FALSE) in a polling mode to determine when an overlapped operation has completed, get this error code until the operation is complete.  */
+		case WSA_IO_PENDING:
+			/* OS dependent */
+			return "Overlapped operations will complete later.";
+			/* The application has initiated an overlapped operation that cannot be completed immediately. A completion indication will be given later when the operation has been completed.  */
+		case WSA_NOT_ENOUGH_MEMORY:
+			/* OS dependent */
+			return "Insufficient memory available.";
+			/* An application used a Windows Sockets function that directly maps to a Windows function. The Windows function is indicating a lack of required memory resources.  */
+		case WSA_OPERATION_ABORTED:
+			/* OS dependent */
+			return "Overlapped operation aborted.";
+			/* An overlapped operation was canceled due to the closure of the socket, or the execution of the SIO_FLUSH command in WSAIoctl.  */
+#ifdef WSAINVALIDPROCTABLE
+		case WSAINVALIDPROCTABLE:
+			/* OS dependent */
+			return "Invalid procedure table from service provider.";
+			/* A service provider returned a bogus procedure table to Ws2_32.dll. (Usually caused by one or more of the function pointers being null.)  */
+#endif /* WSAINVALIDPROCTABLE */
+#ifdef WSAINVALIDPROVIDER
+		case WSAINVALIDPROVIDER:
+			/* OS dependent */
+			return "Invalid service provider version number.";
+			/* A service provider returned a version number other than 2.0.  */
+#endif /* WSAINVALIDPROVIDER */
+#ifdef WSAPROVIDERFAILEDINIT
+		case WSAPROVIDERFAILEDINIT:
+			/* OS dependent */
+			return "Unable to initialize a service provider.";
+			/* Either a service provider's DLL could not be loaded (LoadLibrary failed) or the provider's WSPStartup/NSPStartup function failed.  */
+#endif /* WSAPROVIDERFAILEDINIT */
+		case WSASYSCALLFAILURE:
+			/* OS dependent */
+			return "System call failure.";
+			/* Generic error code, returned under various conditions. 
+			Returned when a system call that should never fail does fail. For example, if a call to WaitForMultipleEvents fails or one of the registry functions fails trying to manipulate the protocol/namespace catalogs.
+			Returned when a provider does not return SUCCESS and does not provide an extended error code. Can indicate a service provider implementation error.
 			*/
 		default:
 			break;
@@ -331,8 +331,8 @@
  *  Wrapper function for sendto
  */
 
-int os_sock_sendto( OS_SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to, int tolen )
-{
+int os_sock_sendto( OS_SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to, int tolen )
+{
 	int ret;
 
 	/* reset local errno implementation */
@@ -373,13 +373,13 @@
  *  Wrapper function for recvfrom
  */
 
-int os_sock_recvfrom( OS_SOCKET s, char* buf, int len, int flags, struct sockaddr* from, int* fromlen )
-{
+int os_sock_recvfrom( OS_SOCKET s, char* buf, int len, int flags, struct sockaddr* from, int *fromlen )
+{
 	int ret;
 
 	/* reset local errno implementation */
 	os_sock_errno = 0;
-	ret = recvfrom( s, buf, len, flags, from, fromlen );
+	ret = recvfrom( s, buf, len, flags, from, (socklen_t *)&fromlen );
 	if( ret == SOCKET_ERROR )
 	{
 		OS_SOCK_SET_ERRNO();
@@ -394,7 +394,7 @@
 		}	
 	}
 	return ret;
-}
+}
 
 /*
  *  Wrapper function for set_nonblocking
@@ -473,88 +473,88 @@
  *  Wrapper function for bind
  */
 
-int os_sock_bind( OS_SOCKET s, const struct sockaddr* name, int namelen )
-{
-	int ret;
-
+int os_sock_bind( OS_SOCKET s, const struct sockaddr* name, int namelen )
+{
+	int ret;
+
 	/* reset local errno implementation */
 	os_sock_errno = 0;
-	ret = bind( s, name, namelen );
+	ret = bind( s, name, namelen );
 	if( ret == SOCKET_ERROR )
 	{
 		OS_SOCK_SET_ERRNO();
 		nlog( LOG_WARNING, "os_sock_bind: Unable to bind to IP address %s", os_sock_strerror( os_sock_errno ) );
 	}
-	return ret;
-}
-
+	return ret;
+}
+
 /*
  *  Wrapper function for listen
  */
 
-int os_sock_listen( OS_SOCKET s, int backlog )
-{
-	int ret;
-
+int os_sock_listen( OS_SOCKET s, int backlog )
+{
+	int ret;
+
 	/* reset local errno implementation */
 	os_sock_errno = 0;
-	ret = listen( s, backlog );
+	ret = listen( s, backlog );
 	if( ret == SOCKET_ERROR )
 	{
 		OS_SOCK_SET_ERRNO();
 		nlog( LOG_WARNING, "os_sock_listen: Unable to listen %s", os_sock_strerror( os_sock_errno ) );
 	}
-	return ret;
-}
-
+	return ret;
+}
+
 /*
  *  Wrapper function for setsockopt
  */
 
-int os_sock_setsockopt( OS_SOCKET s, int level, int optname, const char* optval, int optlen )
-{
-	int ret;
-
+int os_sock_setsockopt( OS_SOCKET s, int level, int optname, const char* optval, int optlen )
+{
+	int ret;
+
 	/* reset local errno implementation */
 	os_sock_errno = 0;
-	ret = setsockopt( s, level, optname, optval, optlen );
+	ret = setsockopt( s, level, optname, optval, optlen );
 	if( ret == SOCKET_ERROR )
 	{
 		OS_SOCK_SET_ERRNO();
 		nlog( LOG_WARNING, "setsockopt: failed %s", os_sock_strerror( os_sock_errno ) );
 	}
-	return ret;	
-}
-
+	return ret;	
+}
+
 /*
  *  Wrapper function for ioctl
  */
 
-int os_sock_ioctl( OS_SOCKET s, int cmd, void* argp )
-{
+int os_sock_ioctl( OS_SOCKET s, int cmd, void* argp )
+{
 #ifdef WIN32
 	return ioctlsocket( s, cmd, argp );
 #else
 	return ioctl( s, cmd, argp );
 #endif
-}
-
+}
+
 /*
  *  Wrapper function for select
  */
 
-int os_sock_select( int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, struct timeval* timeout )
-{
-	int ret;
-
+int os_sock_select( int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, struct timeval* timeout )
+{
+	int ret;
+
 	/* reset local errno implementation */
 	os_sock_errno = 0;
-	ret = select( nfds, readfds, writefds, exceptfds, timeout );
+	ret = select( nfds, readfds, writefds, exceptfds, timeout );
 	if( ret == SOCKET_ERROR )
 	{
 		OS_SOCK_SET_ERRNO();
 		nlog( LOG_WARNING, "os_sock_select: select failed %s", os_sock_strerror( os_sock_errno ) );
 	}
-	return ret;
+	return ret;
 }
 

Modified: trunk/src/protocol/unreal32.c
==============================================================================
--- trunk/src/protocol/unreal32.c	(original)
+++ trunk/src/protocol/unreal32.c	Fri Jul  1 16:18:15 2005
@@ -565,7 +565,7 @@
 	char targ[25];
 	struct in_addr ia;
 
-	b64_decode( buf, targ, 25 );
+	b64_decode( buf, (unsigned char *)targ, 25 );
 	ia = *( struct in_addr * )targ;
 	if( len == 8 )  /* IPv4 */
 		return ia.s_addr;

Modified: trunk/src/sock.c
==============================================================================
--- trunk/src/sock.c	(original)
+++ trunk/src/sock.c	Fri Jul  1 16:18:15 2005
@@ -462,8 +462,9 @@
 
 int InitSocks (void)
 {
+#if 0
 	struct hostent *hp;
-
+#endif
 	me.maxsocks = getmaxsock ();
 	sockethash = hash_create (me.maxsocks, 0, 0);
 	if(!sockethash) {
@@ -741,7 +742,7 @@
 void
 read_sock_activity(int fd, short what, void *data) {
 	Sock *sock = (Sock *)data;
-	u_char *p = NULL;
+	char *p = NULL;
 	int n;
 	size_t howmuch = READBUFSIZE;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.