[Scummvm-git-logs] scummvm master -> 1396df5b2afaf56f3d6019ae1ed921622df11af1
digitall
noreply at scummvm.org
Sun Jul 9 10:20:53 UTC 2023
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:
1396df5b2a WATCHMAKER: Further Fixes For GCC Compiler Warnings
Commit: 1396df5b2afaf56f3d6019ae1ed921622df11af1
https://github.com/scummvm/scummvm/commit/1396df5b2afaf56f3d6019ae1ed921622df11af1
Author: D G Turner (digitall at scummvm.org)
Date: 2023-07-09T11:20:43+01:00
Commit Message:
WATCHMAKER: Further Fixes For GCC Compiler Warnings
Changed paths:
engines/watchmaker/2d_stuff.cpp
engines/watchmaker/classes/do_system.cpp
engines/watchmaker/struct.h
engines/watchmaker/t2d/t2d.cpp
diff --git a/engines/watchmaker/2d_stuff.cpp b/engines/watchmaker/2d_stuff.cpp
index a7e5cf490d7..41d67878e5e 100644
--- a/engines/watchmaker/2d_stuff.cpp
+++ b/engines/watchmaker/2d_stuff.cpp
@@ -45,7 +45,7 @@ void TwoDeeStuff::garbageCollectPreRenderedText() {
// If it should no longer be displayed
if (a >= MAX_DD_TEXTS) {
rReleaseBitmap(r->tnum);
- memset(r, 0, sizeof(struct SDDText));
+ if (r) r->reset();
}
}
}
diff --git a/engines/watchmaker/classes/do_system.cpp b/engines/watchmaker/classes/do_system.cpp
index e78ff3e7de6..7a1dddd50e0 100644
--- a/engines/watchmaker/classes/do_system.cpp
+++ b/engines/watchmaker/classes/do_system.cpp
@@ -881,7 +881,7 @@ void doSystem(WGame &game) {
time = t3dCurTime;
if (time >= 1300) time -= 1200;
- sprintf(RoomInfo.fullstring, "%s, %d.%02dam", RoomInfo.name, time / 100, time - (time / 100) * 100);
+ snprintf(RoomInfo.fullstring, sizeof(RoomInfo.fullstring), "%s, %2d.%02dam", RoomInfo.name, time / 100, time - (time / 100) * 100);
rGetScreenInfos((unsigned int *)&width, (unsigned int *)&height, (unsigned int *)&bpp);
game._fonts.getTextDim(RoomInfo.fullstring, RoomInfo.f, &RoomInfo.dx, &RoomInfo.dy);
diff --git a/engines/watchmaker/struct.h b/engines/watchmaker/struct.h
index 6674b5c962a..ce19108595f 100644
--- a/engines/watchmaker/struct.h
+++ b/engines/watchmaker/struct.h
@@ -567,7 +567,7 @@ struct STitoliCoda {
struct SRoomInfo {
char name[64] = {}; //nome della stanza
- char fullstring[64 + 16] = {}; //stringa con ora
+ char fullstring[64 + 16 + 1] = {}; //stringa con ora
int32 px = 0, py = 0; //posizione
int32 dx = 0, dy = 0; //dimensione totale
int32 _dx = 0, _dy = 0; //dimensione della stringa attuale
diff --git a/engines/watchmaker/t2d/t2d.cpp b/engines/watchmaker/t2d/t2d.cpp
index 18dbab91571..f0325d565b8 100644
--- a/engines/watchmaker/t2d/t2d.cpp
+++ b/engines/watchmaker/t2d/t2d.cpp
@@ -5091,7 +5091,7 @@ void doT2D(WGame &game) {
t2dWin[i].bt[j].tnum = 0;
}*/
}
- memset(t2dWin, 0, sizeof(t2dWin));
+ for (uint k = 0; k < ARRAYSIZE(t2dWin); k++) t2dWin[k].reset();
memset(WinActive, 0, sizeof(WinActive));
switch (bT2DActive) {
More information about the Scummvm-git-logs
mailing list