Skip to content

Commit 67e59c4

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

File tree

86 files changed

+236
-241
lines changed

Some content is hidden

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

86 files changed

+236
-241
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
@@ -284,7 +284,7 @@ void dumpVector3(const Vector3 *v, AsciiString name, AsciiString fname, Int line
284284
if (!(IS_FRAME_OK_TO_LOG)) return;
285285
fname.toLower();
286286
fname = getFname(fname);
287-
addCRCDebugLine("dumpVector3() %s:%d %s %8.8X %8.8X %8.8X\n",
287+
addCRCDebugLine("dumpVector3() %s:%d %s %8.8X %8.8X %8.8X",
288288
fname.str(), line, name.str(),
289289
AS_INT(v->X), AS_INT(v->Y), AS_INT(v->Z));
290290
}
@@ -294,7 +294,7 @@ void dumpCoord3D(const Coord3D *c, AsciiString name, AsciiString fname, Int line
294294
if (!(IS_FRAME_OK_TO_LOG)) return;
295295
fname.toLower();
296296
fname = getFname(fname);
297-
addCRCDebugLine("dumpCoord3D() %s:%d %s %8.8X %8.8X %8.8X\n",
297+
addCRCDebugLine("dumpCoord3D() %s:%d %s %8.8X %8.8X %8.8X",
298298
fname.str(), line, name.str(),
299299
AS_INT(c->x), AS_INT(c->y), AS_INT(c->z));
300300
}
@@ -305,10 +305,10 @@ void dumpMatrix3D(const Matrix3D *m, AsciiString name, AsciiString fname, Int li
305305
fname.toLower();
306306
fname = getFname(fname);
307307
const Real *matrix = (const Real *)m;
308-
addCRCDebugLine("dumpMatrix3D() %s:%d %s\n",
308+
addCRCDebugLine("dumpMatrix3D() %s:%d %s",
309309
fname.str(), line, name.str());
310310
for (Int i=0; i<3; ++i)
311-
addCRCDebugLine(" 0x%08X 0x%08X 0x%08X 0x%08X\n",
311+
addCRCDebugLine(" 0x%08X 0x%08X 0x%08X 0x%08X",
312312
AS_INT(matrix[(i<<2)+0]), AS_INT(matrix[(i<<2)+1]), AS_INT(matrix[(i<<2)+2]), AS_INT(matrix[(i<<2)+3]));
313313
}
314314

@@ -317,7 +317,7 @@ void dumpReal(Real r, AsciiString name, AsciiString fname, Int line)
317317
if (!(IS_FRAME_OK_TO_LOG)) return;
318318
fname.toLower();
319319
fname = getFname(fname);
320-
addCRCDebugLine("dumpReal() %s:%d %s %8.8X (%f)\n",
320+
addCRCDebugLine("dumpReal() %s:%d %s %8.8X (%f)",
321321
fname.str(), line, name.str(), AS_INT(r), r);
322322
}
323323

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ void PerfTimer::outputInfo( void )
529529
"Average Time (per frame): %.4f ms\n"
530530
"Average calls per frame: %.2f\n"
531531
"Number of calls: %d\n"
532-
"Max possible FPS: %.4f\n",
532+
"Max possible FPS: %.4f",
533533
m_identifier,
534534
avgTimePerCall,
535535
avgTimePerFrame,
@@ -542,7 +542,7 @@ void PerfTimer::outputInfo( void )
542542
"Average Time (per frame): %.4f ms\n"
543543
"Average calls per frame: %.2f\n"
544544
"Number of calls: %d\n"
545-
"Max possible FPS: %.4f\n",
545+
"Max possible FPS: %.4f",
546546
m_identifier,
547547
avgTimePerCall,
548548
avgTimePerFrame,

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ static void memset32(void* ptr, Int value, Int bytesToFill)
325325
static void doStackDumpOutput(const char* m)
326326
{
327327
const char *PREPEND = "STACKTRACE";
328-
if (*m == 0 || strcmp(m, "\n") == 0)
328+
if (*m == 0)
329329
{
330330
DEBUG_LOG((m));
331331
}
@@ -346,7 +346,6 @@ static void doStackDumpOutput(const char* m)
346346
static void doStackDump(void **stacktrace, int size)
347347
{
348348
::doStackDumpOutput("Allocation Stack Trace:");
349-
::doStackDumpOutput("\n");
350349
::StackDumpFromAddresses(stacktrace, size, ::doStackDumpOutput);
351350
}
352351
#endif

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

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

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

414414
// 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
@@ -596,34 +596,34 @@ Module *ModuleFactory::newModule( Thing *thing, const AsciiString& name, const M
596596

597597
DEBUG_ASSERTCRASH(
598598
((mt->m_whichInterfaces & (MODULEINTERFACE_BODY)) != 0) == (bm->getBody() != NULL),
599-
("getInterfaceMask bad for MODULE_BODY (%s)\n",name.str()));
599+
("getInterfaceMask bad for MODULE_BODY (%s)",name.str()));
600600
DEBUG_ASSERTCRASH(
601601
((mt->m_whichInterfaces & (MODULEINTERFACE_COLLIDE)) != 0) == (bm->getCollide() != NULL),
602-
("getInterfaceMask bad for MODULE_COLLIDE (%s)\n",name.str()));
602+
("getInterfaceMask bad for MODULE_COLLIDE (%s)",name.str()));
603603
DEBUG_ASSERTCRASH(
604604
((mt->m_whichInterfaces & (MODULEINTERFACE_CONTAIN)) != 0) == (bm->getContain() != NULL),
605-
("getInterfaceMask bad for MODULE_CONTAIN (%s)\n",name.str()));
605+
("getInterfaceMask bad for MODULE_CONTAIN (%s)",name.str()));
606606
DEBUG_ASSERTCRASH(
607607
((mt->m_whichInterfaces & (MODULEINTERFACE_CREATE)) != 0) == (bm->getCreate() != NULL),
608-
("getInterfaceMask bad for MODULE_CREATE (%s)\n",name.str()));
608+
("getInterfaceMask bad for MODULE_CREATE (%s)",name.str()));
609609
DEBUG_ASSERTCRASH(
610610
((mt->m_whichInterfaces & (MODULEINTERFACE_DAMAGE)) != 0) == (bm->getDamage() != NULL),
611-
("getInterfaceMask bad for MODULE_DAMAGE (%s)\n",name.str()));
611+
("getInterfaceMask bad for MODULE_DAMAGE (%s)",name.str()));
612612
DEBUG_ASSERTCRASH(
613613
((mt->m_whichInterfaces & (MODULEINTERFACE_DESTROY)) != 0) == (bm->getDestroy() != NULL),
614-
("getInterfaceMask bad for MODULE_DESTROY (%s)\n",name.str()));
614+
("getInterfaceMask bad for MODULE_DESTROY (%s)",name.str()));
615615
DEBUG_ASSERTCRASH(
616616
((mt->m_whichInterfaces & (MODULEINTERFACE_DIE)) != 0) == (bm->getDie() != NULL),
617-
("getInterfaceMask bad for MODULE_DIE (%s)\n",name.str()));
617+
("getInterfaceMask bad for MODULE_DIE (%s)",name.str()));
618618
DEBUG_ASSERTCRASH(
619619
((mt->m_whichInterfaces & (MODULEINTERFACE_SPECIAL_POWER)) != 0) == (bm->getSpecialPower() != NULL),
620-
("getInterfaceMask bad for MODULE_SPECIAL_POWER (%s)\n",name.str()));
620+
("getInterfaceMask bad for MODULE_SPECIAL_POWER (%s)",name.str()));
621621
DEBUG_ASSERTCRASH(
622622
((mt->m_whichInterfaces & (MODULEINTERFACE_UPDATE)) != 0) == (bm->getUpdate() != NULL),
623-
("getInterfaceMask bad for MODULE_UPDATE (%s)\n",name.str()));
623+
("getInterfaceMask bad for MODULE_UPDATE (%s)",name.str()));
624624
DEBUG_ASSERTCRASH(
625625
((mt->m_whichInterfaces & (MODULEINTERFACE_UPGRADE)) != 0) == (bm->getUpgrade() != NULL),
626-
("getInterfaceMask bad for MODULE_UPGRADE (%s)\n",name.str()));
626+
("getInterfaceMask bad for MODULE_UPGRADE (%s)",name.str()));
627627
}
628628
#endif
629629

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

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

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

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

0 commit comments

Comments
 (0)