summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-06-06 16:48:27 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-06-06 16:49:44 +0200
commit7abe976be5166845c5f43b70a0dfb38608d31356 (patch)
tree1b753b3e10e49d62e20b8c4a56603dc9814f09d8 /lotuswordpro
parent9b57a0aeb841506cff387eece9015505086e353c (diff)
Avoid undefined mis-aligned memory access
(assuming this shall always be little endian, given "Intel" in the function names) Change-Id: Iff7e1305108dd0f8d9fae762c1f715e2e7b481b3
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/ut.hxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/lotuswordpro/source/filter/ut.hxx b/lotuswordpro/source/filter/ut.hxx
index 3f3080160c93..478336075648 100644
--- a/lotuswordpro/source/filter/ut.hxx
+++ b/lotuswordpro/source/filter/ut.hxx
@@ -76,16 +76,16 @@ namespace OpenStormBento
typedef const Name * pConst##Name
inline UtWord UtGetIntelWord(UtByte * pData)
-{ return * (UtWord *) pData; }
+{ return pData[0] | pData[1] << 8; }
inline UtDWord UtGetIntelDWord(UtByte * pData)
-{ return * (UtDWord *) pData; }
+{ return pData[0] | pData[1] << 8 | pData[2] << 16 | pData[3] << 24; }
inline void UtPutIntelWord(UtByte * pData, UtWord Val)
-{ * (UtWord *) pData = Val; }
+{ pData[0] = Val; pData[1] = Val >> 8; }
inline void UtPutIntelDWord(UtByte * pData, UtDWord Val)
-{ * (UtDWord *) pData = Val; }
+{ pData[0] = Val; pData[1] = Val >> 8; pData[2] = Val >> 16; pData[3] = Val >> 24; }
inline UtByte UtGetIntelByte(UtByte * pData)
{ return * pData; }