Date:	Friday April 27, 2001 @ 20:37
Author:	cameron

Update of /home/netrek/cvsroot/Vanilla/ntserv
In directory swashbuckler.fortress.real-time.com:/var/tmp/cvs-serv19315/ntserv

Modified Files:
	genspkt.c socket.c 
Log Message:
Fri Apr 27 22:09:19 2001  James Cameron  <quozl at us.netrek.org>

	* tools/ltd_convert.c, tools/sortdb.c: main should be int.
	
	* ntserv/socket.c: added numerous casts of struct sockaddr,
	removed always true short packets test code.

	* Makefile.in (reallyclean): include config.cache in target.



****************************************

Index: Vanilla/ntserv/genspkt.c
diff -u Vanilla/ntserv/genspkt.c:1.19 Vanilla/ntserv/genspkt.c:1.20
--- Vanilla/ntserv/genspkt.c:1.19	Tue Nov  7 09:22:49 2000
+++ Vanilla/ntserv/genspkt.c	Fri Apr 27 20:37:25 2001
@@ -369,6 +369,7 @@
 	}
 #endif
 	/* S_P2 */
+#if 0
 	if ( send_short < 2
 #ifdef OBSERVERS
 	     || pobserv
@@ -380,7 +381,9 @@
 	     || pstatus->status != PDEAD)
 
 /* WTF?  This if always tests true??? */
-
+/* Agreed.  My compiler warns of this too, so I've added "#if 0" to
+ * avoid the warning.  quozl at us.netrek.org */
+#endif
 	    sendClientPacket(pstatus);
 	if (dead_warp) dead_warp = 1;
 #ifdef OBSERVERS
Index: Vanilla/ntserv/socket.c
diff -u Vanilla/ntserv/socket.c:1.29 Vanilla/ntserv/socket.c:1.30
--- Vanilla/ntserv/socket.c:1.29	Thu Jan  4 05:06:06 2001
+++ Vanilla/ntserv/socket.c	Fri Apr 27 20:37:25 2001
@@ -1,4 +1,4 @@
-/* $Id: socket.c,v 1.29 2001/01/04 11:06:06 xyzzy Exp $
+/* $Id: socket.c,v 1.30 2001/04/28 01:37:25 cameron Exp $
  */
 
 /*
@@ -24,6 +24,7 @@
 #include <math.h>
 #include <errno.h>
 #include <signal.h>
+#include <time.h>
 #include "defs.h"
 #include INC_UNISTD
 #include INC_STRINGS
@@ -412,7 +413,7 @@
     }
 
     /* start a connection attempt */
-    stat = connect(ns, &addr, sizeof(addr));
+    stat = connect(ns, (struct sockaddr *) &addr, sizeof(addr));
     if (stat < 0 && errno != EINPROGRESS) {
 	ERROR(2,("%s: connect() failed, %s\n", whoami(), 
 		 strerror(errno)));
@@ -1020,7 +1021,7 @@
 		addr.sin_addr.s_addr = remoteaddr;
 		addr.sin_port = htons(udpClientPort);
 		addr.sin_family = AF_INET;
-		if (connect(udpSock, &addr, sizeof(addr)) < 0) {
+		if (connect(udpSock, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
 		    ERROR(1,("%s: hiccup connect() failed, %s\n",
 			     whoami(), strerror(errno)));
 		    UDPDIAG(("Unable to reconnect\n"));
@@ -2294,7 +2295,7 @@
     }
     addr.sin_port = 0;
 
-    if (bind(udpSock, &addr, sizeof(addr)) < 0) {
+    if (bind(udpSock, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
         perror("ntserv: cannot bind to local port");
         close(udpSock);
 	udpSock = -1;
@@ -2325,7 +2326,7 @@
     }
     else
 #endif /* UDP_PORTSWAP */
-    if (connect(udpSock, &caddr, sizeof(caddr)) < 0)
+    if (connect(udpSock, (struct sockaddr *) &caddr, sizeof(caddr)) < 0)
 #else /* !UDP_FIX */
 
     addr.sin_family = AF_INET;
@@ -2356,7 +2357,7 @@
 
     /* determine what our port is */
     len = sizeof(addr);
-    if (getsockname(udpSock, &addr, &len) < 0) {
+    if (getsockname(udpSock, (struct sockaddr *) &addr, &len) < 0) {
 	perror("netrek: unable to getsockname(UDP)");
 	UDPDIAG(("Can't get our own socket; connection failed\n"));
 	close(udpSock);
@@ -2397,14 +2398,14 @@
     int len;
 
     len = sizeof(addr);
-    if (getsockname(udpSock, &addr, &len) < 0) {
+    if (getsockname(udpSock, (struct sockaddr *) &addr, &len) < 0) {
 	perror("printUdpInfo: getsockname");
 	return;
     }
     UDPDIAG(("LOCAL: addr=0x%x, family=%d, port=%d\n", addr.sin_addr.s_addr,
 	     addr.sin_family, ntohs(addr.sin_port)));
 
-    if (getpeername(udpSock, &addr, &len) < 0) {
+    if (getpeername(udpSock, (struct sockaddr *) &addr, &len) < 0) {
 	perror("printUdpInfo: getpeername");
 	return;
     }