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. --- graphics/thumbnail.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'graphics/thumbnail.cpp') diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp index b245cfc5fa..8688096c3d 100644 --- a/graphics/thumbnail.cpp +++ b/graphics/thumbnail.cpp @@ -49,7 +49,7 @@ bool loadHeader(Common::SeekableReadStream &in, ThumbnailHeader &header, bool ou // We also accept the bad 'BMHT' header here, for the sake of compatibility // with some older savegames which were written incorrectly due to a bug in // ScummVM which wrote the thumb header type incorrectly on LE systems. - if (header.type != MKID_BE('THMB') && header.type != MKID_BE('BMHT')) { + if (header.type != MKTAG('T','H','M','B') && header.type != MKTAG('B','M','H','T')) { if (outputWarnings) warning("couldn't find thumbnail header type"); return false; @@ -145,7 +145,7 @@ bool saveThumbnail(Common::WriteStream &out, const Graphics::Surface &thumb) { } ThumbnailHeader header; - header.type = MKID_BE('THMB'); + header.type = MKTAG('T','H','M','B'); header.size = ThumbnailHeaderSize + thumb.w*thumb.h*thumb.bytesPerPixel; header.version = THMB_VERSION; header.width = thumb.w; -- cgit v1.2.3