Browse Source

Introjucer: avoided clang warning in generated binary data code.

tags/2021-05-28
jules 13 years ago
parent
commit
0c142b51b5
5 changed files with 20 additions and 26 deletions
  1. +2
    -12
      extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp
  2. +1
    -9
      extras/Introjucer/Source/Project/jucer_Project.cpp
  3. +5
    -5
      extras/Introjucer/Source/Utility/jucer_CodeHelpers.cpp
  4. +10
    -0
      extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp
  5. +2
    -0
      extras/Introjucer/Source/Utility/jucer_MiscUtilities.h

+ 2
- 12
extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp View File

@@ -521,22 +521,12 @@ StringPairArray ProjectExporter::BuildConfiguration::getAllPreprocessorDefs() co
StringArray ProjectExporter::BuildConfiguration::getHeaderSearchPaths() const
{
StringArray s;
s.addTokens (getHeaderSearchPathString(), ";", String::empty);
s.trim();
s.removeEmptyStrings();
s.removeDuplicates (false);
return s;
return getSearchPathsFromString (getHeaderSearchPathString());
}
StringArray ProjectExporter::BuildConfiguration::getLibrarySearchPaths() const
{
StringArray s;
s.addTokens (getLibrarySearchPathString(), ";", String::empty);
s.trim();
s.removeEmptyStrings();
s.removeDuplicates (false);
return s;
return getSearchPathsFromString (getLibrarySearchPathString());
}
String ProjectExporter::BuildConfiguration::getGCCLibraryPathFlags() const


+ 1
- 9
extras/Introjucer/Source/Project/jucer_Project.cpp View File

@@ -901,15 +901,7 @@ String Project::getModuleID (int index) const
//==============================================================================
ValueTree Project::getExporters()
{
ValueTree exporters (projectRoot.getChildWithName (Tags::exporters));
if (! exporters.isValid())
{
projectRoot.addChild (ValueTree (Tags::exporters), 0, getUndoManagerFor (projectRoot));
exporters = getExporters();
}
return exporters;
return projectRoot.getOrCreateChildWithName (Tags::exporters, nullptr);
}
int Project::getNumExporters()


+ 5
- 5
extras/Introjucer/Source/Utility/jucer_CodeHelpers.cpp View File

@@ -339,10 +339,10 @@ namespace CodeHelpers
}
//==============================================================================
static int calculateHash (const String& s, const int hashMultiplier)
static unsigned int calculateHash (const String& s, const int hashMultiplier)
{
const char* t = s.toUTF8();
int hash = 0;
unsigned int hash = 0;
while (*t != 0)
hash = hashMultiplier * hash + *t++;
@@ -360,11 +360,11 @@ namespace CodeHelpers
for (;;)
{
SortedSet <int> hashes;
SortedSet <unsigned int> hashes;
bool collision = false;
for (int i = allStrings.size(); --i >= 0;)
{
const int hash = calculateHash (allStrings[i], v);
const unsigned int hash = calculateHash (allStrings[i], v);
if (hashes.contains (hash))
{
collision = true;
@@ -390,7 +390,7 @@ namespace CodeHelpers
const String indent (String::repeatedString (" ", indentLevel));
const int hashMultiplier = findBestHashMultiplier (strings);
out << indent << "int hash = 0;" << newLine
out << indent << "unsigned int hash = 0;" << newLine
<< indent << "if (" << utf8PointerVariable << " != 0)" << newLine
<< indent << " while (*" << utf8PointerVariable << " != 0)" << newLine
<< indent << " hash = " << hashMultiplier << " * hash + *" << utf8PointerVariable << "++;" << newLine


+ 10
- 0
extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp View File

@@ -162,6 +162,16 @@ String replacePreprocessorDefs (const StringPairArray& definitions, String sourc
return sourceString;
}
StringArray getSearchPathsFromString (const String& searchPath)
{
StringArray s;
s.addTokens (searchPath, ";", String::empty);
s.trim();
s.removeEmptyStrings();
s.removeDuplicates (false);
return s;
}
//==============================================================================
void autoScrollForMouseEvent (const MouseEvent& e, bool scrollX, bool scrollY)
{


+ 2
- 0
extras/Introjucer/Source/Utility/jucer_MiscUtilities.h View File

@@ -37,6 +37,8 @@ StringPairArray mergePreprocessorDefs (StringPairArray inheritedDefs, const Stri
String createGCCPreprocessorFlags (const StringPairArray& defs);
String replacePreprocessorDefs (const StringPairArray& definitions, String sourceString);
StringArray getSearchPathsFromString (const String& searchPath);
void setValueIfVoid (Value value, const var& defaultValue);
//==============================================================================


Loading…
Cancel
Save