[Scummvm-git-logs] scummvm master -> 8727026784dd36bcc546e217b41c250aaada2525

dwatteau noreply at scummvm.org
Fri May 23 22:39:35 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:
8727026784 AGOS: Prefer uintptr over ptrdiff_t in my previous alignTableMem() change


Commit: 8727026784dd36bcc546e217b41c250aaada2525
    https://github.com/scummvm/scummvm/commit/8727026784dd36bcc546e217b41c250aaada2525
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-05-24T00:36:39+02:00

Commit Message:
AGOS: Prefer uintptr over ptrdiff_t in my previous alignTableMem() change

uintptr better matches the intent.

Changed paths:
    engines/agos/subroutine.cpp


diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp
index 579dd2b4fb4..3135c22d29f 100644
--- a/engines/agos/subroutine.cpp
+++ b/engines/agos/subroutine.cpp
@@ -218,10 +218,11 @@ Subroutine *AGOSEngine::getSubroutineByID(uint subroutineId) {
 }
 
 void AGOSEngine::alignTableMem() {
-	ptrdiff_t delta;
+	uintptr uptrVal = (uintptr)_tablesHeapPtr;
+	size_t delta;
 
-	if (!IS_ALIGNED(_tablesHeapPtr, sizeof(byte *))) {
-		delta = -(ptrdiff_t)_tablesHeapPtr & (sizeof(byte *) - 1);
+	if (!IS_ALIGNED(uptrVal, sizeof(byte *))) {
+		delta = -uptrVal & (sizeof(byte *) - 1);
 		_tablesHeapPtr += delta;
 		_tablesHeapCurPos += delta;
 	}




More information about the Scummvm-git-logs mailing list