[Scummvm-git-logs] scummvm master -> 7e4d9b1e52708839646fb03bd6dacc3bc57052b0
alxpnv
noreply at scummvm.org
Tue Jun 28 10:19:16 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7e4d9b1e52 ASYLUM: make byte twiddling macros endian agnostic
Commit: 7e4d9b1e52708839646fb03bd6dacc3bc57052b0
https://github.com/scummvm/scummvm/commit/7e4d9b1e52708839646fb03bd6dacc3bc57052b0
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2022-06-28T13:11:08+03:00
Commit Message:
ASYLUM: make byte twiddling macros endian agnostic
Also removed a couple of unused macros
Changed paths:
engines/asylum/shared.h
diff --git a/engines/asylum/shared.h b/engines/asylum/shared.h
index 474b984bb61..bdb937a3a91 100644
--- a/engines/asylum/shared.h
+++ b/engines/asylum/shared.h
@@ -922,10 +922,13 @@ enum AsylumAction {
//////////////////////////////////////////////////////////////////////////
// Sub-integer partial access macros
//////////////////////////////////////////////////////////////////////////
+#if defined SCUMM_LITTLE_ENDIAN
#define LOBYTE(d) (*((char *)&(d)))
#define BYTE1(d) (*((char *)&(d) + 1)) // Same as HIBYTE()
-#define BYTE2(d) (*((char *)&(d) + 2))
-#define LOWORD(x) (*((int16 *)&(x)))
+#elif defined SCUMM_BIG_ENDIAN
+#define LOBYTE(d) (*((char *)&(d) + sizeof(d) - 1))
+#define BYTE1(d) (*((char *)&(d) + sizeof(d) - 2))
+#endif
//////////////////////////////////////////////////////////////////////////
// Resource ID macros
More information about the Scummvm-git-logs
mailing list