Browse Source

Tidied up some inconsistent use of size_t and a problem in a demo build.

tags/2021-05-28
jules 10 years ago
parent
commit
8d8c946528
4 changed files with 6 additions and 6 deletions
  1. +1
    -1
      examples/PluckedStringsDemo/Source/StringSynthesiser.h
  2. +1
    -1
      modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp
  3. +3
    -3
      modules/juce_core/text/juce_String.cpp
  4. +1
    -1
      modules/juce_core/text/juce_String.h

+ 1
- 1
examples/PluckedStringsDemo/Source/StringSynthesiser.h View File

@@ -81,7 +81,7 @@ private:
//=======================================================================
void prepareSynthesiserState (double sampleRate, double frequencyInHz)
{
std::size_t delayLineLength = std::lround (sampleRate / frequencyInHz);
size_t delayLineLength = (size_t) roundToInt (sampleRate / frequencyInHz);
// we need a minimum delay line length to get a reasonable synthesis.
// if you hit this assert, increase sample rate or decrease frequency!


+ 1
- 1
modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -2163,7 +2163,7 @@ private:
if (object->getState (&stream) == kResultTrue)
{
MemoryBlock info (stream.getData(), (std::size_t) stream.getSize());
MemoryBlock info (stream.getData(), (size_t) stream.getSize());
head.createNewChildElement (identifier)->addTextElement (info.toBase64Encoding());
}
}


+ 3
- 3
modules/juce_core/text/juce_String.cpp View File

@@ -566,9 +566,9 @@ struct HashGenerator
enum { multiplier = sizeof (Type) > 4 ? 101 : 31 };
};
int String::hashCode() const noexcept { return HashGenerator<int> ::calculate (text); }
int64 String::hashCode64() const noexcept { return HashGenerator<int64> ::calculate (text); }
std::size_t String::hash() const noexcept { return HashGenerator<std::size_t>::calculate (text); }
int String::hashCode() const noexcept { return HashGenerator<int> ::calculate (text); }
int64 String::hashCode64() const noexcept { return HashGenerator<int64> ::calculate (text); }
size_t String::hash() const noexcept { return HashGenerator<size_t> ::calculate (text); }
//==============================================================================
JUCE_API bool JUCE_CALLTYPE operator== (const String& s1, const String& s2) noexcept { return s1.compare (s2) == 0; }


+ 1
- 1
modules/juce_core/text/juce_String.h View File

@@ -181,7 +181,7 @@ public:
int64 hashCode64() const noexcept;
/** Generates a probably-unique hashcode from this string. */
std::size_t hash() const noexcept;
size_t hash() const noexcept;
/** Returns the number of characters in the string. */
int length() const noexcept;


Loading…
Cancel
Save