Update of /cvsroot/netrek/server/Vanilla/ntserv
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5657/ntserv
Modified Files:
cluecheck.c conquer.c coup.c daemonII.c data.c db.c genspkt.c
main.c ntscmds.c
Log Message:
compilation fixes from -Wall
Index: ntscmds.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/ntserv/ntscmds.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ntscmds.c 26 Apr 2006 09:52:43 -0000 1.9
+++ ntscmds.c 6 May 2006 12:06:39 -0000 1.10
@@ -13,10 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
-#include <string.h>
-#include <time.h>
#include <signal.h>
-#include <sys/types.h>
#include <unistd.h>
#include "defs.h"
#include "struct.h"
@@ -354,7 +351,7 @@
{
if (vfork() == 0) {
(void) SIGNAL(SIGALRM,SIG_DFL);
- execl(Basep, "basep", 0);
+ execl(Basep, "basep", (char *) NULL);
perror(Basep);
}
}
@@ -376,7 +373,7 @@
{
if (vfork() == 0) {
(void) SIGNAL(SIGALRM,SIG_DFL);
- execl(Puck, "puck", 0);
+ execl(Puck, "puck", (char *) NULL);
perror(Puck);
}
}
@@ -387,7 +384,7 @@
{
if (vfork() == 0) {
(void) SIGNAL(SIGALRM,SIG_DFL);
- execl(Mars, "mars", 0);
+ execl(Mars, "mars", (char *) NULL);
perror(Mars);
}
}
@@ -1180,7 +1177,7 @@
char *one, *two;
/* guests have no player file position */
- if (me->p_pos < 0) {
+ if (p->p_pos < 0) {
pmessage(who, MINDIV, addr,
"You can't change your password, sorry!");
return;
@@ -1298,11 +1295,9 @@
{
int whofrom = mess->m_from;
struct player *p = &players[whofrom];
- struct player *victim;
char *addr = addr_mess(whofrom,MINDIV);
- char *who, *what;
+ char *what;
char *usage = "transwarp usage: 'TRANSWARP ON|GREEN|YELLOW|SHIELD|OFF'";
- int slot;
if (p->p_ship.s_type != STARBASE) {
pmessage(whofrom, MINDIV, addr, "transwarp: must be a starbase to use this");
Index: coup.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/ntserv/coup.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- coup.c 21 Mar 2005 05:23:43 -0000 1.1
+++ coup.c 6 May 2006 12:06:39 -0000 1.2
@@ -2,9 +2,6 @@
* coup.c
*/
#include "copyright.h"
-
-#include <stdio.h>
-#include <sys/types.h>
#include "defs.h"
#include "struct.h"
#include "data.h"
Index: db.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/ntserv/db.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- db.c 21 Mar 2005 09:40:45 -0000 1.1
+++ db.c 6 May 2006 12:06:39 -0000 1.2
@@ -5,7 +5,10 @@
#include "config.h"
#include <stdio.h>
+#include <stdlib.h>
#include <stddef.h>
+#define _XOPEN_SOURCE
+#include <unistd.h>
#include INC_MATH
#include <signal.h>
#include <errno.h>
@@ -72,7 +75,7 @@
free(content.dptr);
gdbm_close(dbf);
ERROR(8,("db.c: db_index_fetch: gdbm_fetch('%s'): index says position '%d'\n",
- namePick, position));
+ namePick, (int) position));
return position;
}
@@ -94,14 +97,14 @@
/* store this key and position */
if (gdbm_store(dbf, key, content, GDBM_REPLACE) < 0) {
ERROR(8,("db.c: db_index_store: gdbm_store('%s' -> '%d'): %s, %s\n",
- player->name, position, gdbm_strerror(gdbm_errno),
+ player->name, (int) position, gdbm_strerror(gdbm_errno),
strerror(errno)));
gdbm_close(dbf);
return;
}
ERROR(8,("db.c: db_index_store: gdbm_store('%s' -> '%d'): ok\n",
- player->name, position));
+ player->name, (int) position));
gdbm_close(dbf);
}
@@ -143,15 +146,18 @@
if (strcmp(namePick, player->name)==0) {
close(fd);
ERROR(8,("db.c: findplayer: ok, '%s' is indeed at position '%d'\n",
- namePick, position));
+ namePick, (int) position));
#ifdef DB_TIMING
- ERROR(8,("db.c: timing, cached resolution, %f\n", g_timer_elapsed(timer, NULL)));
+ ERROR(8,("db.c: timing, cached resolution, %f\n",
+ g_timer_elapsed(timer, NULL)));
g_timer_destroy(timer);
#endif
return position;
}
/* otherwise there's an inconsistency that we can recover from */
- ERROR(2,("db.c: findplayer: player index inconsistent with player file, entered name '%s', index says position '%d', but file entry name '%s'\n", namePick, position, player->name));
+ ERROR(2,("db.c: findplayer: player index inconsistent with player file, "
+ "entered name '%s', index says position '%d', but file entry name '%s'\n",
+ namePick, (int) position, player->name));
/* return file to start for sequential search */
lseek(fd, 0, SEEK_SET);
}
@@ -167,7 +173,7 @@
db_index_store(player, position);
#endif
ERROR(8,("db.c: findplayer: '%s' found in sequential scan at position '%d'\n",
- namePick, position));
+ namePick, (int) position));
#ifdef DB_TIMING
ERROR(8,("db.c: timing, sequential resolution, %f\n", g_timer_elapsed(timer, NULL)));
g_timer_destroy(timer);
Index: conquer.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/ntserv/conquer.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- conquer.c 24 Apr 2006 10:12:18 -0000 1.1
+++ conquer.c 6 May 2006 12:06:39 -0000 1.2
@@ -1,8 +1,12 @@
+#include <stdlib.h>
#include "copyright.h"
#include "config.h"
#include "defs.h"
#include "struct.h"
#include "data.h"
+#include "proto.h"
+#include "daemon.h"
+#include "conquer.h"
/* conquest gloating parade */
Index: data.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/ntserv/data.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- data.c 26 Apr 2006 09:52:43 -0000 1.6
+++ data.c 6 May 2006 12:06:39 -0000 1.7
@@ -6,9 +6,6 @@
#include "struct.h"
#include "data.h"
-#include <sys/types.h> /* needed to define fd_set for inputMask */
-#include INC_SYS_SELECT
-
struct player *players;
struct player *me;
struct torp *torps;
Index: genspkt.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/ntserv/genspkt.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- genspkt.c 27 Apr 2006 00:24:07 -0000 1.4
+++ genspkt.c 6 May 2006 12:06:39 -0000 1.5
@@ -11,15 +11,10 @@
#include <stdio.h>
#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/time.h>
+#include <unistd.h>
#include <netinet/in.h>
#include <signal.h>
#include "defs.h"
-#include INC_UNISTD
-#include INC_STRINGS
-#include INC_SYS_SELECT
#include "struct.h"
#include "data.h"
#include "packets.h"
Index: cluecheck.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/ntserv/cluecheck.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cluecheck.c 21 Mar 2005 05:23:43 -0000 1.1
+++ cluecheck.c 6 May 2006 12:06:39 -0000 1.2
@@ -2,17 +2,12 @@
*/
#include "copyright.h"
-#include <stdio.h>
-#include <math.h>
#include <stdlib.h>
#include "defs.h"
#include "struct.h"
#include "data.h"
-#include "packets.h"
-
#include "proto.h"
-
struct Question {
char *quest;
char *help[5];
@@ -250,5 +245,3 @@
if ((me->p_status != POBSERV) && (me->p_armies>0)) save_armies();
}
}
-
-
Index: main.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/ntserv/main.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- main.c 26 Apr 2006 09:52:43 -0000 1.8
+++ main.c 6 May 2006 12:06:39 -0000 1.9
@@ -4,19 +4,13 @@
#include "copyright.h"
#include <stdio.h>
-#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
-#include <signal.h>
#include <pwd.h>
-#include <sys/time.h>
#include <fcntl.h>
-#include <string.h>
-#include <sys/types.h>
#include <arpa/inet.h>
#include "defs.h"
-#include INC_STRINGS
#include INC_UNISTD
#include INC_SYS_WAIT
#include "struct.h"
@@ -28,7 +22,6 @@
#ifdef SENDFLAGS
#include "../cflags.h"
#endif
-
#include "proto.h"
#ifndef TRUE
Index: daemonII.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/ntserv/daemonII.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- daemonII.c 26 Apr 2006 09:52:43 -0000 1.12
+++ daemonII.c 6 May 2006 12:06:39 -0000 1.13
@@ -6,30 +6,20 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <sys/types.h>
-#ifdef AUTOMOTD
-#include <sys/stat.h>
-#endif
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ipc.h>
-#include <sys/ioctl.h>
-#include <signal.h>
#include <time.h>
#include <math.h>
#include <errno.h>
-#include <sys/errno.h>
-#include <sys/file.h>
#include <sys/wait.h>
#include "defs.h"
#include "struct.h"
#include "data.h"
#include "planets.h"
#include "proto.h"
+#include "conquer.h"
+#include "daemon.h"
#include INC_UNISTD
#include INC_SYS_FCNTL
-#include INC_STRINGS
#include INC_SYS_TIME
#ifdef AUTOMOTD
@@ -118,7 +108,6 @@
static void conquerMessage(int winner);
static void displayBest(FILE *conqfile, int team, int type);
static void fork_robot(int robot);
-void doResources(void);
/* static void doRotateGalaxy(void); */
static void signal_servers(void);
@@ -395,7 +384,6 @@
FILE *fp;
struct tm *today;
time_t gmtsecs;
- char *jptr, *iptr;
for (i=0; i<MAXPLAYER; i++) {
struct player *me = &players[i];
@@ -544,7 +532,6 @@
static void move(int ignored)
{
- static int oldtourn=0;
static int oldmessage;
int old_robot;
static enum ts {
@@ -1877,7 +1864,7 @@
}
else {
if ((torp->t_attribute & TDETTEAMSAFE) &&
- (j->p_team == players[torp->t_whodet].p_team))
+ (j->p_team == players[(int)torp->t_whodet].p_team))
continue;
}
}
@@ -1959,7 +1946,7 @@
#ifdef CHAIN_REACTION
if ((torp->t_whodet != NODET)
&& (torp->t_whodet != j->p_no)
- && (players[torp->t_whodet].p_team != j->p_team))
+ && (players[(int)torp->t_whodet].p_team != j->p_team))
k = player_(torp->t_whodet);
else
k = player_(torp->t_owner);
@@ -2953,7 +2940,7 @@
{
register int i;
register struct player *j;
- register struct planet *l;
+ register struct planet *l = NULL;
char buf1[MSG_LEN];
for (i = 0, j = &players[i]; i < MAXPLAYER; i++, j++) {
@@ -3720,7 +3707,6 @@
{
register int i, h;
register struct planet *l;
- register struct player *j;
int team[MAXTEAM + 1];
int teamtemp[MAXTEAM + 1];
@@ -4231,34 +4217,34 @@
case NO_ROBOT: break;
#ifdef BASEPRACTICE
case BASEP_ROBOT:
- execl(Basep, "basep", 0);
+ execl(Basep, "basep", (char *) NULL);
perror(Basep);
break;
#endif
#ifdef NEWBIESERVER
case NEWBIE_ROBOT:
- execl(Newbie, "newbie", 0);
+ execl(Newbie, "newbie", (char *) NULL);
perror(Newbie);
break;
#endif
#ifdef PRETSERVER
case PRET_ROBOT:
- execl(PreT, "pret", 0);
+ execl(PreT, "pret", (char *) NULL);
perror(PreT);
break;
#endif
#ifdef DOGFIGHT
case MARS_ROBOT:
- execl(Mars, "mars", 0);
+ execl(Mars, "mars", (char *) NULL);
perror(Mars);
break;
#endif
case PUCK_ROBOT:
- execl(Puck, "puck", 0);
+ execl(Puck, "puck", (char *) NULL);
perror(Puck);
break;
case INL_ROBOT:
- execl(Inl, "inl", 0);
+ execl(Inl, "inl", (char *) NULL);
perror(Inl);
break;
default: ERROR(1,( "Unknown Robot: %d\n", robot ));