[Scummvm-git-logs] scummvm master -> 8ec9835358bd3384ba660bf57926366719347160
lephilousophe
noreply at scummvm.org
Sun Sep 18 14:16:22 UTC 2022
This automated email contains information about 8 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
64675dbba6 COMMON: Avoid passing U32String full object as parameter
aa5da2e140 GUI: Don't pass U32String by value
511852e431 MATH: Use reference instead of value
30d8b64657 ENGINES: Don't pass U32String by value
0fbd85772d ENGINES: Initialize _metaEngine
e020710d5d GRAPHICS: Free WinFont when erroring out
5774811be8 GRAPHICS: Don't dereference a null pointer
8ec9835358 GRAPHICS: Initialize _japaneseFontsLoaded before it's used
Commit: 64675dbba6a885c4f3a19b0e3d777a9c23a10d37
https://github.com/scummvm/scummvm/commit/64675dbba6a885c4f3a19b0e3d777a9c23a10d37
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-09-18T16:15:56+02:00
Commit Message:
COMMON: Avoid passing U32String full object as parameter
Use a const reference instead
Changed paths:
common/ustr.cpp
common/ustr.h
diff --git a/common/ustr.cpp b/common/ustr.cpp
index ee7afeea83b..081acc607bf 100644
--- a/common/ustr.cpp
+++ b/common/ustr.cpp
@@ -145,7 +145,7 @@ void U32String::insertString(const String &s, uint32 p, CodePage page) {
insertString(U32String(s, page), p);
}
-U32String U32String::format(U32String fmt, ...) {
+U32String U32String::format(const U32String &fmt, ...) {
U32String output;
va_list va;
diff --git a/common/ustr.h b/common/ustr.h
index 904a34cdcab..82fd318e71b 100644
--- a/common/ustr.h
+++ b/common/ustr.h
@@ -137,7 +137,7 @@ public:
* Similar to sprintf, except that it stores the result
* in a (variably sized) string instead of a fixed-size buffer.
*/
- static U32String format(U32String fmt, ...);
+ static U32String format(const U32String &fmt, ...);
/** @overload **/
static U32String format(const char *fmt, ...);
Commit: aa5da2e1405f154d04c952b92a7750abdd866596
https://github.com/scummvm/scummvm/commit/aa5da2e1405f154d04c952b92a7750abdd866596
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-09-18T16:15:56+02:00
Commit Message:
GUI: Don't pass U32String by value
Changed paths:
gui/editrecorddialog.cpp
gui/editrecorddialog.h
gui/launcher.cpp
gui/widgets/list.cpp
gui/widgets/list.h
diff --git a/gui/editrecorddialog.cpp b/gui/editrecorddialog.cpp
index 0fca0f12d0a..1437500f946 100644
--- a/gui/editrecorddialog.cpp
+++ b/gui/editrecorddialog.cpp
@@ -53,7 +53,7 @@ void EditRecordDialog::setName(const Common::String &name) {
EditRecordDialog::~EditRecordDialog() {
}
-EditRecordDialog::EditRecordDialog(const Common::U32String author, const Common::String name, const Common::String notes) : Dialog("EditRecordDialog") {
+EditRecordDialog::EditRecordDialog(const Common::U32String &author, const Common::String &name, const Common::String ¬es) : Dialog("EditRecordDialog") {
new StaticTextWidget(this, "EditRecordDialog.AuthorLabel", _("Author:"));
new StaticTextWidget(this, "EditRecordDialog.NameLabel", _("Name:"));
new StaticTextWidget(this, "EditRecordDialog.NotesLabel", _("Notes:"));
diff --git a/gui/editrecorddialog.h b/gui/editrecorddialog.h
index de6ac00ac12..5887681e157 100644
--- a/gui/editrecorddialog.h
+++ b/gui/editrecorddialog.h
@@ -36,7 +36,7 @@ private:
EditTextWidget *_authorEdit;
EditRecordDialog() : Dialog("EditRecordDialog") {};
public:
- EditRecordDialog(const Common::U32String author, const Common::String name, const Common::String notes);
+ EditRecordDialog(const Common::U32String &author, const Common::String &name, const Common::String ¬es);
~EditRecordDialog() override;
const Common::U32String getAuthor();
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index bbebffa2a75..ba110ae8e68 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -114,8 +114,10 @@ const GroupingMode groupingModes[] = {
#pragma mark -
-bool LauncherFilterMatcher(void *boss, int idx, const Common::U32String &item, Common::U32String token) {
+bool LauncherFilterMatcher(void *boss, int idx, const Common::U32String &item, const Common::U32String &token_) {
bool invert = false;
+ Common::U32String token(token_);
+
while (token.size() && token[0] == '!') {
token = token.substr(1);
invert = !invert;
diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp
index ba2c0e295ee..9399b338e29 100644
--- a/gui/widgets/list.cpp
+++ b/gui/widgets/list.cpp
@@ -32,7 +32,7 @@
namespace GUI {
-bool ListWidgetDefaultMatcher(void *, int, const Common::U32String &item, Common::U32String token) {
+bool ListWidgetDefaultMatcher(void *, int, const Common::U32String &item, const Common::U32String &token) {
return item.contains(token);
}
@@ -815,7 +815,7 @@ Common::U32String ListWidget::getThemeColor(ThemeEngine::FontColor color) {
}
}
-ThemeEngine::FontColor ListWidget::getThemeColor(Common::U32String color) {
+ThemeEngine::FontColor ListWidget::getThemeColor(const Common::U32String &color) {
if (color == "normal")
return ThemeEngine::kFontColorNormal;
diff --git a/gui/widgets/list.h b/gui/widgets/list.h
index e1465816f1f..6fa125b3aad 100644
--- a/gui/widgets/list.h
+++ b/gui/widgets/list.h
@@ -48,13 +48,13 @@ enum {
/* ListWidget */
class ListWidget : public EditableWidget {
public:
- typedef bool (*FilterMatcher)(void *arg, int idx, const Common::U32String &item, Common::U32String token);
+ typedef bool (*FilterMatcher)(void *arg, int idx, const Common::U32String &item, const Common::U32String &token);
struct ListData {
Common::U32String orig;
Common::U32String clean;
- ListData(Common::U32String o, Common::U32String c) { orig = o; clean = c; }
+ ListData(const Common::U32String &o, const Common::U32String &c) { orig = o; clean = c; }
};
typedef Common::Array<ListData> ListDataArray;
@@ -152,7 +152,7 @@ public:
static Common::U32String getThemeColor(byte r, byte g, byte b);
static Common::U32String getThemeColor(ThemeEngine::FontColor color);
- static ThemeEngine::FontColor getThemeColor(Common::U32String color);
+ static ThemeEngine::FontColor getThemeColor(const Common::U32String &color);
static Common::U32String stripGUIformatting(const Common::U32String &str);
protected:
Commit: 511852e431e9e177fff4584c2114e60570794da6
https://github.com/scummvm/scummvm/commit/511852e431e9e177fff4584c2114e60570794da6
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-09-18T16:15:56+02:00
Commit Message:
MATH: Use reference instead of value
Else we can't return a reference to the object as it's a local copy
Changed paths:
math/matrix.h
math/vector.h
diff --git a/math/matrix.h b/math/matrix.h
index a3f96900fbb..133babd6a1f 100644
--- a/math/matrix.h
+++ b/math/matrix.h
@@ -495,7 +495,7 @@ bool operator!=(const Matrix<r, c> &m1, const Matrix<r, c> &m2) {
}
template<int r, int c>
-Common::StreamDebug &operator<<(Common::StreamDebug dbg, const Math::Matrix<r, c> &m) {
+Common::StreamDebug &operator<<(Common::StreamDebug &dbg, const Math::Matrix<r, c> &m) {
dbg.nospace() << "Matrix<" << r << ", " << c << ">(";
for (int col = 0; col < c; ++col) {
dbg << m(0, col) << ", ";
diff --git a/math/vector.h b/math/vector.h
index 994f66fe54e..73ef079e3e5 100644
--- a/math/vector.h
+++ b/math/vector.h
@@ -125,7 +125,7 @@ void MatrixType<dim, 1>::readFromStream(Common::ReadStream *stream) {
template<int dim>
-Common::StreamDebug &operator<<(Common::StreamDebug dbg, const Math::Matrix<dim, 1> &v) {
+Common::StreamDebug &operator<<(Common::StreamDebug &dbg, const Math::Matrix<dim, 1> &v) {
dbg.nospace() << "Vector<" << dim << ">(" << v.getValue(0);
for (int i = 1; i < dim; ++i) {
dbg << ", " << v.getValue(i);
Commit: 30d8b64657f431efb13d98123170893e691952e0
https://github.com/scummvm/scummvm/commit/30d8b64657f431efb13d98123170893e691952e0
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-09-18T16:15:56+02:00
Commit Message:
ENGINES: Don't pass U32String by value
Changed paths:
engines/engine.cpp
engines/engine.h
diff --git a/engines/engine.cpp b/engines/engine.cpp
index d88f095ecfe..fac4c2eab47 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -463,7 +463,7 @@ void GUIErrorMessageFormat(const char *fmt, ...) {
GUIErrorMessage(msg);
}
-void GUIErrorMessageFormat(Common::U32String fmt, ...) {
+void GUIErrorMessageFormat(const Common::U32String &fmt, ...) {
Common::U32String msg("");
va_list va;
diff --git a/engines/engine.h b/engines/engine.h
index 5fb6b6f8195..7e028f796ee 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -78,7 +78,7 @@ void GUIErrorMessageWithURL(const Common::String &msg, const char *url);
/**
* Initialize graphics and show an error message.
*/
-void GUIErrorMessageFormat(Common::U32String fmt, ...);
+void GUIErrorMessageFormat(const Common::U32String &fmt, ...);
/**
* Initialize graphics and show an error message.
*/
Commit: 0fbd85772d26c64a5a2bb04e47333adfe98780f3
https://github.com/scummvm/scummvm/commit/0fbd85772d26c64a5a2bb04e47333adfe98780f3
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-09-18T16:15:56+02:00
Commit Message:
ENGINES: Initialize _metaEngine
Changed paths:
engines/engine.cpp
diff --git a/engines/engine.cpp b/engines/engine.cpp
index fac4c2eab47..0846cdd2ba0 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -140,6 +140,7 @@ Engine::Engine(OSystem *syst)
_eventMan(_system->getEventManager()),
_saveFileMan(_system->getSavefileManager()),
_targetName(ConfMan.getActiveDomainName()),
+ _metaEngine(nullptr),
_pauseLevel(0),
_pauseStartTime(0),
_saveSlotToLoad(-1),
Commit: e020710d5d579db93ff4916941deec206368ae0b
https://github.com/scummvm/scummvm/commit/e020710d5d579db93ff4916941deec206368ae0b
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-09-18T16:15:56+02:00
Commit Message:
GRAPHICS: Free WinFont when erroring out
Changed paths:
graphics/macgui/macfontmanager.cpp
diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp
index 37ede514f21..c6d12447c94 100644
--- a/graphics/macgui/macfontmanager.cpp
+++ b/graphics/macgui/macfontmanager.cpp
@@ -440,6 +440,7 @@ void MacFontManager::loadWindowsFont(const Common::String fileName) {
if (!isLoaded) {
warning("MacFontManager::loadWindowsFont(): Windows Font data from file %s not loaded", fileName.c_str());
+ delete winFont;
return;
}
Commit: 5774811be88f57017c1cf13b13f4cf4e372747b8
https://github.com/scummvm/scummvm/commit/5774811be88f57017c1cf13b13f4cf4e372747b8
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-09-18T16:15:56+02:00
Commit Message:
GRAPHICS: Don't dereference a null pointer
Changed paths:
graphics/macgui/macmenu.cpp
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp
index 75fce6e114b..69a4a90468f 100644
--- a/graphics/macgui/macmenu.cpp
+++ b/graphics/macgui/macmenu.cpp
@@ -390,7 +390,7 @@ MacMenuItem *MacMenu::getSubMenuItem(MacMenuItem *menu, int itemId) {
int MacMenu::numberOfMenuItems(MacMenuItem *menu) {
if (!menu) {
- warning("MacMenu::numberOfMenuItems: can not find menu with id %s", menu->text.c_str());
+ warning("MacMenu::numberOfMenuItems: can not find menu");
return 0;
}
Commit: 8ec9835358bd3384ba660bf57926366719347160
https://github.com/scummvm/scummvm/commit/8ec9835358bd3384ba660bf57926366719347160
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-09-18T16:15:56+02:00
Commit Message:
GRAPHICS: Initialize _japaneseFontsLoaded before it's used
Changed paths:
graphics/macgui/macfontmanager.cpp
diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp
index c6d12447c94..bac50287e57 100644
--- a/graphics/macgui/macfontmanager.cpp
+++ b/graphics/macgui/macfontmanager.cpp
@@ -140,7 +140,8 @@ Common::String cleanFontName(const Common::String fontname) {
return f;
}
-MacFontManager::MacFontManager(uint32 mode, Common::Language language) : _mode(mode), _language(language) {
+MacFontManager::MacFontManager(uint32 mode, Common::Language language) : _mode(mode),
+ _language(language), _japaneseFontsLoaded(false) {
for (FontProto *font = defaultFonts; font->name; font++) {
if (!_fontInfo.contains(font->id)) {
FontInfo *info = new FontInfo;
@@ -171,7 +172,6 @@ MacFontManager::MacFontManager(uint32 mode, Common::Language language) : _mode(m
} else {
loadFonts();
}
- _japaneseFontsLoaded = false;
}
MacFontManager::~MacFontManager() {
More information about the Scummvm-git-logs
mailing list