[Scummvm-git-logs] scummvm master -> fe561ecdeec365b0b6d440b1034a9770813257c5
criezy
criezy at scummvm.org
Sun Aug 30 19:03:30 UTC 2020
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
2fdb7bb894 BACKENDS: PSP: Fix compilation due to incorrect type in TimedMessageDialog
fe561ecdee COMMON: U32: Fix incorrect usage of %i
Commit: 2fdb7bb894794a04eb1c3dc035b803058193e678
https://github.com/scummvm/scummvm/commit/2fdb7bb894794a04eb1c3dc035b803058193e678
Author: aryanrawlani28 (aryanrawlani007 at gmail.com)
Date: 2020-08-30T20:03:26+01:00
Commit Message:
BACKENDS: PSP: Fix compilation due to incorrect type in TimedMessageDialog
Changed paths:
backends/platform/psp/image_viewer.cpp
backends/platform/psp/input.cpp
diff --git a/backends/platform/psp/image_viewer.cpp b/backends/platform/psp/image_viewer.cpp
index 885462c501..c457d2ebc0 100644
--- a/backends/platform/psp/image_viewer.cpp
+++ b/backends/platform/psp/image_viewer.cpp
@@ -76,19 +76,19 @@ bool ImageViewer::load(int imageNum) {
char error[100];
if (status == PngLoader::BAD_FILE) {
sprintf(error, "Cannot display %s. Not a proper PNG file", specificImageName.c_str());
- GUI::TimedMessageDialog dialog(error, 4000);
+ GUI::TimedMessageDialog dialog(Common::U32String(error), 4000);
dialog.runModal();
return false;
} else if (status == PngLoader::OUT_OF_MEMORY) {
sprintf(error, "Out of memory loading %s. Try making the image smaller", specificImageName.c_str());
- GUI::TimedMessageDialog dialog(error, 4000);
+ GUI::TimedMessageDialog dialog(Common::U32String(error), 4000);
dialog.runModal();
return false;
}
// try to load the image file
if (!image.load()) {
sprintf(error, "Cannot display %s. Not a proper PNG file", specificImageName.c_str());
- GUI::TimedMessageDialog dialog(error, 4000);
+ GUI::TimedMessageDialog dialog(Common::U32String(error), 4000);
dialog.runModal();
return false;
}
@@ -146,7 +146,7 @@ void ImageViewer::setVisible(bool visible) {
setViewerButtons(true);
{ // so dialog goes out of scope, destroying all allocations
- GUI::TimedMessageDialog dialog("Image Viewer", 1000);
+ GUI::TimedMessageDialog dialog(Common::U32String("Image Viewer"), 1000);
dialog.runModal();
}
diff --git a/backends/platform/psp/input.cpp b/backends/platform/psp/input.cpp
index 8e5f170a7d..26e6f32447 100644
--- a/backends/platform/psp/input.cpp
+++ b/backends/platform/psp/input.cpp
@@ -540,7 +540,7 @@ void InputHandler::handleModeSwitchEvent() {
if (_padMode >= PAD_MODE_LAST)
_padMode = PAD_MODE_NORMAL;
- GUI::TimedMessageDialog dialog(_padModeText[_padMode], 1500);
+ GUI::TimedMessageDialog dialog(Common::U32String(_padModeText[_padMode]), 1500);
dialog.runModal();
_buttonPad.setPadMode(_padMode);
Commit: fe561ecdeec365b0b6d440b1034a9770813257c5
https://github.com/scummvm/scummvm/commit/fe561ecdeec365b0b6d440b1034a9770813257c5
Author: aryanrawlani28 (aryanrawlani007 at gmail.com)
Date: 2020-08-30T20:03:26+01:00
Commit Message:
COMMON: U32: Fix incorrect usage of %i
- %i & %d work in the same manner.
Changed paths:
common/ustr.cpp
diff --git a/common/ustr.cpp b/common/ustr.cpp
index 992cefbab4..843672d58a 100644
--- a/common/ustr.cpp
+++ b/common/ustr.cpp
@@ -641,6 +641,8 @@ int U32String::vformat(U32String::const_iterator fmt, const U32String::const_ite
output.insertString(string_temp, pos);
pos += len - 1;
break;
+ case 'i':
+ // fallthrough intended
case 'd':
int_temp = va_arg(args, int);
itoa(int_temp, buffer, 10);
@@ -656,15 +658,6 @@ int U32String::vformat(U32String::const_iterator fmt, const U32String::const_ite
len = strlen(buffer);
length += len;
- output.insertString(buffer, pos);
- pos += len - 1;
- break;
- case 'i':
- int_temp = va_arg(args, uint16);
- itoa(int_temp, buffer, 10);
- len = strlen(buffer);
- length += len;
-
output.insertString(buffer, pos);
pos += len - 1;
break;
More information about the Scummvm-git-logs
mailing list