From 9c72004fada0af13e4c9b4682c733056a777dc59 Mon Sep 17 00:00:00 2001 From: oroborus Date: Fri, 22 Aug 2008 20:25:47 +0000 Subject: - oprava warningov :) git-svn-id: http://opensvn.csie.org/tuxanci_ng@242 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/base/proto.h | 1 - src/base/server.h | 15 +++++++++------ src/client/client.c | 9 +++++++-- src/client/saveLoad.c | 2 ++ src/screen/screen_credits.c | 4 ++-- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/base/proto.h b/src/base/proto.h index 689011b..9e2b666 100644 --- a/src/base/proto.h +++ b/src/base/proto.h @@ -15,7 +15,6 @@ #include "arenaFile.h" #include "myTimer.h" #include "server.h" -#include "proto.h" #include "net_multiplayer.h" #ifndef PUBLIC_SERVER diff --git a/src/base/server.h b/src/base/server.h index f843fea..a730876 100644 --- a/src/base/server.h +++ b/src/base/server.h @@ -9,6 +9,12 @@ #include "tux.h" #include "myTimer.h" #include "protect.h" +#include "buffer.h" + +#ifndef PUBLIC_SERVER +#include "interface.h" +#endif + #ifdef SUPPORT_UDP #include "udp.h" #endif @@ -16,18 +22,12 @@ #ifdef SUPPORT_TCP #include "tcp.h" #endif -#include "buffer.h" - -#ifndef PUBLIC_SERVER -#include "interface.h" -#endif #define SERVER_TIMEOUT 1000 #define SERVER_TIME_SYNC 1000 #define SERVER_TIME_PING 1000 #define SERVER_MAX_CLIENTS 100 - #define SERVER_INDEX_ROOT_TUX 0 #define CLIENT_TYPE_UDP 1 @@ -36,12 +36,15 @@ typedef struct client_struct { int type; + #ifdef SUPPORT_UDP sock_udp_t *socket_udp; #endif + #ifdef SUPPORT_TCP sock_tcp_t *socket_tcp; #endif + buffer_t *recvBuffer; buffer_t *sendBuffer; diff --git a/src/client/client.c b/src/client/client.c index 66c5700..399324a 100644 --- a/src/client/client.c +++ b/src/client/client.c @@ -57,7 +57,6 @@ static int traffic_down; static int traffic_up; #endif - typedef struct proto_cmd_client_struct { char *name; @@ -229,6 +228,8 @@ void sendServer(char *msg) assert( msg != NULL ); + ret = -1; + #ifndef PUBLIC_SERVER if( isParamFlag("--send") ) { @@ -269,7 +270,8 @@ static int eventServerSelect() int ret; memset(buffer, 0, STR_PROTO_SIZE); - + ret = -1; + #ifdef SUPPORT_UDP if( sock_server_udp != NULL ) { @@ -382,6 +384,9 @@ static void selectClientSocket() int sock; bool_t isNext; + max_fd = 0; + sock = 0; + #ifdef SUPPORT_UDP if( sock_server_udp != NULL ) { diff --git a/src/client/saveLoad.c b/src/client/saveLoad.c index 05452a9..a02a80f 100644 --- a/src/client/saveLoad.c +++ b/src/client/saveLoad.c @@ -215,6 +215,8 @@ static arena_t* loadContextArenaFromTextFile(textFile_t *textFile) arena_t *arena; int i; + arena = NULL; + for( i = 0 ; i < textFile->text->count ; i++ ) { char *line; diff --git a/src/screen/screen_credits.c b/src/screen/screen_credits.c index d2fcee2..0d65c07 100644 --- a/src/screen/screen_credits.c +++ b/src/screen/screen_credits.c @@ -127,8 +127,8 @@ void initScreenCredits() { creditExists = 0; widget_t *label; - char *line; - line = _("Credit file not found... %s/%s"),PATH_DOC,SCREEN_CREDITS_FILE; + char line[STR_SIZE]; + sprintf(line, _("Credit file not found... %s/%s"),PATH_DOC,SCREEN_CREDITS_FILE); label = newWidgetLabel(line, WINDOW_SIZE_X/2, (WINDOW_SIZE_Y-100)+i*20, WIDGET_LABEL_CENTER); -- cgit v1.2.3