Skip to content

Commit 7c4864a

Browse files
committed
[GEN][ZH] Remove trailing LF from DEBUG_LOG, DEBUG_LOG_LEVEL strings with script (#1232)
1 parent 7ee40d6 commit 7c4864a

File tree

424 files changed

+4884
-4884
lines changed

Some content is hidden

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

424 files changed

+4884
-4884
lines changed

Core/Libraries/Source/Compression/CompressionManager.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ Int CompressionManager::compressData( CompressionType compType, void *srcVoid, I
262262
}
263263
else
264264
{
265-
DEBUG_LOG(("ZLib compression error (level is %d, src len is %d) %d\n", level, srcLen, err));
265+
DEBUG_LOG(("ZLib compression error (level is %d, src len is %d) %d", level, srcLen, err));
266266
return 0;
267267
}
268268
}
@@ -327,7 +327,7 @@ Int CompressionManager::decompressData( void *srcVoid, Int srcLen, void *destVoi
327327
}
328328
else
329329
{
330-
DEBUG_LOG(("ZLib decompression error (src is level %d, %d bytes long) %d\n",
330+
DEBUG_LOG(("ZLib decompression error (src is level %d, %d bytes long) %d",
331331
compType - COMPRESSION_ZLIB1 + 1 /* 1-9 */, srcLen, err));
332332
return 0;
333333
}
@@ -387,7 +387,7 @@ void DoCompressTest( void )
387387
File *f = TheFileSystem->openFile(it->first.str());
388388
if (f)
389389
{
390-
DEBUG_LOG(("***************************\nTesting '%s'\n\n", it->first.str()));
390+
DEBUG_LOG(("***************************\nTesting '%s'\n", it->first.str()));
391391
Int origSize = f->size();
392392
UnsignedByte *buf = (UnsignedByte *)f->readEntireAndClose();
393393
UnsignedByte *uncompressedBuf = NEW UnsignedByte[origSize];
@@ -398,11 +398,11 @@ void DoCompressTest( void )
398398

399399
for (i=COMPRESSION_MIN; i<=COMPRESSION_MAX; ++i)
400400
{
401-
DEBUG_LOG(("=================================================\n"));
402-
DEBUG_LOG(("Compression Test %d\n", i));
401+
DEBUG_LOG(("================================================="));
402+
DEBUG_LOG(("Compression Test %d", i));
403403

404404
Int maxCompressedSize = CompressionManager::getMaxCompressedSize( origSize, (CompressionType)i );
405-
DEBUG_LOG(("Orig size is %d, max compressed size is %d bytes\n", origSize, maxCompressedSize));
405+
DEBUG_LOG(("Orig size is %d, max compressed size is %d bytes", origSize, maxCompressedSize));
406406

407407
UnsignedByte *compressedBuf = NEW UnsignedByte[maxCompressedSize];
408408
memset(compressedBuf, 0, maxCompressedSize);
@@ -420,9 +420,9 @@ void DoCompressTest( void )
420420
s_decompressGathers[i]->stopTimer();
421421
}
422422
d.compressedSize[i] = compressedLen;
423-
DEBUG_LOG(("Compressed len is %d (%g%% of original size)\n", compressedLen, (double)compressedLen/(double)origSize*100.0));
423+
DEBUG_LOG(("Compressed len is %d (%g%% of original size)", compressedLen, (double)compressedLen/(double)origSize*100.0));
424424
DEBUG_ASSERTCRASH(compressedLen, ("Failed to compress\n"));
425-
DEBUG_LOG(("Decompressed len is %d (%g%% of original size)\n", decompressedLen, (double)decompressedLen/(double)origSize*100.0));
425+
DEBUG_LOG(("Decompressed len is %d (%g%% of original size)", decompressedLen, (double)decompressedLen/(double)origSize*100.0));
426426

427427
DEBUG_ASSERTCRASH(decompressedLen == origSize, ("orig size does not match compressed+uncompressed output\n"));
428428
if (decompressedLen == origSize)
@@ -438,9 +438,9 @@ void DoCompressTest( void )
438438
compressedBuf = NULL;
439439
}
440440

441-
DEBUG_LOG(("d = %d -> %d\n", d.origSize, d.compressedSize[i]));
441+
DEBUG_LOG(("d = %d -> %d", d.origSize, d.compressedSize[i]));
442442
s_sizes[it->first] = d;
443-
DEBUG_LOG(("s_sizes[%s] = %d -> %d\n", it->first.str(), s_sizes[it->first].origSize, s_sizes[it->first].compressedSize[i]));
443+
DEBUG_LOG(("s_sizes[%s] = %d -> %d", it->first.str(), s_sizes[it->first].origSize, s_sizes[it->first].compressedSize[i]));
444444

445445
delete[] buf;
446446
buf = NULL;
@@ -469,13 +469,13 @@ void DoCompressTest( void )
469469
totalUncompressedBytes += d.origSize;
470470
totalCompressedBytes += d.compressedSize[i];
471471
}
472-
DEBUG_LOG(("***************************************************\n"));
473-
DEBUG_LOG(("Compression method %s:\n", CompressionManager::getCompressionNameByType((CompressionType)i)));
474-
DEBUG_LOG(("%d bytes compressed to %d (%g%%)\n", totalUncompressedBytes, totalCompressedBytes,
472+
DEBUG_LOG(("***************************************************"));
473+
DEBUG_LOG(("Compression method %s:", CompressionManager::getCompressionNameByType((CompressionType)i)));
474+
DEBUG_LOG(("%d bytes compressed to %d (%g%%)", totalUncompressedBytes, totalCompressedBytes,
475475
totalCompressedBytes/(Real)totalUncompressedBytes*100.0f));
476-
DEBUG_LOG(("Min ratio: %g%%, Max ratio: %g%%\n",
476+
DEBUG_LOG(("Min ratio: %g%%, Max ratio: %g%%",
477477
minCompression*100.0f, maxCompression*100.0f));
478-
DEBUG_LOG(("\n"));
478+
DEBUG_LOG((""));
479479
}
480480

481481
PerfGather::dumpAll(10000);

Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Bool DecompressFile (char *infile, char *outfile)
9595
break;
9696
}
9797

98-
DEBUG_LOG(("Decompressed %s to %s, output size = %d\n", infile, outfile, rawSize));
98+
DEBUG_LOG(("Decompressed %s to %s, output size = %d", infile, outfile, rawSize));
9999

100100
LZHLDestroyDecompressor(decompress);
101101
outFilePtr = fopen(outfile, "wb");

Core/Libraries/Source/WWVegas/WWDownload/Download.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,9 @@ HRESULT CDownload::PumpMessages()
373373

374374
DEBUG_LOG(("About to OnProgressUpdate() - m_FileSize=%d, m_BytesRead=%d, timetaken=%d, numerator=%d",
375375
m_FileSize, m_BytesRead, timetaken, ( ( m_FileSize - m_BytesRead ) * timetaken )));
376-
DEBUG_LOG((", m_startPosition=%d, denominator=%d, predictionTime=%d\n",
376+
DEBUG_LOG((", m_startPosition=%d, denominator=%d, predictionTime=%d",
377377
m_StartPosition, ( m_BytesRead - m_StartPosition ), predictionIndex));
378-
DEBUG_LOG(("vals are %d %d %d %d %d %d %d %d\n",
378+
DEBUG_LOG(("vals are %d %d %d %d %d %d %d %d",
379379
m_predictionTimes[ 0 ], m_predictionTimes[ 1 ], m_predictionTimes[ 2 ], m_predictionTimes[ 3 ],
380380
m_predictionTimes[ 4 ], m_predictionTimes[ 5 ], m_predictionTimes[ 6 ], m_predictionTimes[ 7 ]));
381381

Core/Libraries/Source/WWVegas/WWDownload/FTP.CPP

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,18 +1613,18 @@ HRESULT Cftp::GetNextFileBlock( LPCSTR szLocalFileName, int * piTotalRead )
16131613
char curdir[256];
16141614
_getcwd(curdir,256);
16151615
Prepare_Directories(curdir, m_szLocalFileName);
1616-
DEBUG_LOG(("CWD: %s\n", curdir));
1616+
DEBUG_LOG(("CWD: %s", curdir));
16171617

16181618
if( rename( downloadfilename, m_szLocalFileName ) != 0 ) {
1619-
DEBUG_LOG(("First rename of %s to %s failed with errno of %d\n", downloadfilename, m_szLocalFileName, errno));
1619+
DEBUG_LOG(("First rename of %s to %s failed with errno of %d", downloadfilename, m_szLocalFileName, errno));
16201620
/* Error moving file - remove file that's already there and try again. */
16211621
_chmod( m_szLocalFileName, _S_IWRITE | _S_IREAD); // make sure it's not readonly
1622-
DEBUG_LOG(("_chmod of %s failed with errno of %d\n", m_szLocalFileName, errno));
1622+
DEBUG_LOG(("_chmod of %s failed with errno of %d", m_szLocalFileName, errno));
16231623
remove( m_szLocalFileName );
1624-
DEBUG_LOG(("remove of %s failed with errno of %d\n", m_szLocalFileName, errno));
1624+
DEBUG_LOG(("remove of %s failed with errno of %d", m_szLocalFileName, errno));
16251625

16261626
if( rename( downloadfilename, m_szLocalFileName ) != 0 ) {
1627-
DEBUG_LOG(("Second rename of %s to %s failed with errno of %d\n", downloadfilename, m_szLocalFileName, errno));
1627+
DEBUG_LOG(("Second rename of %s to %s failed with errno of %d", downloadfilename, m_szLocalFileName, errno));
16281628
return( FTP_FAILED );
16291629
}
16301630
}

Core/Tools/Autorun/GameText.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,15 @@ void GameTextManager::deinit( void )
357357

358358
NoString *noString = m_noStringList;
359359

360-
DEBUG_LOG(("\n*** Missing strings ***\n"));
360+
DEBUG_LOG(("\n*** Missing strings ***"));
361361
while ( noString )
362362
{
363-
DEBUG_LOG(("*** %ls ***\n", noString->text.str()));
363+
DEBUG_LOG(("*** %ls ***", noString->text.str()));
364364
NoString *next = noString->next;
365365
delete noString;
366366
noString = next;
367367
}
368-
DEBUG_LOG(("*** End missing strings ***\n\n"));
368+
DEBUG_LOG(("*** End missing strings ***\n"));
369369

370370
m_noStringList = NULL;
371371

@@ -1085,7 +1085,7 @@ const wchar_t * GameTextManager::fetch( const Char *label )
10851085
noString = noString->next;
10861086
}
10871087

1088-
//DEBUG_LOG(("*** MISSING:'%s' ***\n", label));
1088+
//DEBUG_LOG(("*** MISSING:'%s' ***", label));
10891089
// Remember file could have been altered at this point.
10901090
noString = new NoString;
10911091
noString->text = missingString;

Core/Tools/CRCDiff/expander.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,31 @@ void Expander::expand( const std::string& input,
5757
{
5858
// first time
5959
output.append(input.substr(0, pos));
60-
//DEBUG_LOG(("First time, output='%s'\n", output.c_str()));
60+
//DEBUG_LOG(("First time, output='%s'", output.c_str()));
6161
}
6262
else
6363
{
6464
// done this before
6565
std::string sub = input.substr(lastpos, pos-lastpos);
66-
//DEBUG_LOG(("*** lastpos = %d, pos=%d, sub='%s'\n", lastpos, pos, sub.c_str()));
66+
//DEBUG_LOG(("*** lastpos = %d, pos=%d, sub='%s'", lastpos, pos, sub.c_str()));
6767
output.append(sub);
68-
//DEBUG_LOG(("output='%s'\n", output.c_str()));
68+
//DEBUG_LOG(("output='%s'", output.c_str()));
6969
}
7070
}
7171
else
7272
{
73-
//DEBUG_LOG(("pos == 0\n"));
73+
//DEBUG_LOG(("pos == 0"));
7474
}
7575

7676
// pos is the first position of a possible expansion
77-
//DEBUG_LOG(("Looking for endpos via '%s' in '%s'\n", m_right.c_str(), input.substr(pos+m_left.length()).c_str()));
77+
//DEBUG_LOG(("Looking for endpos via '%s' in '%s'", m_right.c_str(), input.substr(pos+m_left.length()).c_str()));
7878
unsigned int endpos = input.find(m_right, pos+m_left.length());
79-
//DEBUG_LOG(("substr is %d-%d of '%s'\n", pos, endpos, input.c_str()));
79+
//DEBUG_LOG(("substr is %d-%d of '%s'", pos, endpos, input.c_str()));
8080
if (endpos != input.npos)
8181
{
8282
// found a complete token - expand it
8383
std::string sub = input.substr(pos+m_left.length(), endpos-pos-m_left.length());
84-
//DEBUG_LOG(("found token: '%s'\n", sub.c_str()));
84+
//DEBUG_LOG(("found token: '%s'", sub.c_str()));
8585

8686
ExpansionMap::iterator it = m_expansions.find(sub);
8787
if (it == m_expansions.end())
@@ -100,9 +100,9 @@ void Expander::expand( const std::string& input,
100100
{
101101
std::string toExpand = it->second;
102102
std::string expanded = "";
103-
//DEBUG_LOG(("###### expanding '%s'\n", toExpand.c_str()));
103+
//DEBUG_LOG(("###### expanding '%s'", toExpand.c_str()));
104104
expand(toExpand, expanded, stripUnknown);
105-
//DEBUG_LOG(("###### expanded '%s'\n", expanded.c_str()));
105+
//DEBUG_LOG(("###### expanded '%s'", expanded.c_str()));
106106
output.append(expanded);
107107
}
108108
}

Core/Tools/Compress/Compress.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ static void DebugLog(const char* format, ...)
3939

4040
void dumpHelp(const char *exe)
4141
{
42-
DEBUG_LOG(("Usage:\n To print the compression type of an existing file: %s -in infile\n", exe));
43-
DEBUG_LOG((" To compress a file: %s -in infile -out outfile <-type compressionmode>\n\n", exe));
44-
DEBUG_LOG(("Compression modes:\n"));
42+
DEBUG_LOG(("Usage:\n To print the compression type of an existing file: %s -in infile", exe));
43+
DEBUG_LOG((" To compress a file: %s -in infile -out outfile <-type compressionmode>\n", exe));
44+
DEBUG_LOG(("Compression modes:"));
4545
for (int i=COMPRESSION_MIN; i<=COMPRESSION_MAX; ++i)
4646
{
47-
DEBUG_LOG((" %s\n", CompressionManager::getCompressionNameByType((CompressionType)i)));
47+
DEBUG_LOG((" %s", CompressionManager::getCompressionNameByType((CompressionType)i)));
4848
}
4949
}
5050

@@ -103,7 +103,7 @@ int main(int argc, char **argv)
103103
return EXIT_SUCCESS;
104104
}
105105

106-
DEBUG_LOG(("IN:'%s' OUT:'%s' Compression:'%s'\n",
106+
DEBUG_LOG(("IN:'%s' OUT:'%s' Compression:'%s'",
107107
inFile.c_str(), outFile.c_str(), CompressionManager::getCompressionNameByType(compressType)));
108108

109109
// just check compression on the input file if we have no output specified
@@ -112,7 +112,7 @@ int main(int argc, char **argv)
112112
FILE *fpIn = fopen(inFile.c_str(), "rb");
113113
if (!fpIn)
114114
{
115-
DEBUG_LOG(("Cannot open '%s'\n", inFile.c_str()));
115+
DEBUG_LOG(("Cannot open '%s'", inFile.c_str()));
116116
return EXIT_FAILURE;
117117
}
118118
fseek(fpIn, 0, SEEK_END);
@@ -125,20 +125,20 @@ int main(int argc, char **argv)
125125

126126
if (numRead != 8)
127127
{
128-
DEBUG_LOG(("Cannot read header from '%s'\n", inFile.c_str()));
128+
DEBUG_LOG(("Cannot read header from '%s'", inFile.c_str()));
129129
return EXIT_FAILURE;
130130
}
131131

132132
CompressionType usedType = CompressionManager::getCompressionType(data, 8);
133133
if (usedType == COMPRESSION_NONE)
134134
{
135-
DEBUG_LOG(("No compression on '%s'\n", inFile.c_str()));
135+
DEBUG_LOG(("No compression on '%s'", inFile.c_str()));
136136
return EXIT_SUCCESS;
137137
}
138138

139139
int uncompressedSize = CompressionManager::getUncompressedSize(data, 8);
140140

141-
DEBUG_LOG(("'%s' is compressed using %s, from %d to %d bytes, %g%% of its original size\n",
141+
DEBUG_LOG(("'%s' is compressed using %s, from %d to %d bytes, %g%% of its original size",
142142
inFile.c_str(), CompressionManager::getCompressionNameByType(usedType),
143143
uncompressedSize, size, size/(double)(uncompressedSize+0.1)*100.0));
144144

@@ -149,7 +149,7 @@ int main(int argc, char **argv)
149149
FILE *fpIn = fopen(inFile.c_str(), "rb");
150150
if (!fpIn)
151151
{
152-
DEBUG_LOG(("Cannot open input '%s'\n", inFile.c_str()));
152+
DEBUG_LOG(("Cannot open input '%s'", inFile.c_str()));
153153
return EXIT_FAILURE;
154154
}
155155

@@ -163,26 +163,26 @@ int main(int argc, char **argv)
163163
fclose(fpIn);
164164
if (numRead != inputSize)
165165
{
166-
DEBUG_LOG(("Cannot read input '%s'\n", inFile.c_str()));
166+
DEBUG_LOG(("Cannot read input '%s'", inFile.c_str()));
167167
delete[] inputData;
168168
return EXIT_FAILURE;
169169
}
170170

171-
DEBUG_LOG(("Read %d bytes from '%s'\n", numRead, inFile.c_str()));
171+
DEBUG_LOG(("Read %d bytes from '%s'", numRead, inFile.c_str()));
172172

173173
// Open the output file
174174
FILE *fpOut = fopen(outFile.c_str(), "wb");
175175
if (!fpOut)
176176
{
177-
DEBUG_LOG(("Cannot open output '%s'\n", outFile.c_str()));
177+
DEBUG_LOG(("Cannot open output '%s'", outFile.c_str()));
178178
delete[] inputData;
179179
return EXIT_FAILURE;
180180
}
181181

182182

183183
if (compressType == COMPRESSION_NONE)
184184
{
185-
DEBUG_LOG(("No compression requested, writing uncompressed data\n"));
185+
DEBUG_LOG(("No compression requested, writing uncompressed data"));
186186
int outSize = CompressionManager::getUncompressedSize(inputData, inputSize);
187187
char *outData = new char[outSize];
188188
CompressionManager::decompressData(inputData, inputSize, outData, outSize);
@@ -192,7 +192,7 @@ int main(int argc, char **argv)
192192
}
193193
else
194194
{
195-
DEBUG_LOG(("Compressing data using %s\n", CompressionManager::getCompressionNameByType(compressType)));
195+
DEBUG_LOG(("Compressing data using %s", CompressionManager::getCompressionNameByType(compressType)));
196196
// Allocate the output buffer
197197
int outSize = CompressionManager::getMaxCompressedSize(inputSize, compressType);
198198
char *outData = new char[outSize];

Core/Tools/MapCacheBuilder/Source/WinMain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
245245
while (token != NULL) {
246246
char * str = strtrim(token);
247247
argvSet.push_back(str);
248-
DEBUG_LOG(("Adding '%s'\n", str));
248+
DEBUG_LOG(("Adding '%s'", str));
249249
token = nextParam(NULL, "\" ");
250250
}
251251

@@ -294,7 +294,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
294294
// add in allowed maps
295295
for (std::list<std::string>::const_iterator cit = argvSet.begin(); cit != argvSet.end(); ++cit)
296296
{
297-
DEBUG_LOG(("Adding shipping map: '%s'\n", cit->c_str()));
297+
DEBUG_LOG(("Adding shipping map: '%s'", cit->c_str()));
298298
TheMapCache->addShippingMap((*cit).c_str());
299299
}
300300

0 commit comments

Comments
 (0)