[Scummvm-cvs-logs] scummvm-tools master -> 9a505bf162497ef93e47f6ecfcffa31126ddea4d

criezy criezy at scummvm.org
Thu Nov 24 23:07:12 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .

Summary:
9a505bf162 TOOLS: Add EOL in the Tool print, warning and error function


Commit: 9a505bf162497ef93e47f6ecfcffa31126ddea4d
    https://github.com/scummvm/scummvm-tools/commit/9a505bf162497ef93e47f6ecfcffa31126ddea4d
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2011-11-24T14:06:47-08:00

Commit Message:
TOOLS: Add EOL in the Tool print, warning and error function

This is consistent with the Common warning and error functions from
both ScummVM and the tools. Only the functions from the class Tool
didn't add EOL automatically. Unsurprisingly the End Of Line was
then missing in many places were these functions were called.

Changed paths:
    compress.cpp
    encode_dxa.cpp
    engines/agos/compress_agos.cpp
    engines/agos/extract_agos.cpp
    engines/cge/extract_cge.cpp
    engines/cge/pack_cge.cpp
    engines/cine/extract_cine.cpp
    engines/cruise/extract_cruise_pc.cpp
    engines/gob/compress_gob.cpp
    engines/gob/extract_gob_stk.cpp
    engines/kyra/compress_kyra.cpp
    engines/parallaction/extract_parallaction.cpp
    engines/queen/compress_queen.cpp
    engines/saga/compress_saga.cpp
    engines/sci/compress_sci.cpp
    engines/scumm/compress_scumm_bun.cpp
    engines/scumm/compress_scumm_san.cpp
    engines/scumm/extract_loom_tg16.cpp
    engines/scumm/extract_mm_apple.cpp
    engines/scumm/extract_mm_nes.cpp
    engines/scumm/extract_scumm_mac.cpp
    engines/scumm/extract_zak_c64.cpp
    engines/sword1/compress_sword1.cpp
    engines/tinsel/compress_tinsel.cpp
    engines/touche/compress_touche.cpp
    engines/tucker/compress_tucker.cpp
    example_tool.cpp
    tool.cpp



diff --git a/compress.cpp b/compress.cpp
index ac9c84a..62604b1 100644
--- a/compress.cpp
+++ b/compress.cpp
@@ -312,7 +312,7 @@ void CompressionTool::encodeAudio(const char *inname, bool rawInput, int rawSamp
 
 void CompressionTool::encodeRaw(const char *rawData, int length, int samplerate, const char *outname, AudioFormat compmode) {
 
-	print(" - len=%ld, ch=%d, rate=%d, %dbits\n", length, (rawAudioType.isStereo ? 2 : 1), samplerate, rawAudioType.bitsPerSample);
+	print(" - len=%ld, ch=%d, rate=%d, %dbits", length, (rawAudioType.isStereo ? 2 : 1), samplerate, rawAudioType.bitsPerSample);
 
 #ifdef USE_VORBIS
 	if (compmode == AUDIO_VORBIS) {
@@ -510,9 +510,9 @@ void CompressionTool::encodeRaw(const char *rawData, int length, int samplerate,
 		vorbis_info_clear(&vi);
 
 		if (!oggparms.silent) {
-			print("\nDone encoding file \"%s\"\n", outname);
-			print("\n\tFile length:  %dm %ds\n", (int)(totalSamples / samplerate / 60), (totalSamples / samplerate % 60));
-			print("\tAverage bitrate: %.1f kb/s\n\n", (8.0 * (double)totalBytes / 1000.0) / ((double)totalSamples / (double)samplerate));
+			print("\nDone encoding file \"%s\"", outname);
+			print("\n\tFile length:  %dm %ds", (int)(totalSamples / samplerate / 60), (totalSamples / samplerate % 60));
+			print("\tAverage bitrate: %.1f kb/s\n", (8.0 * (double)totalBytes / 1000.0) / ((double)totalSamples / (double)samplerate));
 		}
 	}
 #endif
@@ -544,7 +544,7 @@ void CompressionTool::encodeRaw(const char *rawData, int length, int samplerate,
 		}
 
 		if (!flacparms.silent) {
-			print("Encoding to\n         \"%s\"\nat compression level %d using blocksize %d\n\n", outname, flacparms.compressionLevel, flacparms.blocksize);
+			print("Encoding to\n         \"%s\"\nat compression level %d using blocksize %d\n", outname, flacparms.compressionLevel, flacparms.blocksize);
 		}
 
 		encoder = FLAC__stream_encoder_new();
@@ -562,7 +562,7 @@ void CompressionTool::encodeRaw(const char *rawData, int length, int samplerate,
 
 		if (initStatus != FLAC__STREAM_ENCODER_INIT_STATUS_OK) {
 			char buf[2048];
-			sprintf(buf, "Error in FLAC encoder. (check the parameters)\nExact error was:%s\n", FLAC__StreamEncoderInitStatusString[initStatus]);
+			sprintf(buf, "Error in FLAC encoder. (check the parameters)\nExact error was:%s", FLAC__StreamEncoderInitStatusString[initStatus]);
 			free(flacData);
 			throw ToolException(buf);
 		} else {
@@ -575,8 +575,8 @@ void CompressionTool::encodeRaw(const char *rawData, int length, int samplerate,
 		free(flacData);
 
 		if (!flacparms.silent) {
-			print("\nDone encoding file \"%s\"\n", outname);
-			print("\n\tFile length:  %dm %ds\n\n", (int)(samplesPerChannel / samplerate / 60), (samplesPerChannel / samplerate % 60));
+			print("\nDone encoding file \"%s\"", outname);
+			print("\n\tFile length:  %dm %ds\n", (int)(samplesPerChannel / samplerate / 60), (samplesPerChannel / samplerate % 60));
 		}
 	}
 #endif
@@ -724,7 +724,7 @@ void CompressionTool::extractAndEncodeVOC(const char *outName, Common::File &inp
 		}
 
 		/* Sound Data */
-		print(" Sound Data\n");
+		print(" Sound Data");
 		length = input.readChar();
 		length |= input.readChar() << 8;
 		length |= input.readChar() << 16;
@@ -746,9 +746,9 @@ void CompressionTool::extractAndEncodeVOC(const char *outName, Common::File &inp
 			input.readUint32LE();
 		}
 
-		print(" - length = %d\n", length);
-		print(" - sample rate = %d (%02x)\n", real_samplerate, sample_rate);
-		print(" - compression = %s (%02x)\n",
+		print(" - length = %d", length);
+		print(" - sample rate = %d (%02x)", real_samplerate, sample_rate);
+		print(" - compression = %s (%02x)",
 			   (comp ==	   0 ? "8bits"   :
 				(comp ==   1 ? "4bits"   :
 				 (comp ==  2 ? "2.6bits" :
diff --git a/encode_dxa.cpp b/encode_dxa.cpp
index 8d59be3..9e7aa69 100644
--- a/encode_dxa.cpp
+++ b/encode_dxa.cpp
@@ -572,7 +572,7 @@ void EncodeDXA::execute() {
 	// read some data from the Bink or Smacker file.
 	readVideoInfo(&inpath, width, height, framerate, frames, scaleMode);
 
-	print("Width = %d, Height = %d, Framerate = %d, Frames = %d\n",
+	print("Width = %d, Height = %d, Framerate = %d, Frames = %d",
 		   width, height, framerate, frames);
 
 	// create the encoder object
@@ -640,7 +640,7 @@ void EncodeDXA::execute() {
 		}
 	}
 
-	print("Encoding video...100%% (%d of %d)\n", frames, frames);
+	print("Encoding video...100%% (%d of %d)", frames, frames);
 }
 
 int EncodeDXA::read_png_file(const char* filename, unsigned char *&image, unsigned char *&palette, int &width, int &height) {
diff --git a/engines/agos/compress_agos.cpp b/engines/agos/compress_agos.cpp
index 8fa1b31..c6678e1 100644
--- a/engines/agos/compress_agos.cpp
+++ b/engines/agos/compress_agos.cpp
@@ -113,11 +113,11 @@ uint32 CompressAgos::get_sound(uint32 offset) {
 
 	_input.read_throwsOnError(buf, 8);
 	if (!memcmp(buf, "Creative", 8)) {
-		print("VOC found (pos = %d) :\n", offset);
+		print("VOC found (pos = %d) :", offset);
 		_input.seek(18, SEEK_CUR);
 		extractAndEncodeVOC(TEMP_RAW, _input, _format);
 	} else if (!memcmp(buf, "RIFF", 4)) {
-		print("WAV found (pos = %d) :\n", offset);
+		print("WAV found (pos = %d) :", offset);
 		extractAndEncodeWAV(TEMP_WAV, _input, _format);
 	} else {
 		error("Unexpected data at offset: %d", offset);
diff --git a/engines/agos/extract_agos.cpp b/engines/agos/extract_agos.cpp
index ba55504..db5f9d6 100644
--- a/engines/agos/extract_agos.cpp
+++ b/engines/agos/extract_agos.cpp
@@ -58,7 +58,7 @@ void ExtractAgos::execute() {
 		} else {
 			free(x);
 			free(out);
-			error("%s: decrunch error\n", infilename.getFullPath().c_str());
+			error("%s: decrunch error", infilename.getFullPath().c_str());
 		}
 	}
 }
diff --git a/engines/cge/extract_cge.cpp b/engines/cge/extract_cge.cpp
index b7442be..2dffa98 100644
--- a/engines/cge/extract_cge.cpp
+++ b/engines/cge/extract_cge.cpp
@@ -55,18 +55,18 @@ void ExtractCge::readData(Common::File &f, byte *buff, int size) {
 }
 
 void ExtractCge::unpack() {
-	print("Unpacking...\n");
+	print("Unpacking...");
 
 	BtPage btPage;
 
 	Common::File volCat(_inputPaths[0].path, "rb");
 	if (!volCat.isOpen()) {
-		error("Unable to open vol.cat\n");
+		error("Unable to open vol.cat");
 	}
 
 	Common::File volDat(_inputPaths[1].path, "rb");
 	if (!volDat.isOpen()) {
-		error("Unable to open vol.dat\n");
+		error("Unable to open vol.dat");
 	}
 
 	// We always need to setup default output path, since there is no obligation to specify it
@@ -76,7 +76,7 @@ void ExtractCge::unpack() {
 	_outputPath.setFullName("files.txt");
 	Common::File fFiles(_outputPath, "w");
 	if (!fFiles.isOpen()) {
-		error("Unable to create files.txt\n");
+		error("Unable to create files.txt");
 	}
 
 	// Get in a list of pages individual files will be on
diff --git a/engines/cge/pack_cge.cpp b/engines/cge/pack_cge.cpp
index 3dc4372..8bd38ab 100644
--- a/engines/cge/pack_cge.cpp
+++ b/engines/cge/pack_cge.cpp
@@ -58,7 +58,7 @@ void PackCge::writeData(Common::File &f, byte *buff, int size) {
 
 void PackCge::pack() {
 	BtPage btPage;
-	print("Packing...\n");
+	print("Packing...");
 	
 	Common::Filename inPath(_inputPaths[0].path);
 
@@ -68,7 +68,7 @@ void PackCge::pack() {
 	inPath.setFullName("files.txt");
 	Common::File fIn(inPath, "r");
 	if (!fIn.isOpen()) {
-		error("Unable to open %s\n", inPath.getFullPath().c_str());
+		error("Unable to open %s", inPath.getFullPath().c_str());
 	}
 
 	while (!fIn.eos()) {
@@ -85,12 +85,12 @@ void PackCge::pack() {
 	_outputPath.setFullName("vol.cat");
 	Common::File volCat(_outputPath, "wb");
 	if (!volCat.isOpen()) {
-		error("Unable to create %s\n", _outputPath.getFullPath().c_str());
+		error("Unable to create %s", _outputPath.getFullPath().c_str());
 	}
 	_outputPath.setFullName("vol.dat");
 	Common::File volDat(_outputPath, "wb");
 	if (!volDat.isOpen()) {
-		error("Unable to create %s\n", _outputPath.getFullPath().c_str());
+		error("Unable to create %s", _outputPath.getFullPath().c_str());
 	}
 
 	/* Build the index page */
@@ -138,7 +138,7 @@ void PackCge::pack() {
 			inPath.setFullName(fname);
 			fIn.open(inPath, "rb");
 			if (!fIn.isOpen()) {
-				error("Error opening %s\n", inPath.getFullPath().c_str());
+				error("Error opening %s", inPath.getFullPath().c_str());
 			}
 			int fileSize = fIn.size();
 			fIn.seek(0, SEEK_SET);
diff --git a/engines/cine/extract_cine.cpp b/engines/cine/extract_cine.cpp
index 9ba6093..0224a41 100644
--- a/engines/cine/extract_cine.cpp
+++ b/engines/cine/extract_cine.cpp
@@ -222,7 +222,7 @@ void ExtractCine::unpackFile(Common::File &file) {
 		} else {
 			print("ok");
 		}
-		print(", packedSize %u unpackedSize %u\n", packedSize, unpackedSize);
+		print(", packedSize %u unpackedSize %u", packedSize, unpackedSize);
 		file.seek(savedPos, SEEK_SET);
 	}
 }
@@ -280,14 +280,14 @@ void ExtractCine::unpackAllResourceFiles(const Common::Filename &filename) {
 
 	unsigned int resourceFilesCount = READ_BE_UINT16(&buf[0]);
 	unsigned int entrySize = READ_BE_UINT16(&buf[2]);
-	print("--- Unpacking all %d resource files from 'vol.cnf' (entrySize = %d):\n", resourceFilesCount, entrySize);
+	print("--- Unpacking all %d resource files from 'vol.cnf' (entrySize = %d):", resourceFilesCount, entrySize);
 	char resourceFileName[9];
 	for (unsigned int i = 0; i < resourceFilesCount; ++i) {
 		memcpy(resourceFileName, &buf[4 + i * entrySize], 8);
 		resourceFileName[8] = 0;
 
 		Common::File fpResFile(resourceFileName, "rb");
-		print("--- Unpacking resource file %s:\n", resourceFileName);
+		print("--- Unpacking resource file %s:", resourceFileName);
 		unpackFile(fpResFile);
 	}
 
diff --git a/engines/cruise/extract_cruise_pc.cpp b/engines/cruise/extract_cruise_pc.cpp
index 6eb01ef..4ffcba6 100644
--- a/engines/cruise/extract_cruise_pc.cpp
+++ b/engines/cruise/extract_cruise_pc.cpp
@@ -239,10 +239,10 @@ void ExtractCruisePC::execute() {
 	if (!stream.readHeader(&hdr)) {
 		error("Invalid file signature");
 	}
-	print("Output filename '%s'\n", hdr.name);
-	print("Date %02d/%02d/%04d\n", hdr.creationDate & 31, (hdr.creationDate >> 5) & 15, ((hdr.creationDate >> 9) & 127) + 1980);
-	print("Time %02d:%02d:%02d\n", (hdr.creationTime >> 11) & 31, (hdr.creationTime >> 5) & 63, (hdr.creationTime & 31) << 1);
-	print("Size %d (uncompressed %d)\n", hdr.compressedSize, hdr.uncompressedSize);
+	print("Output filename '%s'", hdr.name);
+	print("Date %02d/%02d/%04d", hdr.creationDate & 31, (hdr.creationDate >> 5) & 15, ((hdr.creationDate >> 9) & 127) + 1980);
+	print("Time %02d:%02d:%02d", (hdr.creationTime >> 11) & 31, (hdr.creationTime >> 5) & 63, (hdr.creationTime & 31) << 1);
+	print("Size %d (uncompressed %d)", hdr.compressedSize, hdr.uncompressedSize);
 
 	_outputPath.setFullName(hdr.name);
 	Common::File output(_outputPath, "wb");
@@ -250,9 +250,9 @@ void ExtractCruisePC::execute() {
 	Disk1Decoder d(&stream, &output, hdr.uncompressedSize);
 	print("Decompressing...");
 	if (d.decode()) {
-		print("Ok\n");
+		print("Ok");
 	} else {
-		print("Error\n");
+		print("Error");
 	}
 }
 
diff --git a/engines/gob/compress_gob.cpp b/engines/gob/compress_gob.cpp
index 7630a57..873fb4d 100644
--- a/engines/gob/compress_gob.cpp
+++ b/engines/gob/compress_gob.cpp
@@ -128,7 +128,7 @@ CompressGob::Chunk *CompressGob::readChunkConf(Common::File &gobConf, Common::Fi
 	else if (signature != confSTK10)
 		error("Unknown format signature %s", signature.c_str());
 
-	print("Checking duplicate files\n");
+	print("Checking duplicate files");
 
 // All the other reads concern file + compression flag
 	gobConf.scanString(buffer);
@@ -157,7 +157,7 @@ CompressGob::Chunk *CompressGob::readChunkConf(Common::File &gobConf, Common::Fi
 // If files are identical, use the same compressed chunk instead of re-compressing the same thing
 					curChunk->packed = 2;
 					curChunk->replChunk = parseChunk;
-					print("Identical files : %s %s (%d bytes)\n", curChunk->name, parseChunk->name, curChunk->realSize);
+					print("Identical files : %s %s (%d bytes)", curChunk->name, parseChunk->name, curChunk->realSize);
 					break;
 				}
 			}
@@ -212,7 +212,7 @@ void CompressGob::writeBody(Common::Filename *inpath, Common::File &stk, Chunk *
 		src.open(*inpath, "rb");
 
 		if (curChunk->packed == 2)
-			print("Identical file %12s\t(compressed size %d bytes)\n", curChunk->name, curChunk->replChunk->size);
+			print("Identical file %12s\t(compressed size %d bytes)", curChunk->name, curChunk->replChunk->size);
 
 		curChunk->offset = stk.pos();
 		if (curChunk->packed == 1) {
@@ -224,14 +224,14 @@ void CompressGob::writeBody(Common::Filename *inpath, Common::File &stk, Chunk *
 				stk.seek(curChunk->offset, SEEK_SET);
 				src.rewind();
 			} else
-				print("Compressing %12s\t%d -> %d bytes\n", curChunk->name, curChunk->realSize, curChunk->size);
+				print("Compressing %12s\t%d -> %d bytes", curChunk->name, curChunk->realSize, curChunk->size);
 
 		}
 
 		if (curChunk->packed == 0) {
 			tmpSize = 0;
 			curChunk->size = writeBodyStoreFile(stk, src);
-			print("Storing %12s\t%d bytes\n", curChunk->name, curChunk->size);
+			print("Storing %12s\t%d bytes", curChunk->name, curChunk->size);
 		}
 		curChunk = curChunk->next;
 	}
diff --git a/engines/gob/extract_gob_stk.cpp b/engines/gob/extract_gob_stk.cpp
index 2218c56..7a5647c 100644
--- a/engines/gob/extract_gob_stk.cpp
+++ b/engines/gob/extract_gob_stk.cpp
@@ -88,7 +88,7 @@ void ExtractGobStk::execute() {
 	stk.read_throwsOnError(signature, 6);
 
 	if (strncmp(signature, "STK2.1", 6) == 0) {
-		print("Signature of new STK format (STK 2.1) detected in file \"%s\"\n", inpath.getFullPath().c_str());
+		print("Signature of new STK format (STK 2.1) detected in file \"%s\"", inpath.getFullPath().c_str());
 		gobConf.print("%s\n", confSTK21);
 		readChunkListV2(stk, gobConf);
 	} else {
@@ -97,7 +97,7 @@ void ExtractGobStk::execute() {
 		readChunkList(stk, gobConf);
 	}
 
-	print("config file created: %s\n", _outputPath.getFullPath().c_str());
+	print("config file created: %s", _outputPath.getFullPath().c_str());
 
 	extractChunks(_outputPath, stk);
 }
@@ -262,7 +262,7 @@ void ExtractGobStk::extractChunks(Common::Filename &outpath, Common::File &stk)
 	byte *unpackedData = NULL;
 
 	while (curChunk != 0) {
-		print("Extracting \"%s\"\n", curChunk->name);
+		print("Extracting \"%s\"", curChunk->name);
 
 		outpath.setFullName(curChunk->name);
 		Common::File chunkFile(outpath, "wb");
diff --git a/engines/kyra/compress_kyra.cpp b/engines/kyra/compress_kyra.cpp
index 6e3418b..f7a23ba 100644
--- a/engines/kyra/compress_kyra.cpp
+++ b/engines/kyra/compress_kyra.cpp
@@ -114,7 +114,7 @@ void CompressKyra::process(Common::Filename *infile, Common::Filename *outfile)
 	if (output.getFileList())
 		output.saveFile(outfile->getFullPath().c_str());
 	else
-		print("file '%s' doesn't contain any .voc files\n", infile->getFullPath().c_str());
+		print("file '%s' doesn't contain any .voc files", infile->getFullPath().c_str());
 }
 
 // Kyra3 specifc code
@@ -282,7 +282,7 @@ void CompressKyra::compressAUDFile(Common::File &input, const char *outfile) {
 	header.size = input.readUint32LE();
 	header.flags = input.readByte();
 	header.type = input.readByte();
-	//print("%d Hz, %d bytes, type %d (%08X)\n", header.freq, header.size, header.type, header.flags);
+	//print("%d Hz, %d bytes, type %d (%08X)", header.freq, header.size, header.type, header.flags);
 
 	Common::File output(TEMP_RAW, "wb");
 
diff --git a/engines/parallaction/extract_parallaction.cpp b/engines/parallaction/extract_parallaction.cpp
index 55288c1..9d2b60f 100644
--- a/engines/parallaction/extract_parallaction.cpp
+++ b/engines/parallaction/extract_parallaction.cpp
@@ -151,7 +151,7 @@ void Archive::open(const char *filename, bool smallArchive) {
 
 	_numSlots = i;
 
-	_tool.print("%i files found in %i slots (%i empty)\n", _numFiles, _numSlots, _numSlots - _numFiles);
+	_tool.print("%i files found in %i slots (%i empty)", _numFiles, _numSlots, _numSlots - _numFiles);
 
 	_file.seek(_numSlots * ARCHIVE_FILENAME_LEN + ARCHIVE_HEADER_SIZE, SEEK_SET);
 
diff --git a/engines/queen/compress_queen.cpp b/engines/queen/compress_queen.cpp
index 0cd821e..58e95aa 100644
--- a/engines/queen/compress_queen.cpp
+++ b/engines/queen/compress_queen.cpp
@@ -231,7 +231,7 @@ void CompressQueen::execute() {
 		_entry.offset = inputTbl.readUint32BE();
 		_entry.size = inputTbl.readUint32BE();
 
-		print("Processing entry: %s\n", _entry.filename);
+		print("Processing entry: %s", _entry.filename);
 		inputData.seek(_entry.offset, SEEK_SET);
 
 		if (_versionExtra.compression && strstr(_entry.filename, ".SB")) { /* Do we want to compress? */
@@ -253,7 +253,7 @@ void CompressQueen::execute() {
 				headerSize = SB_HEADER_SIZE_V110;
 				break;
 			default:
-				warning("Unhandled SB file version %d, defaulting to 104\n", sbVersion);
+				warning("Unhandled SB file version %d, defaulting to 104", sbVersion);
 				headerSize = SB_HEADER_SIZE_V104;
 				break;
 			}
@@ -292,7 +292,7 @@ void CompressQueen::execute() {
 
 					if (fpPatch.isOpen()) {
 						_entry.size = fpPatch.size();
-						print("Patching entry, new size = %d bytes\n", _entry.size);
+						print("Patching entry, new size = %d bytes", _entry.size);
 						fromFileToFile(fpPatch, outputData, _entry.size);
 						fpPatch.close();
 						patched = true;
diff --git a/engines/saga/compress_saga.cpp b/engines/saga/compress_saga.cpp
index a1d079a..0b5e13e 100644
--- a/engines/saga/compress_saga.cpp
+++ b/engines/saga/compress_saga.cpp
@@ -143,11 +143,11 @@ bool CompressSaga::detectFile(const Common::Filename *infile) {
 	char md5str[32+1];
 
 	Common::md5_file(infile->getFullPath().c_str(), md5sum, FILE_MD5_BYTES);
-	print("Input file name: %s\n", infile->getFullPath().c_str());
+	print("Input file name: %s", infile->getFullPath().c_str());
 	for (j = 0; j < 16; j++) {
 		sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
 	}
-	print("md5: %s\n", md5str);
+	print("md5: %s", md5str);
 
 	for (i = 0; i < gamesCount; i++) {
 		for (j = 0; j < gameDescriptions[i].filesCount; j++) {
@@ -158,7 +158,7 @@ bool CompressSaga::detectFile(const Common::Filename *infile) {
 					_currentGameDescription = &gameDescriptions[i];
 					_currentFileDescription = &_currentGameDescription->filesDescriptions[j];
 
-					print("Matched game: Inherit the Earth: Quest for the Orb\n");
+					print("Matched game: Inherit the Earth: Quest for the Orb");
 					return true;
 				}
 			} else {			// IHNM
@@ -169,13 +169,13 @@ bool CompressSaga::detectFile(const Common::Filename *infile) {
 					_currentGameDescription = &gameDescriptions[i];
 					_currentFileDescription = &_currentGameDescription->filesDescriptions[j];
 
-					print("Matched game: I Have No Mouth, and I Must Scream\n");
+					print("Matched game: I Have No Mouth, and I Must Scream");
 					return true;
 				}
 			}
 		}
 	}
-	print("Unsupported file\n");
+	print("Unsupported file");
 	return false;
 }
 
@@ -348,7 +348,7 @@ void CompressSaga::sagaEncode(Common::Filename *inpath, Common::Filename *outpat
 
 	inputFile.open(*inpath, "rb");
 	inputFileSize = inputFile.size();
-	print("Filesize: %ul\n", inputFileSize);
+	print("Filesize: %ul", inputFileSize);
 	/*
 	 * At the end of the resource file there are 2 values: one points to the
 	 * beginning of the resource table the other gives the number of
@@ -364,7 +364,7 @@ void CompressSaga::sagaEncode(Common::Filename *inpath, Common::Filename *outpat
 		resTableCount = inputFile.readUint32BE();
 	}
 
-	print("Table offset: %ul\nnumber of records: %ul\n", resTableOffset, resTableCount);
+	print("Table offset: %ul\nnumber of records: %ul", resTableOffset, resTableCount);
 	if (resTableOffset != inputFileSize - RSC_TABLEINFO_SIZE - RSC_TABLEENTRY_SIZE * resTableCount) {
 		error("Something's wrong with your resource file");
 	}
@@ -385,7 +385,7 @@ void CompressSaga::sagaEncode(Common::Filename *inpath, Common::Filename *outpat
 			inputTable[i].size = inputFile.readUint32BE();
 		}
 
-		print("Record: %ul, offset: %ul, size: %ul\n", i, inputTable[i].offset, inputTable[i].size);
+		print("Record: %ul, offset: %ul, size: %ul", i, inputTable[i].offset, inputTable[i].size);
 
 		if ((inputTable[i].offset > inputFileSize) ||
 			(inputTable[i].offset + inputTable[i].size > inputFileSize)) {
@@ -433,7 +433,7 @@ void CompressSaga::sagaEncode(Common::Filename *inpath, Common::Filename *outpat
 	Common::removeFile(TEMP_RAW);
 	Common::removeFile(tempEncoded);
 
-	print("Done!\n");
+	print("Done!");
 }
 
 void CompressSaga::execute() {
diff --git a/engines/sci/compress_sci.cpp b/engines/sci/compress_sci.cpp
index f944b1f..e6d695e 100644
--- a/engines/sci/compress_sci.cpp
+++ b/engines/sci/compress_sci.cpp
@@ -86,7 +86,7 @@ SciResourceDataType CompressSci::detectData(byte *header, bool compressMode) {
 			buffer[i] = buffer[i + 1];
 		_input.read_throwsOnError(&buffer[offset], 1);
 		_inputOffset++;
-		warning("WAVE resource position adjusted at %lx\n", _inputOffset);
+		warning("WAVE resource position adjusted at %lx", _inputOffset);
 	}
 	if (memcmp(buffer, "RIFF", 4) == 0) {
 		// WAVE files begin with
@@ -132,7 +132,7 @@ SciResourceDataType CompressSci::detectData(byte *header, bool compressMode) {
 	if (!searchForward) {
 		searchForward = 2048;
 		if (!compressMode)
-			warning("possibly raw lipsync data found at offset %lx\n", _input.pos());
+			warning("possibly raw lipsync data found at offset %lx", _input.pos());
 		noSignature = true;
 	}
 
@@ -244,7 +244,7 @@ void CompressSci::compressData(SciResourceDataType dataType) {
 
 	switch (dataType) {
 	case kSciResourceDataTypeWAVE:
-		print("WAVE found\n");
+		print("WAVE found");
 		if (!Audio::loadWAVFromStream(_input, sampleDataSize, sampleRate, sampleFlags))
 			error("Unable to read WAV at offset %lx", _inputOffset);
 
@@ -294,7 +294,7 @@ void CompressSci::compressData(SciResourceDataType dataType) {
 		_input.read_throwsOnError(sampleData, sampleDataSize);
 		break;
 	case kSciResourceTypeTypeSync:
-		print("SYNC found at %lx\n", _inputOffset);
+		print("SYNC found at %lx", _inputOffset);
 		// Simply copy original data over
 		newDataSize = orgDataSize;
 		newData = new byte[newDataSize];
@@ -330,7 +330,7 @@ uint CompressSci::parseRawAudioMap() {
 	// Assume the map is in the same dir as the resource file
 	// and is called AUDIO001.MAP
 	mapFileName.setFullName("AUDIO001.MAP");
-	print("Trying %s as resource map\n", mapFileName.getFullPath().data());
+	print("Trying %s as resource map", mapFileName.getFullPath().data());
 	Common::File mapFile;
 	mapFile.open(mapFileName, "rb");
 	uint32 offset = 0;
@@ -361,15 +361,15 @@ void CompressSci::execute() {
 	_inputOffset = 0;
 	_input.read_throwsOnError(&header, 6);
 	if (memcmp(header, "MP3 ", 4) == 0)
-		error("This resource file is already MP3-compressed, aborting...\n");
+		error("This resource file is already MP3-compressed, aborting...");
 	if (memcmp(header, "OGG ", 4) == 0)
-		error("This resource file is already OGG-compressed, aborting...\n");
+		error("This resource file is already OGG-compressed, aborting...");
 	if (memcmp(header, "FLAC", 4) == 0)
-		error("This resource file is already FLAC-compressed, aborting...\n");
+		error("This resource file is already FLAC-compressed, aborting...");
 
 	int resourceCount = 0;
 	if (_input.size() == 97103872 || _input.size() == 23126016) {
-		print("Size matches KQ5 or Jones in the Fast Lane audio file, assuming raw audio\n");
+		print("Size matches KQ5 or Jones in the Fast Lane audio file, assuming raw audio");
 		_rawAudio = true;
 		resourceCount = parseRawAudioMap();
 	} else {
@@ -390,9 +390,9 @@ void CompressSci::execute() {
 
 	// This case happens on pharkas resource.sfx
 	if (_inputOffset != _inputSize)
-		warning("resource file has additional byte before end-of-file\n");
+		warning("resource file has additional byte before end-of-file");
 
-	print("Valid sci audio resource file. Found %d resources\n", resourceCount);
+	print("Valid sci audio resource file. Found %d resources", resourceCount);
 
 	if (outfile.empty())
 		error("please specify an output file");
diff --git a/engines/scumm/compress_scumm_bun.cpp b/engines/scumm/compress_scumm_bun.cpp
index bcec206..d59fca8 100644
--- a/engines/scumm/compress_scumm_bun.cpp
+++ b/engines/scumm/compress_scumm_bun.cpp
@@ -1160,7 +1160,7 @@ void CompressScummBun::execute() {
 
 	free(_bundleTable);
 
-	print("compression done.\n");
+	print("compression done.");
 }
 
 #ifdef STANDALONE_MAIN
diff --git a/engines/scumm/compress_scumm_san.cpp b/engines/scumm/compress_scumm_san.cpp
index 81e3772..842ea7a 100644
--- a/engines/scumm/compress_scumm_san.cpp
+++ b/engines/scumm/compress_scumm_san.cpp
@@ -161,7 +161,7 @@ void CompressScummSan::flushTracks(int frame) {
 void CompressScummSan::prepareForMixing(const std::string &outputDir, const std::string &inputFilename) {
 	char filename[200];
 
-	print("Decompressing tracks files...\n");
+	print("Decompressing tracks files...");
 	for (int l = 0; l < COMPRESS_SCUMM_SAN_MAX_TRACKS; l++) {
 		if (_audioTracks[l].used) {
 			_audioTracks[l].file.close();
@@ -289,12 +289,12 @@ void CompressScummSan::mixing(const std::string &outputDir, const std::string &i
 		error("Unsupported fps value %d", fps);
 	}
 
-	print("Creating silent wav file...\n");
+	print("Creating silent wav file...");
 	for (l = 0; l < frameAudioSize * frames; l++) {
 		wavFile.writeByte(0);
 	}
 
-	print("Mixing tracks into wav file...\n");
+	print("Mixing tracks into wav file...");
 	for (l = 0; l < COMPRESS_SCUMM_SAN_MAX_TRACKS; l++) {
 		if (_audioTracks[l].used) {
 			char filename[200];
@@ -632,13 +632,13 @@ void CompressScummSan::execute() {
 	int fps = 0;
 	uint32 inputSize = input.size();
 
-	print("Frames: %d\n", nbframes);
+	print("Frames: %d", nbframes);
 
 	for (l = 0; l < nbframes; l++) {
 		// Compression takes place in this loops, which takes the most time by far
 		updateProgress(l, nbframes);
 
-		print("frame: %d\n", l);
+		print("frame: %d", l);
 		bool first_fobj = true;
 		uint32 tag = input.readUint32BE(); // chunk tag
 		assert(tag == 'FRME');
@@ -730,7 +730,7 @@ skip:
 
 				// Some files have garbage at the end
 				if ((uint32)(size + input.pos()) > inputSize) {
-					print("Skipping rest of the file (%d bytes)\n", inputSize - input.pos());
+					print("Skipping rest of the file (%d bytes)", inputSize - input.pos());
 					break;
 				}
 
@@ -765,7 +765,7 @@ skip:
 
 	input.close();
 
-	print("Fixing frames header...\n");
+	print("Fixing frames header...");
 	int32 sumDiff = 0;
 	for (l = 0; l < nbframes; l++) {
 		int32 diff = 0;
@@ -783,15 +783,15 @@ skip:
 		if (diff != 0)
 			output.writeUint32BE(frameInfo[l].frameSize - diff);
 	}
-	print("done.\n");
+	print("done.");
 
-	print("Fixing anim header...\n");
+	print("Fixing anim header...");
 	output.seek(4, SEEK_SET);
 	output.writeUint32BE(animChunkSize - sumDiff);
-	print("done.\n");
+	print("done.");
 
 	if (flu_in.isOpen()) {
-		print("Fixing flu offsets...\n");
+		print("Fixing flu offsets...");
 		int fsize = flu_in.size();
 		for (int k = 0; k < fsize; k++) {
 			flu_out.writeByte(flu_in.readByte());
@@ -800,12 +800,12 @@ skip:
 		for (l = 0; l < nbframes; l++) {
 			flu_out.writeUint32LE(frameInfo[l].offsetOutput - 4);
 		}
-		print("done.\n");
+		print("done.");
 	}
 
 	free(frameInfo);
 
-	print("compression done.\n");
+	print("compression done.");
 }
 
 #ifdef STANDALONE_MAIN
diff --git a/engines/scumm/extract_loom_tg16.cpp b/engines/scumm/extract_loom_tg16.cpp
index 061d941..58e588f 100644
--- a/engines/scumm/extract_loom_tg16.cpp
+++ b/engines/scumm/extract_loom_tg16.cpp
@@ -1226,15 +1226,15 @@ void ExtractLoomTG16::execute() {
 	case 0x29EED3C5: // dumpcd
 	case 0xE70FA498: // turborip
 		ISO = ISO_USA;
-		print("ISO contents verified as Loom USA (track 2)\n");
+		print("ISO contents verified as Loom USA (track 2)");
 		break;
 	case 0xD7B5F808: // dumpcd
 	case 0xCA757D06: // turborip
 		ISO = ISO_JPN;
-		print("ISO contents verified as Loom Japan (track 2)\n");
+		print("ISO contents verified as Loom Japan (track 2)");
 		break;
 	default:
-		error("ISO contents not recognized\n");
+		error("ISO contents not recognized");
 		break;
 	}
 #ifdef	MAKE_LFLS
@@ -1248,7 +1248,7 @@ void ExtractLoomTG16::execute() {
 
 		Common::File output(_outputPath, "wb");
 
-		print("Creating %s...\n", fname);
+		print("Creating %s...", fname);
 		for (int j = 0; lfl->entries[j] != NULL; j++) {
 			p_resource entry = lfl->entries[j];
 			switch (entry->type) {
@@ -1280,7 +1280,7 @@ void ExtractLoomTG16::execute() {
 
 	_outputPath.setFullName("00.LFL");
 	Common::File output(_outputPath, "wb");
-	print("Creating 00.LFL...\n");
+	print("Creating 00.LFL...");
 
 	lfl_index.num_rooms = NUM_ROOMS;
 	lfl_index.num_costumes = NUM_COSTUMES;
@@ -1329,17 +1329,17 @@ void ExtractLoomTG16::execute() {
 
 	_outputPath.setFullName("97.LFL");
 	output.open(_outputPath, "wb");
-	print("Creating 97.LFL...\n");
+	print("Creating 97.LFL...");
 	extract_resource(input, output, &res_charset);
 
 	_outputPath.setFullName("98.LFL");
 	output.open(_outputPath, "wb");
-	print("Creating 98.LFL...\n");
+	print("Creating 98.LFL...");
 	extract_resource(input, output, &res_charset);
 
 	_outputPath.setFullName("99.LFL");
 	output.open(_outputPath, "wb");
-	print("Creating 99.LFL...\n");
+	print("Creating 99.LFL...");
 	extract_resource(input, output, &res_charset);
 
 #else // !MAKE_LFLS
diff --git a/engines/scumm/extract_mm_apple.cpp b/engines/scumm/extract_mm_apple.cpp
index 81d68ee..1ef9e5a 100644
--- a/engines/scumm/extract_mm_apple.cpp
+++ b/engines/scumm/extract_mm_apple.cpp
@@ -88,7 +88,7 @@ void ExtractMMApple::execute() {
 	Common::File output(outpath, "wb");
 	// All output should be xored
 	output.setXorMode(0xFF);
-	print("Creating 00.LFL...\n");
+	print("Creating 00.LFL...");
 
 	/* write signature */
 	output.writeUint16LE(signature);
@@ -143,7 +143,7 @@ void ExtractMMApple::execute() {
 		outpath.setFullName(fname);
 		output.open(outpath, "wb");
 
-		print("Creating %s...\n", fname);
+		print("Creating %s...", fname);
 		input->seek((SectorOffset[room_tracks_apple[i]] + room_sectors_apple[i]) * 256, SEEK_SET);
 
 		for (j = 0; j < ResourcesPerFile[i]; j++) {
diff --git a/engines/scumm/extract_mm_nes.cpp b/engines/scumm/extract_mm_nes.cpp
index f085580..09ced31 100644
--- a/engines/scumm/extract_mm_nes.cpp
+++ b/engines/scumm/extract_mm_nes.cpp
@@ -1200,7 +1200,7 @@ void ExtractMMNES::dump_resource (Common::File &input, const char *fn_template,
 	char fname[256];
 	sprintf(fname, fn_template, num);
 	Common::File output(fname, "wb");
-	print("Extracting resource to %s\n", fname);
+	print("Extracting resource to %s", fname);
 	extract_resource(input, output, res, type);
 }
 #endif /* MAKE_LFLS */
@@ -1263,37 +1263,37 @@ void ExtractMMNes::execute() {
 	switch (CRC) {
 	case 0x0D9F5BD1:
 		ROMset = ROMSET_USA;
-		print("ROM contents verified as Maniac Mansion (USA)\n");
+		print("ROM contents verified as Maniac Mansion (USA)");
 		break;
 	case 0xF59CFC3D:
 		ROMset = ROMSET_EUROPE;
-		print("ROM contents verified as Maniac Mansion (Europe)\n");
+		print("ROM contents verified as Maniac Mansion (Europe)");
 		break;
 	case 0x3F2BDA65:
 		ROMset = ROMSET_SWEDEN;
-		print("ROM contents verified as Maniac Mansion (Sweden)\n");
+		print("ROM contents verified as Maniac Mansion (Sweden)");
 		break;
 	case 0xF4B70BFE:
 		ROMset = ROMSET_FRANCE;
-		print("ROM contents verified as Maniac Mansion (France)\n");
+		print("ROM contents verified as Maniac Mansion (France)");
 		break;
 	case 0x60EA98A0:
 		ROMset = ROMSET_GERMANY;
-		print("ROM contents verified as Maniac Mansion (Germany)\n");
+		print("ROM contents verified as Maniac Mansion (Germany)");
 		break;
 	case 0xF5B2AFCA:
 		ROMset = ROMSET_SPAIN;
-		print("ROM contents verified as Maniac Mansion (Spain)\n");
+		print("ROM contents verified as Maniac Mansion (Spain)");
 		break;
 	case 0xDC529482:
 		ROMset = ROMSET_ITALY;
-		print("ROM contents verified as Maniac Mansion (Italy)\n");
+		print("ROM contents verified as Maniac Mansion (Italy)");
 		break;
 	case 0x3DA2085E:
-		error("Maniac Mansion (Japan) is not supported\n");
+		error("Maniac Mansion (Japan) is not supported");
 		break;
 	default:
-		error("ROM contents not recognized (%08X)\n", CRC);
+		error("ROM contents not recognized (%08X)", CRC);
 		break;
 	}
 
@@ -1310,7 +1310,7 @@ void ExtractMMNes::execute() {
 #ifdef MAKE_LFLS
 		output.setXorMode(0xFF);
 #endif
-		print("Creating %s...\n", fname);
+		print("Creating %s...", fname);
 
 		for (j = 0; lfl->entries[j].type != NULL; j++) {
 			const struct t_lflentry *entry = &lfl->entries[j];
@@ -1381,7 +1381,7 @@ void ExtractMMNes::execute() {
 #ifdef MAKE_LFLS
 	output.setXorMode(0xFF);
 #endif
-	print("Creating 00.LFL...\n");
+	print("Creating 00.LFL...");
 
 	output.writeUint16LE(0x4643);
 	extract_resource(input, output, &res_globdata.langs[ROMset][0], res_globdata.type);
@@ -1412,7 +1412,7 @@ void ExtractMMNes::execute() {
 	for (i = 0; i < 2; i++)
 		dump_resource(input, "sproffs-%d.dmp", i, &res_sproffs.langs[ROMset][i], res_sproffs.type);
 #endif	/* MAKE_LFLS */
-	print("All done!\n");
+	print("All done!");
 }
 
 #ifdef STANDALONE_MAIN
diff --git a/engines/scumm/extract_scumm_mac.cpp b/engines/scumm/extract_scumm_mac.cpp
index d641cb8..76a2e39 100644
--- a/engines/scumm/extract_scumm_mac.cpp
+++ b/engines/scumm/extract_scumm_mac.cpp
@@ -116,11 +116,11 @@ void ExtractScummMac::execute() {
 
 		if (j == 0x20) {
 			file_name[0x1f] = 0;
-			warning("\'%s\'. file name not null terminated.\n", file_name);
-			print("data file \'%s\' may be not a file extract_scumm_mac can extract.\n", inpath.getFullPath().c_str());
+			warning("\'%s\'. file name not null terminated.", file_name);
+			print("data file \'%s\' may be not a file extract_scumm_mac can extract.", inpath.getFullPath().c_str());
 		}
 
-		print(", saving as \'%s\'\n", file_name);
+		print(", saving as \'%s\'", file_name);
 
 		/* Consistency check. make sure the file data is in the file */
 		if (file_off + file_len > data_file_len) {
diff --git a/engines/scumm/extract_zak_c64.cpp b/engines/scumm/extract_zak_c64.cpp
index 86daee6..c5a0f14 100644
--- a/engines/scumm/extract_zak_c64.cpp
+++ b/engines/scumm/extract_zak_c64.cpp
@@ -84,7 +84,7 @@ void ExtractZakC64::execute() {
 	outpath.setFullName("00.LFL");
 	Common::File output(outpath, "wb");
 	output.setXorMode(0xFF);
-	print("Creating 00.LFL...\n");
+	print("Creating 00.LFL...");
 
 	/* write signature */
 	output.writeUint16LE(signature);
@@ -139,7 +139,7 @@ void ExtractZakC64::execute() {
 		outpath.setFullName(fname);
 		output.open(outpath, "wb");
 
-		print("Creating %s...\n", fname);
+		print("Creating %s...", fname);
 		input->seek((SectorOffset[room_tracks_c64[i]] + room_sectors_c64[i]) * 256, SEEK_SET);
 
 		for (j = 0; j < ResourcesPerFile[i]; j++) {
@@ -158,7 +158,7 @@ void ExtractZakC64::execute() {
 		input->rewind();
 	}
 
-	print("All done!\n");
+	print("All done!");
 }
 
 #ifdef STANDALONE_MAIN
diff --git a/engines/sword1/compress_sword1.cpp b/engines/sword1/compress_sword1.cpp
index 065a0aa..332927b 100644
--- a/engines/sword1/compress_sword1.cpp
+++ b/engines/sword1/compress_sword1.cpp
@@ -432,14 +432,14 @@ void CompressSword1::convertClu(Common::File &clu, Common::File &cl3) {
 	sampleIndex = cowHeader + numRooms + 1;
 	/* This points to the sample index table. 8 bytes each (4 bytes size and then 4 bytes file index) */
 
-	print("converting %d samples\n", numSamples);
+	print("converting %d samples", numSamples);
 
 	for (cnt = 0; cnt < numSamples; cnt++) {
 		if (sampleIndex[cnt << 1] | sampleIndex[(cnt << 1) | 1]) {
-			print("sample %5d: \n", cnt);
+			print("sample %5d: ", cnt);
 			smpData = (uint8*)uncompressSpeech(clu, sampleIndex[cnt << 1] + headerSize, sampleIndex[(cnt << 1) | 1], &smpSize);
 			if ((!smpData) || (!smpSize))
-				error("unable to handle speech sample %d!\n", cnt);
+				error("unable to handle speech sample %d!", cnt);
 
 			mp3Data = convertData(smpData, smpSize, &mp3Size);
 			cl3Index[cnt << 1] = cl3.pos();
@@ -450,7 +450,7 @@ void CompressSword1::convertClu(Common::File &clu, Common::File &cl3) {
 			free(mp3Data);
 		} else {
 			cl3Index[cnt << 1] = cl3Index[(cnt << 1) | 1] = 0;
-			print("sample %5d: skipped\n", cnt);
+			print("sample %5d: skipped", cnt);
 		}
 	}
 	cl3.seek((numRooms + 2) * 4, SEEK_SET);	/* Now write the sample index into the CL3 file */
@@ -482,8 +482,8 @@ void CompressSword1::compressSpeech(const Common::Filename *inpath, const Common
 			try {
 				clu.open(cluName, "rb");
 			} catch (Common::FileException &) {
-				print("Unable to open \"SPEECH%d.CLU\".\n", i);
-				print("Please copy the \"SPEECH.CLU\" from CD %d\nand rename it to \"SPEECH%d.CLU\".\n", i, i);
+				print("Unable to open \"SPEECH%d.CLU\".", i);
+				print("Please copy the \"SPEECH.CLU\" from CD %d\nand rename it to \"SPEECH%d.CLU\".", i, i);
 				continue;
 			}
 		}
@@ -508,18 +508,18 @@ void CompressSword1::compressSpeech(const Common::Filename *inpath, const Common
 			cl3.open(outName, "wb");
 		} catch (Common::FileException &) {
 			// Try opening at root of output directory
-			print("Unable to create file \"%s\".\n", outName);
+			print("Unable to create file \"%s\".", outName);
 			sprintf(outName, "%s/%s", outpath->getPath().c_str(), outFileName);
-			print("Trying \"%s\".\n", outName);
+			print("Trying \"%s\".", outName);
 			try {
 				cl3.open(outName, "wb");
 			} catch (Common::FileException &) {
-				print("Unable to create file \"%s\".\n", outName);
-				print("Please make sure you've got write permission in this directory or its \"MUSIC\" sub-directory.\n");
+				print("Unable to create file \"%s\".", outName);
+				print("Please make sure you've got write permission in this directory or its \"MUSIC\" sub-directory.");
 				continue;
 			}
 		}
-		print("Converting CD %d...\n", i);
+		print("Converting CD %d...", i);
 		convertClu(clu, cl3);
 	}
 	Common::removeFile(TEMP_RAW);
@@ -538,7 +538,7 @@ void CompressSword1::compressMusic(const Common::Filename *inpath, const Common:
 		Common::removeFile(outName);
 	} catch(Common::FileException& err) {
 		_useOutputMusicSubdir = false;
-		print("Cannot create files in %s/MUSIC/; will try in %s/\n", outpath->getPath().c_str(), outpath->getPath().c_str());
+		print("Cannot create files in %s/MUSIC/; will try in %s/", outpath->getPath().c_str(), outpath->getPath().c_str());
 	}
 
 	for (i = 0; i < TOTAL_TUNES; i++) {
@@ -561,11 +561,11 @@ void CompressSword1::compressMusic(const Common::Filename *inpath, const Common:
 			// Try at root of input directory
 			print(err.what());
 			sprintf(inName, "%s/%s", inpath->getPath().c_str(), inFileName);
-			print(", trying %s\n", inName);
+			print(", trying %s", inName);
 			try {
 				inf.open(inName, "rb");
 			} catch (Common::FileException& err2) {
-				print("%s\n", err2.what());
+				print("%s", err2.what());
 				continue;
 			}
 		}
@@ -590,7 +590,7 @@ void CompressSword1::compressMusic(const Common::Filename *inpath, const Common:
 		else
 			sprintf(outName, "%s/%s", outpath->getPath().c_str(), outFileName);
 
-		print("encoding file (%3d/%d) %s -> %s\n", i + 1, TOTAL_TUNES, musicNames[i].fileName, outName);
+		print("encoding file (%3d/%d) %s -> %s", i + 1, TOTAL_TUNES, musicNames[i].fileName, outName);
 
 		try {
 			if (!_macVersion)
@@ -598,7 +598,7 @@ void CompressSword1::compressMusic(const Common::Filename *inpath, const Common:
 			else
 				extractAndEncodeAIFF(inName, outName, _format);
 		} catch (Common::FileException& err) {
-			print("%s\n", err.what());
+			print("%s", err.what());
 		}
 	}
 }
@@ -633,12 +633,12 @@ void CompressSword1::checkFilesExist(bool checkSpeech, bool checkMusic, const Co
 		}
 
 		if (!speechFound) {
-			print("Unable to find speech files.\n");
-			print("Please copy the SPEECH.CLU files from Broken Sword CD1 and CD2\n");
-			print("into the game directory on your disk or into a \"SPEECH\" subdirectory\n");
-			print("and rename them to SPEECH1.CLU and SPEECH2.CLU\n\n");
-			print("If your OS is case-sensitive, make sure the filenames\n");
-			print("and directorynames are all upper-case.\n\n");
+			print("Unable to find speech files.");
+			print("Please copy the SPEECH.CLU files from Broken Sword CD1 and CD2");
+			print("into the game directory on your disk or into a \"SPEECH\" subdirectory");
+			print("and rename them to SPEECH1.CLU and SPEECH2.CLU\n");
+			print("If your OS is case-sensitive, make sure the filenames");
+			print("and directorynames are all upper-case.\n");
 		}
 	}
 
@@ -699,11 +699,11 @@ void CompressSword1::checkFilesExist(bool checkSpeech, bool checkMusic, const Co
 		}
 
 		if (!musicFound) {
-			print("Unable to find music files.\n");
-			print("Please copy the music files from Broken Sword CD1 and CD2\n");
-			print("into the game directory on your disk or into a \"MUSIC\" subdirectory.\n");
-			print("If your OS is case-sensitive, make sure the filenames\n");
-			print("and directorynames are all upper-case.\n");
+			print("Unable to find music files.");
+			print("Please copy the music files from Broken Sword CD1 and CD2");
+			print("into the game directory on your disk or into a \"MUSIC\" subdirectory.");
+			print("If your OS is case-sensitive, make sure the filenames");
+			print("and directorynames are all upper-case.");
 		}
 	} else {
 		_speechEndianness = UnknownEndian;
diff --git a/engines/tinsel/compress_tinsel.cpp b/engines/tinsel/compress_tinsel.cpp
index 537f1fd..f9ae084 100644
--- a/engines/tinsel/compress_tinsel.cpp
+++ b/engines/tinsel/compress_tinsel.cpp
@@ -71,7 +71,7 @@ void CompressTinsel::convertTinselRawSample (uint32 sampleSize) {
 	char buffer[2048];
 	Common::File curFileHandle;
 
-	print("Assuming DW1 sample being 8-bit raw...\n");
+	print("Assuming DW1 sample being 8-bit raw...");
 
 	Common::removeFile(TEMP_RAW); Common::removeFile(TEMP_ENC);
 	curFileHandle.open(TEMP_RAW, "wb");
@@ -144,12 +144,12 @@ void CompressTinsel::convertTinselADPCMSample (uint32 sampleSize) {
 	char buffer[2048];
 	Common::File curFileHandle;
 
-	print("Assuming DW2 sample using ADPCM 6-bit, decoding to 16-bit raw...\n");
+	print("Assuming DW2 sample using ADPCM 6-bit, decoding to 16-bit raw...");
 
 	// Allocate buffer for the ADPCM-compressed sample
 	inBuffer = (byte *)malloc(sampleSize);
 	if (!inBuffer) {
-		print("malloc failed!\n");
+		print("malloc failed!");
 		return;
 	}
 
@@ -157,7 +157,7 @@ void CompressTinsel::convertTinselADPCMSample (uint32 sampleSize) {
 	uncompressedSize = (sampleSize/3)*4*2+16;
 	outBuffer = (int16 *)malloc(uncompressedSize);
 	if (!outBuffer) {
-		print("malloc failed!\n");
+		print("malloc failed!");
 		free(inBuffer);
 		return;
 	}
@@ -286,10 +286,10 @@ void CompressTinsel::execute() {
 		indexOffset = _input_idx.readUint32LE();
 		if (indexOffset) {
 			if (indexNo==0) {
-				error("The sourcefiles are already compressed, aborting...\n");
+				error("The sourcefiles are already compressed, aborting...");
 			}
 			// Got sample(s), so convert...
-			print("Converting sample %d of %d\n", indexNo, indexCount);
+			print("Converting sample %d of %d", indexNo, indexCount);
 
 			// Seek to Sample in input-file and read SampleSize
 			_input_smp.seek(indexOffset, SEEK_SET);
diff --git a/engines/touche/compress_touche.cpp b/engines/touche/compress_touche.cpp
index 566668c..4275ee8 100644
--- a/engines/touche/compress_touche.cpp
+++ b/engines/touche/compress_touche.cpp
@@ -87,7 +87,7 @@ uint32 CompressTouche::compress_sound_data_file(uint32 current_offset, Common::F
 				error("Invalid VOC data found");
 			}
 
-			print("VOC found (pos = %d) :\n", offs_table[i]);
+			print("VOC found (pos = %d) :", offs_table[i]);
 			input.seek(18, SEEK_CUR);
 			extractAndEncodeVOC(TEMP_RAW, input, _format);
 
@@ -143,7 +143,7 @@ void CompressTouche::compress_sound_data(Common::Filename *inpath, Common::Filen
 	offsets_table[0] = current_offset;
 	current_offset = compress_sound_data_file(current_offset, output, input, input_OBJ_offs, input_OBJ_size, OBJ_HDR_LEN);
 	input.close();
-	print("Processed '%s'.\n", inpath->getFullPath().c_str());
+	print("Processed '%s'.", inpath->getFullPath().c_str());
 
 	/* process Vxx files */
 	for (i = 1; i < MAX_OFFSETS; ++i) {
@@ -158,9 +158,9 @@ void CompressTouche::compress_sound_data(Common::Filename *inpath, Common::Filen
 			offsets_table[i] = current_offset;
 			current_offset = compress_sound_data_file(current_offset, output, input, input_Vxx_offs, input_Vxx_size, Vxx_HDR_LEN);
 			input.close();
-			print("Processed '%s'.\n", inpath->getFullPath().c_str());
+			print("Processed '%s'.", inpath->getFullPath().c_str());
 		} catch (...) {
-			//print("Skipping '%s'.\n", inpath->getFullPath().c_str());
+			//print("Skipping '%s'.", inpath->getFullPath().c_str());
 		}
 	}
 
@@ -176,7 +176,7 @@ void CompressTouche::compress_sound_data(Common::Filename *inpath, Common::Filen
 	Common::removeFile(TEMP_RAW);
 	Common::removeFile(tempEncoded);
 
-	print("Done.\n");
+	print("Done.");
 }
 
 void CompressTouche::execute() {
diff --git a/engines/tucker/compress_tucker.cpp b/engines/tucker/compress_tucker.cpp
index 9031879..476ebc3 100644
--- a/engines/tucker/compress_tucker.cpp
+++ b/engines/tucker/compress_tucker.cpp
@@ -330,7 +330,7 @@ uint32 CompressTucker::compress_audio_directory(const Common::Filename *inpath,
 				break;
 			}
 		} catch (...) {
-			warning("Can't open file '%s'\n", filepath);
+			warning("Can't open file '%s'", filepath);
 			temp_table[i].size = 0;
 		}
 
@@ -374,16 +374,16 @@ void CompressTucker::compress_sound_files(const Common::Filename *inpath, const
 	for (i = 0; i < SOUND_TYPES_COUNT; ++i) {
 		updateProgress(i, SOUND_TYPES_COUNT + 1);
 
-		print("Processing directory '%s'...\n", sound_directory_table[i].name);
+		print("Processing directory '%s'...", sound_directory_table[i].name);
 		sound_directory_size[i] = compress_sounds_directory(inpath, outpath, output, &sound_directory_table[i]);
-		print("Done (%d bytes)\n", sound_directory_size[i]);
+		print("Done (%d bytes)", sound_directory_size[i]);
 	}
 	if (flags & HEADER_FLAG_AUDIO_INTRO) {
 		updateProgress(1, 1);
 
-		print("Processing directory 'audio'...\n");
+		print("Processing directory 'audio'...");
 		audio_directory_size = compress_audio_directory(inpath, outpath, output);
-		print("Done (%d bytes)\n", audio_directory_size);
+		print("Done (%d bytes)", audio_directory_size);
 	}
 
 	/* fix sound types offsets/counts */
@@ -407,7 +407,7 @@ void CompressTucker::compress_sound_files(const Common::Filename *inpath, const
 	Common::removeFile(TEMP_RAW);
 	Common::removeFile(tempEncoded);
 
-	print("Done.\n");
+	print("Done.");
 }
 
 static const char *inputDirs[] = { "AUDIO", "FX", "MUSIC", "SPEECH", 0 };
@@ -421,7 +421,7 @@ void CompressTucker::execute() {
 		char path[1024];
 		snprintf(path, sizeof(path), "%s%s", inpath.getPath().c_str(), inputDirs[i]);
 		if (!Common::isDirectory(path)) {
-			error("Missing input directory '%s'\n", path);
+			error("Missing input directory '%s'", path);
 		}
 	}
 
diff --git a/example_tool.cpp b/example_tool.cpp
index 08cdbe3..226270d 100644
--- a/example_tool.cpp
+++ b/example_tool.cpp
@@ -167,7 +167,7 @@ void CompressionExample::execute() {
 
 		// Print can also throw an AbortException
 		// Do NOT use printf or anything else that outputs to standard output, as it will not display in the GUI.
-		print("Outputted file %d of %d\n", i, total_files);
+		print("Outputted file %d of %d", i, total_files);
 	}
 
 	// We indicate success by not throwing any exceptions during the execution
diff --git a/tool.cpp b/tool.cpp
index 2feb3d9..973c73c 100644
--- a/tool.cpp
+++ b/tool.cpp
@@ -48,7 +48,7 @@ Tool::Tool(const std::string &name, ToolType type) {
 
 	_abort = false;
 
-	_helptext = "\nUsage: tool [-o outputname] <infile>\n";
+	_helptext = "\nUsage: tool [-o outputname] <infile>";
 }
 
 Tool::~Tool() {
@@ -80,13 +80,13 @@ int Tool::run(const std::deque<std::string> &args) {
 	parseExtraArguments();
 
 	if (!_arguments.empty() && _arguments.front()[0] == '-') {
-		std::string s = "Possibly ignored option " + _arguments.front() + ".\n";
+		std::string s = "Possibly ignored option " + _arguments.front() + ".";
 		print(s);
 	}
 
 	// Make sure we have enough input files.
 	if (_arguments.size() < _inputPaths.size()) {
-		print("Too few input files!\n");
+		print("Too few input files!");
 		return -2;
 	}
 
@@ -115,7 +115,7 @@ int Tool::run(const std::deque<std::string> &args) {
 			}
 		}
 		if (bestMatch == IMATCH_AWFUL) {
-			print("Unexpected input file '%s'!\n", in.c_str());
+			print("Unexpected input file '%s'!", in.c_str());
 			return -2;
 		}
 		if (!_inputPaths[bestMatchIndex].file) {
@@ -136,7 +136,7 @@ int Tool::run(const std::deque<std::string> &args) {
 			os << "'" << _arguments.front() << "' ";
 			_arguments.pop_front();
 		}
-		os << ")\n";
+		os << ")";
 		print(os.str());
 		return -2;
 	}
@@ -152,7 +152,7 @@ int Tool::run(const std::deque<std::string> &args) {
 		run();
 	} catch(ToolException &err) {
 		const char *what = err.what();
-		print("Fatal Error : %s\n", what);
+		print("Fatal Error : %s", what);
 		return err._retcode;
 	}
 	return 0;
@@ -258,7 +258,7 @@ void Tool::error(const char *format, ...) {
 	vsnprintf(buf, 4096, format, va);
 	va_end(va);
 
-	throw ToolException(buf);
+	throw ToolException(std::string(buf) + "\n");
 }
 
 void Tool::warning(const char *format, ...) {
@@ -269,7 +269,7 @@ void Tool::warning(const char *format, ...) {
 	vsnprintf(buf, 4096, format, va);
 	va_end(va);
 
-	_internalPrint(_print_udata, (std::string("Warning: ") + buf).c_str());
+	_internalPrint(_print_udata, (std::string("Warning: ") + buf + "\n").c_str());
 }
 
 void Tool::print(const char *format, ...) {
@@ -280,7 +280,7 @@ void Tool::print(const char *format, ...) {
 	vsnprintf(buf, 4096, format, va);
 	va_end(va);
 
-	_internalPrint(_print_udata, buf);
+	_internalPrint(_print_udata, (std::string(buf)  + "\n").c_str());
 
 	// We notify of progress here
 	// This way, almost all tools will be able to exit gracefully (as they print stuff)
@@ -288,7 +288,7 @@ void Tool::print(const char *format, ...) {
 }
 
 void Tool::print(const std::string &msg) {
-	_internalPrint(_print_udata, msg.c_str());
+	_internalPrint(_print_udata, (msg + "\n").c_str());
 
 	// We notify of progress here
 	// This way, almost all tools will be able to exit gracefully (as they print stuff)






More information about the Scummvm-git-logs mailing list