[Scummvm-git-logs] scummvm master -> fae01e8c84a66acdb499d12aeb2e55eec2cd65db

dreammaster noreply at scummvm.org
Sun May 29 21:47:22 UTC 2022


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:
fae01e8c84 GLK: ALAN2: Hopefully fix address of packed field warnings


Commit: fae01e8c84a66acdb499d12aeb2e55eec2cd65db
    https://github.com/scummvm/scummvm/commit/fae01e8c84a66acdb499d12aeb2e55eec2cd65db
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2022-05-29T14:47:15-07:00

Commit Message:
GLK: ALAN2: Hopefully fix address of packed field warnings

Changed paths:
    engines/glk/alan2/alan2.cpp
    engines/glk/alan2/main.cpp
    engines/glk/alan2/main.h


diff --git a/engines/glk/alan2/alan2.cpp b/engines/glk/alan2/alan2.cpp
index 6098c86c739..3d18a43fa7b 100644
--- a/engines/glk/alan2/alan2.cpp
+++ b/engines/glk/alan2/alan2.cpp
@@ -118,9 +118,11 @@ Common::Error Alan2::writeGameData(Common::WriteStream *ws) {
 }
 
 // This works around gcc errors for passing packed structure fields
-void syncVal(Common::Serializer &s, uint32 *fld) {
-	uint32 &v = *fld;
+void syncVal(Common::Serializer &s, void *fld) {
+	uint32 v = READ_UINT32(fld);
 	s.syncAsUint32LE(v);
+	if (s.isLoading())
+		WRITE_UINT32(fld, v);
 }
 
 static void syncActors(Common::Serializer &s) {
diff --git a/engines/glk/alan2/main.cpp b/engines/glk/alan2/main.cpp
index b94497f266a..581ae872e03 100644
--- a/engines/glk/alan2/main.cpp
+++ b/engines/glk/alan2/main.cpp
@@ -477,8 +477,10 @@ void prmsg(MsgKind msg /* IN - message number */) {
 \*----------------------------------------------------------------------*/
 
 /* How to know we are at end of a table */
-Boolean eot(Aword *adr) {
-	return *adr == EOD;
+Boolean eot(const void *adr) {
+	const byte *v = (const byte *)adr;
+	return v[0] == 0xff && v[1] == 0xff &&
+		v[2] == 0xff && v[3] == 0xff;
 }
 
 Boolean isObj(Aword x) {
diff --git a/engines/glk/alan2/main.h b/engines/glk/alan2/main.h
index 1dd43703c0d..ced59484574 100644
--- a/engines/glk/alan2/main.h
+++ b/engines/glk/alan2/main.h
@@ -90,7 +90,7 @@ extern Boolean fail;
 extern Boolean anyOutput;
 extern Boolean needsp;
 
-#define endOfTable(x) eot((Aword *) x)
+#define endOfTable(x) eot((const void *)x)
 
 extern void *allocate(unsigned long len);
 extern void terminate(CONTEXT, int code);
@@ -109,7 +109,7 @@ extern Boolean exitto(int to, int from);
 extern void action(CONTEXT, ParamElem *plst);
 extern void go(CONTEXT, int dir);
 
-extern Boolean eot(Aword *adr);
+extern Boolean eot(const void *adr);
 extern Boolean isObj(Aword x);
 extern Boolean isCnt(Aword x);
 extern Boolean isAct(Aword x);




More information about the Scummvm-git-logs mailing list