This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
31fa20c246 TOT: Pass HashMap by reference
796718d668 AGI: Make a few arrays const
Commit: 31fa20c246b9955655fc1fbac3c4ead1430be705
https://github.com/scummvm/scummvm/commit/31fa20c246b9955655fc1fbac3c4ead1430be705
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-10-21T17:16:03-07:00
Commit Message:
TOT: Pass HashMap by reference
CID 1639946
Changed paths:
engines/tot/saveload.cpp
diff --git a/engines/tot/saveload.cpp b/engines/tot/saveload.cpp
index ff0f216f7ed..94403012ee0 100644
--- a/engines/tot/saveload.cpp
+++ b/engines/tot/saveload.cpp
@@ -574,7 +574,7 @@ void TotEngine::loadGame(SavedGame *game) {
const int kMaxSaveSlots = 100;
-Common::String drawAndSelectSaves(int pageNumber, Common::HashMap<int, SaveStateDescriptor> saveMap, uint selectedSlot) {
+Common::String drawAndSelectSaves(int pageNumber, const Common::HashMap<int, SaveStateDescriptor> &saveMap, uint selectedSlot) {
g_engine->_mouse->hide();
const char *availableText = getHardcodedTextsByCurrentLanguage()[11];
ExtendedSavegameHeader header;
Commit: 796718d668dffcda024c1435b86d915d6e4b22c8
https://github.com/scummvm/scummvm/commit/796718d668dffcda024c1435b86d915d6e4b22c8
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-10-21T17:20:47-07:00
Commit Message:
AGI: Make a few arrays const
Changed paths:
engines/agi/op_cmd.cpp
engines/agi/sound_midi.cpp
engines/agi/view.cpp
engines/sci/engine/kfile.cpp
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index a241f00f9c8..0a245b1bc58 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -1795,11 +1795,11 @@ void cmdSetMenuItem(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
}
void cmdVersion(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
- char ver2Msg[] =
+ const char *ver2Msg =
"\n"
" \n\n"
" ScummVM Sierra AGI v%x.%03x";
- char ver3Msg[] =
+ const char *ver3Msg =
"\n"
" \n\n"
"ScummVM Sierra AGI v%x.002.%03x";
diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp
index a8c54088ceb..4a14f4e7fed 100644
--- a/engines/agi/sound_midi.cpp
+++ b/engines/agi/sound_midi.cpp
@@ -134,10 +134,10 @@ void SoundGenMIDI::play(int resnum) {
/* channel / instrument setup: */
/* most songs are good with this: */
-unsigned char instr[] = {0, 0, 0};
+static const unsigned char instr[] = {0, 0, 0};
/* cool for sq2:
-unsigned char instr[] = {50, 51, 19};
+static const unsigned char instr[] = {50, 51, 19};
*/
static void writeDelta(Common::MemoryWriteStreamDynamic *st, int32 delta) {
diff --git a/engines/agi/view.cpp b/engines/agi/view.cpp
index 77e76c8bdc6..a55a848beea 100644
--- a/engines/agi/view.cpp
+++ b/engines/agi/view.cpp
@@ -661,11 +661,11 @@ void AgiEngine::stopUpdate(ScreenObjEntry *viewPtr) {
// loops to use according to direction and number of loops in
// the view resource
-static int loopTable2[] = {
+static const int loopTable2[] = {
0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x01, 0x01, 0x01
};
-static int loopTable4[] = {
+static const int loopTable4[] = {
0x04, 0x03, 0x00, 0x00, 0x00, 0x02, 0x01, 0x01, 0x01
};
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 766890668f4..5c8af26a284 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -915,7 +915,7 @@ reg_t kFileIOExists(EngineState *s, int argc, reg_t *argv) {
if (!exists && name == "memory.drv") {
// Create a new file, and write the bytes for the empty password
// string inside
- byte defaultContent[] = { 0xE9, 0xE9, 0xEB, 0xE1, 0x0D, 0x0A, 0x31, 0x30, 0x30, 0x30 };
+ const byte defaultContent[] = { 0xE9, 0xE9, 0xEB, 0xE1, 0x0D, 0x0A, 0x31, 0x30, 0x30, 0x30 };
Common::WriteStream *outFile = saveFileMan->openForSaving(wrappedName);
for (int i = 0; i < 10; i++)
outFile->writeByte(defaultContent[i]);