From 98fbe07684072351f03b5450e8ff6d892167de59 Mon Sep 17 00:00:00 2001 From: dhewg Date: Wed, 30 Nov 2011 23:14:44 +0100 Subject: [PATCH] Fix -Wpointer-arith warnings NULL used in arithmetic --- d3xp/Actor.cpp | 2 +- d3xp/Player.cpp | 8 ++++---- game/Actor.cpp | 2 +- game/Player.cpp | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/d3xp/Actor.cpp b/d3xp/Actor.cpp index 107e506..d4638c6 100644 --- a/d3xp/Actor.cpp +++ b/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 ) != 0 ) { idThread::ReturnFloat( 1.0f ); } else { idThread::ReturnFloat( 0.0f ); diff --git a/d3xp/Player.cpp b/d3xp/Player.cpp index dd179a7..e535c7a 100644 --- a/d3xp/Player.cpp +++ b/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 ); diff --git a/game/Actor.cpp b/game/Actor.cpp index f5d26ef..0fb02ad 100644 --- a/game/Actor.cpp +++ b/game/Actor.cpp @@ -3063,7 +3063,7 @@ idActor::Event_HasAnim ================ */ void idActor::Event_HasAnim( int channel, const char *animname ) { - if ( GetAnim( channel, animname ) != NULL ) { + if ( GetAnim( channel, animname ) != 0 ) { idThread::ReturnFloat( 1.0f ); } else { idThread::ReturnFloat( 0.0f ); diff --git a/game/Player.cpp b/game/Player.cpp index f33d10f..48d7a93 100644 --- a/game/Player.cpp +++ b/game/Player.cpp @@ -3281,7 +3281,7 @@ idPlayer::GiveVideo */ void idPlayer::GiveVideo( const char *videoName, idDict *item ) { - if ( videoName == NULL || *videoName == NULL ) { + if ( videoName == NULL || *videoName == 0 ) { return; } @@ -3318,7 +3318,7 @@ idPlayer::GiveEmail */ void idPlayer::GiveEmail( const char *emailName ) { - if ( emailName == NULL || *emailName == NULL ) { + if ( emailName == NULL || *emailName == 0 ) { return; } @@ -3345,7 +3345,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"; } @@ -5249,7 +5249,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 );