From 3664d275cbc34255010334dbd4ed258c5a8d098c Mon Sep 17 00:00:00 2001 From: laurentgom Date: Sat, 28 Feb 2009 21:20:01 +0000 Subject: [PATCH] Fixed warnings in Unicode.inl git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1031 4e206d99-4929-0410-ac5d-dfc041789085 --- include/SFML/System/Unicode.hpp | 2 +- include/SFML/System/Unicode.inl | 6 +++--- src/SFML/System/Unicode.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/SFML/System/Unicode.hpp b/include/SFML/System/Unicode.hpp index 6463ed8d8..c79c8748f 100644 --- a/include/SFML/System/Unicode.hpp +++ b/include/SFML/System/Unicode.hpp @@ -277,7 +277,7 @@ private : //////////////////////////////////////////////////////////// // Static member data //////////////////////////////////////////////////////////// - static const char UTF8TrailingBytes[256]; ///< Lookup table to find the length of an UTF-8 sequence + static const int UTF8TrailingBytes[256]; ///< Lookup table to find the length of an UTF-8 sequence static const Uint32 UTF8Offsets[6]; ///< Magic values to subtract during UTF-8 conversions static const Uint8 UTF8FirstBytes[7]; ///< First bytes for UTF-8 sequences }; diff --git a/include/SFML/System/Unicode.inl b/include/SFML/System/Unicode.inl index 2dbb3a253..08f055e91 100644 --- a/include/SFML/System/Unicode.inl +++ b/include/SFML/System/Unicode.inl @@ -104,7 +104,7 @@ inline Out Unicode::UTF8ToUTF16(In Begin, In End, Out Output, Uint16 Replacement while (Begin < End) { Uint32 c = 0; - int TrailingBytes = UTF8TrailingBytes[*Begin]; + int TrailingBytes = UTF8TrailingBytes[static_cast(*Begin)]; if (Begin + TrailingBytes < End) { // First decode the UTF-8 character @@ -165,7 +165,7 @@ inline Out Unicode::UTF8ToUTF32(In Begin, In End, Out Output, Uint32 Replacement while (Begin < End) { Uint32 c = 0; - int TrailingBytes = UTF8TrailingBytes[*Begin]; + int TrailingBytes = UTF8TrailingBytes[static_cast(*Begin)]; if (Begin + TrailingBytes < End) { // First decode the UTF-8 character @@ -424,7 +424,7 @@ inline std::size_t Unicode::GetUTF8Length(In Begin, In End) std::size_t Length = 0; while (Begin < End) { - int NbBytes = UTF8TrailingBytes[*Begin]; + int NbBytes = UTF8TrailingBytes[static_cast(*Begin)]; if (Begin + NbBytes < End) ++Length; diff --git a/src/SFML/System/Unicode.cpp b/src/SFML/System/Unicode.cpp index 0b5345278..f921b5001 100644 --- a/src/SFML/System/Unicode.cpp +++ b/src/SFML/System/Unicode.cpp @@ -78,7 +78,7 @@ namespace sf //////////////////////////////////////////////////////////// // Static member data //////////////////////////////////////////////////////////// -const char Unicode::UTF8TrailingBytes[256] = +const int Unicode::UTF8TrailingBytes[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,