diff options
Diffstat (limited to 'engines/wintermute')
-rw-r--r-- | engines/wintermute/base/scriptables/script.cpp | 3 | ||||
-rw-r--r-- | engines/wintermute/base/scriptables/script_ext_file.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
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 { |