From 0ce2ca4e006a70d787481040fa844c85aac43222 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 12 Apr 2011 16:53:15 +0200 Subject: COMMON: Replace MKID_BE by MKTAG MKID_BE relied on unspecified behavior of the C++ compiler, and as such was always a bit unsafe. The new MKTAG macro is slightly less elegant, but does no longer depend on the behavior of the compiler. Inspired by FFmpeg, which has an almost identical macro. --- engines/scumm/smush/saud_channel.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/scumm/smush/saud_channel.cpp') diff --git a/engines/scumm/smush/saud_channel.cpp b/engines/scumm/smush/saud_channel.cpp index 94df70633f..04ed955224 100644 --- a/engines/scumm/smush/saud_channel.cpp +++ b/engines/scumm/smush/saud_channel.cpp @@ -50,7 +50,7 @@ bool SaudChannel::handleSubTags(int32 &offset) { uint32 available_size = _tbufferSize - offset; switch (type) { - case MKID_BE('STRK'): + case MKTAG('S','T','R','K'): _inData = false; if (available_size >= (size + 8)) { int32 subSize = READ_BE_UINT32((byte *)_tbuffer + offset + 4); @@ -60,14 +60,14 @@ bool SaudChannel::handleSubTags(int32 &offset) { } else return false; break; - case MKID_BE('SMRK'): + case MKTAG('S','M','R','K'): _inData = false; if (available_size >= (size + 8)) _markReached = true; else return false; break; - case MKID_BE('SHDR'): + case MKTAG('S','H','D','R'): _inData = false; if (available_size >= (size + 8)) { int32 subSize = READ_BE_UINT32((byte *)_tbuffer + offset + 4); @@ -76,7 +76,7 @@ bool SaudChannel::handleSubTags(int32 &offset) { } else return false; break; - case MKID_BE('SDAT'): + case MKTAG('S','D','A','T'): _inData = true; _dataSize = size; offset += 8; @@ -123,7 +123,7 @@ bool SaudChannel::appendData(Common::SeekableReadStream &b, int32 size) { assert(size > 8); uint32 saud_type = b.readUint32BE(); /*uint32 saud_size =*/ b.readUint32BE(); - if (saud_type != MKID_BE('SAUD')) + if (saud_type != MKTAG('S','A','U','D')) error("Invalid Chunk for SaudChannel : %X", saud_type); size -= 8; _dataSize = -2; -- cgit v1.2.3