From 34490bb875b8117d6be3d430f1d0cdc798772d5c Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sun, 27 Sep 2015 18:05:04 +0200 Subject: [PATCH] Fix some compiler warnings (wrong types, superfluous checks, printf-fuckup) --- d3xp/Game_local.cpp | 2 +- game/Game_local.cpp | 2 +- idlib/Parser.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/d3xp/Game_local.cpp b/d3xp/Game_local.cpp index 9a61712..dc09037 100644 --- a/d3xp/Game_local.cpp +++ b/d3xp/Game_local.cpp @@ -2653,7 +2653,7 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const { // FIXME: somehow, this is happening occasionally assert( fov_y > 0 ); if ( fov_y <= 0 ) { - Error( "idGameLocal::CalcFov: bad result, fov_y == %f, base_fov == ", fov_y, base_fov ); + Error( "idGameLocal::CalcFov: bad result, fov_y == %f, base_fov == %f", fov_y, base_fov ); } switch( r_aspectRatio.GetInteger() ) { diff --git a/game/Game_local.cpp b/game/Game_local.cpp index 0517b82..524bc5d 100644 --- a/game/Game_local.cpp +++ b/game/Game_local.cpp @@ -2387,7 +2387,7 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const { // FIXME: somehow, this is happening occasionally assert( fov_y > 0 ); if ( fov_y <= 0 ) { - Error( "idGameLocal::CalcFov: bad result, fov_y == %f, base_fov == ", fov_y, base_fov ); + Error( "idGameLocal::CalcFov: bad result, fov_y == %f, base_fov == %f", fov_y, base_fov ); } switch( r_aspectRatio.GetInteger() ) { diff --git a/idlib/Parser.cpp b/idlib/Parser.cpp index 931fd52..86a57d3 100644 --- a/idlib/Parser.cpp +++ b/idlib/Parser.cpp @@ -712,9 +712,9 @@ int idParser::ExpandBuiltinDefine( idToken *deftoken, define_t *define, idToken curtime = ctime(&t); (*token) = "\""; token->Append( curtime+4 ); - token[7] = '\0'; + token[7] = NULL; token->Append( curtime+20 ); - token[10] = '\0'; + token[10] = NULL; token->Append( "\"" ); free(curtime); token->type = TT_STRING; @@ -731,7 +731,7 @@ int idParser::ExpandBuiltinDefine( idToken *deftoken, define_t *define, idToken curtime = ctime(&t); (*token) = "\""; token->Append( curtime+11 ); - token[8] = '\0'; + token[8] = NULL; token->Append( "\"" ); free(curtime); token->type = TT_STRING;