Fix -Wpointer-arith warnings

NULL used in arithmetic
This commit is contained in:
dhewg 2011-11-30 23:14:44 +01:00 committed by Daniel Gibson
parent c155107ba9
commit 98fbe07684
4 changed files with 10 additions and 10 deletions

View file

@ -3134,7 +3134,7 @@ idActor::Event_HasAnim
================ ================
*/ */
void idActor::Event_HasAnim( int channel, const char *animname ) { void idActor::Event_HasAnim( int channel, const char *animname ) {
if ( GetAnim( channel, animname ) != NULL ) { if ( GetAnim( channel, animname ) != 0 ) {
idThread::ReturnFloat( 1.0f ); idThread::ReturnFloat( 1.0f );
} else { } else {
idThread::ReturnFloat( 0.0f ); idThread::ReturnFloat( 0.0f );

View file

@ -4140,7 +4140,7 @@ idPlayer::GiveVideo
*/ */
void idPlayer::GiveVideo( const char *videoName, idDict *item ) { void idPlayer::GiveVideo( const char *videoName, idDict *item ) {
if ( videoName == NULL || *videoName == NULL ) { if ( videoName == NULL || *videoName == 0 ) {
return; return;
} }
@ -4177,7 +4177,7 @@ idPlayer::GiveEmail
*/ */
void idPlayer::GiveEmail( const char *emailName ) { void idPlayer::GiveEmail( const char *emailName ) {
if ( emailName == NULL || *emailName == NULL ) { if ( emailName == NULL || *emailName == 0 ) {
return; return;
} }
@ -4204,7 +4204,7 @@ void idPlayer::GivePDA( const char *pdaName, idDict *item )
inventory.pdaSecurity.AddUnique( item->GetString( "inv_name" ) ); inventory.pdaSecurity.AddUnique( item->GetString( "inv_name" ) );
} }
if ( pdaName == NULL || *pdaName == NULL ) { if ( pdaName == NULL || *pdaName == 0 ) {
pdaName = "personal"; pdaName = "personal";
} }
@ -6297,7 +6297,7 @@ void idPlayer::UpdatePDAInfo( bool updatePDASel ) {
const char *security = pda->GetSecurity(); const char *security = pda->GetSecurity();
if ( j == currentPDA || (currentPDA == 0 && security && *security ) ) { if ( j == currentPDA || (currentPDA == 0 && security && *security ) ) {
if ( *security == NULL ) { if ( *security == 0 ) {
security = common->GetLanguageDict()->GetString( "#str_00066" ); security = common->GetLanguageDict()->GetString( "#str_00066" );
} }
objectiveSystem->SetStateString( "PDASecurityClearance", security ); objectiveSystem->SetStateString( "PDASecurityClearance", security );

View file

@ -3063,7 +3063,7 @@ idActor::Event_HasAnim
================ ================
*/ */
void idActor::Event_HasAnim( int channel, const char *animname ) { void idActor::Event_HasAnim( int channel, const char *animname ) {
if ( GetAnim( channel, animname ) != NULL ) { if ( GetAnim( channel, animname ) != 0 ) {
idThread::ReturnFloat( 1.0f ); idThread::ReturnFloat( 1.0f );
} else { } else {
idThread::ReturnFloat( 0.0f ); idThread::ReturnFloat( 0.0f );

View file

@ -3281,7 +3281,7 @@ idPlayer::GiveVideo
*/ */
void idPlayer::GiveVideo( const char *videoName, idDict *item ) { void idPlayer::GiveVideo( const char *videoName, idDict *item ) {
if ( videoName == NULL || *videoName == NULL ) { if ( videoName == NULL || *videoName == 0 ) {
return; return;
} }
@ -3318,7 +3318,7 @@ idPlayer::GiveEmail
*/ */
void idPlayer::GiveEmail( const char *emailName ) { void idPlayer::GiveEmail( const char *emailName ) {
if ( emailName == NULL || *emailName == NULL ) { if ( emailName == NULL || *emailName == 0 ) {
return; return;
} }
@ -3345,7 +3345,7 @@ void idPlayer::GivePDA( const char *pdaName, idDict *item )
inventory.pdaSecurity.AddUnique( item->GetString( "inv_name" ) ); inventory.pdaSecurity.AddUnique( item->GetString( "inv_name" ) );
} }
if ( pdaName == NULL || *pdaName == NULL ) { if ( pdaName == NULL || *pdaName == 0 ) {
pdaName = "personal"; pdaName = "personal";
} }
@ -5249,7 +5249,7 @@ void idPlayer::UpdatePDAInfo( bool updatePDASel ) {
const char *security = pda->GetSecurity(); const char *security = pda->GetSecurity();
if ( j == currentPDA || (currentPDA == 0 && security && *security ) ) { if ( j == currentPDA || (currentPDA == 0 && security && *security ) ) {
if ( *security == NULL ) { if ( *security == 0 ) {
security = common->GetLanguageDict()->GetString( "#str_00066" ); security = common->GetLanguageDict()->GetString( "#str_00066" );
} }
objectiveSystem->SetStateString( "PDASecurityClearance", security ); objectiveSystem->SetStateString( "PDASecurityClearance", security );