ref: 0823efb6440b7108375f10441ee47faa8e3517c8
parent: 303984cda676adbc7b8ed7240c96b845fa6a2ef4
author: mkf <mkf@cloud9p.org>
date: Wed Jun 5 16:50:39 EDT 2024
srv: fix build, remove unused variables
--- a/srv5.c
+++ b/srv5.c
@@ -59,7 +59,6 @@
static void
printclients(char *fmt, ...)
{
- int i;
/* it seems arg gets changed during the first call to vprint, thus we need two */
va_list arg, arg2;
@@ -273,8 +272,7 @@
int
proc(int player, char *s)
{
- char *t;
- int oturn, n;
+ int oturn;
/* early return paths */
if(*s == '\0' || *s == 'q')
@@ -406,7 +404,7 @@
static void
clienthandler(void *data)
{
- int res, gid, player;
+ int gid, player;
char *s;
Game *g;
@@ -414,9 +412,7 @@
player = ((int*)data)[1];
dprint("clienthandler({%d, %d})\n", gid, player);
-
- g = (Game*)lookup(games, gid);
-
+
for(;;)
{
/* most of time is spent here */
@@ -432,7 +428,7 @@
pthread_mutex_lock(&game_lock);
loadgame(gid);
- res = proc(player, s);
+ proc(player, s);
setgame(gid);
pthread_mutex_unlock(&game_lock);
@@ -532,10 +528,9 @@
if(g == 0)
return g;
- die:
- fprint(fd, "DIE invalid game: %d", g);
- close(fd);
- return -1;
+ fprint(fd, "DIE invalid game: %d", g);
+ close(fd);
+ return -1;
}
@@ -548,10 +543,9 @@
if(s == PGlenda || s == PTrapper || s == PRandom)
return s;
- die:
- fprint(fd, "DIE invalid side: %d", s);
- close(fd);
- return -1;
+ fprint(fd, "DIE invalid side: %d", s);
+ close(fd);
+ return -1;
}
int
@@ -668,7 +662,7 @@
cl = newclient(s, fd);
if(cl != nil)
- makematch(cl);/
+ makematch(cl);
die:
free(s);
}
@@ -678,7 +672,7 @@
{
int *clientfd;
socklen_t clilen;
- struct sockaddr_in servaddr, clientaddr;
+ struct sockaddr_in clientaddr;
pthread_t t;
for(;;)