[Scummvm-git-logs] scummvm master -> 6e7a25b08106ba68ca7a37e0e6699514ca6e431b

dwatteau noreply at scummvm.org
Fri Jan 9 21:29:18 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
6e7a25b081 SWORD1: Use MKTAG() macro when looking for the 'data' FourCC


Commit: 6e7a25b08106ba68ca7a37e0e6699514ca6e431b
    https://github.com/scummvm/scummvm/commit/6e7a25b08106ba68ca7a37e0e6699514ca6e431b
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-01-09T21:36:16+01:00

Commit Message:
SWORD1: Use MKTAG() macro when looking for the 'data' FourCC

As far as I can tell, the MKTAG() macro was introduced because the
resulting endianness of multi-character literal is implementation
defined.  Since we're comparing it against READ_BE_UINT32() here,
it's better to use MKTAG(), to be sure that `'data'` is interpreted
in the big-endian order of FourCC.

(In practice, it's getting hard to find a C++11 compiler that
wouldn't guarantee this by default, nowadays.  Except maybe the IBM
or Oracle/Sun compilers, but I'm not aware of anyone still using
this to build modern ScummVM.  Still, MKTAG() remains used a lot in
the codebase, so it's a bit more coherent this way.)

Changed paths:
    engines/sword1/sound.cpp


diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp
index 452155e92a2..67f94854eb4 100644
--- a/engines/sword1/sound.cpp
+++ b/engines/sword1/sound.cpp
@@ -615,7 +615,7 @@ bool Sound::expandSpeech(byte *src, byte *dst, uint32 dstSize, bool *endiannessC
 	uint8 *fBuf = src;
 	uint32 headerPos = 0;
 
-	while ((READ_BE_UINT32(fBuf + headerPos) != 'data') && (headerPos < 100))
+	while ((READ_BE_UINT32(fBuf + headerPos) != MKTAG('d','a','t','a')) && (headerPos < 100))
 		headerPos++;
 
 	if (headerPos < 100) {




More information about the Scummvm-git-logs mailing list