[Scummvm-git-logs] scummvm master -> 81ef3296365930097a71f02782c40e8a0991592f

bluegr noreply at scummvm.org
Mon Apr 6 12:43:00 UTC 2026


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:
cdcc77df11 AGOS: do not use memset in constructor, disable copy and move
81ef329636 SAGA2: remove redundant copy constructor


Commit: cdcc77df11c95ec8f61a5c802e4e3d217be517ea
    https://github.com/scummvm/scummvm/commit/cdcc77df11c95ec8f61a5c802e4e3d217be517ea
Author: Michael Kuerbis (michael_kuerbis at web.de)
Date: 2026-04-06T15:42:56+03:00

Commit Message:
AGOS: do not use memset in constructor, disable copy and move

Clang considers the struct non-trivially copyable because of the non-trivial constructor.
The non-trivial destructor also makes the struct unsafe to copy and move, potentially causing double-free problems.

Changed paths:
    engines/agos/intern.h


diff --git a/engines/agos/intern.h b/engines/agos/intern.h
index 5170e89260d..2611d31a0a7 100644
--- a/engines/agos/intern.h
+++ b/engines/agos/intern.h
@@ -149,16 +149,20 @@ struct IconBlock {
 };
 
 struct WindowBlock {
-	byte mode;
-	byte flags;
-	int16 x, y;
-	int16 width, height;
-	int16 textColumn, textRow;
-	int16 scrollY;
-	uint16 textColumnOffset, textLength, textMaxLength;
-	uint8 fillColor, textColor;
-	IconBlock *iconPtr;
-	WindowBlock() { memset(this, 0, sizeof(*this)); }
+	byte mode = 0;
+	byte flags = 0;
+	int16 x = 0, y = 0;
+	int16 width = 0, height = 0;
+	int16 textColumn = 0, textRow = 0;
+	int16 scrollY = 0;
+	uint16 textColumnOffset = 0, textLength = 0, textMaxLength = 0;
+	uint8 fillColor, textColor = 0;
+	IconBlock *iconPtr = nullptr;
+	WindowBlock() = default;
+	WindowBlock(const WindowBlock &) = delete;
+	WindowBlock(WindowBlock &&) = delete;
+	WindowBlock &operator=(const WindowBlock &) = delete;
+	WindowBlock &operator=(WindowBlock &&) = delete;
 	~WindowBlock() { free (iconPtr); }
 };
 // note on text offset:


Commit: 81ef3296365930097a71f02782c40e8a0991592f
    https://github.com/scummvm/scummvm/commit/81ef3296365930097a71f02782c40e8a0991592f
Author: Michael Kuerbis (michael_kuerbis at web.de)
Date: 2026-04-06T15:42:56+03:00

Commit Message:
SAGA2: remove redundant copy constructor

clang dislikes memcpy here because it considers the class non-trivially copyable.
The default copy constructor should be good enough.

Changed paths:
    engines/saga2/actor.h


diff --git a/engines/saga2/actor.h b/engines/saga2/actor.h
index 337068748ac..5f2618a3088 100644
--- a/engines/saga2/actor.h
+++ b/engines/saga2/actor.h
@@ -254,11 +254,6 @@ struct ResourceActorProtoExtension {
 		baseEffectFlags = 0;
 	}
 
-	//  Copy constructor
-	ResourceActorProtoExtension(ResourceActorProtoExtension &ext) {
-		memcpy(this, &ext, sizeof(ResourceActorProtoExtension));
-	}
-
 	void load(Common::SeekableReadStream *stream) {
 		baseStats.read(stream);
 		combatBehavior = stream->readByte();




More information about the Scummvm-git-logs mailing list