fixed several warnings

This commit is contained in:
Walter Julius Hennecke 2013-05-23 23:58:15 +02:00
parent f6cafeb599
commit 596ab8be01
4 changed files with 19 additions and 11 deletions

View File

@ -210,7 +210,7 @@ struct gentity_s {
// EXPECTS THE FIELDS IN THAT ORDER! // EXPECTS THE FIELDS IN THAT ORDER!
//================================ //================================
/*@null@*/ struct gclient_s *client; // NULL if not a client /*@shared@*/ /*@null@*/ struct gclient_s *client; // NULL if not a client
qboolean inuse; qboolean inuse;

View File

@ -1681,7 +1681,7 @@ extern int lastKillTime[];
extern int LastFKRadius[]; //(RPG-X J2J) added so array can be initialised to 0 first. extern int LastFKRadius[]; //(RPG-X J2J) added so array can be initialised to 0 first.
extern RPGX_SiteTOSiteData TransDat[]; //(RPG-X J2J) added for tricorder transporter extern RPGX_SiteTOSiteData TransDat[]; //(RPG-X J2J) added for tricorder transporter
extern RPGX_DragData DragDat[]; extern RPGX_DragData DragDat[];
void G_InitGame( int levelTime, int randomSeed, int restart ) { void G_InitGame( int levelTime, unsigned int randomSeed, int restart ) {
int i; int i;
char fileName[MAX_QPATH]; char fileName[MAX_QPATH];
float messageTime; float messageTime;
@ -1755,18 +1755,19 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
level.snd_fry = G_SoundIndex("sound/player/fry.wav"); // FIXME standing in lava / slime level.snd_fry = G_SoundIndex("sound/player/fry.wav"); // FIXME standing in lava / slime
if ( g_gametype.integer != GT_SINGLE_PLAYER && g_log.string[0] ) { if ( g_gametype.integer != GT_SINGLE_PLAYER && g_log.string[0] != 0 ) {
if ( g_logSync.integer ) { if ( g_logSync.integer != 0 ) {
trap_FS_FOpenFile( g_log.string, &level.logFile, FS_APPEND_SYNC ); trap_FS_FOpenFile( g_log.string, &level.logFile, FS_APPEND_SYNC );
} else { } else {
trap_FS_FOpenFile( g_log.string, &level.logFile, FS_APPEND ); trap_FS_FOpenFile( g_log.string, &level.logFile, FS_APPEND );
} }
if ( !level.logFile ) { if ( level.logFile == 0 ) {
G_Printf( "WARNING: Couldn't open logfile: %s\n", g_log.string ); G_Printf( "WARNING: Couldn't open logfile: %s\n", g_log.string );
} else { } else {
char serverinfo[MAX_INFO_STRING]; char serverinfo[MAX_INFO_STRING];
trap_GetServerinfo( serverinfo, sizeof( serverinfo ) ); memset(serverinfo, 0, sizeof(serverinfo));
trap_GetServerinfo( serverinfo, (int)sizeof( serverinfo ) );
G_LogPrintf("------------------------------------------------------------\n" ); G_LogPrintf("------------------------------------------------------------\n" );
G_LogPrintf("InitGame: %s\n", serverinfo ); G_LogPrintf("InitGame: %s\n", serverinfo );
@ -2276,8 +2277,15 @@ void SendScoreboardMessageToAllClients( void ) {
} }
void MoveClientToIntermission( gentity_t *ent ) { void MoveClientToIntermission( gentity_t *ent ) {
entityState_t *es = &ent->s; entityState_t* es;
playerState_t *ps = &ent->client->ps; playerState_t* ps;
if(ent == NULL || ent->client == NULL) {
return;
}
ps = &ent->client->ps;
es = &ent->s;
// take out of follow mode if needed // take out of follow mode if needed
if ( ent->client->sess.spectatorState == SPECTATOR_FOLLOW ) { if ( ent->client->sess.spectatorState == SPECTATOR_FOLLOW ) {
@ -2636,7 +2644,7 @@ void G_RunFrame( int levelTime ) {
// //
ent = &g_entities[0]; ent = &g_entities[0];
for (i=0 ; i<level.num_entities ; i++, ent++) { for (i=0 ; i<level.num_entities ; i++, ent++) {
if ( !ent->inuse ) { if ( ent == NULL || ent->client == NULL || ent->inuse == qfalse ) {
continue; continue;
} }

View File

@ -115,7 +115,7 @@ void trap_SetUserinfo( int num, const char *buffer ) {
syscall( G_SET_USERINFO, num, buffer ); syscall( G_SET_USERINFO, num, buffer );
} }
void trap_GetServerinfo( char *buffer, int bufferSize ) { void trap_GetServerinfo( char *buffer, size_t bufferSize ) {
syscall( G_GET_SERVERINFO, buffer, bufferSize ); syscall( G_GET_SERVERINFO, buffer, bufferSize );
} }

View File

@ -674,7 +674,7 @@ void Parse1DMatrix (char **buf_p, int x, float *m);
void Parse2DMatrix (char **buf_p, int y, int x, float *m); void Parse2DMatrix (char **buf_p, int y, int x, float *m);
void Parse3DMatrix (char **buf_p, int z, int y, int x, float *m); void Parse3DMatrix (char **buf_p, int z, int y, int x, float *m);
void QDECL Com_sprintf (char *dest, int size, const char *fmt, ...) __attribute__ ((format (printf, 3, 4))); void QDECL Com_sprintf (char *dest, size_t size, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
// mode parm for FS_FOpenFile // mode parm for FS_FOpenFile