From 383c1678ceeaf4afd99d1cd9f0d4fa9df2b7d985 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 23 Aug 2017 10:06:56 +0100 Subject: [PATCH] Worked around a compiler warning --- modules/juce_core/text/juce_String.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index d66b945693..ef1a2844cc 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -563,7 +563,7 @@ struct HashGenerator template static Type calculate (CharPointer t) noexcept { - Type result = Type(); + Type result = {}; while (! t.isEmpty()) result = ((Type) multiplier) * result + (Type) t.getAndAdvance(); @@ -574,9 +574,9 @@ struct HashGenerator enum { multiplier = sizeof (Type) > 4 ? 101 : 31 }; }; -int String::hashCode() const noexcept { return HashGenerator ::calculate (text); } -int64 String::hashCode64() const noexcept { return HashGenerator ::calculate (text); } -size_t String::hash() const noexcept { return HashGenerator ::calculate (text); } +int String::hashCode() const noexcept { return (int) HashGenerator ::calculate (text); } +int64 String::hashCode64() const noexcept { return (int64) HashGenerator ::calculate (text); } +size_t String::hash() const noexcept { return HashGenerator ::calculate (text); } //============================================================================== JUCE_API bool JUCE_CALLTYPE operator== (const String& s1, const String& s2) noexcept { return s1.compare (s2) == 0; }