Skip to content

Commit 2264f35

Browse files
committed
[GEN][ZH] Remove trailing LF from DEBUG_CRASH strings with script (#1232)
1 parent 7c4864a commit 2264f35

File tree

241 files changed

+772
-772
lines changed

Some content is hidden

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

241 files changed

+772
-772
lines changed

Core/GameEngine/Source/Common/System/Xfer.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void Xfer::xferVersion( XferVersion *versionData, XferVersion currentVersion )
8585
if( *versionData > currentVersion )
8686
{
8787

88-
DEBUG_CRASH(( "XferVersion - Unknown version '%d' should be no higher than '%d'\n",
88+
DEBUG_CRASH(( "XferVersion - Unknown version '%d' should be no higher than '%d'",
8989
*versionData, currentVersion ));
9090
throw XFER_INVALID_VERSION;
9191

@@ -398,7 +398,7 @@ void Xfer::xferSTLObjectIDVector( std::vector<ObjectID> *objectIDVectorData )
398398
if( objectIDVectorData->size() != 0 )
399399
{
400400

401-
DEBUG_CRASH(( "Xfer::xferSTLObjectIDList - object vector should be empty before loading\n" ));
401+
DEBUG_CRASH(( "Xfer::xferSTLObjectIDList - object vector should be empty before loading" ));
402402
throw XFER_LIST_NOT_EMPTY;
403403

404404
} // end if
@@ -416,7 +416,7 @@ void Xfer::xferSTLObjectIDVector( std::vector<ObjectID> *objectIDVectorData )
416416
else
417417
{
418418

419-
DEBUG_CRASH(( "xferSTLObjectIDList - Unknown xfer mode '%d'\n", getXferMode() ));
419+
DEBUG_CRASH(( "xferSTLObjectIDList - Unknown xfer mode '%d'", getXferMode() ));
420420
throw XFER_MODE_UNKNOWN;
421421

422422
} // end else
@@ -465,7 +465,7 @@ void Xfer::xferSTLObjectIDList( std::list< ObjectID > *objectIDListData )
465465
if( objectIDListData->size() != 0 )
466466
{
467467

468-
DEBUG_CRASH(( "Xfer::xferSTLObjectIDList - object list should be empty before loading\n" ));
468+
DEBUG_CRASH(( "Xfer::xferSTLObjectIDList - object list should be empty before loading" ));
469469
throw XFER_LIST_NOT_EMPTY;
470470

471471
} // end if
@@ -483,7 +483,7 @@ void Xfer::xferSTLObjectIDList( std::list< ObjectID > *objectIDListData )
483483
else
484484
{
485485

486-
DEBUG_CRASH(( "xferSTLObjectIDList - Unknown xfer mode '%d'\n", getXferMode() ));
486+
DEBUG_CRASH(( "xferSTLObjectIDList - Unknown xfer mode '%d'", getXferMode() ));
487487
throw XFER_MODE_UNKNOWN;
488488

489489
} // end else
@@ -531,7 +531,7 @@ void Xfer::xferSTLIntList( std::list< Int > *intListData )
531531
if( intListData->size() != 0 )
532532
{
533533

534-
DEBUG_CRASH(( "Xfer::xferSTLIntList - int list should be empty before loading\n" ));
534+
DEBUG_CRASH(( "Xfer::xferSTLIntList - int list should be empty before loading" ));
535535
throw XFER_LIST_NOT_EMPTY;
536536

537537
} // end if
@@ -549,7 +549,7 @@ void Xfer::xferSTLIntList( std::list< Int > *intListData )
549549
else
550550
{
551551

552-
DEBUG_CRASH(( "xferSTLIntList - Unknown xfer mode '%d'\n", getXferMode() ));
552+
DEBUG_CRASH(( "xferSTLIntList - Unknown xfer mode '%d'", getXferMode() ));
553553
throw XFER_MODE_UNKNOWN;
554554

555555
} // end else
@@ -584,7 +584,7 @@ void Xfer::xferScienceType( ScienceType *science )
584584
if( *science == SCIENCE_INVALID )
585585
{
586586

587-
DEBUG_CRASH(( "xferScienceType - Unknown science '%s'\n", scienceName.str() ));
587+
DEBUG_CRASH(( "xferScienceType - Unknown science '%s'", scienceName.str() ));
588588
throw XFER_UNKNOWN_STRING;
589589

590590
} // end if
@@ -598,7 +598,7 @@ void Xfer::xferScienceType( ScienceType *science )
598598
else
599599
{
600600

601-
DEBUG_CRASH(( "xferScienceType - Unknown xfer mode '%d'\n", getXferMode() ));
601+
DEBUG_CRASH(( "xferScienceType - Unknown xfer mode '%d'", getXferMode() ));
602602
throw XFER_MODE_UNKNOWN;
603603

604604
} // end else
@@ -639,7 +639,7 @@ void Xfer::xferScienceVec( ScienceVec *scienceVec )
639639
scienceVec->clear();
640640

641641
// Homework for today. Write 2000 words reconciling "Your code must never crash" with "Intentionally putting crashes in the code". Fucktard.
642-
// DEBUG_CRASH(( "xferScienceVec - vector is not empty, but should be\n" ));
642+
// DEBUG_CRASH(( "xferScienceVec - vector is not empty, but should be" ));
643643
// throw XFER_LIST_NOT_EMPTY;
644644
}
645645

@@ -662,7 +662,7 @@ void Xfer::xferScienceVec( ScienceVec *scienceVec )
662662
else
663663
{
664664

665-
DEBUG_CRASH(( "xferScienceVec - Unknown xfer mode '%d'\n", getXferMode() ));
665+
DEBUG_CRASH(( "xferScienceVec - Unknown xfer mode '%d'", getXferMode() ));
666666
throw XFER_MODE_UNKNOWN;
667667

668668
} // end else
@@ -715,7 +715,7 @@ void Xfer::xferKindOf( KindOfType *kindOfData )
715715
else
716716
{
717717

718-
DEBUG_CRASH(( "xferKindOf - Unknown xfer mode '%d'\n", getXferMode() ));
718+
DEBUG_CRASH(( "xferKindOf - Unknown xfer mode '%d'", getXferMode() ));
719719
throw XFER_MODE_UNKNOWN;
720720

721721
} // end else
@@ -795,7 +795,7 @@ void Xfer::xferUpgradeMask( UpgradeMaskType *upgradeMaskData )
795795
if( upgradeTemplate == NULL )
796796
{
797797

798-
DEBUG_CRASH(( "Xfer::xferUpgradeMask - Unknown upgrade '%s'\n", upgradeName.str() ));
798+
DEBUG_CRASH(( "Xfer::xferUpgradeMask - Unknown upgrade '%s'", upgradeName.str() ));
799799
throw XFER_UNKNOWN_STRING;
800800

801801
} // end if
@@ -816,7 +816,7 @@ void Xfer::xferUpgradeMask( UpgradeMaskType *upgradeMaskData )
816816
else
817817
{
818818

819-
DEBUG_CRASH(( "xferUpgradeMask - Unknown xfer mode '%d'\n", getXferMode() ));
819+
DEBUG_CRASH(( "xferUpgradeMask - Unknown xfer mode '%d'", getXferMode() ));
820820
throw XFER_MODE_UNKNOWN;
821821

822822
} // end else

Core/GameEngine/Source/Common/System/XferCRC.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ XferDeepCRC::~XferDeepCRC( void )
203203
if( m_fileFP != NULL )
204204
{
205205

206-
DEBUG_CRASH(( "Warning: Xfer file '%s' was left open\n", m_identifier.str() ));
206+
DEBUG_CRASH(( "Warning: Xfer file '%s' was left open", m_identifier.str() ));
207207
close();
208208

209209
} // end if
@@ -222,7 +222,7 @@ void XferDeepCRC::open( AsciiString identifier )
222222
if( m_fileFP != NULL )
223223
{
224224

225-
DEBUG_CRASH(( "Cannot open file '%s' cause we've already got '%s' open\n",
225+
DEBUG_CRASH(( "Cannot open file '%s' cause we've already got '%s' open",
226226
identifier.str(), m_identifier.str() ));
227227
throw XFER_FILE_ALREADY_OPEN;
228228

@@ -236,7 +236,7 @@ void XferDeepCRC::open( AsciiString identifier )
236236
if( m_fileFP == NULL )
237237
{
238238

239-
DEBUG_CRASH(( "File '%s' not found\n", identifier.str() ));
239+
DEBUG_CRASH(( "File '%s' not found", identifier.str() ));
240240
throw XFER_FILE_NOT_FOUND;
241241

242242
} // end if
@@ -256,7 +256,7 @@ void XferDeepCRC::close( void )
256256
if( m_fileFP == NULL )
257257
{
258258

259-
DEBUG_CRASH(( "Xfer close called, but no file was open\n" ));
259+
DEBUG_CRASH(( "Xfer close called, but no file was open" ));
260260
throw XFER_FILE_NOT_OPEN;
261261

262262
} // end if
@@ -289,7 +289,7 @@ void XferDeepCRC::xferImplementation( void *data, Int dataSize )
289289
if( fwrite( data, dataSize, 1, m_fileFP ) != 1 )
290290
{
291291

292-
DEBUG_CRASH(( "XferSave - Error writing to file '%s'\n", m_identifier.str() ));
292+
DEBUG_CRASH(( "XferSave - Error writing to file '%s'", m_identifier.str() ));
293293
throw XFER_WRITE_ERROR;
294294

295295
} // end if
@@ -316,7 +316,7 @@ void XferDeepCRC::xferAsciiString( AsciiString *asciiStringData )
316316
if( asciiStringData->getLength() > 16385 )
317317
{
318318

319-
DEBUG_CRASH(( "XferSave cannot save this ascii string because it's too long. Change the size of the length header (but be sure to preserve save file compatability\n" ));
319+
DEBUG_CRASH(( "XferSave cannot save this ascii string because it's too long. Change the size of the length header (but be sure to preserve save file compatability" ));
320320
throw XFER_STRING_ERROR;
321321

322322
} // end if
@@ -341,7 +341,7 @@ void XferDeepCRC::xferUnicodeString( UnicodeString *unicodeStringData )
341341
if( unicodeStringData->getLength() > 255 )
342342
{
343343

344-
DEBUG_CRASH(( "XferSave cannot save this unicode string because it's too long. Change the size of the length header (but be sure to preserve save file compatability\n" ));
344+
DEBUG_CRASH(( "XferSave cannot save this unicode string because it's too long. Change the size of the length header (but be sure to preserve save file compatability" ));
345345
throw XFER_STRING_ERROR;
346346

347347
} // end if

Core/GameEngine/Source/Common/System/XferLoad.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ XferLoad::~XferLoad( void )
5353
if( m_fileFP != NULL )
5454
{
5555

56-
DEBUG_CRASH(( "Warning: Xfer file '%s' was left open\n", m_identifier.str() ));
56+
DEBUG_CRASH(( "Warning: Xfer file '%s' was left open", m_identifier.str() ));
5757
close();
5858

5959
} // end if
@@ -70,7 +70,7 @@ void XferLoad::open( AsciiString identifier )
7070
if( m_fileFP != NULL )
7171
{
7272

73-
DEBUG_CRASH(( "Cannot open file '%s' cause we've already got '%s' open\n",
73+
DEBUG_CRASH(( "Cannot open file '%s' cause we've already got '%s' open",
7474
identifier.str(), m_identifier.str() ));
7575
throw XFER_FILE_ALREADY_OPEN;
7676

@@ -84,7 +84,7 @@ void XferLoad::open( AsciiString identifier )
8484
if( m_fileFP == NULL )
8585
{
8686

87-
DEBUG_CRASH(( "File '%s' not found\n", identifier.str() ));
87+
DEBUG_CRASH(( "File '%s' not found", identifier.str() ));
8888
throw XFER_FILE_NOT_FOUND;
8989

9090
} // end if
@@ -101,7 +101,7 @@ void XferLoad::close( void )
101101
if( m_fileFP == NULL )
102102
{
103103

104-
DEBUG_CRASH(( "Xfer close called, but no file was open\n" ));
104+
DEBUG_CRASH(( "Xfer close called, but no file was open" ));
105105
throw XFER_FILE_NOT_OPEN;
106106

107107
} // end if
@@ -130,7 +130,7 @@ Int XferLoad::beginBlock( void )
130130
if( fread( &blockSize, sizeof( XferBlockSize ), 1, m_fileFP ) != 1 )
131131
{
132132

133-
DEBUG_CRASH(( "Xfer - Error reading block size for '%s'\n", m_identifier.str() ));
133+
DEBUG_CRASH(( "Xfer - Error reading block size for '%s'", m_identifier.str() ));
134134
return 0;
135135

136136
} // end if
@@ -177,7 +177,7 @@ void XferLoad::xferSnapshot( Snapshot *snapshot )
177177
if( snapshot == NULL )
178178
{
179179

180-
DEBUG_CRASH(( "XferLoad::xferSnapshot - Invalid parameters\n" ));
180+
DEBUG_CRASH(( "XferLoad::xferSnapshot - Invalid parameters" ));
181181
throw XFER_INVALID_PARAMETERS;
182182

183183
} // end if
@@ -251,7 +251,7 @@ void XferLoad::xferImplementation( void *data, Int dataSize )
251251
if( fread( data, dataSize, 1, m_fileFP ) != 1 )
252252
{
253253

254-
DEBUG_CRASH(( "XferLoad - Error reading from file '%s'\n", m_identifier.str() ));
254+
DEBUG_CRASH(( "XferLoad - Error reading from file '%s'", m_identifier.str() ));
255255
throw XFER_READ_ERROR;
256256

257257
} // end if

Core/GameEngine/Source/Common/System/XferSave.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ XferSave::~XferSave( void )
7070
if( m_fileFP != NULL )
7171
{
7272

73-
DEBUG_CRASH(( "Warning: Xfer file '%s' was left open\n", m_identifier.str() ));
73+
DEBUG_CRASH(( "Warning: Xfer file '%s' was left open", m_identifier.str() ));
7474
close();
7575

7676
} // end if
@@ -83,7 +83,7 @@ XferSave::~XferSave( void )
8383
{
8484

8585
// tell the user there is an error
86-
DEBUG_CRASH(( "Warning: XferSave::~XferSave - m_blockStack was not NULL!\n" ));
86+
DEBUG_CRASH(( "Warning: XferSave::~XferSave - m_blockStack was not NULL!" ));
8787

8888
// delete the block stack
8989
XferBlockData *next;
@@ -110,7 +110,7 @@ void XferSave::open( AsciiString identifier )
110110
if( m_fileFP != NULL )
111111
{
112112

113-
DEBUG_CRASH(( "Cannot open file '%s' cause we've already got '%s' open\n",
113+
DEBUG_CRASH(( "Cannot open file '%s' cause we've already got '%s' open",
114114
identifier.str(), m_identifier.str() ));
115115
throw XFER_FILE_ALREADY_OPEN;
116116

@@ -124,7 +124,7 @@ void XferSave::open( AsciiString identifier )
124124
if( m_fileFP == NULL )
125125
{
126126

127-
DEBUG_CRASH(( "File '%s' not found\n", identifier.str() ));
127+
DEBUG_CRASH(( "File '%s' not found", identifier.str() ));
128128
throw XFER_FILE_NOT_FOUND;
129129

130130
} // end if
@@ -141,7 +141,7 @@ void XferSave::close( void )
141141
if( m_fileFP == NULL )
142142
{
143143

144-
DEBUG_CRASH(( "Xfer close called, but no file was open\n" ));
144+
DEBUG_CRASH(( "Xfer close called, but no file was open" ));
145145
throw XFER_FILE_NOT_OPEN;
146146

147147
} // end if
@@ -177,7 +177,7 @@ Int XferSave::beginBlock( void )
177177
if( fwrite( &blockSize, sizeof( XferBlockSize ), 1, m_fileFP ) != 1 )
178178
{
179179

180-
DEBUG_CRASH(( "XferSave::beginBlock - Error writing block size in '%s'\n",
180+
DEBUG_CRASH(( "XferSave::beginBlock - Error writing block size in '%s'",
181181
m_identifier.str() ));
182182
return XFER_WRITE_ERROR;
183183

@@ -189,7 +189,7 @@ Int XferSave::beginBlock( void )
189189
// if( top == NULL )
190190
// {
191191
//
192-
// DEBUG_CRASH(( "XferSave - Begin block, out of memory - can't save block stack data\n" ));
192+
// DEBUG_CRASH(( "XferSave - Begin block, out of memory - can't save block stack data" ));
193193
// return XFER_OUT_OF_MEMORY;
194194
//
195195
// } // end if
@@ -218,7 +218,7 @@ void XferSave::endBlock( void )
218218
if( m_blockStack == NULL )
219219
{
220220

221-
DEBUG_CRASH(( "Xfer end block called, but no matching begin block was found\n" ));
221+
DEBUG_CRASH(( "Xfer end block called, but no matching begin block was found" ));
222222
throw XFER_BEGIN_END_MISMATCH;
223223

224224
} // end if
@@ -238,7 +238,7 @@ void XferSave::endBlock( void )
238238
if( fwrite( &blockSize, sizeof( XferBlockSize ), 1, m_fileFP ) != 1 )
239239
{
240240

241-
DEBUG_CRASH(( "Error writing block size to file '%s'\n", m_identifier.str() ));
241+
DEBUG_CRASH(( "Error writing block size to file '%s'", m_identifier.str() ));
242242
throw XFER_WRITE_ERROR;
243243

244244
} // end if
@@ -276,7 +276,7 @@ void XferSave::xferSnapshot( Snapshot *snapshot )
276276
if( snapshot == NULL )
277277
{
278278

279-
DEBUG_CRASH(( "XferSave::xferSnapshot - Invalid parameters\n" ));
279+
DEBUG_CRASH(( "XferSave::xferSnapshot - Invalid parameters" ));
280280
throw XFER_INVALID_PARAMETERS;
281281

282282
} // end if
@@ -296,7 +296,7 @@ void XferSave::xferAsciiString( AsciiString *asciiStringData )
296296
if( asciiStringData->getLength() > 255 )
297297
{
298298

299-
DEBUG_CRASH(( "XferSave cannot save this unicode string because it's too long. Change the size of the length header (but be sure to preserve save file compatability\n" ));
299+
DEBUG_CRASH(( "XferSave cannot save this unicode string because it's too long. Change the size of the length header (but be sure to preserve save file compatability" ));
300300
throw XFER_STRING_ERROR;
301301

302302
} // end if
@@ -321,7 +321,7 @@ void XferSave::xferUnicodeString( UnicodeString *unicodeStringData )
321321
if( unicodeStringData->getLength() > 255 )
322322
{
323323

324-
DEBUG_CRASH(( "XferSave cannot save this unicode string because it's too long. Change the size of the length header (but be sure to preserve save file compatability\n" ));
324+
DEBUG_CRASH(( "XferSave cannot save this unicode string because it's too long. Change the size of the length header (but be sure to preserve save file compatability" ));
325325
throw XFER_STRING_ERROR;
326326

327327
} // end if
@@ -350,7 +350,7 @@ void XferSave::xferImplementation( void *data, Int dataSize )
350350
if( fwrite( data, dataSize, 1, m_fileFP ) != 1 )
351351
{
352352

353-
DEBUG_CRASH(( "XferSave - Error writing to file '%s'\n", m_identifier.str() ));
353+
DEBUG_CRASH(( "XferSave - Error writing to file '%s'", m_identifier.str() ));
354354
throw XFER_WRITE_ERROR;
355355

356356
} // end if

Core/Libraries/Source/Compression/CompressionManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ void DoCompressTest( void )
430430
Int ret = memcmp(buf, uncompressedBuf, origSize);
431431
if (ret != 0)
432432
{
433-
DEBUG_CRASH(("orig buffer does not match compressed+uncompressed output - ret was %d\n", ret));
433+
DEBUG_CRASH(("orig buffer does not match compressed+uncompressed output - ret was %d", ret));
434434
}
435435
}
436436

Generals/Code/GameEngine/Include/Common/BitFlagsIO.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void BitFlags<NUMBITS>::xfer(Xfer* xfer)
223223
else
224224
{
225225

226-
DEBUG_CRASH(( "BitFlagsXfer - Unknown xfer mode '%d'\n", xfer->getXferMode() ));
226+
DEBUG_CRASH(( "BitFlagsXfer - Unknown xfer mode '%d'", xfer->getXferMode() ));
227227
throw XFER_MODE_UNKNOWN;
228228

229229
} // end else

Generals/Code/GameEngine/Include/Common/SparseMatchFinder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class SparseMatchFinder
178178
{
179179
AsciiString curConditionStr;
180180
bits.buildDescription(&curConditionStr);
181-
DEBUG_CRASH(("ambiguous model match in findBestInfoSlow \n\nbetween \n(%s)\n<and>\n(%s)\n\n(%d extra matches found)\n\ncurrent bits are (\n%s)\n",
181+
DEBUG_CRASH(("ambiguous model match in findBestInfoSlow \n\nbetween \n(%s)\n<and>\n(%s)\n\n(%d extra matches found)\n\ncurrent bits are (\n%s)",
182182
curBestMatchStr.str(),
183183
dupMatchStr.str(),
184184
numDupMatches,

0 commit comments

Comments
 (0)