[Scummvm-git-logs] scummvm master -> 0e13331556eae44d0fc3e19a3953f9cd25f4aaff
digitall
noreply at scummvm.org
Mon Feb 13 01:55:10 UTC 2023
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:
0e13331556 DEVTOOLS: Fix Endian Check In sky.cpt Generation Tool
Commit: 0e13331556eae44d0fc3e19a3953f9cd25f4aaff
https://github.com/scummvm/scummvm/commit/0e13331556eae44d0fc3e19a3953f9cd25f4aaff
Author: D G Turner (digitall at scummvm.org)
Date: 2023-02-13T01:51:08Z
Commit Message:
DEVTOOLS: Fix Endian Check In sky.cpt Generation Tool
The endian check in this tool was generating a GCC warning that the
array was being used uninitialised. Testing on amd64 which is little
endian returned failure which was incorrect. Have replaced with better
standard code for this function which now returns as expected on amd64
with no warnings.
Changed paths:
devtools/skycpt/AsciiCptCompile.cpp
diff --git a/devtools/skycpt/AsciiCptCompile.cpp b/devtools/skycpt/AsciiCptCompile.cpp
index a630d9847bc..ef343e60e91 100644
--- a/devtools/skycpt/AsciiCptCompile.cpp
+++ b/devtools/skycpt/AsciiCptCompile.cpp
@@ -41,8 +41,8 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE *
int main(int argc, char* argv[])
{
- uint8 testBuf[4] = { 0x11, 0x22, 0x33, 0x44 };
- if (*(uint32 *)testBuf != 0x44332211) {
+ volatile uint32 t = 0x11223344;
+ if (*((volatile uint8 *)&t) != 0x44) {
printf("Sorry, this program only works on little endian systems.\nGoodbye.\n");
return 0;
}
More information about the Scummvm-git-logs
mailing list