[Scummvm-git-logs] scummvm master -> 5a146aa471e7417c39f0390ff25c6b52bd529c41

digitall noreply at scummvm.org
Tue May 7 22:31:42 UTC 2024


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:
5a146aa471 SCUMM: HE: Fix Memset On Non-Trivial Structure GCC Compiler Warnings


Commit: 5a146aa471e7417c39f0390ff25c6b52bd529c41
    https://github.com/scummvm/scummvm/commit/5a146aa471e7417c39f0390ff25c6b52bd529c41
Author: D G Turner (digitall at scummvm.org)
Date: 2024-05-07T23:31:07+01:00

Commit Message:
SCUMM: HE: Fix Memset On Non-Trivial Structure GCC Compiler Warnings

Changed paths:
    engines/scumm/he/wizwarp_he.cpp


diff --git a/engines/scumm/he/wizwarp_he.cpp b/engines/scumm/he/wizwarp_he.cpp
index 9efd7ffdcfd..12db72257ac 100644
--- a/engines/scumm/he/wizwarp_he.cpp
+++ b/engines/scumm/he/wizwarp_he.cpp
@@ -219,7 +219,16 @@ WarpWizOneSpanTable *Wiz::warpCreateSpanTable(int spanCount) {
 	if (!spanTable) {
 		return nullptr;
 	}
-	memset(spanTable, 0, sizeof(WarpWizOneSpanTable));
+
+	// Clear spanTable structure
+	spanTable->dstMinPt = WarpWizPoint();
+	spanTable->dstMaxPt = WarpWizPoint();
+	spanTable->srcMinPt = WarpWizPoint();
+	spanTable->srcMaxPt = WarpWizPoint();
+	spanTable->drawSpans = nullptr;
+	spanTable->spans = nullptr;
+	spanTable->drawSpanCount = 0;
+	spanTable->spanCount = 0;
 
 	spanTable->spanCount = spanCount;
 	spanTable->spans = (WarpWizOneSpan *)malloc(spanCount * sizeof(WarpWizOneSpan));
@@ -227,7 +236,14 @@ WarpWizOneSpanTable *Wiz::warpCreateSpanTable(int spanCount) {
 		warpDestroySpanTable(spanTable);
 		return nullptr;
 	}
-	memset(spanTable->spans, 0, spanCount * sizeof(WarpWizOneSpan));
+
+	// Clear spanTable spans structure
+	for (counter = 0; counter < spanCount; counter++) {
+		spanTable->spans[counter].dstLeft = 0;
+		spanTable->spans[counter].dstRight = 0;
+		spanTable->spans[counter].srcLeft = WarpWizPoint();
+		spanTable->spans[counter].srcRight = WarpWizPoint();
+	}
 
 	spanPtr = spanTable->spans;
 	for (counter = 0; counter < spanCount; counter++) {




More information about the Scummvm-git-logs mailing list