1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-21 01:24:21 +00:00

Fixed some pedantic warnings.

This commit is contained in:
jules 2013-09-16 18:47:28 +01:00
parent 3ab3c79589
commit fc772941d6
15 changed files with 30 additions and 55 deletions

View file

@ -401,7 +401,7 @@ namespace CodeHelpers
}
//==============================================================================
static unsigned int calculateHash (const String& s, const int hashMultiplier)
static unsigned int calculateHash (const String& s, const unsigned int hashMultiplier)
{
const char* t = s.toUTF8();
unsigned int hash = 0;
@ -411,9 +411,9 @@ namespace CodeHelpers
return hash;
}
static int findBestHashMultiplier (const StringArray& strings)
static unsigned int findBestHashMultiplier (const StringArray& strings)
{
int v = 31;
unsigned int v = 31;
for (;;)
{
@ -445,19 +445,19 @@ namespace CodeHelpers
{
jassert (strings.size() == codeToExecute.size());
const String indent (String::repeatedString (" ", indentLevel));
const int hashMultiplier = findBestHashMultiplier (strings);
const unsigned int hashMultiplier = findBestHashMultiplier (strings);
out << indent << "unsigned int hash = 0;" << newLine
<< indent << "if (" << utf8PointerVariable << " != 0)" << newLine
<< indent << " while (*" << utf8PointerVariable << " != 0)" << newLine
<< indent << " hash = " << hashMultiplier << " * hash + (unsigned int) *" << utf8PointerVariable << "++;" << newLine
<< indent << " hash = " << (int) hashMultiplier << " * hash + (unsigned int) *" << utf8PointerVariable << "++;" << newLine
<< newLine
<< indent << "switch (hash)" << newLine
<< indent << "{" << newLine;
for (int i = 0; i < strings.size(); ++i)
{
out << indent << " case 0x" << hexString8Digits (calculateHash (strings[i], hashMultiplier))
out << indent << " case 0x" << hexString8Digits ((int) calculateHash (strings[i], hashMultiplier))
<< ": " << codeToExecute[i] << newLine;
}