[Scummvm-git-logs] scummvm master -> 865158070b91a2f42dc4e0f61cb017faf076cfde

Strangerke noreply at scummvm.org
Fri Jun 13 00:16:43 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
865158070b M4: Fix a couple of V547 in CreateEdge, remove unreachable code


Commit: 865158070b91a2f42dc4e0f61cb017faf076cfde
    https://github.com/scummvm/scummvm/commit/865158070b91a2f42dc4e0f61cb017faf076cfde
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-06-13T01:16:34+01:00

Commit Message:
M4: Fix a couple of V547 in CreateEdge, remove unreachable code

Changed paths:
    engines/m4/adv_r/adv_rails.cpp


diff --git a/engines/m4/adv_r/adv_rails.cpp b/engines/m4/adv_r/adv_rails.cpp
index d920295b866..a44aaeff842 100644
--- a/engines/m4/adv_r/adv_rails.cpp
+++ b/engines/m4/adv_r/adv_rails.cpp
@@ -440,8 +440,8 @@ void CreateEdge(int32 node1, int32 node2, Buffer *walkCodes) {
 		}
 
 		// Because of the symmetry check, xDiff is always positive
-		int32 xDiff = x2 - x1;
-		int32 x_unit = 1;
+		const int32 xDiff = x2 - x1;
+		const int32 x_unit = 1;
 
 		// If the difference is bigger along the x axis
 		if (xDiff > yDiff) {
@@ -494,11 +494,7 @@ void CreateEdge(int32 node1, int32 node2, Buffer *walkCodes) {
 
 				// Update the walkCodePtr index if necessary
 				if (walkCodePtr) {
-					if (x_unit > 0) {
-						walkCodePtr++;
-					} else {
-						walkCodePtr--;
-					}
+					walkCodePtr++;
 				}
 			}
 		} else {
@@ -510,8 +506,7 @@ void CreateEdge(int32 node1, int32 node2, Buffer *walkCodes) {
 			scanY = y1;
 			for (i = 0; ((i <= yDiff) && valid && (!finished)); i++) {
 				// Check if we have scanned off the edge of the buffer
-				if (((x_unit > 0) && (scanX >= width)) || ((x_unit < 0) && (scanX < 0)) ||
-					((y_unit > 0) && (scanY >= height)) || ((y_unit < 0) && (scanY < 0))) {
+				if (scanX >= width || (y_unit > 0) && (scanY >= height) || ((y_unit < 0) && (scanY < 0))) {
 					finished = true;
 				} else {
 					// Else we either haven't yet reached the buffer, or we are on it
@@ -540,11 +535,7 @@ void CreateEdge(int32 node1, int32 node2, Buffer *walkCodes) {
 
 						// Update the walkCodePtr index if necessary
 						if (walkCodePtr) {
-							if (x_unit > 0) {
-								walkCodePtr++;
-							} else {
-								walkCodePtr--;
-							}
+							walkCodePtr++;
 						}
 					}
 				}




More information about the Scummvm-git-logs mailing list