Skip to content

Commit 9649288

Browse files
committed
[GEN][ZH] Remove trailing CR LF from debug logging strings by hand (#1232)
1 parent 1c131b3 commit 9649288

File tree

88 files changed

+238
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+238
-243
lines changed

Core/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ AssetStatusClass::~AssetStatusClass()
4343
{
4444
#ifdef WWDEBUG
4545
if (Reporting) {
46-
StringClass report("Load-on-demand and missing assets report\r\n\r\n");
46+
StringClass report("Load-on-demand and missing assets report\n\n");
4747
for (int i=0;i<REPORT_COUNT;++i) {
4848
report+="Category: ";
4949
report+=ReportCategoryNames[i];
50-
report+="\r\n\r\n";
50+
report+="\n\n";
5151

5252
HashTemplateIterator<StringClass,int> ite(ReportHashTables[i]);
5353
for (ite.First();!ite.Is_Done();ite.Next()) {
@@ -58,9 +58,9 @@ AssetStatusClass::~AssetStatusClass()
5858
tmp.Format("\t(reported %d times)",count);
5959
report+=tmp;
6060
}
61-
report+="\r\n";
61+
report+="\n";
6262
}
63-
report+="\r\n";
63+
report+="\n";
6464
}
6565
if (report.Get_Length()) {
6666
RawFileClass raw_log_file("asset_report.txt");

Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void WWProfileHierachyNodeClass::Write_To_File(FileClass* file,int recursion)
200200
StringClass string;
201201
StringClass work;
202202
for (i=0;i<recursion;++i) { string+="\t"; }
203-
work.Format("%s\t%d\t%f\r\n",Name,TotalCalls,TotalTime*1000.0f);
203+
work.Format("%s\t%d\t%f\n",Name,TotalCalls,TotalTime*1000.0f);
204204
string+=work;
205205
file->Write(string.str(),string.Get_Length());
206206
}
@@ -574,8 +574,8 @@ void WWProfileManager::End_Collecting(const char* filename)
574574
StringClass str;
575575
float avg_frame_time=TotalFrameTimes/float(ProfileCollectVector.Count());
576576
str.Format(
577-
"Total frames: %d, average frame time: %fms\r\n"
578-
"All frames taking more than twice the average frame time are marked with keyword SPIKE.\r\n\r\n",
577+
"Total frames: %d, average frame time: %fms\n"
578+
"All frames taking more than twice the average frame time are marked with keyword SPIKE.\n\n",
579579
ProfileCollectVector.Count(),avg_frame_time*1000.0f);
580580
file->Write(str.str(),str.Get_Length());
581581

@@ -590,11 +590,11 @@ void WWProfileManager::End_Collecting(const char* filename)
590590
if (name[i]==',') name[i]='.';
591591
if (name[i]==';') name[i]=':';
592592
}
593-
str.Format("ID: %d %s\r\n",ite.Peek_Value(),name.str());
593+
str.Format("ID: %d %s\n",ite.Peek_Value(),name.str());
594594
file->Write(str.str(),str.Get_Length());
595595
}
596596

597-
str.Format("\r\n\r\n");
597+
str.Format("\n\n");
598598
file->Write(str.str(),str.Get_Length());
599599

600600
for (i=0;i<ProfileCollectVector.Count();++i) {

Core/Tools/matchbot/generals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ double GeneralsMatcher::computeMatchFitness(const std::string& i1, const General
506506
//DBGMSG("Match fitness: "<<matchFitness);
507507

508508
/*
509-
DBGMSG(i1->first << " vs " << i2->first << " has fitness " << matchFitness << ""
509+
DBGMSG(i1->first << " vs " << i2->first << " has fitness " << matchFitness
510510
"\tpointPercent: " << pointPercent << "\n"
511511
"\tpingDelta: " << pingDelta << "\n"
512512
"\twidened: " << u1->widened << u2->widened << "\n"

Generals/Code/GameEngine/Source/Common/CRCDebug.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ void dumpVector3(const Vector3 *v, AsciiString name, AsciiString fname, Int line
279279
if (!(IS_FRAME_OK_TO_LOG)) return;
280280
fname.toLower();
281281
fname = getFname(fname);
282-
addCRCDebugLine("dumpVector3() %s:%d %s %8.8X %8.8X %8.8X\n",
282+
addCRCDebugLine("dumpVector3() %s:%d %s %8.8X %8.8X %8.8X",
283283
fname.str(), line, name.str(),
284284
AS_INT(v->X), AS_INT(v->Y), AS_INT(v->Z));
285285
}
@@ -289,7 +289,7 @@ void dumpCoord3D(const Coord3D *c, AsciiString name, AsciiString fname, Int line
289289
if (!(IS_FRAME_OK_TO_LOG)) return;
290290
fname.toLower();
291291
fname = getFname(fname);
292-
addCRCDebugLine("dumpCoord3D() %s:%d %s %8.8X %8.8X %8.8X\n",
292+
addCRCDebugLine("dumpCoord3D() %s:%d %s %8.8X %8.8X %8.8X",
293293
fname.str(), line, name.str(),
294294
AS_INT(c->x), AS_INT(c->y), AS_INT(c->z));
295295
}
@@ -300,10 +300,10 @@ void dumpMatrix3D(const Matrix3D *m, AsciiString name, AsciiString fname, Int li
300300
fname.toLower();
301301
fname = getFname(fname);
302302
const Real *matrix = (const Real *)m;
303-
addCRCDebugLine("dumpMatrix3D() %s:%d %s\n",
303+
addCRCDebugLine("dumpMatrix3D() %s:%d %s",
304304
fname.str(), line, name.str());
305305
for (Int i=0; i<3; ++i)
306-
addCRCDebugLine(" 0x%08X 0x%08X 0x%08X 0x%08X\n",
306+
addCRCDebugLine(" 0x%08X 0x%08X 0x%08X 0x%08X",
307307
AS_INT(matrix[(i<<2)+0]), AS_INT(matrix[(i<<2)+1]), AS_INT(matrix[(i<<2)+2]), AS_INT(matrix[(i<<2)+3]));
308308
}
309309

@@ -312,7 +312,7 @@ void dumpReal(Real r, AsciiString name, AsciiString fname, Int line)
312312
if (!(IS_FRAME_OK_TO_LOG)) return;
313313
fname.toLower();
314314
fname = getFname(fname);
315-
addCRCDebugLine("dumpReal() %s:%d %s %8.8X (%f)\n",
315+
addCRCDebugLine("dumpReal() %s:%d %s %8.8X (%f)",
316316
fname.str(), line, name.str(), AS_INT(r), r);
317317
}
318318

Generals/Code/GameEngine/Source/Common/PerfTimer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ void PerfTimer::outputInfo( void )
524524
"Average Time (per frame): %.4f ms\n"
525525
"Average calls per frame: %.2f\n"
526526
"Number of calls: %d\n"
527-
"Max possible FPS: %.4f\n",
527+
"Max possible FPS: %.4f",
528528
m_identifier,
529529
avgTimePerCall,
530530
avgTimePerFrame,
@@ -537,7 +537,7 @@ void PerfTimer::outputInfo( void )
537537
"Average Time (per frame): %.4f ms\n"
538538
"Average calls per frame: %.2f\n"
539539
"Number of calls: %d\n"
540-
"Max possible FPS: %.4f\n",
540+
"Max possible FPS: %.4f",
541541
m_identifier,
542542
avgTimePerCall,
543543
avgTimePerFrame,

Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static void memset32(void* ptr, Int value, Int bytesToFill)
320320
static void doStackDumpOutput(const char* m)
321321
{
322322
const char *PREPEND = "STACKTRACE";
323-
if (*m == 0 || strcmp(m, "\n") == 0)
323+
if (*m == 0)
324324
{
325325
DEBUG_LOG((m));
326326
}
@@ -341,7 +341,6 @@ static void doStackDumpOutput(const char* m)
341341
static void doStackDump(void **stacktrace, int size)
342342
{
343343
::doStackDumpOutput("Allocation Stack Trace:");
344-
::doStackDumpOutput("\n");
345344
::StackDumpFromAddresses(stacktrace, size, ::doStackDumpOutput);
346345
}
347346
#endif

Generals/Code/GameEngine/Source/Common/System/Radar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ bool Radar::addObject( Object *obj )
405405

406406
// sanity
407407
DEBUG_ASSERTCRASH( obj->friend_getRadarData() == NULL,
408-
("Radar: addObject - non NULL radar data for '%s'\n",
408+
("Radar: addObject - non NULL radar data for '%s'",
409409
obj->getTemplate()->getName().str()) );
410410

411411
// allocate a new object

Generals/Code/GameEngine/Source/Common/System/StackDump.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,6 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info )
621621
eip_ptr++;
622622
}
623623

624-
strcat (scrap, "\n");
625624
DOUBLE_DEBUG ( ( (scrap)));
626625
DEBUG_LOG(( "********** END EXCEPTION DUMP ****************\n" ));
627626
}

Generals/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -591,34 +591,34 @@ Module *ModuleFactory::newModule( Thing *thing, const AsciiString& name, const M
591591

592592
DEBUG_ASSERTCRASH(
593593
((mt->m_whichInterfaces & (MODULEINTERFACE_BODY)) != 0) == (bm->getBody() != NULL),
594-
("getInterfaceMask bad for MODULE_BODY (%s)\n",name.str()));
594+
("getInterfaceMask bad for MODULE_BODY (%s)",name.str()));
595595
DEBUG_ASSERTCRASH(
596596
((mt->m_whichInterfaces & (MODULEINTERFACE_COLLIDE)) != 0) == (bm->getCollide() != NULL),
597-
("getInterfaceMask bad for MODULE_COLLIDE (%s)\n",name.str()));
597+
("getInterfaceMask bad for MODULE_COLLIDE (%s)",name.str()));
598598
DEBUG_ASSERTCRASH(
599599
((mt->m_whichInterfaces & (MODULEINTERFACE_CONTAIN)) != 0) == (bm->getContain() != NULL),
600-
("getInterfaceMask bad for MODULE_CONTAIN (%s)\n",name.str()));
600+
("getInterfaceMask bad for MODULE_CONTAIN (%s)",name.str()));
601601
DEBUG_ASSERTCRASH(
602602
((mt->m_whichInterfaces & (MODULEINTERFACE_CREATE)) != 0) == (bm->getCreate() != NULL),
603-
("getInterfaceMask bad for MODULE_CREATE (%s)\n",name.str()));
603+
("getInterfaceMask bad for MODULE_CREATE (%s)",name.str()));
604604
DEBUG_ASSERTCRASH(
605605
((mt->m_whichInterfaces & (MODULEINTERFACE_DAMAGE)) != 0) == (bm->getDamage() != NULL),
606-
("getInterfaceMask bad for MODULE_DAMAGE (%s)\n",name.str()));
606+
("getInterfaceMask bad for MODULE_DAMAGE (%s)",name.str()));
607607
DEBUG_ASSERTCRASH(
608608
((mt->m_whichInterfaces & (MODULEINTERFACE_DESTROY)) != 0) == (bm->getDestroy() != NULL),
609-
("getInterfaceMask bad for MODULE_DESTROY (%s)\n",name.str()));
609+
("getInterfaceMask bad for MODULE_DESTROY (%s)",name.str()));
610610
DEBUG_ASSERTCRASH(
611611
((mt->m_whichInterfaces & (MODULEINTERFACE_DIE)) != 0) == (bm->getDie() != NULL),
612-
("getInterfaceMask bad for MODULE_DIE (%s)\n",name.str()));
612+
("getInterfaceMask bad for MODULE_DIE (%s)",name.str()));
613613
DEBUG_ASSERTCRASH(
614614
((mt->m_whichInterfaces & (MODULEINTERFACE_SPECIAL_POWER)) != 0) == (bm->getSpecialPower() != NULL),
615-
("getInterfaceMask bad for MODULE_SPECIAL_POWER (%s)\n",name.str()));
615+
("getInterfaceMask bad for MODULE_SPECIAL_POWER (%s)",name.str()));
616616
DEBUG_ASSERTCRASH(
617617
((mt->m_whichInterfaces & (MODULEINTERFACE_UPDATE)) != 0) == (bm->getUpdate() != NULL),
618-
("getInterfaceMask bad for MODULE_UPDATE (%s)\n",name.str()));
618+
("getInterfaceMask bad for MODULE_UPDATE (%s)",name.str()));
619619
DEBUG_ASSERTCRASH(
620620
((mt->m_whichInterfaces & (MODULEINTERFACE_UPGRADE)) != 0) == (bm->getUpgrade() != NULL),
621-
("getInterfaceMask bad for MODULE_UPGRADE (%s)\n",name.str()));
621+
("getInterfaceMask bad for MODULE_UPGRADE (%s)",name.str()));
622622
}
623623
#endif
624624

Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ ThingTemplate* ThingFactory::newOverride( ThingTemplate *thingTemplate )
173173

174174
// sanity just for debuging, the weapon must be in the master list to do overrides
175175
DEBUG_ASSERTCRASH( findTemplate( thingTemplate->getName() ) != NULL,
176-
("newOverride(): Thing template '%s' not in master list\n",
176+
("newOverride(): Thing template '%s' not in master list",
177177
thingTemplate->getName().str()) );
178178

179179
// find final override of the 'parent' template

0 commit comments

Comments
 (0)