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/saveload.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/scumm/saveload.cpp') diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index fb34255683..3bfe51a77b 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -154,7 +154,7 @@ void ScummEngine::requestLoad(int slot) { } static bool saveSaveGameHeader(Common::OutSaveFile *out, SaveGameHeader &hdr) { - hdr.type = MKID_BE('SCVM'); + hdr.type = MKTAG('S','C','V','M'); hdr.size = 0; hdr.ver = CURRENT_VER; @@ -308,7 +308,7 @@ static bool loadSaveGameHeader(Common::SeekableReadStream *in, SaveGameHeader &h hdr.size = in->readUint32LE(); hdr.ver = in->readUint32LE(); in->read(hdr.name, sizeof(hdr.name)); - return !in->err() && hdr.type == MKID_BE('SCVM'); + return !in->err() && hdr.type == MKTAG('S','C','V','M'); } bool ScummEngine::loadState(int slot, bool compat) { @@ -746,7 +746,7 @@ bool ScummEngine::loadInfos(Common::SeekableReadStream *file, SaveStateMetaInfos SaveInfoSection section; section.type = file->readUint32BE(); - if (section.type != MKID_BE('INFO')) { + if (section.type != MKTAG('I','N','F','O')) { return false; } @@ -793,7 +793,7 @@ bool ScummEngine::loadInfos(Common::SeekableReadStream *file, SaveStateMetaInfos void ScummEngine::saveInfos(Common::WriteStream* file) { SaveInfoSection section; - section.type = MKID_BE('INFO'); + section.type = MKTAG('I','N','F','O'); section.version = INFOSECTION_VERSION; section.size = SaveInfoSectionSize; -- cgit v1.2.3