Merge remote-tracking branch 'DanielGibson/linux' into linux

This commit is contained in:
Robert Beckebans 2012-12-12 11:35:19 +01:00
commit 2952f227ea
50 changed files with 112 additions and 101 deletions

View file

@ -109,8 +109,8 @@ idAchievementManager::idAchievementManager
======================== ========================
*/ */
idAchievementManager::idAchievementManager() : idAchievementManager::idAchievementManager() :
lastImpKilledTime( 0 ),
lastPlayerKilledTime( 0 ), lastPlayerKilledTime( 0 ),
lastImpKilledTime( 0 ),
playerTookDamage( false ) playerTookDamage( false )
{ {
counts.Zero(); counts.Zero();

View file

@ -491,7 +491,7 @@ idActor::idActor()
waitState = ""; waitState = "";
blink_anim = NULL; blink_anim = 0;
blink_time = 0; blink_time = 0;
blink_min = 0; blink_min = 0;
blink_max = 0; blink_max = 0;
@ -3679,7 +3679,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 );
} }

View file

@ -412,7 +412,7 @@ void idEntity::UpdateChangeableSpawnArgs( const idDict* source )
} }
cameraTarget = NULL; cameraTarget = NULL;
target = source->GetString( "cameraTarget" ); target = source->GetString( "cameraTarget" );
if( target != NULL && target[0] != NULL ) if( target != NULL && target[0] != '\0' )
{ {
// update the camera taget // update the camera taget
PostEventMS( &EV_UpdateCameraTarget, 0 ); PostEventMS( &EV_UpdateCameraTarget, 0 );
@ -560,7 +560,7 @@ void idEntity::Spawn()
cameraTarget = NULL; cameraTarget = NULL;
temp = spawnArgs.GetString( "cameraTarget" ); temp = spawnArgs.GetString( "cameraTarget" );
if( temp != NULL && temp[0] != NULL ) if( temp != NULL && temp[0] != '\0' )
{ {
// update the camera taget // update the camera taget
PostEventMS( &EV_UpdateCameraTarget, 0 ); PostEventMS( &EV_UpdateCameraTarget, 0 );
@ -624,7 +624,7 @@ void idEntity::Spawn()
SetAxis( axis ); SetAxis( axis );
temp = spawnArgs.GetString( "model" ); temp = spawnArgs.GetString( "model" );
if( temp != NULL && *temp != NULL ) if( temp != NULL && *temp != '\0' )
{ {
SetModel( temp ); SetModel( temp );
} }

View file

@ -1210,7 +1210,7 @@ int idGameEdit::MapGetUniqueMatchingKeyVals( const char* key, const char* list[]
if( ent ) if( ent )
{ {
const char* k = ent->epairs.GetString( key ); const char* k = ent->epairs.GetString( key );
if( k != NULL && *k != NULL && count < max ) if( k != NULL && *k != '\0' && count < max )
{ {
list[count++] = k; list[count++] = k;
} }

View file

@ -73,7 +73,7 @@ idCVar net_usercmd_timing_debug( "net_usercmd_timing_debug", "0", CVAR_BOOL, "Pr
// List of all defs used by the player that will stay on the fast timeline // List of all defs used by the player that will stay on the fast timeline
static char* fastEntityList[] = static const char* fastEntityList[] =
{ {
"player_doommarine", "player_doommarine",
"weapon_chainsaw", "weapon_chainsaw",
@ -744,7 +744,7 @@ void idGameLocal::SetPersistentPlayerInfo( int clientNum, const idDict& playerIn
idGameLocal::Printf idGameLocal::Printf
============ ============
*/ */
void idGameLocal::Printf( const char* fmt, ... ) const void idGameLocal::Printf( const char* fmt, ... ) const // DG: FIXME: printf-annotation
{ {
va_list argptr; va_list argptr;
char text[MAX_STRING_CHARS]; char text[MAX_STRING_CHARS];

View file

@ -471,7 +471,7 @@ bool idItem::Pickup( idPlayer* player )
if( respawn && !dropped && !no_respawn ) if( respawn && !dropped && !no_respawn )
{ {
const char* sfx = spawnArgs.GetString( "fxRespawn" ); const char* sfx = spawnArgs.GetString( "fxRespawn" );
if( sfx != NULL && *sfx != NULL ) if( sfx != NULL && *sfx != '\0' )
{ {
PostEventSec( &EV_RespawnFx, respawn - 0.5f ); PostEventSec( &EV_RespawnFx, respawn - 0.5f );
} }
@ -677,7 +677,7 @@ void idItem::Event_RespawnFx()
ServerSendEvent( EVENT_RESPAWNFX, NULL, false ); ServerSendEvent( EVENT_RESPAWNFX, NULL, false );
} }
const char* sfx = spawnArgs.GetString( "fxRespawn" ); const char* sfx = spawnArgs.GetString( "fxRespawn" );
if( sfx != NULL && *sfx != NULL ) if( sfx != NULL && *sfx != '\0' )
{ {
idEntityFx::StartFx( sfx, NULL, NULL, this, true ); idEntityFx::StartFx( sfx, NULL, NULL, this, true );
} }
@ -888,7 +888,7 @@ void idItemTeam::Spawn()
idItemTeam::LoadScript idItemTeam::LoadScript
=============== ===============
*/ */
function_t* idItemTeam::LoadScript( char* script ) function_t* idItemTeam::LoadScript( const char* script )
{ {
function_t* function = NULL; function_t* function = NULL;
idStr funcname = spawnArgs.GetString( script, "" ); idStr funcname = spawnArgs.GetString( script, "" );

View file

@ -282,7 +282,7 @@ private:
void Event_FlagCapture(); void Event_FlagCapture();
void PrivateReturn(); void PrivateReturn();
function_t* LoadScript( char* script ); function_t* LoadScript( const char* script );
void SpawnNugget( idVec3 pos ); void SpawnNugget( idVec3 pos );
void UpdateGuis(); void UpdateGuis();

View file

@ -756,7 +756,7 @@ void idLight::BecomeBroken( idEntity* activator )
// if the light has a sound, either start the alternate (broken) sound, or stop the sound // if the light has a sound, either start the alternate (broken) sound, or stop the sound
const char* parm = spawnArgs.GetString( "snd_broken" ); const char* parm = spawnArgs.GetString( "snd_broken" );
if( refSound.shader || ( parm != NULL && *parm != NULL ) ) if( refSound.shader || ( parm != NULL && *parm != '\0' ) )
{ {
StopSound( SND_CHANNEL_ANY, false ); StopSound( SND_CHANNEL_ANY, false );
const idSoundShader* alternate = refSound.shader ? refSound.shader->GetAltSound() : declManager->FindSound( parm ); const idSoundShader* alternate = refSound.shader ? refSound.shader->GetAltSound() : declManager->FindSound( parm );
@ -768,7 +768,7 @@ void idLight::BecomeBroken( idEntity* activator )
} }
parm = spawnArgs.GetString( "mtr_broken" ); parm = spawnArgs.GetString( "mtr_broken" );
if( parm != NULL && *parm != NULL ) if( parm != NULL && *parm != '\0' )
{ {
SetShader( parm ); SetShader( parm );
} }

View file

@ -2226,7 +2226,7 @@ void idFuncSplat::Event_Splat()
for( int i = 0; i < count; i++ ) for( int i = 0; i < count; i++ )
{ {
splat = spawnArgs.RandomPrefix( "mtr_splat", gameLocal.random ); splat = spawnArgs.RandomPrefix( "mtr_splat", gameLocal.random );
if( splat != NULL && *splat != NULL ) if( splat != NULL && *splat != '\0' )
{ {
float size = spawnArgs.GetFloat( "splatSize", "128" ); float size = spawnArgs.GetFloat( "splatSize", "128" );
float dist = spawnArgs.GetFloat( "splatDistance", "128" ); float dist = spawnArgs.GetFloat( "splatDistance", "128" );
@ -3512,7 +3512,7 @@ void idFuncRadioChatter::Event_Activate( idEntity* activator )
} }
const char* sound = spawnArgs.GetString( "snd_radiochatter", "" ); const char* sound = spawnArgs.GetString( "snd_radiochatter", "" );
if( sound != NULL && *sound != NULL ) if( sound != NULL && *sound != '\0' )
{ {
const idSoundShader* shader = declManager->FindSound( sound ); const idSoundShader* shader = declManager->FindSound( sound );
int length = 0; int length = 0;

View file

@ -1298,7 +1298,7 @@ void idExplodingBarrel::Killed( idEntity* inflictor, idEntity* attacker, int dam
physicsObj.SetContents( 0 ); physicsObj.SetContents( 0 );
const char* splash = spawnArgs.GetString( "def_splash_damage", "damage_explosion" ); const char* splash = spawnArgs.GetString( "def_splash_damage", "damage_explosion" );
if( splash != NULL && *splash != NULL ) if( splash != NULL && *splash != '\0' )
{ {
gameLocal.RadiusDamage( GetPhysics()->GetOrigin(), this, attacker, this, this, splash ); gameLocal.RadiusDamage( GetPhysics()->GetOrigin(), this, attacker, this, this, splash );
} }
@ -1451,7 +1451,7 @@ void idExplodingBarrel::Event_Respawn()
} }
} }
const char* temp = spawnArgs.GetString( "model" ); const char* temp = spawnArgs.GetString( "model" );
if( temp != NULL && *temp != NULL ) if( temp != NULL && *temp != '\0' )
{ {
SetModel( temp ); SetModel( temp );
} }

View file

@ -4110,7 +4110,7 @@ void idDoor::Lock( int f )
{ {
// in this case the sound trigger never got spawned // in this case the sound trigger never got spawned
const char* sndtemp = door->spawnArgs.GetString( "snd_locked" ); const char* sndtemp = door->spawnArgs.GetString( "snd_locked" );
if( sndtemp != NULL && *sndtemp != NULL ) if( sndtemp != NULL && *sndtemp != '\0' )
{ {
door->PostEventMS( &EV_Door_SpawnSoundTrigger, 0 ); door->PostEventMS( &EV_Door_SpawnSoundTrigger, 0 );
} }
@ -4298,7 +4298,7 @@ void idDoor::Event_SpawnDoorTrigger()
} }
const char* sndtemp = spawnArgs.GetString( "snd_locked" ); const char* sndtemp = spawnArgs.GetString( "snd_locked" );
if( spawnArgs.GetInt( "locked" ) && sndtemp != NULL && *sndtemp != NULL ) if( spawnArgs.GetInt( "locked" ) && sndtemp != NULL && *sndtemp != '\0' )
{ {
PostEventMS( &EV_Door_SpawnSoundTrigger, 0 ); PostEventMS( &EV_Door_SpawnSoundTrigger, 0 );
} }

View file

@ -3736,7 +3736,7 @@ idMultiplayerGame::GetTeamFlag
*/ */
void idMultiplayerGame::FindTeamFlags() void idMultiplayerGame::FindTeamFlags()
{ {
char* flagDefs[2] = const char* flagDefs[2] =
{ {
"team_CTF_redflag", "team_CTF_redflag",
"team_CTF_blueflag" "team_CTF_blueflag"

View file

@ -1729,7 +1729,7 @@ void idPlayer::SetupWeaponEntity()
for( w = 0; w < MAX_WEAPONS; w++ ) for( w = 0; w < MAX_WEAPONS; w++ )
{ {
weap = spawnArgs.GetString( va( "def_weapon%d", w ) ); weap = spawnArgs.GetString( va( "def_weapon%d", w ) );
if( weap != NULL && *weap != NULL ) if( weap != NULL && *weap != '\0' )
{ {
idWeapon::CacheWeapon( weap ); idWeapon::CacheWeapon( weap );
} }
@ -4936,7 +4936,7 @@ idDict* idPlayer::FindInventoryItem( const char* name )
for( int i = 0; i < inventory.items.Num(); i++ ) for( int i = 0; i < inventory.items.Num(); i++ )
{ {
const char* iname = inventory.items[i]->GetString( "inv_name" ); const char* iname = inventory.items[i]->GetString( "inv_name" );
if( iname != NULL && *iname != NULL ) if( iname != NULL && *iname != '\0' )
{ {
if( idStr::Icmp( name, iname ) == 0 ) if( idStr::Icmp( name, iname ) == 0 )
{ {

View file

@ -942,7 +942,7 @@ void idProjectile::Fizzle()
// fizzle FX // fizzle FX
const char* psystem = spawnArgs.GetString( "smoke_fuse" ); const char* psystem = spawnArgs.GetString( "smoke_fuse" );
if( psystem != NULL && *psystem != NULL ) if( psystem != NULL && *psystem != '\0' )
{ {
//FIXME:SMOKE gameLocal.particles->SpawnParticles( GetPhysics()->GetOrigin(), vec3_origin, psystem ); //FIXME:SMOKE gameLocal.particles->SpawnParticles( GetPhysics()->GetOrigin(), vec3_origin, psystem );
} }
@ -1114,7 +1114,7 @@ void idProjectile::Explode( const trace_t& collision, idEntity* ignore )
} }
int surfaceType = collision.c.material != NULL ? collision.c.material->GetSurfaceType() : SURFTYPE_METAL; int surfaceType = collision.c.material != NULL ? collision.c.material->GetSurfaceType() : SURFTYPE_METAL;
if( !( fxname != NULL && *fxname != NULL ) ) if( !( fxname != NULL && *fxname != '\0' ) )
{ {
if( ( surfaceType == SURFTYPE_NONE ) || ( surfaceType == SURFTYPE_METAL ) || ( surfaceType == SURFTYPE_STONE ) ) if( ( surfaceType == SURFTYPE_NONE ) || ( surfaceType == SURFTYPE_METAL ) || ( surfaceType == SURFTYPE_STONE ) )
{ {
@ -2328,7 +2328,7 @@ void idBFGProjectile::Spawn()
memset( &secondModel, 0, sizeof( secondModel ) ); memset( &secondModel, 0, sizeof( secondModel ) );
secondModelDefHandle = -1; secondModelDefHandle = -1;
const char* temp = spawnArgs.GetString( "model_two" ); const char* temp = spawnArgs.GetString( "model_two" );
if( temp != NULL && *temp != NULL ) if( temp != NULL && *temp != '\0' )
{ {
secondModel.hModel = renderModelManager->FindModel( temp ); secondModel.hModel = renderModelManager->FindModel( temp );
secondModel.bounds = secondModel.hModel->Bounds( &secondModel ); secondModel.bounds = secondModel.hModel->Bounds( &secondModel );
@ -2551,7 +2551,7 @@ void idBFGProjectile::Launch( const idVec3& start, const idVec3& dir, const idVe
memset( &secondModel, 0, sizeof( secondModel ) ); memset( &secondModel, 0, sizeof( secondModel ) );
secondModelDefHandle = -1; secondModelDefHandle = -1;
const char* temp = spawnArgs.GetString( "model_two" ); const char* temp = spawnArgs.GetString( "model_two" );
if( temp != NULL && *temp != NULL ) if( temp != NULL && *temp != '\0' )
{ {
secondModel.hModel = renderModelManager->FindModel( temp ); secondModel.hModel = renderModelManager->FindModel( temp );
secondModel.bounds = secondModel.hModel->Bounds( &secondModel ); secondModel.bounds = secondModel.hModel->Bounds( &secondModel );

View file

@ -1238,7 +1238,7 @@ void idTarget_SetInfluence::Event_Activate( idEntity* activator )
} }
parm = spawnArgs.GetString( "snd_influence" ); parm = spawnArgs.GetString( "snd_influence" );
if( parm != NULL && *parm != NULL ) if( parm != NULL && *parm != '\0' )
{ {
PostEventSec( &EV_StartSoundShader, flashIn, parm, SND_CHANNEL_ANY ); PostEventSec( &EV_StartSoundShader, flashIn, parm, SND_CHANNEL_ANY );
} }
@ -1356,7 +1356,7 @@ void idTarget_SetInfluence::Event_Activate( idEntity* activator )
} }
parm = spawnArgs.GetString( "mtrWorld" ); parm = spawnArgs.GetString( "mtrWorld" );
if( parm != NULL && *parm != NULL ) if( parm != NULL && *parm != '\0' )
{ {
gameLocal.SetGlobalMaterial( declManager->FindMaterial( parm ) ); gameLocal.SetGlobalMaterial( declManager->FindMaterial( parm ) );
} }
@ -1809,7 +1809,7 @@ void idTarget_EnableLevelWeapons::Event_Activate( idEntity* activator )
if( gameLocal.entities[ i ] ) if( gameLocal.entities[ i ] )
{ {
gameLocal.entities[ i ]->ProcessEvent( &EV_Player_EnableWeapon ); gameLocal.entities[ i ]->ProcessEvent( &EV_Player_EnableWeapon );
if( weap != NULL && weap[ 0 ] != NULL ) if( weap != NULL && weap[ 0 ] != '\0' )
{ {
gameLocal.entities[ i ]->PostEventSec( &EV_Player_SelectWeapon, 0.5f, weap ); gameLocal.entities[ i ]->PostEventSec( &EV_Player_SelectWeapon, 0.5f, weap );
} }

View file

@ -4630,7 +4630,7 @@ void idWeapon::Event_Melee()
const char* decal; const char* decal;
// project decal // project decal
decal = weaponDef->dict.GetString( "mtr_strike" ); decal = weaponDef->dict.GetString( "mtr_strike" );
if( decal != NULL && *decal != NULL ) if( decal != NULL && *decal != '\0' )
{ {
gameLocal.ProjectDecal( tr.c.point, -tr.c.normal, 8.0f, true, 6.0, decal ); gameLocal.ProjectDecal( tr.c.point, -tr.c.normal, 8.0f, true, 6.0, decal );
} }

View file

@ -5033,7 +5033,7 @@ void idAI::DirectDamage( const char* meleeDefName, idEntity* ent )
// do the damage // do the damage
// //
p = meleeDef->GetString( "snd_hit" ); p = meleeDef->GetString( "snd_hit" );
if( p != NULL && *p != NULL ) if( p != NULL && *p != '\0' )
{ {
shader = declManager->FindSound( p ); shader = declManager->FindSound( p );
StartSoundShader( shader, SND_CHANNEL_DAMAGE, 0, false, NULL ); StartSoundShader( shader, SND_CHANNEL_DAMAGE, 0, false, NULL );
@ -5135,7 +5135,7 @@ bool idAI::AttackMelee( const char* meleeDefName )
if( enemyEnt == NULL ) if( enemyEnt == NULL )
{ {
p = meleeDef->GetString( "snd_miss" ); p = meleeDef->GetString( "snd_miss" );
if( p != NULL && *p != NULL ) if( p != NULL && *p != '\0' )
{ {
shader = declManager->FindSound( p ); shader = declManager->FindSound( p );
StartSoundShader( shader, SND_CHANNEL_DAMAGE, 0, false, NULL ); StartSoundShader( shader, SND_CHANNEL_DAMAGE, 0, false, NULL );
@ -5173,7 +5173,7 @@ bool idAI::AttackMelee( const char* meleeDefName )
{ {
// missed // missed
p = meleeDef->GetString( "snd_miss" ); p = meleeDef->GetString( "snd_miss" );
if( p != NULL && *p != NULL ) if( p != NULL && *p != '\0' )
{ {
shader = declManager->FindSound( p ); shader = declManager->FindSound( p );
StartSoundShader( shader, SND_CHANNEL_DAMAGE, 0, false, NULL ); StartSoundShader( shader, SND_CHANNEL_DAMAGE, 0, false, NULL );
@ -5185,7 +5185,7 @@ bool idAI::AttackMelee( const char* meleeDefName )
// do the damage // do the damage
// //
p = meleeDef->GetString( "snd_hit" ); p = meleeDef->GetString( "snd_hit" );
if( p != NULL && *p != NULL ) if( p != NULL && *p != '\0' )
{ {
shader = declManager->FindSound( p ); shader = declManager->FindSound( p );
StartSoundShader( shader, SND_CHANNEL_DAMAGE, 0, false, NULL ); StartSoundShader( shader, SND_CHANNEL_DAMAGE, 0, false, NULL );
@ -5429,7 +5429,7 @@ void idAI::SetChatSound()
snd = NULL; snd = NULL;
} }
if( snd != NULL && *snd != NULL ) if( snd != NULL && *snd != '\0' )
{ {
chat_snd = declManager->FindSound( snd ); chat_snd = declManager->FindSound( snd );

View file

@ -544,7 +544,7 @@ argv(0) god
*/ */
void Cmd_God_f( const idCmdArgs& args ) void Cmd_God_f( const idCmdArgs& args )
{ {
char* msg; const char* msg;
idPlayer* player; idPlayer* player;
player = gameLocal.GetLocalPlayer(); player = gameLocal.GetLocalPlayer();
@ -578,7 +578,7 @@ argv(0) notarget
*/ */
void Cmd_Notarget_f( const idCmdArgs& args ) void Cmd_Notarget_f( const idCmdArgs& args )
{ {
char* msg; const char* msg;
idPlayer* player; idPlayer* player;
player = gameLocal.GetLocalPlayer(); player = gameLocal.GetLocalPlayer();
@ -610,7 +610,7 @@ argv(0) noclip
*/ */
void Cmd_Noclip_f( const idCmdArgs& args ) void Cmd_Noclip_f( const idCmdArgs& args )
{ {
char* msg; const char* msg;
idPlayer* player; idPlayer* player;
player = gameLocal.GetLocalPlayer(); player = gameLocal.GetLocalPlayer();

View file

@ -317,7 +317,7 @@ void idMenuHandler_PDA::Initialize( const char* swfFile, idSoundWorld* sw )
{ {
const char* weaponDefName = va( "def_weapon%d", j ); const char* weaponDefName = va( "def_weapon%d", j );
const char* weap = player->spawnArgs.GetString( weaponDefName ); const char* weap = player->spawnArgs.GetString( weaponDefName );
if( weap != NULL && *weap != NULL ) if( weap != NULL && *weap != '\0' )
{ {
const idDeclEntityDef* weaponDef = gameLocal.FindEntityDef( weap, false ); const idDeclEntityDef* weaponDef = gameLocal.FindEntityDef( weap, false );
if( weaponDef != NULL ) if( weaponDef != NULL )

View file

@ -545,7 +545,7 @@ void idMenuScreen_HUD::GiveWeapon( idPlayer* player, int weaponIndex )
const char* weapnum = va( "def_weapon%d", weaponIndex ); const char* weapnum = va( "def_weapon%d", weaponIndex );
const char* weap = player->spawnArgs.GetString( weapnum ); const char* weap = player->spawnArgs.GetString( weapnum );
if( weap != NULL && *weap != NULL ) if( weap != NULL && *weap != '\0' )
{ {
const idDeclEntityDef* weaponDef = gameLocal.FindEntityDef( weap, false ); const idDeclEntityDef* weaponDef = gameLocal.FindEntityDef( weap, false );
if( weaponDef != NULL ) if( weaponDef != NULL )
@ -1141,7 +1141,7 @@ void idMenuScreen_HUD::UpdateWeaponStates( idPlayer* player, bool weaponChanged
const idMaterial* hudIcon = NULL; const idMaterial* hudIcon = NULL;
const char* weapNum = weaponDefNames[ weaponIndex ]; const char* weapNum = weaponDefNames[ weaponIndex ];
const char* weap = player->spawnArgs.GetString( weapNum ); const char* weap = player->spawnArgs.GetString( weapNum );
if( weap != NULL && *weap != NULL ) if( weap != NULL && *weap != '\0' )
{ {
const idDeclEntityDef* weaponDef = gameLocal.FindEntityDef( weap, false ); const idDeclEntityDef* weaponDef = gameLocal.FindEntityDef( weap, false );
if( weaponDef != NULL ) if( weaponDef != NULL )
@ -1205,7 +1205,7 @@ void idMenuScreen_HUD::UpdateWeaponStates( idPlayer* player, bool weaponChanged
{ {
hasWeapons = true; hasWeapons = true;
const char* weap = player->spawnArgs.GetString( weapnum ); const char* weap = player->spawnArgs.GetString( weapnum );
if( weap != NULL && *weap != NULL ) if( weap != NULL && *weap != '\0' )
{ {
weapstate++; weapstate++;
} }

View file

@ -123,7 +123,7 @@ void idMenuScreen_PDA_Inventory::ShowScreen( const mainMenuTransition_t transiti
{ {
const char* weap = GetWeaponName( j ); const char* weap = GetWeaponName( j );
if( weap == NULL || *weap == NULL ) if( weap == NULL || *weap == '\0' )
{ {
continue; continue;
} }
@ -226,7 +226,7 @@ void idMenuScreen_PDA_Inventory::Update()
{ {
const char* weap = GetWeaponName( j ); const char* weap = GetWeaponName( j );
if( weap == NULL || *weap == NULL ) if( weap == NULL || *weap == '\0' )
{ {
continue; continue;
} }
@ -313,7 +313,7 @@ void idMenuScreen_PDA_Inventory::EquipWeapon()
{ {
const char* weap = GetWeaponName( j ); const char* weap = GetWeaponName( j );
if( weap == NULL || *weap == NULL ) if( weap == NULL || *weap == '\0' )
{ {
continue; continue;
} }

View file

@ -36,15 +36,15 @@ idMenuWidget::idMenuWidget
======================== ========================
*/ */
idMenuWidget::idMenuWidget() : idMenuWidget::idMenuWidget() :
handlerIsParent( false ),
menuData( NULL ),
swfObj( NULL ),
boundSprite( NULL ), boundSprite( NULL ),
parent( NULL ), parent( NULL ),
dataSource( NULL ), dataSource( NULL ),
dataSourceFieldIndex( 0 ), dataSourceFieldIndex( 0 ),
focusIndex( 0 ), focusIndex( 0 ),
widgetState( WIDGET_STATE_NORMAL ), widgetState( WIDGET_STATE_NORMAL ),
menuData( NULL ),
swfObj( NULL ),
handlerIsParent( false ),
refCount( 0 ), refCount( 0 ),
noAutoFree( false ) noAutoFree( false )
{ {

View file

@ -133,7 +133,7 @@ void idMenuWidget_PDA_UserData::Update()
if( txtClearance != NULL ) if( txtClearance != NULL )
{ {
const char* security = pda->GetSecurity(); const char* security = pda->GetSecurity();
if( *security == NULL ) if( *security == '\0' )
{ {
txtClearance->SetText( idLocalization::GetString( "#str_00066" ) ); txtClearance->SetText( idLocalization::GetString( "#str_00066" ) );
} }

View file

@ -121,9 +121,9 @@ idCommonLocal::idCommonLocal
idCommonLocal::idCommonLocal() : idCommonLocal::idCommonLocal() :
readSnapshotIndex( 0 ), readSnapshotIndex( 0 ),
writeSnapshotIndex( 0 ), writeSnapshotIndex( 0 ),
optimalPCTBuffer( 0.5f ),
optimalTimeBuffered( 0.0f ), optimalTimeBuffered( 0.0f ),
optimalTimeBufferedWindow( 0.0f ), optimalTimeBufferedWindow( 0.0f ),
optimalPCTBuffer( 0.5f ),
lastPacifierSessionTime( 0 ), lastPacifierSessionTime( 0 ),
lastPacifierGuiTime( 0 ), lastPacifierGuiTime( 0 ),
lastPacifierDialogState( false ), lastPacifierDialogState( false ),

View file

@ -102,7 +102,7 @@ public:
#define SCOPED_PROFILE_EVENT( x ) idScopedProfileEvent scopedProfileEvent_##__LINE__( x ) #define SCOPED_PROFILE_EVENT( x ) idScopedProfileEvent scopedProfileEvent_##__LINE__( x )
ID_INLINE bool BeginTraceRecording( char* szName ) ID_INLINE bool BeginTraceRecording( const char* szName )
{ {
return false; return false;
} }

View file

@ -42,11 +42,11 @@ idDebugGraph::idDebugGraph
idDebugGraph::idDebugGraph( int numItems ) : idDebugGraph::idDebugGraph( int numItems ) :
bgColor( 0.0f, 0.0f, 0.0f, 0.5f ), bgColor( 0.0f, 0.0f, 0.0f, 0.5f ),
fontColor( 1.0f, 1.0f, 1.0f, 1.0f ), fontColor( 1.0f, 1.0f, 1.0f, 1.0f ),
enable( true ),
mode( GRAPH_FILL ), mode( GRAPH_FILL ),
sideways( false ), sideways( false ),
border( 0.0f ), border( 0.0f ),
position( 100.0f, 100.0f, 100.0f, 100.0f ) position( 100.0f, 100.0f, 100.0f, 100.0f ),
enable( true )
{ {
Init( numItems ); Init( numItems );

View file

@ -475,10 +475,12 @@ static int unzlocal_GetCurrentFileInfoInternal( unzFile file,
/* we check the magic */ /* we check the magic */
if( err == UNZ_OK ) if( err == UNZ_OK )
{
if( unzlocal_getLong( s->file, &uMagic ) != UNZ_OK ) if( unzlocal_getLong( s->file, &uMagic ) != UNZ_OK )
err = UNZ_ERRNO; err = UNZ_ERRNO;
else if( uMagic != 0x02014b50 ) else if( uMagic != 0x02014b50 )
err = UNZ_BADZIPFILE; err = UNZ_BADZIPFILE;
}
if( unzlocal_getShort( s->file, &file_info.version ) != UNZ_OK ) if( unzlocal_getShort( s->file, &file_info.version ) != UNZ_OK )
err = UNZ_ERRNO; err = UNZ_ERRNO;
@ -555,10 +557,12 @@ static int unzlocal_GetCurrentFileInfoInternal( unzFile file,
uSizeRead = extraFieldBufferSize; uSizeRead = extraFieldBufferSize;
if( lSeek != 0 ) if( lSeek != 0 )
{
if( s->file->Seek( lSeek, FS_SEEK_CUR ) == 0 ) if( s->file->Seek( lSeek, FS_SEEK_CUR ) == 0 )
lSeek = 0; lSeek = 0;
else else
err = UNZ_ERRNO; err = UNZ_ERRNO;
}
if( ( file_info.size_file_extra > 0 ) && ( extraFieldBufferSize > 0 ) ) if( ( file_info.size_file_extra > 0 ) && ( extraFieldBufferSize > 0 ) )
if( s->file->Read( extraField, uSizeRead ) != ( int )uSizeRead ) if( s->file->Read( extraField, uSizeRead ) != ( int )uSizeRead )
err = UNZ_ERRNO; err = UNZ_ERRNO;
@ -580,10 +584,12 @@ static int unzlocal_GetCurrentFileInfoInternal( unzFile file,
uSizeRead = commentBufferSize; uSizeRead = commentBufferSize;
if( lSeek != 0 ) if( lSeek != 0 )
{
if( s->file->Seek( lSeek, FS_SEEK_CUR ) == 0 ) if( s->file->Seek( lSeek, FS_SEEK_CUR ) == 0 )
lSeek = 0; lSeek = 0;
else else
err = UNZ_ERRNO; err = UNZ_ERRNO;
}
if( ( file_info.size_file_comment > 0 ) && ( commentBufferSize > 0 ) ) if( ( file_info.size_file_comment > 0 ) && ( commentBufferSize > 0 ) )
if( s->file->Read( szComment, uSizeRead ) != ( int )uSizeRead ) if( s->file->Read( szComment, uSizeRead ) != ( int )uSizeRead )
err = UNZ_ERRNO; err = UNZ_ERRNO;
@ -778,10 +784,12 @@ static int unzlocal_CheckCurrentFileCoherencyHeader( unz_s* s, uInt* piSizeVar,
if( err == UNZ_OK ) if( err == UNZ_OK )
{
if( unzlocal_getLong( s->file, &uMagic ) != UNZ_OK ) if( unzlocal_getLong( s->file, &uMagic ) != UNZ_OK )
err = UNZ_ERRNO; err = UNZ_ERRNO;
else if( uMagic != 0x04034b50 ) else if( uMagic != 0x04034b50 )
err = UNZ_BADZIPFILE; err = UNZ_BADZIPFILE;
}
if( unzlocal_getShort( s->file, &uData ) != UNZ_OK ) if( unzlocal_getShort( s->file, &uData ) != UNZ_OK )
err = UNZ_ERRNO; err = UNZ_ERRNO;

View file

@ -881,7 +881,7 @@ bool idDict::ReadFromIniFile( idFile* f )
{ {
return false; return false;
} }
buffer[length - 1] = NULL; // Since the .ini files are not null terminated, make sure we mark where the end of the .ini file is in our read buffer buffer[length - 1] = '\0'; // Since the .ini files are not null terminated, make sure we mark where the end of the .ini file is in our read buffer
idLexer parser( LEXFL_NOFATALERRORS | LEXFL_ALLOWPATHNAMES /*| LEXFL_ONLYSTRINGS */ ); idLexer parser( LEXFL_NOFATALERRORS | LEXFL_ALLOWPATHNAMES /*| LEXFL_ONLYSTRINGS */ );
idStr name = f->GetName(); idStr name = f->GetName();

View file

@ -1038,7 +1038,7 @@ idLexer::ReadPunctuation
int idLexer::ReadPunctuation( idToken* token ) int idLexer::ReadPunctuation( idToken* token )
{ {
int l, n, i; int l, n, i;
char* p; const char* p;
const punctuation_t* punc; const punctuation_t* punc;
#ifdef PUNCTABLE #ifdef PUNCTABLE

View file

@ -130,7 +130,7 @@ typedef enum
// punctuation // punctuation
typedef struct punctuation_s typedef struct punctuation_s
{ {
char* p; // punctuation character(s) const char* p; // punctuation character(s)
int n; // punctuation id int n; // punctuation id
} punctuation_t; } punctuation_t;

View file

@ -706,7 +706,7 @@ void idParser::AddBuiltinDefines()
define_t* define; define_t* define;
struct builtin struct builtin
{ {
char* string; const char* string;
int id; int id;
} builtin[] = } builtin[] =
{ {

View file

@ -167,7 +167,7 @@ void idSurface_SweptSpline::Tessellate( const int splineSubdivisions, const int
// calculate the points and first derivatives for the swept spline // calculate the points and first derivatives for the swept spline
totalTime = sweptSpline->GetTime( sweptSpline->GetNumValues() - 1 ) - sweptSpline->GetTime( 0 ) + sweptSpline->GetCloseTime(); totalTime = sweptSpline->GetTime( sweptSpline->GetNumValues() - 1 ) - sweptSpline->GetTime( 0 ) + sweptSpline->GetCloseTime();
sweptSplineDiv = sweptSpline->GetBoundaryType() == idCurve_Spline<idVec3>::BT_CLOSED ? sweptSplineSubdivisions : sweptSplineSubdivisions - 1; sweptSplineDiv = sweptSpline->GetBoundaryType() == idCurve_Spline<idVec4>::BT_CLOSED ? sweptSplineSubdivisions : sweptSplineSubdivisions - 1;
baseOffset = ( splineSubdivisions - 1 ) * sweptSplineSubdivisions; baseOffset = ( splineSubdivisions - 1 ) * sweptSplineSubdivisions;
for( i = 0; i < sweptSplineSubdivisions; i++ ) for( i = 0; i < sweptSplineSubdivisions; i++ )
{ {
@ -181,7 +181,7 @@ void idSurface_SweptSpline::Tessellate( const int splineSubdivisions, const int
// sweep the spline // sweep the spline
totalTime = spline->GetTime( spline->GetNumValues() - 1 ) - spline->GetTime( 0 ) + spline->GetCloseTime(); totalTime = spline->GetTime( spline->GetNumValues() - 1 ) - spline->GetTime( 0 ) + spline->GetCloseTime();
splineDiv = spline->GetBoundaryType() == idCurve_Spline<idVec3>::BT_CLOSED ? splineSubdivisions : splineSubdivisions - 1; splineDiv = spline->GetBoundaryType() == idCurve_Spline<idVec4>::BT_CLOSED ? splineSubdivisions : splineSubdivisions - 1;
splineMat.Identity(); splineMat.Identity();
idVec3 tempNormal; idVec3 tempNormal;
for( i = 0; i < splineSubdivisions; i++ ) for( i = 0; i < splineSubdivisions; i++ )

View file

@ -186,7 +186,7 @@ double ticksPerNanosecond;
PrintClocks PrintClocks
============ ============
*/ */
void PrintClocks( char *string, int dataCount, int clocks, int otherClocks = 0 ) { void PrintClocks( const char *string, int dataCount, int clocks, int otherClocks = 0 ) {
int i; int i;
idLib::common->Printf( string ); idLib::common->Printf( string );

View file

@ -41,7 +41,9 @@ If you have questions concerning this license or the applicable additional terms
#include <xmmintrin.h> #include <xmmintrin.h>
#ifndef M_PI // DG: this is already defined in math.h
#define M_PI 3.14159265358979323846f #define M_PI 3.14159265358979323846f
#endif
/* /*
============ ============

View file

@ -726,13 +726,13 @@ Loads six files with proper extensions
bool R_LoadCubeImages( const char* imgName, cubeFiles_t extensions, byte* pics[6], int* outSize, ID_TIME_T* timestamp ) bool R_LoadCubeImages( const char* imgName, cubeFiles_t extensions, byte* pics[6], int* outSize, ID_TIME_T* timestamp )
{ {
int i, j; int i, j;
char* cameraSides[6] = { "_forward.tga", "_back.tga", "_left.tga", "_right.tga", const char* cameraSides[6] = { "_forward.tga", "_back.tga", "_left.tga", "_right.tga",
"_up.tga", "_down.tga" "_up.tga", "_down.tga"
}; };
char* axisSides[6] = { "_px.tga", "_nx.tga", "_py.tga", "_ny.tga", const char* axisSides[6] = { "_px.tga", "_nx.tga", "_py.tga", "_ny.tga",
"_pz.tga", "_nz.tga" "_pz.tga", "_nz.tga"
}; };
char** sides; const char** sides;
char fullName[MAX_IMAGE_NAME]; char fullName[MAX_IMAGE_NAME];
int width, height, size = 0; int width, height, size = 0;

View file

@ -257,7 +257,7 @@ idImage* idMaterial::GetEditorImage() const
// info parms // info parms
typedef struct typedef struct
{ {
char* name; const char* name;
int clearSolid, surfaceFlags, contents; int clearSolid, surfaceFlags, contents;
} infoParm_t; } infoParm_t;
@ -2847,7 +2847,7 @@ bool idMaterial::Parse( const char* text, const int textLength, bool allowBinary
idMaterial::Print idMaterial::Print
=================== ===================
*/ */
char* opNames[] = const char* opNames[] =
{ {
"OP_TYPE_ADD", "OP_TYPE_ADD",
"OP_TYPE_SUBTRACT", "OP_TYPE_SUBTRACT",

View file

@ -1299,7 +1299,7 @@ bool idRenderModelStatic::ConvertASEToModelSurfaces( const struct aseModel_s* as
// completely ignore any explict normals on surfaces with a renderbump command // completely ignore any explict normals on surfaces with a renderbump command
// which will guarantee the best contours and least vertexes. // which will guarantee the best contours and least vertexes.
const char* rb = im1->GetRenderBump(); const char* rb = im1->GetRenderBump();
if( rb != NULL && rb[0] != NULL ) if( rb != NULL && rb[0] != '\0' )
{ {
normalsParsed = false; normalsParsed = false;
} }
@ -2303,7 +2303,7 @@ bool idRenderModelStatic::ConvertMAToModelSurfaces( const struct maModel_s* ma )
// completely ignore any explict normals on surfaces with a renderbump command // completely ignore any explict normals on surfaces with a renderbump command
// which will guarantee the best contours and least vertexes. // which will guarantee the best contours and least vertexes.
const char* rb = im1->GetRenderBump(); const char* rb = im1->GetRenderBump();
if( rb != NULL && rb[0] != NULL ) if( rb != NULL && rb[0] != '\0' )
{ {
normalsParsed = false; normalsParsed = false;
} }

View file

@ -2311,7 +2311,7 @@ int lwGetPolygons5( idFile* fp, int cksize, lwPolygonList* plist, int ptoffset )
bp += 2; bp += 2;
} }
j -= 1; j -= 1;
pp->surf = ( lwSurface* ) j; pp->surf = ( lwSurface* ) j; // DG: FIXME: cast int to pointer?!
pp++; pp++;
pv += nv; pv += nv;
@ -3054,7 +3054,7 @@ int lwGetPolygonTags( idFile* fp, int cksize, lwTagList* tlist, lwPolygonList* p
switch( type ) switch( type )
{ {
case ID_SURF: case ID_SURF:
plist->pol[ i ].surf = ( lwSurface* ) j; plist->pol[ i ].surf = ( lwSurface* ) j; // DG: FIXME: cast int to pointer?!
break; break;
case ID_PART: case ID_PART:
plist->pol[ i ].part = j; plist->pol[ i ].part = j;

View file

@ -1658,7 +1658,7 @@ void R_MakeAmbientMap_f( const idCmdArgs& args )
renderView_t ref; renderView_t ref;
viewDef_t primary; viewDef_t primary;
int downSample; int downSample;
char* extensions[6] = { "_px.tga", "_nx.tga", "_py.tga", "_ny.tga", const char* extensions[6] = { "_px.tga", "_nx.tga", "_py.tga", "_ny.tga",
"_pz.tga", "_nz.tga" "_pz.tga", "_nz.tga"
}; };
int outSize; int outSize;

View file

@ -587,7 +587,7 @@ void R_AddSingleModel( viewEntity_t* vEntity )
{ {
continue; continue;
} }
if( tri->numIndexes == NULL ) if( tri->numIndexes == 0 )
{ {
continue; // happens for particles continue; // happens for particles
} }

View file

@ -64,7 +64,7 @@ idSWFScriptObject::swfNamedVar_t& idSWFScriptObject::swfNamedVar_t::operator=( c
idSWFScriptObject::idSWFScriptObject idSWFScriptObject::idSWFScriptObject
======================== ========================
*/ */
idSWFScriptObject::idSWFScriptObject() : prototype( NULL ), refCount( 1 ), noAutoDelete( false ), objectType( SWF_OBJECT_OBJECT ) idSWFScriptObject::idSWFScriptObject() : refCount( 1 ), noAutoDelete( false ), prototype( NULL ), objectType( SWF_OBJECT_OBJECT )
{ {
data.sprite = NULL; data.sprite = NULL;
data.text = NULL; data.text = NULL;

View file

@ -36,13 +36,15 @@ idSWFSpriteInstance::idSWFSpriteInstance
======================== ========================
*/ */
idSWFSpriteInstance::idSWFSpriteInstance() : idSWFSpriteInstance::idSWFSpriteInstance() :
sprite( NULL ),
parent( NULL ),
depth( 0 ),
isPlaying( true ), isPlaying( true ),
isVisible( true ), isVisible( true ),
childrenRunning( true ), childrenRunning( true ),
firstRun( false ),
currentFrame( 0 ), currentFrame( 0 ),
frameCount( 0 ),
sprite( NULL ),
parent( NULL ),
depth( 0 ),
itemIndex( 0 ), itemIndex( 0 ),
materialOverride( NULL ), materialOverride( NULL ),
materialWidth( 0 ), materialWidth( 0 ),
@ -52,7 +54,6 @@ idSWFSpriteInstance::idSWFSpriteInstance() :
moveToXScale( 1.0f ), moveToXScale( 1.0f ),
moveToYScale( 1.0f ), moveToYScale( 1.0f ),
moveToSpeed( 1.0f ), moveToSpeed( 1.0f ),
firstRun( false ),
stereoDepth( 0 ) stereoDepth( 0 )
{ {
} }

View file

@ -248,7 +248,7 @@ cpuid_t Sys_GetCPUId()
typedef struct bitFlag_s typedef struct bitFlag_s
{ {
char* name; const char* name;
int bit; int bit;
} bitFlag_t; } bitFlag_t;
@ -265,14 +265,14 @@ static bitFlag_t controlWordFlags[] =
{ "Infinity control", 12 }, { "Infinity control", 12 },
{ "", 0 } { "", 0 }
}; };
static char* precisionControlField[] = static const char* precisionControlField[] =
{ {
"Single Precision (24-bits)", "Single Precision (24-bits)",
"Reserved", "Reserved",
"Double Precision (53-bits)", "Double Precision (53-bits)",
"Double Extended Precision (64-bits)" "Double Extended Precision (64-bits)"
}; };
static char* roundingControlField[] = static const char* roundingControlField[] =
{ {
"Round to nearest", "Round to nearest",
"Round down", "Round down",

View file

@ -248,7 +248,7 @@ void idSaveGameDetails::Clear()
descriptors.Clear(); descriptors.Clear();
damaged = false; damaged = false;
date = 0; date = 0;
slotName[0] = NULL; slotName[0] = '\0';
} }
/* /*
@ -409,7 +409,7 @@ idSaveGameProcessor
idSaveGameProcessor::idSaveGameProcessor idSaveGameProcessor::idSaveGameProcessor
======================== ========================
*/ */
idSaveGameProcessor::idSaveGameProcessor() : working( false ), init( false ) idSaveGameProcessor::idSaveGameProcessor() : init( false ), working( false )
{ {
} }
@ -685,7 +685,7 @@ idSaveGameManager::RetrySave
*/ */
void idSaveGameManager::RetrySave() void idSaveGameManager::RetrySave()
{ {
if( DeviceSelectorWaitingOnSaveRetry() && !common->Dialog().HasDialogMsg( GDM_WARNING_FOR_NEW_DEVICE_ABOUT_TO_LOSE_PROGRESS, false ) ) if( DeviceSelectorWaitingOnSaveRetry() && !common->Dialog().HasDialogMsg( GDM_WARNING_FOR_NEW_DEVICE_ABOUT_TO_LOSE_PROGRESS, NULL ) )
{ {
cmdSystem->AppendCommandText( "savegame autosave\n" ); cmdSystem->AppendCommandText( "savegame autosave\n" );
} }

View file

@ -4392,8 +4392,8 @@ idNetSessionPort::idNetSessionPort
======================== ========================
*/ */
idNetSessionPort::idNetSessionPort() : idNetSessionPort::idNetSessionPort() :
forcePacketDropPrev( 0.0f ), forcePacketDropCurr( 0.0f ),
forcePacketDropCurr( 0.0f ) forcePacketDropPrev( 0.0f )
{ {
} }

View file

@ -669,13 +669,13 @@ static idStr GetDeviceName( const int deviceNum )
&device, &device,
0 /* dwFlags */ ) ) 0 /* dwFlags */ ) )
{ {
return false; return idStr();
} }
// get the monitor for this display // get the monitor for this display
if( !( device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP ) ) if( !( device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP ) )
{ {
return false; return idStr();
} }
return idStr( device.DeviceName ); return idStr( device.DeviceName );

View file

@ -37,7 +37,7 @@ If you have questions concerning this license or the applicable additional terms
#include <io.h> #include <io.h>
#include <conio.h> #include <conio.h>
#include <mapi.h> #include <mapi.h>
#include <shellAPI.h> #include <shellapi.h>
#include <shlobj.h> #include <shlobj.h>
#ifndef __MRC__ #ifndef __MRC__

View file

@ -93,7 +93,7 @@ net_interface netint[MAX_INTERFACES];
NET_ErrorString NET_ErrorString
======================== ========================
*/ */
char* NET_ErrorString() const char* NET_ErrorString()
{ {
int code; int code;

View file

@ -221,7 +221,7 @@ const char* idEditWindow::HandleEvent( const sysEvent_t* event, bool* updateVisu
{ {
// need to call this to allow proper focus and capturing on embedded children // need to call this to allow proper focus and capturing on embedded children
const char* ret = idWindow::HandleEvent( event, updateVisuals ); const char* ret = idWindow::HandleEvent( event, updateVisuals );
if( ret != NULL && *ret != NULL ) if( ret != NULL && *ret != '\0' )
{ {
return ret; return ret;
} }

View file

@ -844,7 +844,7 @@ const char* idWindow::HandleEvent( const sysEvent_t* event, bool* updateVisuals
//} //}
SetFocus( child ); SetFocus( child );
const char* childRet = child->HandleEvent( event, updateVisuals ); const char* childRet = child->HandleEvent( event, updateVisuals );
if( childRet != NULL && *childRet != NULL ) if( childRet != NULL && *childRet != '\0' )
{ {
return childRet; return childRet;
} }
@ -1083,7 +1083,7 @@ const char* idWindow::HandleEvent( const sysEvent_t* event, bool* updateVisuals
*updateVisuals = true; *updateVisuals = true;
} }
const char* mouseRet = RouteMouseCoords( event->evValue, event->evValue2 ); const char* mouseRet = RouteMouseCoords( event->evValue, event->evValue2 );
if( mouseRet != NULL && *mouseRet != NULL ) if( mouseRet != NULL && *mouseRet != '\0' )
{ {
return mouseRet; return mouseRet;
} }