aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorColin Snover2017-11-07 22:27:05 -0600
committerColin Snover2017-11-07 22:57:33 -0600
commitb0eb5caa511d3783a568c0d40e4b35c169c2272e (patch)
tree78ea655b30377b5cb36545f02bccfdd2c0e66b22 /engines/lure
parent8e8ec3900c90fc9e18571df84c5e9e754479052b (diff)
downloadscummvm-rg350-b0eb5caa511d3783a568c0d40e4b35c169c2272e.tar.gz
scummvm-rg350-b0eb5caa511d3783a568c0d40e4b35c169c2272e.tar.bz2
scummvm-rg350-b0eb5caa511d3783a568c0d40e4b35c169c2272e.zip
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.
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/res.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp
index 7a79f48b87..dc9ce29af8 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);