Skip to content

Commit

Permalink
Remove redundant newline characters from the end of Warning message s…
Browse files Browse the repository at this point in the history
…trings. The function already adds these, so you will just end up with extraneous blank lines in the console.

This was done with regex - I did check the replacements, however there's a small chance something that either things were missed or have been removed by mistake.
Regex[RG] for anyone interested : '(?<=(common\s*->\s*|gameLocal\.)D?Warning\s*\(.*)(\\n|\\r)(?=\s*".*\))'

git-svn-id: https://svn.thedarkmod.com/svn/darkmod_src/trunk@5361 49c82d7f-2e2a-0410-a16f-ae8f201b507f
  • Loading branch information
serpentine committed Mar 26, 2012
1 parent ba60b5c commit 7a2577a
Show file tree
Hide file tree
Showing 53 changed files with 132 additions and 132 deletions.
2 changes: 1 addition & 1 deletion cm/CollisionModel_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void idCollisionModelManagerLocal::WriteCollisionModelsToFile( const char *filen
// _D3XP was saving to fs_cdpath TODO: Check this is still relevant
fp = fileSystem->OpenFileWrite( name, "fs_devpath" );
if ( !fp ) {
common->Warning( "idCollisionModelManagerLocal::WriteCollisionModelsToFile: Error opening file %s\n", name.c_str() );
common->Warning( "idCollisionModelManagerLocal::WriteCollisionModelsToFile: Error opening file %s", name.c_str() );
return;
}

Expand Down
2 changes: 1 addition & 1 deletion framework/CVarSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void idInternalCVar::Update( const idCVar *cvar ) {
if ( resetString.Length() == 0 ) {
resetString = cvar->GetString();
} else if ( cvar->GetString()[0] && resetString.Cmp( cvar->GetString() ) != 0 ) {
common->Warning( "cvar \"%s\" given initial values: \"%s\" and \"%s\"\n", nameString.c_str(), resetString.c_str(), cvar->GetString() );
common->Warning( "cvar \"%s\" given initial values: \"%s\" and \"%s\"", nameString.c_str(), resetString.c_str(), cvar->GetString() );
}
}

Expand Down
2 changes: 1 addition & 1 deletion framework/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ int idFileSystemLocal::AddZipFile( const char *path ) {
fullpath.AppendPath( path );
pak = LoadZipFile( fullpath );
if ( !pak ) {
common->Warning( "AddZipFile %s failed\n", path );
common->Warning( "AddZipFile %s failed", path );
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion framework/I18N.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ int I18NLocal::LoadCharacterMapping( idStr& lang ) {
break;
}
// add the two numbers
// common->Warning("got '%s' '%s'\n", tok.c_str(), tok2.c_str() );
// common->Warning("got '%s' '%s'", tok.c_str(), tok2.c_str() );
m_Remap.Append( (char) tok.GetIntValue() );
m_Remap.Append( (char) tok2.GetIntValue() );
// common->Printf("I18N: Mapping %i (0x%02x) to %i (0x%02x)\n", tok.GetIntValue(), tok.GetIntValue(), tok2.GetIntValue(), tok2.GetIntValue() );
Expand Down
4 changes: 2 additions & 2 deletions framework/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ bool idSessionLocal::SaveGame( const char *saveName, bool autosave ) {
// Open savegame file
idFile *fileOut = fileSystem->OpenFileWrite( gameFile );
if ( fileOut == NULL ) {
common->Warning( "Failed to open save file '%s'\n", gameFile.c_str() );
common->Warning( "Failed to open save file '%s'", gameFile.c_str() );
if ( pauseWorld ) {
soundSystem->SetPlayingSoundWorld( pauseWorld );
pauseWorld->UnPause();
Expand Down Expand Up @@ -1781,7 +1781,7 @@ bool idSessionLocal::SaveGame( const char *saveName, bool autosave ) {
// the unclean save name on line 1, map name on line 2, screenshot on line 3
idFile *fileDesc = fileSystem->OpenFileWrite( descriptionFile );
if ( fileDesc == NULL ) {
common->Warning( "Failed to open description file '%s'\n", descriptionFile.c_str() );
common->Warning( "Failed to open description file '%s'", descriptionFile.c_str() );
if ( pauseWorld ) {
soundSystem->SetPlayingSoundWorld( pauseWorld );
pauseWorld->UnPause();
Expand Down
2 changes: 1 addition & 1 deletion framework/async/AsyncClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ void idAsyncClient::ConnectionlessMessage( const netadr_t from, const idBitMsg &
if ( idStr::Icmp( string, "authrequired" ) == 0 ) {
// server telling us that he's expecting an auth mode connect, just in case we're trying to connect in LAN mode
if ( idAsyncNetwork::LANServer.GetBool() ) {
common->Warning( "server %s requests master authorization for this client. Turning off LAN mode\n", Sys_NetAdrToString( from ) );
common->Warning( "server %s requests master authorization for this client. Turning off LAN mode", Sys_NetAdrToString( from ) );
idAsyncNetwork::LANServer.SetBool( false );
}
}
Expand Down
4 changes: 2 additions & 2 deletions framework/async/AsyncNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,11 @@ idAsyncNetwork::UpdateUI_f
*/
void idAsyncNetwork::UpdateUI_f( const idCmdArgs &args ) {
if ( args.Argc() != 2 ) {
common->Warning( "idAsyncNetwork::UpdateUI_f: wrong arguments\n" );
common->Warning( "idAsyncNetwork::UpdateUI_f: wrong arguments" );
return;
}
if ( !server.IsActive() ) {
common->Warning( "idAsyncNetwork::UpdateUI_f: server is not active\n" );
common->Warning( "idAsyncNetwork::UpdateUI_f: server is not active" );
return;
}
int clientNum = atoi( args.Args( 1 ) );
Expand Down
4 changes: 2 additions & 2 deletions framework/async/AsyncServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ void idAsyncServer::UpdateUI( int clientNum ) {
const idDict *info = game->GetUserInfo( clientNum );

if ( !info ) {
common->Warning( "idAsyncServer::UpdateUI: no info from game\n" );
common->Warning( "idAsyncServer::UpdateUI: no info from game" );
return;
}

Expand Down Expand Up @@ -1747,7 +1747,7 @@ bool idAsyncServer::VerifyChecksumMessage( int clientNum, const netadr_t *from,
checksums[ numChecksums++ ] = i;
// just to make sure a broken client doesn't crash us
if ( numChecksums >= MAX_PURE_PAKS ) {
common->Warning( "MAX_PURE_PAKS ( %d ) exceeded\n", MAX_PURE_PAKS );
common->Warning( "MAX_PURE_PAKS ( %d ) exceeded", MAX_PURE_PAKS );
sprintf( reply, "#str_07144" );
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions game/AF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ bool idAF::Load( idEntity *ent, const char *fileName ) {
physicsObj.SetSelf( self );

if ( animator == NULL ) {
gameLocal.Warning( "Couldn't load af '%s' for entity '%s' at (%s): NULL animator\n", name.c_str(), ent->name.c_str(), ent->GetPhysics()->GetOrigin().ToString(0) );
gameLocal.Warning( "Couldn't load af '%s' for entity '%s' at (%s): NULL animator", name.c_str(), ent->name.c_str(), ent->GetPhysics()->GetOrigin().ToString(0) );
return false;
}

Expand All @@ -930,7 +930,7 @@ bool idAF::Load( idEntity *ent, const char *fileName ) {

file = static_cast<const idDeclAF *>( declManager->FindType( DECL_AF, name ) );
if ( !file ) {
gameLocal.Warning( "Couldn't load af '%s' for entity '%s' at (%s)\n", name.c_str(), ent->name.c_str(), ent->GetPhysics()->GetOrigin().ToString(0) );
gameLocal.Warning( "Couldn't load af '%s' for entity '%s' at (%s)", name.c_str(), ent->name.c_str(), ent->GetPhysics()->GetOrigin().ToString(0) );
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions game/BinaryFrobMover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ void CBinaryFrobMover::PostSpawn()
}
else
{
gameLocal.Warning("Mover '%s' has start_rotate set, but rotation angles are zero.\r", name.c_str());
gameLocal.Warning("Mover '%s' has start_rotate set, but rotation angles are zero.", name.c_str());
DM_LOG(LC_SYSTEM, LT_ERROR)LOGSTRING("[%s] has start_rotate set, but rotation angles are zero.\r", name.c_str());
}
}
Expand All @@ -352,7 +352,7 @@ void CBinaryFrobMover::PostSpawn()
}
else
{
gameLocal.Warning("Mover '%s' has start_position set, but translation is zero.\r", name.c_str());
gameLocal.Warning("Mover '%s' has start_position set, but translation is zero.", name.c_str());
DM_LOG(LC_SYSTEM, LT_ERROR)LOGSTRING("[%s] has partial translation set, but translation is zero?\r", name.c_str());
}
}
Expand Down
4 changes: 2 additions & 2 deletions game/DifficultySettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ idList<Setting> Setting::ParseSettingsFromDict(const idDict& dict, int level)
}
else
{
gameLocal.Warning("Found invalid difficulty settings index: %s.\r", keyVal->GetKey().c_str());
gameLocal.Warning("Found invalid difficulty settings index: %s.", keyVal->GetKey().c_str());
DM_LOG(LC_DIFFICULTY, LT_ERROR)LOGSTRING("Found invalid difficulty settings index: %s.\r", keyVal->GetKey().c_str());
}
}
Expand Down Expand Up @@ -565,7 +565,7 @@ void CVARDifficultySettings::LoadFromEntityDef(const idDict& dict)
}
else
{
gameLocal.Warning("Found invalid cvar difficulty settings index: %s.\r", keyVal->GetKey().c_str());
gameLocal.Warning("Found invalid cvar difficulty settings index: %s.", keyVal->GetKey().c_str());
DM_LOG(LC_DIFFICULTY, LT_ERROR)LOGSTRING("Found invalid cvar difficulty settings index: %s.\r", keyVal->GetKey().c_str());
}
}
Expand Down
36 changes: 18 additions & 18 deletions game/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ lod_handle idEntity::ParseLODSpawnargs( const idDict* dict, const float fRandom)

if (m_LOD->fLODFadeOutRange < 0)
{
gameLocal.Warning (" %s: lod_fadeout_range must be >= 0 but is %f. Ignoring it.\n", GetName(), m_LOD->fLODFadeOutRange);
gameLocal.Warning (" %s: lod_fadeout_range must be >= 0 but is %f. Ignoring it.", GetName(), m_LOD->fLODFadeOutRange);
m_LOD->fLODFadeOutRange = 0.0f;
}
else
Expand All @@ -947,12 +947,12 @@ lod_handle idEntity::ParseLODSpawnargs( const idDict* dict, const float fRandom)

if (m_LOD->fLODFadeInRange < 0)
{
gameLocal.Warning (" %s: lod_fadein_range must be >= 0 but is %f. Ignoring it.\n", GetName(), m_LOD->fLODFadeInRange);
gameLocal.Warning (" %s: lod_fadein_range must be >= 0 but is %f. Ignoring it.", GetName(), m_LOD->fLODFadeInRange);
m_LOD->fLODFadeInRange = 0.0f;
}
else if (m_LOD->fLODFadeInRange > 0 && m_LOD->fLODFadeInRange > m_LOD->DistLODSq[1])
{
gameLocal.Warning (" %s: lod_fadein_range must be <= lod_1_distance (%f) 0 but is %f. Ignoring it.\n", GetName(), m_LOD->DistLODSq[1], m_LOD->fLODFadeInRange);
gameLocal.Warning (" %s: lod_fadein_range must be <= lod_1_distance (%f) 0 but is %f. Ignoring it.", GetName(), m_LOD->DistLODSq[1], m_LOD->fLODFadeInRange);
m_LOD->fLODFadeOutRange = 0.0f;
}
else
Expand Down Expand Up @@ -1096,7 +1096,7 @@ void idEntity::Spawn( void )
if ( m_overlays.createOverlay( 0, OVERLAYS_MIN_HANDLE + i ) >= OVERLAYS_MIN_HANDLE )
m_overlays.setGui( OVERLAYS_MIN_HANDLE + i, renderEntity.gui[ i ] );
else
gameLocal.Warning( "Unable to create overlay for renderentity GUI: %d\n", OVERLAYS_MIN_HANDLE + i );
gameLocal.Warning( "Unable to create overlay for renderentity GUI: %d", OVERLAYS_MIN_HANDLE + i );
}

fl.solidForTeam = spawnArgs.GetBool( "solidForTeam", "0" );
Expand Down Expand Up @@ -7320,10 +7320,10 @@ void idEntity::Event_RestorePosition( void ) {
}
if ( part->GetPhysics()->IsType( idPhysics_Parametric::Type ) ) {
if ( static_cast<idPhysics_Parametric *>(part->GetPhysics())->IsPusher() ) {
gameLocal.Warning( "teleported '%s' which has the pushing mover '%s' bound to it\n", GetName(), part->GetName() );
gameLocal.Warning( "teleported '%s' which has the pushing mover '%s' bound to it", GetName(), part->GetName() );
}
} else if ( part->GetPhysics()->IsType( idPhysics_AF::Type ) ) {
gameLocal.Warning( "teleported '%s' which has the articulated figure '%s' bound to it\n", GetName(), part->GetName() );
gameLocal.Warning( "teleported '%s' which has the articulated figure '%s' bound to it", GetName(), part->GetName() );
}
}
}
Expand Down Expand Up @@ -9724,12 +9724,12 @@ if it wanted to.)
*/
void idEntity::Event_SetGui( int handle, const char *guiFile ) {
if ( !uiManager->CheckGui(guiFile) ) {
gameLocal.Warning( "Unable to load GUI file: %s\n", guiFile );
gameLocal.Warning( "Unable to load GUI file: %s", guiFile );
goto Quit;
}

if ( !m_overlays.exists( handle ) ) {
gameLocal.Warning( "Non-existant GUI handle: %d\n", handle );
gameLocal.Warning( "Non-existant GUI handle: %d", handle );
goto Quit;
}

Expand Down Expand Up @@ -9768,7 +9768,7 @@ void idEntity::Event_SetGui( int handle, const char *guiFile ) {
assert( result );

} else {
gameLocal.Warning( "Cannot call setGui() on external handle: %d\n", handle );
gameLocal.Warning( "Cannot call setGui() on external handle: %d", handle );
}

Quit:
Expand Down Expand Up @@ -9979,13 +9979,13 @@ void idEntity::Event_SetGuiStringFromKey( int handle, const char *key, idEntity
{
if(!src)
{
gameLocal.Warning( "Unable to get key, since the source entity was NULL.\n" );
gameLocal.Warning( "Unable to get key, since the source entity was NULL." );
return;
}

if(!m_overlays.exists(handle))
{
gameLocal.Warning( "Non-existant GUI handle: %d\n", handle );
gameLocal.Warning( "Non-existant GUI handle: %d", handle );
return;
}

Expand Down Expand Up @@ -10070,7 +10070,7 @@ void idEntity::Event_LoadExternalData( const char *xdFile, const char* prefix )
}
else
{
gameLocal.Warning("Non-existant xdata declaration: %s\n", xdFile);
gameLocal.Warning("Non-existant xdata declaration: %s", xdFile);
idThread::ReturnInt( 0 );
}
}
Expand Down Expand Up @@ -10144,7 +10144,7 @@ void idEntity::Attach( idEntity *ent, const char *PosName, const char *AttName )
// The following is the old system and will be phased out
else
{
//gameLocal.Warning("%s is attaching %s using the deprecated attachment system.\n", name.c_str(), ent->name.c_str());
//gameLocal.Warning("%s is attaching %s using the deprecated attachment system.", name.c_str(), ent->name.c_str());
angleOffset = ent->spawnArgs.GetAngles( "angles" );
originOffset = ent->spawnArgs.GetVector( "origin" );
}
Expand Down Expand Up @@ -11282,7 +11282,7 @@ void idEntity::DestroyOverlay(int handle)
gui->Activate( false, gameLocal.time );
m_overlays.destroyOverlay( handle );
} else {
gameLocal.Warning( "Cannot destroy HUD.\n" );
gameLocal.Warning( "Cannot destroy HUD." );
}
}

Expand Down Expand Up @@ -11550,12 +11550,12 @@ void idEntity::Event_GetLightInPVS( const float lightFalloff, const float lightD
dist = dist3.Length();
}
// divide by dist
//gameLocal.Warning(" dist %0.2f, falloff %0.0f\n", dist, lightFalloff );
//gameLocal.Warning(" dist %0.2f, falloff %0.0f", dist, lightFalloff );
dist /= dist_scaling;
//gameLocal.Warning(" dist is now %0.2f\n", dist );
//gameLocal.Warning(" local_light %s\n", local_light.ToString() );
//gameLocal.Warning(" dist is now %0.2f", dist );
//gameLocal.Warning(" local_light %s", local_light.ToString() );
local_light /= dist;
//gameLocal.Warning(" local_light %s\n", local_light.ToString() );
//gameLocal.Warning(" local_light %s", local_light.ToString() );
}
sum += local_light;
}
Expand Down
2 changes: 1 addition & 1 deletion game/EscapePointManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ EscapeGoal CEscapePointManager::GetEscapeGoal(const EscapeConditions& conditions

if (escapePoints.Num() == 0)
{
gameLocal.Warning("No escape point information available for the given aas type in map!\n");
gameLocal.Warning("No escape point information available for the given aas type in map!");
goal.escapePointId = -1;
goal.distance = -1;
return goal;
Expand Down
2 changes: 1 addition & 1 deletion game/FrobDoor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ int CFrobDoor::FrobMoverStartSound(const char* soundName)

if (sound.IsEmpty())
{
gameLocal.Warning("Cannot find sound %s on door %s\r", soundName, name.c_str());
gameLocal.Warning("Cannot find sound %s on door %s", soundName, name.c_str());
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion game/Game_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ void idGameLocal::ClientReadSnapshot( int clientNum, int sequence, const int gam

if ( i < MAX_CLIENTS && ent ) {
// SPAWN_PLAYER should be taking care of spawning the entity with the right spawnId
common->Warning( "ClientReadSnapshot: recycling client entity %d\n", i );
common->Warning( "ClientReadSnapshot: recycling client entity %d", i );
}

delete ent;
Expand Down
6 changes: 3 additions & 3 deletions game/ImageMapManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,16 @@ int ImageMapManager::GetImageMap( idStr name ) {
idFile *fl = NULL;
if((fl = fileSystem->OpenFileRead(mapName)) == NULL)
{
//gameLocal.Warning("ImageMapManager: Could not find %s, trying .png next.\n", mapName.c_str() );
//gameLocal.Warning("ImageMapManager: Could not find %s, trying .png next.", mapName.c_str() );
idStr m = mapName + ".png";
if((fl = fileSystem->OpenFileRead(m)) == NULL)
{
//gameLocal.Warning("ImageMapManager: Could not find %s, trying .tga next.\n", m.c_str() );
//gameLocal.Warning("ImageMapManager: Could not find %s, trying .tga next.", m.c_str() );
// can't find PNG, try TGA
m = mapName + ".tga";
if((fl = fileSystem->OpenFileRead(m)) == NULL)
{
// gameLocal.Warning("ImageMapManager: Could not find %s, trying .jpg next.\n", m.c_str() );
// gameLocal.Warning("ImageMapManager: Could not find %s, trying .jpg next.", m.c_str() );
// can't find TGA, try JPG as last resort
mapName += ".jpg";
if((fl = fileSystem->OpenFileRead(mapName)) == NULL)
Expand Down
4 changes: 2 additions & 2 deletions game/Inventory/Inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ bool CInventory::ReplaceItem(idEntity* oldItemEnt, idEntity* newItemEnt)

if (oldItem == NULL)
{
gameLocal.Warning("Could not find old inventory item for %s\n", oldItemEnt->name.c_str());
gameLocal.Warning("Could not find old inventory item for %s", oldItemEnt->name.c_str());
DM_LOG(LC_INVENTORY, LT_DEBUG)LOGSTRING("Could not find old inventory item for %s\n", oldItemEnt->name.c_str());
return false;
}
Expand Down Expand Up @@ -991,7 +991,7 @@ CInventoryItemPtr CInventory::ValidateAmmo(idEntity* ent, const bool gotFromShop
if (weaponName.IsEmpty())
{
DM_LOG(LC_INVENTORY, LT_ERROR)LOGSTRING("Could not find 'inv_weapon_name' on item %s.\r", ent->name.c_str());
gameLocal.Warning("Could not find 'inv_weapon_name' on item %s.\r", ent->name.c_str());
gameLocal.Warning("Could not find 'inv_weapon_name' on item %s.", ent->name.c_str());
return returnValue;
}

Expand Down
2 changes: 1 addition & 1 deletion game/Item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ void idMoveableItem::DropItems( idAnimatedEntity *ent, const char *type, idList
jointName = ent->spawnArgs.GetString( key );
joint = ent->GetAnimator()->GetJointHandle( jointName );
if ( !ent->GetJointWorldTransform( joint, gameLocal.time, origin, axis ) ) {
gameLocal.Warning( "%s refers to invalid joint '%s' on entity '%s'\n", key.c_str(), jointName, ent->name.c_str() );
gameLocal.Warning( "%s refers to invalid joint '%s' on entity '%s'", key.c_str(), jointName, ent->name.c_str() );
origin = ent->GetPhysics()->GetOrigin();
axis = ent->GetPhysics()->GetAxis();
}
Expand Down
Loading

0 comments on commit 7a2577a

Please sign in to comment.