[Scummvm-git-logs] scummvm master -> 201b636f13dcb83b6abb9a7a4f3d08e0effe4e89

digitall noreply at scummvm.org
Fri May 5 20:28:12 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:
201b636f13 WATCHMAKER: Further Fixes for GCC Compiler Warnings


Commit: 201b636f13dcb83b6abb9a7a4f3d08e0effe4e89
    https://github.com/scummvm/scummvm/commit/201b636f13dcb83b6abb9a7a4f3d08e0effe4e89
Author: D G Turner (digitall at scummvm.org)
Date: 2023-05-05T21:27:52+01:00

Commit Message:
WATCHMAKER: Further Fixes for GCC Compiler Warnings

Changed paths:
    engines/watchmaker/ll/ll_regen.cpp
    engines/watchmaker/struct.h


diff --git a/engines/watchmaker/ll/ll_regen.cpp b/engines/watchmaker/ll/ll_regen.cpp
index 206e0bf7bb8..d5eae7e9572 100644
--- a/engines/watchmaker/ll/ll_regen.cpp
+++ b/engines/watchmaker/ll/ll_regen.cpp
@@ -96,7 +96,7 @@ void Regen(WGame &game) {
 #endif
 	upn = 0;
 	memset(refresh, 0, sizeof(refresh));
-	memset(UpdateRect, 0, sizeof(UpdateRect));
+	for (uint32 i = 0; i < ARRAYSIZE(UpdateRect); i++) UpdateRect[i].reset();
 	// I take the Extends of what the engine drew
 	rGetExtends(&ext.x1, &ext.y1, &ext.x2, &ext.y2);
 	// 1 - Compare each element of PaintRect to all OlPaintRect elements
@@ -187,8 +187,9 @@ void Regen(WGame &game) {
 			}
 		}
 
-		if (!found)
-			memset(p, 0, sizeof(struct SRect));
+		if (!found) {
+			if (p) p->reset();
+		}
 	}
 
 	// 4 - Copy on screen only the UpdateRects by stretching them.
diff --git a/engines/watchmaker/struct.h b/engines/watchmaker/struct.h
index b7e9fb81dd6..613fb45c8c1 100644
--- a/engines/watchmaker/struct.h
+++ b/engines/watchmaker/struct.h
@@ -417,6 +417,13 @@ struct SRect {
 	int32  x1 = 0, y1 = 0, x2 = 0, y2 = 0;
 	constexpr SRect() = default;
 	constexpr SRect(int32 _x1, int32 _y1, int32 _x2, int32 _y2): x1(_x1), y1(_y1), x2(_x2), y2(_y2) {}
+
+	void reset() {
+		x1 = 0;
+		y1 = 0;
+		x2 = 0;
+		y2 = 0;
+	}
 };
 
 struct SD3DRect {




More information about the Scummvm-git-logs mailing list