From e85cf8d54ddf6f55d47c1257538356e074bc4c19 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 7 Nov 2015 14:41:45 +0100 Subject: WINTERMUTE: C++'ify code --- engines/wintermute/utils/convert_utf.cpp | 6 ++---- engines/wintermute/utils/convert_utf.h | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/wintermute/utils/convert_utf.cpp b/engines/wintermute/utils/convert_utf.cpp index 7ebc011d01..cdb48103d0 100644 --- a/engines/wintermute/utils/convert_utf.cpp +++ b/engines/wintermute/utils/convert_utf.cpp @@ -55,8 +55,6 @@ static const UTF32 halfMask = 0x3FFUL; #define UNI_SUR_HIGH_END (UTF32)0xDBFF #define UNI_SUR_LOW_START (UTF32)0xDC00 #define UNI_SUR_LOW_END (UTF32)0xDFFF -#define false 0 -#define true 1 /* --------------------------------------------------------------------- */ @@ -311,7 +309,7 @@ ConversionResult ConvertUTF16toUTF8( * definition of UTF-8 goes up to 4-byte sequences. */ -static Boolean isLegalUTF8(const UTF8 *source, int length) { +static bool isLegalUTF8(const UTF8 *source, int length) { UTF8 a; const UTF8 *srcptr = source + length; switch (length) { @@ -356,7 +354,7 @@ static Boolean isLegalUTF8(const UTF8 *source, int length) { * Exported function to return whether a UTF-8 sequence is legal or not. * This is not used here; it's just exported. */ -Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { +bool isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { int length = trailingBytesForUTF8[*source] + 1; if (source + length > sourceEnd) { return false; diff --git a/engines/wintermute/utils/convert_utf.h b/engines/wintermute/utils/convert_utf.h index a5f34456f5..d2e54f4af4 100644 --- a/engines/wintermute/utils/convert_utf.h +++ b/engines/wintermute/utils/convert_utf.h @@ -96,7 +96,6 @@ namespace Wintermute { typedef uint32 UTF32; /* at least 32 bits */ typedef uint16 UTF16; /* at least 16 bits */ typedef uint8 UTF8; /* typically 8 bits */ -typedef uint8 Boolean; /* 0 or 1 */ /* Some fundamental constants */ #define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD @@ -141,7 +140,7 @@ ConversionResult ConvertUTF32toUTF16( const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags); -Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); +bool isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); } // End of namespace Wintermute -- cgit v1.2.3