[Scummvm-git-logs] scummvm master -> c3f0025b1ae2a4532e8f61038303d73ec4b641d6
dreammaster
noreply at scummvm.org
Fri Aug 14 11:14:50 UTC 2026
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
3c726032f6 MADS: PVS-Studio conv warning fixes. PVS-Studio V519, V547, V730
100cfe6104 MADS: PVS-Studio dialog warning fixes. PVS-Studio V1051, V547, V1029, V1037
c3f0025b1a MADS: PVS Studio game.cpp warning fixes. PVS-Studio V779, V629, V1037
Commit: 3c726032f60c8ee172f63aff46846abd28538d3b
https://github.com/scummvm/scummvm/commit/3c726032f60c8ee172f63aff46846abd28538d3b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-08-14T21:14:40+10:00
Commit Message:
MADS: PVS-Studio conv warning fixes. PVS-Studio V519, V547, V730
Changed paths:
engines/mads/core/conv.cpp
engines/mads/core/conv.h
diff --git a/engines/mads/core/conv.cpp b/engines/mads/core/conv.cpp
index 408294b905f..6891c1b0b91 100644
--- a/engines/mads/core/conv.cpp
+++ b/engines/mads/core/conv.cpp
@@ -1347,7 +1347,6 @@ static void conv_generate_message(Conv *convIn, ConvData *convData,
int16 *msgList, int msgListSize, int16 *voiceList, int voiceListSize) {
Box *priorBox = box;
box = &conv_box;
- conv_control.has_text = 0;
int personSpeaking;
int messageId;
int lineStart, lineCount;
@@ -1703,8 +1702,6 @@ void conv_flush() {
for (i = 0; i < CONV_MAX_SLOTS; ++i) {
if (conv_indexes[i] >= 2) {
dest = conv_open_write(i);
- if (!dest)
- goto done;
ConvData *convData = conv_data[conv_indexes[i] - 2];
errCode = conv_write(dest, convData);
@@ -1803,8 +1800,6 @@ int conv_expand(Common::SeekableReadStream *handle) {
// Open a temporary file for the conversation
Common::WriteStream *dest = conv_open_write(index);
- if (!dest)
- break;
// Read it's data from the savegame
convData = conv_read(handle);
diff --git a/engines/mads/core/conv.h b/engines/mads/core/conv.h
index e333bd5464d..7a30da67897 100644
--- a/engines/mads/core/conv.h
+++ b/engines/mads/core/conv.h
@@ -98,7 +98,7 @@ struct ConvVariable {
bool isPtr = false;
int16 val = 0, type = 0;
- int16 *ptr;
+ int16 *ptr = nullptr;
static constexpr size_t SIZE = 2 * 3;
void load(Common::SeekableReadStream *src);
Commit: 100cfe610415b0872b5c36cc33ddb4e9a05cf27b
https://github.com/scummvm/scummvm/commit/100cfe610415b0872b5c36cc33ddb4e9a05cf27b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-08-14T21:14:40+10:00
Commit Message:
MADS: PVS-Studio dialog warning fixes. PVS-Studio V1051, V547, V1029, V1037
Changed paths:
engines/mads/core/dialog.cpp
diff --git a/engines/mads/core/dialog.cpp b/engines/mads/core/dialog.cpp
index 2af5c3af942..20192434c8f 100644
--- a/engines/mads/core/dialog.cpp
+++ b/engines/mads/core/dialog.cpp
@@ -416,12 +416,14 @@ ItemPtr dialog_add_message(DialogPtr dialog, int x, int y, const char *prompt) {
if (item != NULL) {
item->prompt = space;
- if (prompt == NULL) {
+
+ if (!prompt) {
item->width = DD_LINEACROSS;
} else {
- item->width = strlen(prompt);
+ item->width = (short)strlen(prompt);
Common::strcpy_s(item->prompt, 65536, prompt);
}
+
item_locate(dialog, item, x, y);
dialog->width = MAX<short>(dialog->width, (item->x + item->width + 1));
item->status = 0;
@@ -1298,13 +1300,7 @@ static void dialog_show_any(DialogPtr dialog, ItemPtr item) {
break;
case DD_I_STRING:
- dialog_show_string(dialog, item);
- break;
-
case DD_I_FILENAME:
- dialog_show_string(dialog, item);
- break;
-
case DD_I_LISTBASED:
dialog_show_string(dialog, item);
break;
@@ -2404,14 +2400,12 @@ static void dialog_exec_mouse_list(DialogPtr dialog, ItemPtr item) {
}
if (mouse_start_stroke) mouse_list_timing = timer_read_dos();
- if (!abort) {
- baseitem = &dialog->item[item->status];
- buf = baseitem->buf_id;
- strncpy(dialog->buffer[buf], list->list + (list->picked_entry * list->element_offset), baseitem->buf_width);
- dialog->buffer[buf][baseitem->buf_width] = 0;
- fileio_purge_trailing_spaces(dialog->buffer[buf]);
- dialog_update_any(dialog, baseitem, false);
- }
+ baseitem = &dialog->item[item->status];
+ buf = baseitem->buf_id;
+ strncpy(dialog->buffer[buf], list->list + (list->picked_entry * list->element_offset), baseitem->buf_width);
+ dialog->buffer[buf][baseitem->buf_width] = 0;
+ fileio_purge_trailing_spaces(dialog->buffer[buf]);
+ dialog_update_any(dialog, baseitem, false);
}
}
}
Commit: c3f0025b1ae2a4532e8f61038303d73ec4b641d6
https://github.com/scummvm/scummvm/commit/c3f0025b1ae2a4532e8f61038303d73ec4b641d6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-08-14T21:14:40+10:00
Commit Message:
MADS: PVS Studio game.cpp warning fixes. PVS-Studio V779, V629, V1037
Changed paths:
engines/mads/core/env.cpp
engines/mads/core/game.cpp
diff --git a/engines/mads/core/env.cpp b/engines/mads/core/env.cpp
index 7edcbeccf0c..e82f8999583 100644
--- a/engines/mads/core/env.cpp
+++ b/engines/mads/core/env.cpp
@@ -731,9 +731,7 @@ done:
}
int env_insert(char *environment, char *variable, char *value) {
- int error_flag = true;
int new_size;
- int free;
int copy_size;
char *target;
char *bottom;
@@ -752,10 +750,8 @@ int env_insert(char *environment, char *variable, char *value) {
Common::strcat_s(var_string, "=");
Common::strcat_s(var_string, value);
- // Get size of string & check of there is space in the environment
+ // Get size of string
new_size = strlen(var_string) + 1;
- free = env_free(environment);
- if (new_size > free) goto done;
// Find end of environment (for new string). Also find end of whole
// environment structure (must be moved out of the way).
@@ -772,10 +768,7 @@ int env_insert(char *environment, char *variable, char *value) {
memmove(new_home, target, copy_size);
memmove(target, var_string, new_size);
- error_flag = false;
-
-done:
- return error_flag;
+ return false;
}
} // namespace MADS
diff --git a/engines/mads/core/game.cpp b/engines/mads/core/game.cpp
index 67b5682d018..e4a658924e1 100644
--- a/engines/mads/core/game.cpp
+++ b/engines/mads/core/game.cpp
@@ -960,31 +960,21 @@ int game_parse_keystroke(int mykey) {
}
break;
- case f2_key:
- case alt_s_key:
- if (room_id != 199 && section_id != 9) {
- kernel.activate_menu = GAME_SAVE_MENU;
- }
- break;
-
- case f3_key:
- case alt_r_key:
- if (room_id != 199) {
- kernel.activate_menu = GAME_RESTORE_MENU;
- }
- break;
-
case f4_key:
kernel.activate_menu = GAME_OPTIONS_MENU;
break;
case f5_key:
+ case f2_key:
+ case alt_s_key:
if (room_id != 199 && section_id != 9) {
kernel.activate_menu = GAME_SAVE_MENU;
}
break;
case f7_key:
+ case f3_key:
+ case alt_r_key:
if (room_id != 199 && section_id != 9) {
kernel.activate_menu = GAME_RESTORE_MENU;
}
@@ -2095,7 +2085,7 @@ static void game_palette_update() {
int count;
int count2;
int x, y;
- long handle;
+ int handle;
long any_flag;
long walker_flag;
long picture_flag;
More information about the Scummvm-git-logs
mailing list