aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r--engines/wintermute/base/file/base_package.cpp4
-rw-r--r--engines/wintermute/base/scriptables/script.cpp3
-rw-r--r--engines/wintermute/base/scriptables/script_ext_file.cpp2
3 files changed, 5 insertions, 4 deletions
diff --git a/engines/wintermute/base/file/base_package.cpp b/engines/wintermute/base/file/base_package.cpp
index b1461283e8..ae4955390b 100644
--- a/engines/wintermute/base/file/base_package.cpp
+++ b/engines/wintermute/base/file/base_package.cpp
@@ -53,8 +53,8 @@ static bool findPackageSignature(Common::SeekableReadStream *f, uint32 *offset)
byte buf[32768];
byte signature[8];
- ((uint32 *)signature)[0] = PACKAGE_MAGIC_1;
- ((uint32 *)signature)[1] = PACKAGE_MAGIC_2;
+ WRITE_LE_UINT32(signature + 0, PACKAGE_MAGIC_1);
+ WRITE_LE_UINT32(signature + 4, PACKAGE_MAGIC_2);
uint32 fileSize = (uint32)f->size();
uint32 startPos = 1024 * 1024;
diff --git a/engines/wintermute/base/scriptables/script.cpp b/engines/wintermute/base/scriptables/script.cpp
index f0b868209d..44fd117e61 100644
--- a/engines/wintermute/base/scriptables/script.cpp
+++ b/engines/wintermute/base/scriptables/script.cpp
@@ -488,7 +488,8 @@ double ScScript::getFloat() {
SWAP(buffer[3], buffer[4]);
#endif
- double ret = *(double *)(buffer);
+ double ret;
+ memcpy(&ret, buffer, sizeof(double));
_iP += 8; // Hardcode the double-size used originally.
return ret;
}
diff --git a/engines/wintermute/base/scriptables/script_ext_file.cpp b/engines/wintermute/base/scriptables/script_ext_file.cpp
index 36a624367c..15ddd4bcca 100644
--- a/engines/wintermute/base/scriptables/script_ext_file.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_file.cpp
@@ -443,7 +443,7 @@ bool SXFile::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
return STATUS_OK;
}
float val;
- (*(uint32 *)&val) = _readFile->readUint32LE();
+ WRITE_UINT32(&val, _readFile->readUint32LE());
if (!_readFile->err()) {
stack->pushFloat(val);
} else {