[Scummvm-git-logs] scummvm master -> 0e81058cc7b1857055681a8712c0e6131f99d17e

bluegr noreply at scummvm.org
Sun Oct 16 19:28:03 UTC 2022


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

Summary:
0e81058cc7 SCUMM: Don't print unprintable chars in warnings and errors


Commit: 0e81058cc7b1857055681a8712c0e6131f99d17e
    https://github.com/scummvm/scummvm/commit/0e81058cc7b1857055681a8712c0e6131f99d17e
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2022-10-16T22:27:58+03:00

Commit Message:
SCUMM: Don't print unprintable chars in warnings and errors

Changed paths:
    engines/scumm/charset.cpp
    engines/scumm/imuse/imuse.cpp


diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index cad47038cc5..b8931d1b0a9 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -841,7 +841,7 @@ void CharsetRendererV3::printChar(int chr, bool ignoreCharsetMask) {
 	assertRange(0, _curId, _vm->_numCharsets - 1, "charset");
 
 	if ((vs = _vm->findVirtScreen(_top)) == nullptr) {
-		warning("findVirtScreen(%d) failed, therefore printChar cannot print '%c'", _top, chr);
+		warning("findVirtScreen(%d) failed, therefore printChar cannot print '\\x%X'", _top, chr);
 		return;
 	}
 
@@ -1695,7 +1695,7 @@ void CharsetRendererMac::printChar(int chr, bool ignoreCharsetMask) {
 	VirtScreen *vs;
 
 	if ((vs = _vm->findVirtScreen(_top)) == nullptr) {
-		warning("findVirtScreen(%d) failed, therefore printChar cannot print '%c'", _top, chr);
+		warning("findVirtScreen(%d) failed, therefore printChar cannot print '\\x%X'", _top, chr);
 		return;
 	}
 
diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp
index cc50697cc56..00ecdee0480 100644
--- a/engines/scumm/imuse/imuse.cpp
+++ b/engines/scumm/imuse/imuse.cpp
@@ -185,7 +185,7 @@ bool IMuseInternal::isMT32(int sound) {
 	if (ptr[4] == 'S' && ptr[5] == 'O')
 		return false;
 
-	error("Unknown music type: '%c%c%c%c'", (char)tag >> 24, (char)tag >> 16, (char)tag >> 8, (char)tag);
+	error("Unknown music type: '%s'", tag2str(tag));
 
 	return false;
 }
@@ -227,7 +227,7 @@ bool IMuseInternal::isMIDI(int sound) {
 	if (ptr[4] == 'S' && ptr[5] == 'O')
 		return true;
 
-	error("Unknown music type: '%c%c%c%c'", (char)tag >> 24, (char)tag >> 16, (char)tag >> 8, (char)tag);
+	error("Unknown music type: '%s'", tag2str(tag));
 
 	return false;
 }
@@ -271,7 +271,7 @@ bool IMuseInternal::supportsPercussion(int sound) {
 	if (ptr[4] == 'S' && ptr[5] == 'O')
 		return true;
 
-	error("Unknown music type: '%c%c%c%c'", (char)tag >> 24, (char)tag >> 16, (char)tag >> 8, (char)tag);
+	error("Unknown music type: '%s'", tag2str(tag));
 
 	return false;
 }




More information about the Scummvm-git-logs mailing list