From 9c8cc19f9639c7e293f5f723cb8cadd46d6ea00a Mon Sep 17 00:00:00 2001 From: SGauvin Date: Sun, 10 Feb 2019 11:02:45 -0500 Subject: [PATCH] Removed useless cast Removed useless cast in SFML/System/Utf.inl at line 296. This useless cast creates a warning when using -Wuseless-cast as an option in g++ and clang++. Operations can't be made on types smaller than 4 bytes (32 bits), so types smaller than 4 bytes are converted to at least 4 bytes types, thus rendering the static_cast useless in this particular case. --- include/SFML/System/Utf.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SFML/System/Utf.inl b/include/SFML/System/Utf.inl index d48d8b510..1fed3a002 100644 --- a/include/SFML/System/Utf.inl +++ b/include/SFML/System/Utf.inl @@ -293,7 +293,7 @@ In Utf<16>::decode(In begin, In end, Uint32& output, Uint32 replacement) if ((second >= 0xDC00) && (second <= 0xDFFF)) { // The second element is valid: convert the two elements to a UTF-32 character - output = static_cast(((first - 0xD800) << 10) + (second - 0xDC00) + 0x0010000); + output = ((first - 0xD800) << 10) + (second - 0xDC00) + 0x0010000; } else {