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

dreammaster dreammaster at scummvm.org
Fri Nov 10 00:29:11 CET 2017


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

Summary:
b0eb5caa51 LURE: Stop taking address of unaligned pointer
d8aab6362a Merge pull request #1049 from csnover/lure-unaligned


Commit: b0eb5caa511d3783a568c0d40e4b35c169c2272e
    https://github.com/scummvm/scummvm/commit/b0eb5caa511d3783a568c0d40e4b35c169c2272e
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-11-07T22:57:33-06:00

Commit Message:
LURE: Stop taking address of unaligned pointer

While usage of these pointers was technically safe because they
were read through an alignment-aware API, taking the address of an
unaligned pointer was generating warnings in Clang, and is not
strictly necessary here. This change solves the warning and also
protects this code from any future change that might cause it to
start reading unsafely.

Changed paths:
    engines/lure/res.cpp


diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp
index 7a79f48..dc9ce29 100644
--- a/engines/lure/res.cpp
+++ b/engines/lure/res.cpp
@@ -87,7 +87,7 @@ void Resources::freeData() {
 }
 
 struct AnimRecordTemp {
-	uint16 *offset;
+	uint16 offset;
 	MovementDataList *list;
 };
 
@@ -235,12 +235,12 @@ void Resources::reloadData() {
 
 		// Handle any direction frames
 		AnimRecordTemp dirEntries[4] = {
-			{&animRec->leftOffset, &newEntry->leftFrames},
-			{&animRec->rightOffset, &newEntry->rightFrames},
-			{&animRec->upOffset, &newEntry->upFrames},
-			{&animRec->downOffset, &newEntry->downFrames}};
+			{FROM_LE_16(animRec->leftOffset), &newEntry->leftFrames},
+			{FROM_LE_16(animRec->rightOffset), &newEntry->rightFrames},
+			{FROM_LE_16(animRec->upOffset), &newEntry->upFrames},
+			{FROM_LE_16(animRec->downOffset), &newEntry->downFrames}};
 		for (int dirCtr = 0; dirCtr < 4; ++dirCtr) {
-			offsetVal = READ_LE_UINT16(dirEntries[dirCtr].offset);
+			offsetVal = dirEntries[dirCtr].offset;
 			if (offsetVal != 0) {
 				MovementResource *moveRec = (MovementResource *)
 					(mb->data() + offsetVal);


Commit: d8aab6362a82ff9e2424cb7063c78f9b10c4d12a
    https://github.com/scummvm/scummvm/commit/d8aab6362a82ff9e2424cb7063c78f9b10c4d12a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-11-09T18:29:07-05:00

Commit Message:
Merge pull request #1049 from csnover/lure-unaligned

LURE: Stop taking address of unaligned pointer

Changed paths:
    engines/lure/res.cpp







More information about the Scummvm-git-logs mailing list