From 61c9f6211b23e7c9ac823f91e889179366138467 Mon Sep 17 00:00:00 2001 From: XoD Date: Sun, 18 Dec 2011 23:06:11 +0100 Subject: [PATCH 1/2] Replace NULL by '\0' in some char comparison fix some Warning: pointer-arith in Player.cpp Signed-off-by: XoD --- neo/d3xp/Player.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/neo/d3xp/Player.cpp b/neo/d3xp/Player.cpp index 51fa74d..c746920 100644 --- a/neo/d3xp/Player.cpp +++ b/neo/d3xp/Player.cpp @@ -4140,7 +4140,7 @@ idPlayer::GiveVideo */ void idPlayer::GiveVideo( const char *videoName, idDict *item ) { - if ( videoName == NULL || *videoName == NULL ) { + if ( videoName == NULL || *videoName == '\0' ) { return; } @@ -4177,7 +4177,7 @@ idPlayer::GiveEmail */ void idPlayer::GiveEmail( const char *emailName ) { - if ( emailName == NULL || *emailName == NULL ) { + if ( emailName == NULL || *emailName == '\0' ) { return; } @@ -4204,7 +4204,7 @@ void idPlayer::GivePDA( const char *pdaName, idDict *item ) inventory.pdaSecurity.AddUnique( item->GetString( "inv_name" ) ); } - if ( pdaName == NULL || *pdaName == NULL ) { + if ( pdaName == NULL || *pdaName == '\0' ) { pdaName = "personal"; } @@ -6297,7 +6297,7 @@ void idPlayer::UpdatePDAInfo( bool updatePDASel ) { const char *security = pda->GetSecurity(); if ( j == currentPDA || (currentPDA == 0 && security && *security ) ) { - if ( *security == NULL ) { + if ( *security == '\0' ) { security = common->GetLanguageDict()->GetString( "#str_00066" ); } objectiveSystem->SetStateString( "PDASecurityClearance", security ); From 72fd4c6fc20d7fe8a3410767d16441c7eb576467 Mon Sep 17 00:00:00 2001 From: XoD Date: Wed, 21 Dec 2011 23:52:32 +0100 Subject: [PATCH 2/2] Remove comparison from a int to NULL In Event_HasAnim the result of GetAnim is compared to a pointer, GetAnim return a int. Fix a Warning: pointer-arith Signed-off-by: XoD --- neo/d3xp/Actor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neo/d3xp/Actor.cpp b/neo/d3xp/Actor.cpp index 6392cd9..f130424 100644 --- a/neo/d3xp/Actor.cpp +++ b/neo/d3xp/Actor.cpp @@ -3134,7 +3134,7 @@ idActor::Event_HasAnim ================ */ void idActor::Event_HasAnim( int channel, const char *animname ) { - if ( GetAnim( channel, animname ) != NULL ) { + if ( GetAnim( channel, animname ) ) { idThread::ReturnFloat( 1.0f ); } else { idThread::ReturnFloat( 0.0f );