Browse Source

Purged some warnings.

tags/2021-05-28
jules 13 years ago
parent
commit
1f95f54089
79 changed files with 380 additions and 352 deletions
  1. +1
    -0
      extras/Introjucer/JuceLibraryCode/BinaryData.cpp
  2. +1
    -0
      extras/Introjucer/Source/Project Saving/jucer_ResourceFile.cpp
  3. +2
    -2
      extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp
  4. +1
    -0
      extras/JuceDemo/JuceLibraryCode/BinaryData.cpp
  5. +1
    -0
      extras/the jucer/JuceLibraryCode/BinaryData.cpp
  6. +4
    -4
      modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp
  7. +17
    -17
      modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.cpp
  8. +7
    -7
      modules/juce_audio_basics/midi/juce_MidiBuffer.cpp
  9. +10
    -10
      modules/juce_audio_basics/midi/juce_MidiFile.cpp
  10. +10
    -10
      modules/juce_audio_basics/midi/juce_MidiMessage.cpp
  11. +4
    -4
      modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp
  12. +15
    -15
      modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp
  13. +13
    -13
      modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp
  14. +1
    -1
      modules/juce_audio_formats/codecs/flac/libFLAC/bitreader.c
  15. +5
    -0
      modules/juce_audio_formats/codecs/flac/libFLAC/stream_encoder.c
  16. +10
    -10
      modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp
  17. +7
    -7
      modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp
  18. +14
    -14
      modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp
  19. +5
    -5
      modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp
  20. +1
    -1
      modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp
  21. +1
    -1
      modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/block.c
  22. +1
    -1
      modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/psy.c
  23. +12
    -12
      modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/res0.c
  24. +1
    -1
      modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/sharedbook.c
  25. +1
    -1
      modules/juce_audio_formats/codecs/oggvorbis/ogg.h
  26. +4
    -4
      modules/juce_audio_formats/format/juce_AudioFormatReader.cpp
  27. +3
    -2
      modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp
  28. +1
    -1
      modules/juce_audio_formats/format/juce_AudioSubsectionReader.cpp
  29. +4
    -0
      modules/juce_audio_processors/juce_audio_processors.cpp
  30. +5
    -5
      modules/juce_audio_utils/players/juce_AudioProcessorPlayer.cpp
  31. +6
    -6
      modules/juce_core/containers/juce_Array.h
  32. +5
    -5
      modules/juce_core/containers/juce_OwnedArray.h
  33. +5
    -5
      modules/juce_core/containers/juce_ReferenceCountedArray.h
  34. +2
    -2
      modules/juce_core/containers/juce_SortedSet.h
  35. +1
    -1
      modules/juce_core/maths/juce_BigInteger.cpp
  36. +1
    -1
      modules/juce_core/maths/juce_Random.cpp
  37. +3
    -3
      modules/juce_core/native/juce_mac_Files.mm
  38. +1
    -1
      modules/juce_core/native/juce_mac_SystemStats.mm
  39. +5
    -0
      modules/juce_core/native/juce_posix_SharedCode.h
  40. +15
    -15
      modules/juce_core/network/juce_Socket.cpp
  41. +6
    -6
      modules/juce_core/network/juce_URL.cpp
  42. +6
    -6
      modules/juce_core/text/juce_String.cpp
  43. +4
    -3
      modules/juce_core/time/juce_Time.cpp
  44. +2
    -2
      modules/juce_core/xml/juce_XmlDocument.cpp
  45. +3
    -3
      modules/juce_core/xml/juce_XmlElement.cpp
  46. +1
    -0
      modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp
  47. +6
    -6
      modules/juce_cryptography/encryption/juce_Primes.cpp
  48. +1
    -1
      modules/juce_cryptography/hashing/juce_SHA256.cpp
  49. +2
    -0
      modules/juce_events/messages/juce_MessageManager.cpp
  50. +3
    -1
      modules/juce_events/native/juce_mac_MessageManager.mm
  51. +2
    -2
      modules/juce_graphics/colour/juce_Colour.cpp
  52. +1
    -1
      modules/juce_graphics/colour/juce_ColourGradient.cpp
  53. +19
    -19
      modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp
  54. +2
    -2
      modules/juce_graphics/fonts/juce_CustomTypeface.cpp
  55. +1
    -1
      modules/juce_graphics/fonts/juce_Font.cpp
  56. +1
    -1
      modules/juce_graphics/geometry/juce_Path.cpp
  57. +36
    -36
      modules/juce_graphics/geometry/juce_PathStrokeType.cpp
  58. +11
    -11
      modules/juce_graphics/image_formats/juce_JPEGLoader.cpp
  59. +3
    -3
      modules/juce_graphics/image_formats/juce_PNGLoader.cpp
  60. +1
    -0
      modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
  61. +6
    -6
      modules/juce_graphics/native/juce_mac_Fonts.mm
  62. +2
    -2
      modules/juce_gui_basics/drawables/juce_DrawablePath.cpp
  63. +2
    -2
      modules/juce_gui_basics/keyboard/juce_KeyPress.cpp
  64. +2
    -2
      modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.cpp
  65. +7
    -7
      modules/juce_gui_basics/layout/juce_ComponentBuilder.cpp
  66. +1
    -1
      modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp
  67. +3
    -3
      modules/juce_gui_basics/layout/juce_TabbedComponent.cpp
  68. +11
    -11
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp
  69. +2
    -2
      modules/juce_gui_basics/native/juce_mac_MainMenu.mm
  70. +1
    -1
      modules/juce_gui_basics/positioning/juce_RelativeRectangle.cpp
  71. +2
    -2
      modules/juce_gui_basics/widgets/juce_Slider.cpp
  72. +1
    -1
      modules/juce_gui_basics/widgets/juce_TextEditor.cpp
  73. +1
    -1
      modules/juce_gui_basics/widgets/juce_TreeView.cpp
  74. +3
    -3
      modules/juce_gui_basics/windows/juce_ComponentPeer.cpp
  75. +1
    -0
      modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp
  76. +15
    -15
      modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniser.cpp
  77. +1
    -1
      modules/juce_gui_extra/code_editor/juce_CodeDocument.cpp
  78. +1
    -1
      modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp
  79. +1
    -0
      modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp

+ 1
- 0
extras/Introjucer/JuceLibraryCode/BinaryData.cpp View File

@@ -1112,6 +1112,7 @@ static const unsigned char temp_ee6f0c0f[] =
const char* juce_icon_png = (const char*) temp_ee6f0c0f;
const char* getNamedResource (const char*, int&) throw();
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw()
{
int hash = 0;


+ 1
- 0
extras/Introjucer/Source/Project Saving/jucer_ResourceFile.cpp View File

@@ -175,6 +175,7 @@ bool ResourceFile::write (const File& cppFile, OutputStream& cpp, OutputStream&
cpp << newLine
<< newLine
<< "const char* getNamedResource (const char*, int&) throw();" << newLine
<< "const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw()" << newLine
<< "{" << newLine;


+ 2
- 2
extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp View File

@@ -30,7 +30,7 @@
//==============================================================================
namespace FileHelpers
{
int64 calculateMemoryHashCode (const void* data, const int numBytes)
static int64 calculateMemoryHashCode (const void* data, const int numBytes)
{
int64 t = 0;
@@ -112,7 +112,7 @@ namespace FileHelpers
return path.replaceCharacter ('/', '\\');
}
String appendPath (const String& path, const String& subpath)
static String appendPath (const String& path, const String& subpath)
{
if (File::isAbsolutePath (subpath)
|| subpath.startsWithChar ('$')


+ 1
- 0
extras/JuceDemo/JuceLibraryCode/BinaryData.cpp View File

@@ -2142,6 +2142,7 @@ static const unsigned char temp_816ae700[] =
const char* treedemo_xml = (const char*) temp_816ae700;
const char* getNamedResource (const char*, int&) throw();
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw()
{
int hash = 0;


+ 1
- 0
extras/the jucer/JuceLibraryCode/BinaryData.cpp View File

@@ -509,6 +509,7 @@ static const unsigned char temp_2dcb70c7[] =
const char* prefs_misc_png = (const char*) temp_2dcb70c7;
const char* getNamedResource (const char*, int&) throw();
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw()
{
int hash = 0;


+ 4
- 4
modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp View File

@@ -82,7 +82,7 @@ void AudioDataConverters::convertFloatToInt24LE (const float* source, void* dest
{
for (int i = 0; i < numSamples; ++i)
{
ByteOrder::littleEndian24BitToChars ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])), intData);
ByteOrder::littleEndian24BitToChars (roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])), intData);
intData += destBytesPerSample;
}
}
@@ -93,7 +93,7 @@ void AudioDataConverters::convertFloatToInt24LE (const float* source, void* dest
for (int i = numSamples; --i >= 0;)
{
intData -= destBytesPerSample;
ByteOrder::littleEndian24BitToChars ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])), intData);
ByteOrder::littleEndian24BitToChars (roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])), intData);
}
}
}
@@ -107,7 +107,7 @@ void AudioDataConverters::convertFloatToInt24BE (const float* source, void* dest
{
for (int i = 0; i < numSamples; ++i)
{
ByteOrder::bigEndian24BitToChars ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])), intData);
ByteOrder::bigEndian24BitToChars (roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])), intData);
intData += destBytesPerSample;
}
}
@@ -118,7 +118,7 @@ void AudioDataConverters::convertFloatToInt24BE (const float* source, void* dest
for (int i = numSamples; --i >= 0;)
{
intData -= destBytesPerSample;
ByteOrder::bigEndian24BitToChars ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])), intData);
ByteOrder::bigEndian24BitToChars (roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])), intData);
}
}
}


+ 17
- 17
modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.cpp View File

@@ -39,7 +39,7 @@ AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) noexcept
size (other.size)
{
allocateData();
const size_t numBytes = size * sizeof (float);
const size_t numBytes = sizeof (float) * (size_t) size;
for (int i = 0; i < numChannels; ++i)
memcpy (channels[i], other.channels[i], numBytes);
@@ -47,8 +47,8 @@ AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) noexcept
void AudioSampleBuffer::allocateData()
{
const size_t channelListSize = (numChannels + 1) * sizeof (float*);
allocatedBytes = (int) (numChannels * size * sizeof (float) + channelListSize + 32);
const size_t channelListSize = sizeof (float*) * (size_t) (numChannels + 1);
allocatedBytes = (size_t) numChannels * (size_t) size * sizeof (float) + channelListSize + 32;
allocatedData.malloc (allocatedBytes);
channels = reinterpret_cast <float**> (allocatedData.getData());
@@ -109,7 +109,7 @@ void AudioSampleBuffer::allocateChannels (float** const dataToReferTo, int offse
}
else
{
allocatedData.malloc (numChannels + 1, sizeof (float*));
allocatedData.malloc ((size_t) numChannels + 1, sizeof (float*));
channels = reinterpret_cast <float**> (allocatedData.getData());
}
@@ -130,7 +130,7 @@ AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& other)
{
setSize (other.getNumChannels(), other.getNumSamples(), false, false, false);
const size_t numBytes = size * sizeof (float);
const size_t numBytes = sizeof (float) * (size_t) size;
for (int i = 0; i < numChannels; ++i)
memcpy (channels[i], other.channels[i], numBytes);
@@ -154,15 +154,15 @@ void AudioSampleBuffer::setSize (const int newNumChannels,
if (newNumSamples != size || newNumChannels != numChannels)
{
const size_t channelListSize = (newNumChannels + 1) * sizeof (float*);
const size_t newTotalBytes = (newNumChannels * newNumSamples * sizeof (float)) + channelListSize + 32;
const size_t channelListSize = sizeof (float*) * (size_t) (newNumChannels + 1);
const size_t newTotalBytes = ((size_t) newNumChannels * (size_t) newNumSamples * sizeof (float)) + channelListSize + 32;
if (keepExistingContent)
{
HeapBlock <char, true> newData;
newData.allocate (newTotalBytes, clearExtraSpace);
const size_t numBytesToCopy = sizeof (float) * jmin (newNumSamples, size);
const size_t numBytesToCopy = sizeof (float) * (size_t) jmin (newNumSamples, size);
float** const newChannels = reinterpret_cast <float**> (newData.getData());
float* newChan = reinterpret_cast <float*> (newData + channelListSize);
@@ -178,7 +178,7 @@ void AudioSampleBuffer::setSize (const int newNumChannels,
memcpy (newChannels[i], channels[i], numBytesToCopy);
allocatedData.swapWith (newData);
allocatedBytes = (int) newTotalBytes;
allocatedBytes = newTotalBytes;
channels = newChannels;
}
else
@@ -212,7 +212,7 @@ void AudioSampleBuffer::setSize (const int newNumChannels,
void AudioSampleBuffer::clear() noexcept
{
for (int i = 0; i < numChannels; ++i)
zeromem (channels[i], size * sizeof (float));
zeromem (channels[i], sizeof (float) * (size_t) size);
}
void AudioSampleBuffer::clear (const int startSample,
@@ -221,7 +221,7 @@ void AudioSampleBuffer::clear (const int startSample,
jassert (startSample >= 0 && startSample + numSamples <= size);
for (int i = 0; i < numChannels; ++i)
zeromem (channels [i] + startSample, numSamples * sizeof (float));
zeromem (channels [i] + startSample, sizeof (float) * (size_t) numSamples);
}
void AudioSampleBuffer::clear (const int channel,
@@ -231,7 +231,7 @@ void AudioSampleBuffer::clear (const int channel,
jassert (isPositiveAndBelow (channel, numChannels));
jassert (startSample >= 0 && startSample + numSamples <= size);
zeromem (channels [channel] + startSample, numSamples * sizeof (float));
zeromem (channels [channel] + startSample, sizeof (float) * (size_t) numSamples);
}
void AudioSampleBuffer::applyGain (const int channel,
@@ -248,7 +248,7 @@ void AudioSampleBuffer::applyGain (const int channel,
if (gain == 0.0f)
{
zeromem (d, sizeof (float) * numSamples);
zeromem (d, sizeof (float) * (size_t) numSamples);
}
else
{
@@ -403,7 +403,7 @@ void AudioSampleBuffer::copyFrom (const int destChannel,
{
memcpy (channels [destChannel] + destStartSample,
source.channels [sourceChannel] + sourceStartSample,
sizeof (float) * numSamples);
sizeof (float) * (size_t) numSamples);
}
}
@@ -420,7 +420,7 @@ void AudioSampleBuffer::copyFrom (const int destChannel,
{
memcpy (channels [destChannel] + destStartSample,
source,
sizeof (float) * numSamples);
sizeof (float) * (size_t) numSamples);
}
}
@@ -442,7 +442,7 @@ void AudioSampleBuffer::copyFrom (const int destChannel,
{
if (gain == 0)
{
zeromem (d, sizeof (float) * numSamples);
zeromem (d, sizeof (float) * (size_t) numSamples);
}
else
{
@@ -452,7 +452,7 @@ void AudioSampleBuffer::copyFrom (const int destChannel,
}
else
{
memcpy (d, source, sizeof (float) * numSamples);
memcpy (d, source, sizeof (float) * (size_t) numSamples);
}
}
}


+ 7
- 7
modules/juce_audio_basics/midi/juce_MidiBuffer.cpp View File

@@ -40,7 +40,7 @@ namespace MidiBufferHelpers
return getEventDataSize (d) + sizeof (int) + sizeof (uint16);
}
int findActualEventLength (const uint8* const data, const int maxBytes) noexcept
static int findActualEventLength (const uint8* const data, const int maxBytes) noexcept
{
unsigned int byte = (unsigned int) *data;
int size = 0;
@@ -126,7 +126,7 @@ void MidiBuffer::clear (const int startSample, const int numSamples)
const int bytesToMove = bytesUsed - (int) (end - getData());
if (bytesToMove > 0)
memmove (start, end, bytesToMove);
memmove (start, end, (size_t) bytesToMove);
bytesUsed -= (int) (end - start);
}
@@ -143,23 +143,23 @@ void MidiBuffer::addEvent (const void* const newData, const int maxBytes, const
if (numBytes > 0)
{
int spaceNeeded = bytesUsed + numBytes + sizeof (int) + sizeof (uint16);
data.ensureSize ((spaceNeeded + spaceNeeded / 2 + 8) & ~7);
size_t spaceNeeded = (size_t) bytesUsed + (size_t) numBytes + sizeof (int) + sizeof (uint16);
data.ensureSize ((spaceNeeded + spaceNeeded / 2 + 8) & ~(size_t) 7);
uint8* d = findEventAfter (getData(), sampleNumber);
const int bytesToMove = bytesUsed - (int) (d - getData());
if (bytesToMove > 0)
memmove (d + numBytes + sizeof (int) + sizeof (uint16), d, bytesToMove);
memmove (d + numBytes + sizeof (int) + sizeof (uint16), d, (size_t) bytesToMove);
*reinterpret_cast <int*> (d) = sampleNumber;
d += sizeof (int);
*reinterpret_cast <uint16*> (d) = (uint16) numBytes;
d += sizeof (uint16);
memcpy (d, newData, numBytes);
memcpy (d, newData, (size_t) numBytes);
bytesUsed += numBytes + sizeof (int) + sizeof (uint16);
bytesUsed += sizeof (int) + sizeof (uint16) + (size_t) numBytes;
}
}


+ 10
- 10
modules/juce_audio_basics/midi/juce_MidiFile.cpp View File

@@ -25,7 +25,7 @@
namespace MidiFileHelpers
{
void writeVariableLengthInt (OutputStream& out, unsigned int v)
static void writeVariableLengthInt (OutputStream& out, unsigned int v)
{
unsigned int buffer = v & 0x7f;
@@ -46,9 +46,9 @@ namespace MidiFileHelpers
}
}
bool parseMidiHeader (const uint8* &data, short& timeFormat, short& fileType, short& numberOfTracks) noexcept
static bool parseMidiHeader (const uint8* &data, short& timeFormat, short& fileType, short& numberOfTracks) noexcept
{
unsigned int ch = (int) ByteOrder::bigEndianInt (data);
unsigned int ch = ByteOrder::bigEndianInt (data);
data += 4;
if (ch != ByteOrder::bigEndianInt ("MThd"))
@@ -88,9 +88,9 @@ namespace MidiFileHelpers
return true;
}
double convertTicksToSeconds (const double time,
const MidiMessageSequence& tempoEvents,
const int timeFormat)
static double convertTicksToSeconds (const double time,
const MidiMessageSequence& tempoEvents,
const int timeFormat)
{
if (timeFormat > 0)
{
@@ -261,7 +261,7 @@ bool MidiFile::readFrom (InputStream& sourceStream)
if (size > 16 && MidiFileHelpers::parseMidiHeader (d, timeFormat, fileType, expectedTracks))
{
size -= (int) (d - static_cast <const uint8*> (data.getData()));
size -= (size_t) (d - static_cast <const uint8*> (data.getData()));
int track = 0;
@@ -278,7 +278,7 @@ bool MidiFile::readFrom (InputStream& sourceStream)
if (chunkType == (int) ByteOrder::bigEndianInt ("MTrk"))
readNextTrack (d, chunkSize);
size -= chunkSize + 8;
size -= (size_t) chunkSize + 8;
d += chunkSize;
++track;
}
@@ -384,7 +384,7 @@ void MidiFile::writeTrack (OutputStream& mainOut, const int trackNum)
{
const int tick = roundToInt (mm.getTimeStamp());
const int delta = jmax (0, tick - lastTick);
MidiFileHelpers::writeVariableLengthInt (out, delta);
MidiFileHelpers::writeVariableLengthInt (out, (uint32) delta);
lastTick = tick;
const uint8* data = mm.getRawData();
@@ -407,7 +407,7 @@ void MidiFile::writeTrack (OutputStream& mainOut, const int trackNum)
++data;
--dataSize;
MidiFileHelpers::writeVariableLengthInt (out, dataSize);
MidiFileHelpers::writeVariableLengthInt (out, (uint32) dataSize);
}
out.write (data, dataSize);


+ 10
- 10
modules/juce_audio_basics/midi/juce_MidiMessage.cpp View File

@@ -115,7 +115,7 @@ MidiMessage::MidiMessage (const void* const d, const int dataSize, const double
else
data = new uint8 [dataSize];
memcpy (data, d, dataSize);
memcpy (data, d, (size_t) dataSize);
// check that the length matches the data..
jassert (size > 3 || data[0] >= 0xf0 || getMessageLengthFromFirstByte (data[0]) == size);
@@ -164,7 +164,7 @@ MidiMessage::MidiMessage (const MidiMessage& other)
if (other.usesAllocatedData())
{
data = new uint8 [size];
memcpy (data, other.data, size);
memcpy (data, other.data, (size_t) size);
}
else
{
@@ -180,7 +180,7 @@ MidiMessage::MidiMessage (const MidiMessage& other, const double newTimeStamp)
if (other.usesAllocatedData())
{
data = new uint8 [size];
memcpy (data, other.data, size);
memcpy (data, other.data, (size_t) size);
}
else
{
@@ -247,7 +247,7 @@ MidiMessage::MidiMessage (const void* src_, int sz, int& numBytesUsed, const uin
data = new uint8 [size - numVariableLengthSysexBytes];
*data = (uint8) byte;
memcpy (data + 1, src + numVariableLengthSysexBytes, size - numVariableLengthSysexBytes - 1);
memcpy (data + 1, src + numVariableLengthSysexBytes, (size_t) (size - numVariableLengthSysexBytes - 1));
}
else if (byte == 0xff)
{
@@ -257,7 +257,7 @@ MidiMessage::MidiMessage (const void* src_, int sz, int& numBytesUsed, const uin
data = new uint8 [size];
*data = (uint8) byte;
memcpy (data + 1, src, size - 1);
memcpy (data + 1, src, (size_t) size - 1);
}
else
{
@@ -295,7 +295,7 @@ MidiMessage& MidiMessage::operator= (const MidiMessage& other)
if (other.usesAllocatedData())
{
data = new uint8 [size];
memcpy (data, other.data, size);
memcpy (data, other.data, (size_t) size);
}
else
{
@@ -404,7 +404,7 @@ int MidiMessage::getNoteNumber() const noexcept
void MidiMessage::setNoteNumber (const int newNoteNumber) noexcept
{
if (isNoteOnOrOff())
data[1] = (char) (newNoteNumber & 127);
data[1] = (uint8) (newNoteNumber & 127);
}
uint8 MidiMessage::getVelocity() const noexcept
@@ -622,10 +622,10 @@ bool MidiMessage::isSysEx() const noexcept
MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const int dataSize)
{
HeapBlock<uint8> m (dataSize + 2);
HeapBlock<uint8> m ((size_t) dataSize + 2);
m[0] = 0xf0;
memcpy (m + 1, sysexData, dataSize);
memcpy (m + 1, sysexData, (size_t) dataSize);
m[dataSize + 1] = 0xf7;
return MidiMessage (m, dataSize + 2);
@@ -682,7 +682,7 @@ bool MidiMessage::isTextMetaEvent() const noexcept
String MidiMessage::getTextFromTextMetaEvent() const
{
return String (reinterpret_cast <const char*> (getMetaEventData()), getMetaEventLength());
return String (reinterpret_cast <const char*> (getMetaEventData()), (size_t) getMetaEventLength());
}
bool MidiMessage::isTrackNameEvent() const noexcept { return (data[1] == 3) && (*data == 0xff); }


+ 4
- 4
modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp View File

@@ -59,9 +59,9 @@ void ResamplingAudioSource::prepareToPlay (int samplesPerBlockExpected,
bufferPos = 0;
subSampleOffset = 0.0;
filterStates.calloc (numChannels);
srcBuffers.calloc (numChannels);
destBuffers.calloc (numChannels);
filterStates.calloc ((size_t) numChannels);
srcBuffers.calloc ((size_t) numChannels);
destBuffers.calloc ((size_t) numChannels);
createLowPass (ratio);
resetFilters();
}
@@ -228,7 +228,7 @@ void ResamplingAudioSource::setFilterCoefficients (double c1, double c2, double
void ResamplingAudioSource::resetFilters()
{
filterStates.clear (numChannels);
filterStates.clear ((size_t) numChannels);
}
void ResamplingAudioSource::applyFilter (float* samples, int num, FilterState& fs)


+ 15
- 15
modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp View File

@@ -79,10 +79,10 @@ public:
void allocateTempBuffers()
{
const int tempBufSize = bufferSize + 4;
audioBuffer.calloc ((numInputChans + numOutputChans) * tempBufSize);
audioBuffer.calloc ((size_t) ((numInputChans + numOutputChans) * tempBufSize));
tempInputBuffers.calloc (numInputChans + 2);
tempOutputBuffers.calloc (numOutputChans + 2);
tempInputBuffers.calloc ((size_t) numInputChans + 2);
tempOutputBuffers.calloc ((size_t) numOutputChans + 2);
int i, count = 0;
for (i = 0; i < numInputChans; ++i)
@@ -110,7 +110,7 @@ public:
if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, bufList)))
{
const int numStreams = bufList->mNumberBuffers;
const int numStreams = (int) bufList->mNumberBuffers;
for (int i = 0; i < numStreams; ++i)
{
@@ -123,11 +123,11 @@ public:
{
char channelName [256] = { 0 };
UInt32 nameSize = sizeof (channelName);
UInt32 channelNum = chanNum + 1;
UInt32 channelNum = (UInt32) chanNum + 1;
pa.mSelector = kAudioDevicePropertyChannelName;
if (AudioObjectGetPropertyData (deviceID, &pa, sizeof (channelNum), &channelNum, &nameSize, channelName) == noErr)
name = String::fromUTF8 (channelName, nameSize);
name = String::fromUTF8 (channelName, (int) nameSize);
}
if (input)
@@ -135,8 +135,8 @@ public:
if (activeInputChans[chanNum])
{
inputChannelInfo [numInputChannelInfos].streamNum = i;
inputChannelInfo [numInputChannelInfos].dataOffsetSamples = j;
inputChannelInfo [numInputChannelInfos].dataStrideSamples = b.mNumberChannels;
inputChannelInfo [numInputChannelInfos].dataOffsetSamples = (int) j;
inputChannelInfo [numInputChannelInfos].dataStrideSamples = (int) b.mNumberChannels;
++numInputChannelInfos;
}
@@ -150,8 +150,8 @@ public:
if (activeOutputChans[chanNum])
{
outputChannelInfo [numOutputChannelInfos].streamNum = i;
outputChannelInfo [numOutputChannelInfos].dataOffsetSamples = j;
outputChannelInfo [numOutputChannelInfos].dataStrideSamples = b.mNumberChannels;
outputChannelInfo [numOutputChannelInfos].dataOffsetSamples = (int) j;
outputChannelInfo [numOutputChannelInfos].dataStrideSamples = (int) b.mNumberChannels;
++numOutputChannelInfos;
}
@@ -199,7 +199,7 @@ public:
pa.mSelector = kAudioDevicePropertyBufferFrameSize;
if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, &framesPerBuf)))
{
bufferSize = framesPerBuf;
bufferSize = (int) framesPerBuf;
allocateTempBuffers();
}
@@ -294,10 +294,10 @@ public:
inChanNames.clear();
outChanNames.clear();
inputChannelInfo.calloc (numInputChans + 2);
inputChannelInfo.calloc ((size_t) numInputChans + 2);
numInputChannelInfos = 0;
outputChannelInfo.calloc (numOutputChans + 2);
outputChannelInfo.calloc ((size_t) numOutputChans + 2);
numOutputChannelInfos = 0;
fillInChannelInfo (true);
@@ -431,7 +431,7 @@ public:
else
{
// change buffer size
UInt32 framesPerBuf = bufferSizeSamples;
UInt32 framesPerBuf = (UInt32) bufferSizeSamples;
pa.mSelector = kAudioDevicePropertyBufferFrameSize;
if (! OK (AudioObjectSetPropertyData (deviceID, &pa, 0, 0, sizeof (framesPerBuf), &framesPerBuf)))
@@ -1233,7 +1233,7 @@ private:
if (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, bufList) == noErr)
{
const int numStreams = bufList->mNumberBuffers;
const int numStreams = (int) bufList->mNumberBuffers;
for (int i = 0; i < numStreams; ++i)
{


+ 13
- 13
modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp View File

@@ -25,7 +25,7 @@
namespace CoreMidiHelpers
{
bool logError (const OSStatus err, const int lineNum)
static bool logError (const OSStatus err, const int lineNum)
{
if (err == noErr)
return true;
@@ -39,7 +39,7 @@ namespace CoreMidiHelpers
#define CHECK_ERROR(a) CoreMidiHelpers::logError (a, __LINE__)
//==============================================================================
String getEndpointName (MIDIEndpointRef endpoint, bool isExternal)
static String getEndpointName (MIDIEndpointRef endpoint, bool isExternal)
{
String result;
CFStringRef str = 0;
@@ -101,7 +101,7 @@ namespace CoreMidiHelpers
return result;
}
String getConnectedEndpointName (MIDIEndpointRef endpoint)
static String getConnectedEndpointName (MIDIEndpointRef endpoint)
{
String result;
@@ -113,7 +113,7 @@ namespace CoreMidiHelpers
if (connections != 0)
{
numConnections = (int) (CFDataGetLength (connections) / sizeof (MIDIUniqueID));
numConnections = ((int) CFDataGetLength (connections)) / (int) sizeof (MIDIUniqueID);
if (numConnections > 0)
{
@@ -121,7 +121,7 @@ namespace CoreMidiHelpers
for (int i = 0; i < numConnections; ++i, ++pid)
{
MIDIUniqueID uid = ByteOrder::swapIfLittleEndian ((uint32) *pid);
MIDIUniqueID uid = (MIDIUniqueID) ByteOrder::swapIfLittleEndian ((uint32) *pid);
MIDIObjectRef connObject;
MIDIObjectType connObjectType;
OSStatus err = MIDIObjectFindByUniqueID (uid, &connObject, &connObjectType);
@@ -170,7 +170,7 @@ namespace CoreMidiHelpers
return getEndpointName (endpoint, false);
}
MIDIClientRef getGlobalMidiClient()
static MIDIClientRef getGlobalMidiClient()
{
static MIDIClientRef globalMidiClient = 0;
@@ -273,7 +273,7 @@ namespace CoreMidiHelpers
MidiDataConcatenator concatenator;
};
void midiInputProc (const MIDIPacketList* pktlist, void* readProcRefCon, void* /*srcConnRefCon*/)
static void midiInputProc (const MIDIPacketList* pktlist, void* readProcRefCon, void* /*srcConnRefCon*/)
{
static_cast <MidiPortAndCallback*> (readProcRefCon)->handlePackets (pktlist);
}
@@ -313,7 +313,7 @@ MidiOutput* MidiOutput::openDevice (int index)
if (isPositiveAndBelow (index, (int) MIDIGetNumberOfDestinations()))
{
MIDIEndpointRef endPoint = MIDIGetDestination (index);
MIDIEndpointRef endPoint = MIDIGetDestination ((ItemCount) index);
CFStringRef pname;
if (CHECK_ERROR (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname)))
@@ -373,15 +373,15 @@ void MidiOutput::sendMessageNow (const MidiMessage& message)
int pos = 0, bytesLeft = message.getRawDataSize();
const int numPackets = (bytesLeft + maxPacketSize - 1) / maxPacketSize;
HeapBlock <MIDIPacketList> packets;
packets.malloc (32 * numPackets + message.getRawDataSize(), 1);
packets->numPackets = numPackets;
packets.malloc ((size_t) (32 * numPackets + message.getRawDataSize()), 1);
packets->numPackets = (UInt32) numPackets;
MIDIPacket* p = packets->packet;
for (int i = 0; i < numPackets; ++i)
{
p->timeStamp = timeStamp;
p->length = jmin (maxPacketSize, bytesLeft);
p->length = (UInt16) jmin (maxPacketSize, bytesLeft);
memcpy (p->data, message.getRawData() + pos, p->length);
pos += p->length;
bytesLeft -= p->length;
@@ -395,7 +395,7 @@ void MidiOutput::sendMessageNow (const MidiMessage& message)
MIDIPacketList packets;
packets.numPackets = 1;
packets.packet[0].timeStamp = timeStamp;
packets.packet[0].length = message.getRawDataSize();
packets.packet[0].length = (UInt16) message.getRawDataSize();
*(int*) (packets.packet[0].data) = *(const int*) message.getRawData();
mpe->send (&packets);
@@ -439,7 +439,7 @@ MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback)
if (isPositiveAndBelow (index, (int) MIDIGetNumberOfSources()))
{
MIDIEndpointRef endPoint = MIDIGetSource (index);
MIDIEndpointRef endPoint = MIDIGetSource ((ItemCount) index);
if (endPoint != 0)
{


+ 1
- 1
modules/juce_audio_formats/codecs/flac/libFLAC/bitreader.c View File

@@ -388,7 +388,7 @@ FLAC__uint16 FLAC__bitreader_get_read_crc16(FLAC__BitReader *br)
for( ; br->crc16_align < br->consumed_bits; br->crc16_align += 8)
br->read_crc16 = FLAC__CRC16_UPDATE((unsigned)((tail >> (FLAC__BITS_PER_WORD-8-br->crc16_align)) & 0xff), br->read_crc16);
}
return br->read_crc16;
return (FLAC__uint16) br->read_crc16;
}
FLaC__INLINE FLAC__bool FLAC__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br)


+ 5
- 0
modules/juce_audio_formats/codecs/flac/libFLAC/stream_encoder.c View File

@@ -1422,6 +1422,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_streamable_subset(FLAC__StreamEncod
return true;
}
FLAC_API FLAC__bool FLAC__stream_encoder_set_do_md5(FLAC__StreamEncoder *encoder, FLAC__bool value);
FLAC_API FLAC__bool FLAC__stream_encoder_set_do_md5(FLAC__StreamEncoder *encoder, FLAC__bool value)
{
FLAC__ASSERT(0 != encoder);
@@ -1750,6 +1751,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_metadata(FLAC__StreamEncoder *encod
* These three functions are not static, but not publically exposed in
* include/FLAC/ either. They are used by the test suite.
*/
FLAC_API FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value);
FLAC_API FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value)
{
FLAC__ASSERT(0 != encoder);
@@ -1761,6 +1763,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__Stream
return true;
}
FLAC_API FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value);
FLAC_API FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value)
{
FLAC__ASSERT(0 != encoder);
@@ -1772,6 +1775,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEnc
return true;
}
FLAC_API FLAC__bool FLAC__stream_encoder_disable_verbatim_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value);
FLAC_API FLAC__bool FLAC__stream_encoder_disable_verbatim_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value)
{
FLAC__ASSERT(0 != encoder);
@@ -1848,6 +1852,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_get_streamable_subset(const FLAC__Strea
return encoder->protected_->streamable_subset;
}
FLAC_API FLAC__bool FLAC__stream_encoder_get_do_md5(const FLAC__StreamEncoder *encoder);
FLAC_API FLAC__bool FLAC__stream_encoder_get_do_md5(const FLAC__StreamEncoder *encoder)
{
FLAC__ASSERT(0 != encoder);


+ 10
- 10
modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp View File

@@ -86,7 +86,7 @@ namespace AiffFileHelpers
{
if (values.getAllKeys().contains ("MidiUnityNote", true))
{
block.setSize ((sizeof (InstChunk) + 3) & ~3, true);
block.setSize ((sizeof (InstChunk) + 3) & ~(size_t) 3, true);
InstChunk* const inst = static_cast <InstChunk*> (block.getData());
inst->baseNote = (int8) values.getValue ("MidiUnityNote", "60").getIntValue();
@@ -117,7 +117,7 @@ namespace AiffFileHelpers
//==============================================================================
namespace MarkChunk
{
bool metaDataContainsZeroIdentifiers (const StringPairArray& values)
static bool metaDataContainsZeroIdentifiers (const StringPairArray& values)
{
// (zero cue identifiers are valid for WAV but not for AIFF)
const String cueString ("Cue");
@@ -145,7 +145,7 @@ namespace AiffFileHelpers
return false;
}
void create (MemoryBlock& block, const StringPairArray& values)
static void create (MemoryBlock& block, const StringPairArray& values)
{
const int numCues = values.getValue ("NumCuePoints", "0").getIntValue();
@@ -205,7 +205,7 @@ namespace AiffFileHelpers
//==============================================================================
namespace COMTChunk
{
void create (MemoryBlock& block, const StringPairArray& values)
static void create (MemoryBlock& block, const StringPairArray& values)
{
const int numNotes = values.getValue ("NumCueNotes", "0").getIntValue();
@@ -321,7 +321,7 @@ public:
const int offset = input->readIntBigEndian();
dataChunkStart = input->getPosition() + 4 + offset;
lengthInSamples = (bytesPerFrame > 0) ? jmin (lengthInSamples, (int64) (length / bytesPerFrame)) : 0;
lengthInSamples = (bytesPerFrame > 0) ? jmin (lengthInSamples, ((int64) length) / (int64) bytesPerFrame) : 0;
}
else if (type == chunkName ("MARK"))
{
@@ -407,7 +407,7 @@ public:
{
for (int i = numDestChannels; --i >= 0;)
if (destSamples[i] != nullptr)
zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * numSamples);
zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples);
numSamples = (int) samplesAvailable;
}
@@ -517,7 +517,7 @@ public:
if (writeFailed)
return false;
const int bytes = numChannels * numSamples * bitsPerSample / 8;
const size_t bytes = (size_t) numSamples * numChannels * bitsPerSample / 8;
tempBlock.ensureSize ((size_t) bytes, false);
switch (bitsPerSample)
@@ -530,7 +530,7 @@ public:
}
if (bytesWritten + bytes >= (size_t) 0xfff00000
|| ! output->write (tempBlock.getData(), bytes))
|| ! output->write (tempBlock.getData(), (int) bytes))
{
// failed to write to disk, so let's try writing the header.
// If it's just run out of disk space, then if it does manage
@@ -542,7 +542,7 @@ public:
else
{
bytesWritten += bytes;
lengthInSamples += numSamples;
lengthInSamples += (uint64) numSamples;
return true;
}
@@ -550,7 +550,7 @@ public:
private:
MemoryBlock tempBlock, markChunk, comtChunk, instChunk;
uint32 lengthInSamples, bytesWritten;
uint64 lengthInSamples, bytesWritten;
int64 headerPosition;
bool writeFailed;


+ 7
- 7
modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp View File

@@ -129,7 +129,7 @@ public:
{
for (int i = numDestChannels; --i >= 0;)
if (destSamples[i] != nullptr)
zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * numSamples);
zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples);
numSamples = (int) samplesAvailable;
}
@@ -149,20 +149,20 @@ public:
while (numSamples > 0)
{
const int numThisTime = jmin (8192, numSamples);
const int numBytes = numThisTime * sizeof (float);
const size_t numBytes = sizeof (float) * (size_t) numThisTime;
audioDataBlock.ensureSize (numBytes * numChannels, false);
float* data = static_cast<float*> (audioDataBlock.getData());
for (int j = numChannels; --j >= 0;)
for (int j = (int) numChannels; --j >= 0;)
{
bufferList->mBuffers[j].mNumberChannels = 1;
bufferList->mBuffers[j].mDataByteSize = numBytes;
bufferList->mBuffers[j].mDataByteSize = (UInt32) numBytes;
bufferList->mBuffers[j].mData = data;
data += numThisTime;
}
UInt32 numFramesToRead = numThisTime;
UInt32 numFramesToRead = (UInt32) numThisTime;
OSStatus status = ExtAudioFileRead (audioFileRef, &numFramesToRead, bufferList);
if (status != noErr)
return false;
@@ -171,7 +171,7 @@ public:
{
if (destSamples[i] != nullptr)
{
if (i < numChannels)
if (i < (int) numChannels)
memcpy (destSamples[i] + startOffsetInDestBuffer, bufferList->mBuffers[i].mData, numBytes);
else
zeromem (destSamples[i] + startOffsetInDestBuffer, numBytes);
@@ -210,7 +210,7 @@ private:
CoreAudioReader* const reader = static_cast<CoreAudioReader*> (inClientData);
reader->input->setPosition (inPosition);
*actualCount = reader->input->read (buffer, requestCount);
*actualCount = (UInt32) reader->input->read (buffer, (int) requestCount);
return noErr;
}


+ 14
- 14
modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp View File

@@ -131,7 +131,7 @@ public:
lengthInSamples = (unsigned int) info.total_samples;
numChannels = info.channels;
reservoir.setSize ((int) numChannels, 2 * info.max_blocksize, false, false, true);
reservoir.setSize ((int) numChannels, 2 * (int) info.max_blocksize, false, false, true);
}
// returns the number of samples read
@@ -157,7 +157,7 @@ public:
if (destSamples[i] != nullptr)
memcpy (destSamples[i] + startOffsetInDestBuffer,
reservoir.getSampleData (i, (int) (startSampleInFile - reservoirStart)),
sizeof (int) * num);
sizeof (int) * (size_t) num);
startOffsetInDestBuffer += num;
startSampleInFile += num;
@@ -194,7 +194,7 @@ public:
{
for (int i = numDestChannels; --i >= 0;)
if (destSamples[i] != nullptr)
zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * numSamples);
zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples);
}
return true;
@@ -252,14 +252,14 @@ public:
static FlacNamespace::FLAC__StreamDecoderTellStatus tellCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__uint64* absolute_byte_offset, void* client_data)
{
using namespace FlacNamespace;
*absolute_byte_offset = static_cast <const FlacReader*> (client_data)->input->getPosition();
*absolute_byte_offset = (uint64) static_cast <const FlacReader*> (client_data)->input->getPosition();
return FLAC__STREAM_DECODER_TELL_STATUS_OK;
}
static FlacNamespace::FLAC__StreamDecoderLengthStatus lengthCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__uint64* stream_length, void* client_data)
{
using namespace FlacNamespace;
*stream_length = static_cast <const FlacReader*> (client_data)->input->getTotalLength();
*stream_length = (uint64) static_cast <const FlacReader*> (client_data)->input->getTotalLength();
return FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
}
@@ -274,7 +274,7 @@ public:
void* client_data)
{
using namespace FlacNamespace;
static_cast <FlacReader*> (client_data)->useSamples (buffer, frame->header.blocksize);
static_cast <FlacReader*> (client_data)->useSamples (buffer, (int) frame->header.blocksize);
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
@@ -305,7 +305,7 @@ class FlacWriter : public AudioFormatWriter
public:
//==============================================================================
FlacWriter (OutputStream* const out, double sampleRate_,
int numChannels_, int bitsPerSample_, int qualityOptionIndex)
uint32 numChannels_, uint32 bitsPerSample_, int qualityOptionIndex)
: AudioFormatWriter (out, TRANS (flacFormatName),
sampleRate_, numChannels_, bitsPerSample_)
{
@@ -313,7 +313,7 @@ public:
encoder = FLAC__stream_encoder_new();
if (qualityOptionIndex > 0)
FLAC__stream_encoder_set_compression_level (encoder, jmin (8, qualityOptionIndex));
FLAC__stream_encoder_set_compression_level (encoder, (uint32) jmin (8, qualityOptionIndex));
FLAC__stream_encoder_set_do_mid_side_stereo (encoder, numChannels == 2);
FLAC__stream_encoder_set_loose_mid_side_stereo (encoder, numChannels == 2);
@@ -354,11 +354,11 @@ public:
HeapBlock<int*> channels;
HeapBlock<int> temp;
const int bitsToShift = 32 - bitsPerSample;
const int bitsToShift = 32 - (int) bitsPerSample;
if (bitsToShift > 0)
{
temp.malloc (numSamples * numChannels);
temp.malloc (numChannels * (size_t) numSamples);
channels.calloc (numChannels + 1);
for (unsigned int i = 0; i < numChannels; ++i)
@@ -366,7 +366,7 @@ public:
if (samplesToWrite[i] == nullptr)
break;
int* const destData = temp.getData() + i * numSamples;
int* const destData = temp.getData() + i * (size_t) numSamples;
channels[i] = destData;
for (int j = 0; j < numSamples; ++j)
@@ -376,7 +376,7 @@ public:
samplesToWrite = const_cast <const int**> (channels.getData());
}
return FLAC__stream_encoder_process (encoder, (const FLAC__int32**) samplesToWrite, numSamples) != 0;
return FLAC__stream_encoder_process (encoder, (const FLAC__int32**) samplesToWrite, (size_t) numSamples) != 0;
}
bool writeData (const void* const data, const int size) const
@@ -518,8 +518,8 @@ AudioFormatWriter* FlacAudioFormat::createWriterFor (OutputStream* out,
{
if (getPossibleBitDepths().contains (bitsPerSample))
{
ScopedPointer<FlacWriter> w (new FlacWriter (out, sampleRate, numberOfChannels, bitsPerSample, qualityOptionIndex));
ScopedPointer<FlacWriter> w (new FlacWriter (out, sampleRate, numberOfChannels,
(uint32) bitsPerSample, qualityOptionIndex));
if (w->ok)
return w.release();
}


+ 5
- 5
modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp View File

@@ -358,8 +358,8 @@ namespace WavFileHelpers
//==============================================================================
namespace ListChunk
{
void appendLabelOrNoteChunk (const StringPairArray& values, const String& prefix,
const int chunkType, MemoryOutputStream& out)
static void appendLabelOrNoteChunk (const StringPairArray& values, const String& prefix,
const int chunkType, MemoryOutputStream& out)
{
const String label (values.getValue (prefix + "Text", prefix));
const int labelLength = label.getNumBytesAsUTF8() + 1;
@@ -374,7 +374,7 @@ namespace WavFileHelpers
out.writeByte (0);
}
void appendExtraChunk (const StringPairArray& values, const String& prefix, MemoryOutputStream& out)
static void appendExtraChunk (const StringPairArray& values, const String& prefix, MemoryOutputStream& out)
{
const String text (values.getValue (prefix + "Text", prefix));
@@ -396,7 +396,7 @@ namespace WavFileHelpers
out.writeByte (0);
}
void create (MemoryBlock& block, const StringPairArray& values)
static void create (MemoryBlock& block, const StringPairArray& values)
{
const int numCueLabels = values.getValue ("NumCueLabels", "0").getIntValue();
const int numCueNotes = values.getValue ("NumCueNotes", "0").getIntValue();
@@ -1032,7 +1032,7 @@ AudioFormatWriter* WavAudioFormat::createWriterFor (OutputStream* out, double sa
namespace WavFileHelpers
{
bool slowCopyWavFileWithNewMetadata (const File& file, const StringPairArray& metadata)
static bool slowCopyWavFileWithNewMetadata (const File& file, const StringPairArray& metadata)
{
TemporaryFile tempFile (file);


+ 1
- 1
modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp View File

@@ -50,7 +50,7 @@ public:
if (bytesRead != nullptr)
*bytesRead = numRead;
return numRead == (int) numBytes ? S_OK : S_FALSE;
return (numRead == (int) numBytes) ? S_OK : S_FALSE;
}
JUCE_COMRESULT Seek (LARGE_INTEGER position, DWORD origin, ULARGE_INTEGER* resultPosition)


+ 1
- 1
modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/block.c View File

@@ -1025,7 +1025,7 @@ int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm){
}
float *vorbis_window(vorbis_dsp_state *v,int W){
static float *vorbis_window(vorbis_dsp_state *v,int W){
vorbis_info *vi=v->vi;
codec_setup_info *ci=(codec_setup_info*) vi->codec_setup;
int hs=ci->halfrate_flag;


+ 1
- 1
modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/psy.c View File

@@ -52,7 +52,7 @@ void _vp_global_free(vorbis_look_psy_global *look){
}
}
void _vi_gpsy_free(vorbis_info_psy_global *i){
static void _vi_gpsy_free(vorbis_info_psy_global *i){
if(i){
memset(i,0,sizeof(*i));
_ogg_free(i);


+ 12
- 12
modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/res0.c View File

@@ -66,7 +66,7 @@ typedef struct {
} vorbis_look_residue0;
void res0_free_info(vorbis_info_residue *i){
static void res0_free_info(vorbis_info_residue *i){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)i;
if(info){
memset(info,0,sizeof(*info));
@@ -74,7 +74,7 @@ void res0_free_info(vorbis_info_residue *i){
}
}
void res0_free_look(vorbis_look_residue *i){
static void res0_free_look(vorbis_look_residue *i){
int j;
if(i){
@@ -173,7 +173,7 @@ static int icount(unsigned int v){
}
void res0_pack(vorbis_info_residue *vr,oggpack_buffer *opb){
static void res0_pack(vorbis_info_residue *vr,oggpack_buffer *opb){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
int j,acc=0;
oggpack_write(opb,info->begin,24);
@@ -203,7 +203,7 @@ void res0_pack(vorbis_info_residue *vr,oggpack_buffer *opb){
}
/* vorbis_info is for range checking */
vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){
static vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){
int j,acc=0;
vorbis_info_residue0 *info=(vorbis_info_residue0*) _ogg_calloc(1,sizeof(*info));
codec_setup_info *ci=(codec_setup_info*) vi->codec_setup;
@@ -267,7 +267,7 @@ vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){
return(NULL);
}
vorbis_look_residue *res0_look(vorbis_dsp_state *vd,
static vorbis_look_residue *res0_look(vorbis_dsp_state *vd,
vorbis_info_residue *vr){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)_ogg_calloc(1,sizeof(*look));
@@ -716,7 +716,7 @@ static int _01inverse(vorbis_block *vb,vorbis_look_residue *vl,
return(0);
}
int res0_inverse(vorbis_block *vb,vorbis_look_residue *vl,
static int res0_inverse(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<ch;i++)
@@ -728,7 +728,7 @@ int res0_inverse(vorbis_block *vb,vorbis_look_residue *vl,
return(0);
}
int res1_forward(oggpack_buffer *opb,vorbis_block *vb,vorbis_look_residue *vl,
static int res1_forward(oggpack_buffer *opb,vorbis_block *vb,vorbis_look_residue *vl,
int **in,int *nonzero,int ch, long **partword, int submap){
int i,used=0;
for(i=0;i<ch;i++)
@@ -742,7 +742,7 @@ int res1_forward(oggpack_buffer *opb,vorbis_block *vb,vorbis_look_residue *vl,
}
}
long **res1_class(vorbis_block *vb,vorbis_look_residue *vl,
static long **res1_class(vorbis_block *vb,vorbis_look_residue *vl,
int **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<ch;i++)
@@ -754,7 +754,7 @@ long **res1_class(vorbis_block *vb,vorbis_look_residue *vl,
return(0);
}
int res1_inverse(vorbis_block *vb,vorbis_look_residue *vl,
static int res1_inverse(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<ch;i++)
@@ -766,7 +766,7 @@ int res1_inverse(vorbis_block *vb,vorbis_look_residue *vl,
return(0);
}
long **res2_class(vorbis_block *vb,vorbis_look_residue *vl,
static long **res2_class(vorbis_block *vb,vorbis_look_residue *vl,
int **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<ch;i++)
@@ -780,7 +780,7 @@ long **res2_class(vorbis_block *vb,vorbis_look_residue *vl,
/* res2 is slightly more different; all the channels are interleaved
into a single vector and encoded. */
int res2_forward(oggpack_buffer *opb,
static int res2_forward(oggpack_buffer *opb,
vorbis_block *vb,vorbis_look_residue *vl,
int **in,int *nonzero,int ch, long **partword,int submap){
long i,j,k,n=vb->pcmend/2,used=0;
@@ -804,7 +804,7 @@ int res2_forward(oggpack_buffer *opb,
}
/* duplicate code here as speed is somewhat more important */
int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
static int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
long i,k,l,s;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;


+ 1
- 1
modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/sharedbook.c View File

@@ -70,7 +70,7 @@ float _float32_unpack(long val){
/* given a list of word lengths, generate a list of codewords. Works
for length ordered or unordered, always assigns the lowest valued
codewords first. Extended to handle unused entries (length 0) */
ogg_uint32_t *_make_words(long *l,long n,long sparsecount){
static ogg_uint32_t *_make_words(long *l,long n,long sparsecount){
long i,j,count=0;
ogg_uint32_t marker[33];
ogg_uint32_t *r=(ogg_uint32_t*)_ogg_malloc((sparsecount?sparsecount:n)*sizeof(*r));


+ 1
- 1
modules/juce_audio_formats/codecs/oggvorbis/ogg.h View File

@@ -42,7 +42,7 @@ typedef struct {
} ogg_page;
ogg_uint32_t ogg_bitreverse(ogg_uint32_t x){
static ogg_uint32_t ogg_bitreverse(ogg_uint32_t x){
x= ((x>>16)&0x0000ffffUL) | ((x<<16)&0xffff0000UL);
x= ((x>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL);
x= ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL);


+ 4
- 4
modules/juce_audio_formats/format/juce_AudioFormatReader.cpp View File

@@ -56,7 +56,7 @@ bool AudioFormatReader::read (int* const* destSamples,
for (int i = numDestChannels; --i >= 0;)
if (destSamples[i] != nullptr)
zeromem (destSamples[i], sizeof (int) * silence);
zeromem (destSamples[i], sizeof (int) * (size_t) silence);
startOffsetInDestBuffer += silence;
numSamplesToRead -= silence;
@@ -89,13 +89,13 @@ bool AudioFormatReader::read (int* const* destSamples,
if (lastFullChannel != nullptr)
for (int i = (int) numChannels; i < numDestChannels; ++i)
if (destSamples[i] != nullptr)
memcpy (destSamples[i], lastFullChannel, sizeof (int) * numSamplesToRead);
memcpy (destSamples[i], lastFullChannel, sizeof (int) * (size_t) numSamplesToRead);
}
else
{
for (int i = (int) numChannels; i < numDestChannels; ++i)
if (destSamples[i] != nullptr)
zeromem (destSamples[i], sizeof (int) * numSamplesToRead);
zeromem (destSamples[i], sizeof (int) * (size_t) numSamplesToRead);
}
}
@@ -158,7 +158,7 @@ void AudioFormatReader::read (AudioSampleBuffer* buffer,
// if this is a stereo buffer and the source was mono, dupe the first channel..
memcpy (buffer->getSampleData (1, startSample),
buffer->getSampleData (0, startSample),
sizeof (float) * numSamples);
sizeof (float) * (size_t) numSamples);
}
}
}


+ 3
- 2
modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp View File

@@ -151,14 +151,15 @@ bool AudioFormatWriter::writeFromAudioSampleBuffer (const AudioSampleBuffer& sou
}
else
{
tempBuffer.malloc (numSamples * numChannels);
tempBuffer.malloc (((size_t) numSamples) * (size_t) numChannels);
for (unsigned int i = 0; i < numChannels; ++i)
{
typedef AudioData::Pointer <AudioData::Int32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> DestSampleType;
typedef AudioData::Pointer <AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const> SourceSampleType;
DestSampleType destData (chans[i] = tempBuffer + i * numSamples);
chans[i] = tempBuffer + (int) i * numSamples;
DestSampleType destData (chans[i]);
SourceSampleType sourceData (source.getSampleData ((int) i, startSample));
destData.convertSamples (sourceData, numSamples);
}


+ 1
- 1
modules/juce_audio_formats/format/juce_AudioSubsectionReader.cpp View File

@@ -55,7 +55,7 @@ bool AudioSubsectionReader::readSamples (int** destSamples, int numDestChannels,
{
for (int i = numDestChannels; --i >= 0;)
if (destSamples[i] != nullptr)
zeromem (destSamples[i], sizeof (int) * numSamples);
zeromem (destSamples[i], sizeof (int) * (size_t) numSamples);
numSamples = jmin (numSamples, (int) (length - startSampleInFile));


+ 4
- 0
modules/juce_audio_processors/juce_audio_processors.cpp View File

@@ -52,6 +52,10 @@
#endif
#endif
#if JUCE_PLUGINHOST_VST && JUCE_LINUX
#include <X11/Xlib.h>
#endif
//==============================================================================
namespace juce
{


+ 5
- 5
modules/juce_audio_utils/players/juce_AudioProcessorPlayer.cpp View File

@@ -91,14 +91,14 @@ void AudioProcessorPlayer::audioDeviceIOCallback (const float** const inputChann
for (i = 0; i < numOutputChannels; ++i)
{
channels[totalNumChans] = outputChannelData[i];
memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * numSamples);
memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * (size_t) numSamples);
++totalNumChans;
}
for (i = numOutputChannels; i < numInputChannels; ++i)
{
channels[totalNumChans] = tempBuffer.getSampleData (i - numOutputChannels, 0);
memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * numSamples);
memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * (size_t) numSamples);
++totalNumChans;
}
}
@@ -107,14 +107,14 @@ void AudioProcessorPlayer::audioDeviceIOCallback (const float** const inputChann
for (i = 0; i < numInputChannels; ++i)
{
channels[totalNumChans] = outputChannelData[i];
memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * numSamples);
memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * (size_t) numSamples);
++totalNumChans;
}
for (i = numInputChannels; i < numOutputChannels; ++i)
{
channels[totalNumChans] = outputChannelData[i];
zeromem (channels[totalNumChans], sizeof (float) * numSamples);
zeromem (channels[totalNumChans], sizeof (float) * (size_t) numSamples);
++totalNumChans;
}
}
@@ -130,7 +130,7 @@ void AudioProcessorPlayer::audioDeviceIOCallback (const float** const inputChann
if (processor->isSuspended())
{
for (i = 0; i < numOutputChannels; ++i)
zeromem (outputChannelData[i], sizeof (float) * numSamples);
zeromem (outputChannelData[i], sizeof (float) * (size_t) numSamples);
}
else
{


+ 6
- 6
modules/juce_core/containers/juce_Array.h View File

@@ -390,7 +390,7 @@ public:
const int numberToMove = numUsed - indexToInsertAt;
if (numberToMove > 0)
memmove (insertPos + 1, insertPos, numberToMove * sizeof (ElementType));
memmove (insertPos + 1, insertPos, ((size_t) numberToMove) * sizeof (ElementType));
new (insertPos) ElementType (newElement);
++numUsed;
@@ -426,7 +426,7 @@ public:
{
insertPos = data.elements + indexToInsertAt;
const int numberToMove = numUsed - indexToInsertAt;
memmove (insertPos + numberOfTimesToInsertIt, insertPos, numberToMove * sizeof (ElementType));
memmove (insertPos + numberOfTimesToInsertIt, insertPos, ((size_t) numberToMove) * sizeof (ElementType));
}
else
{
@@ -731,7 +731,7 @@ public:
const int numberToShift = numUsed - indexToRemove;
if (numberToShift > 0)
memmove (e, e + 1, numberToShift * sizeof (ElementType));
memmove (e, e + 1, ((size_t) numberToShift) * sizeof (ElementType));
if ((numUsed << 1) < data.numAllocated)
minimiseStorageOverheads();
@@ -795,7 +795,7 @@ public:
const int numToShift = numUsed - endIndex;
if (numToShift > 0)
memmove (e, e + numberToRemove, numToShift * sizeof (ElementType));
memmove (e, e + numberToRemove, ((size_t) numToShift) * sizeof (ElementType));
numUsed -= numberToRemove;
@@ -932,13 +932,13 @@ public:
{
memmove (data.elements + currentIndex,
data.elements + currentIndex + 1,
(newIndex - currentIndex) * sizeof (ElementType));
sizeof (ElementType) * (size_t) (newIndex - currentIndex));
}
else
{
memmove (data.elements + newIndex + 1,
data.elements + newIndex,
(currentIndex - newIndex) * sizeof (ElementType));
sizeof (ElementType) * (size_t) (currentIndex - newIndex));
}
memcpy (data.elements + newIndex, tempCopy, sizeof (ElementType));


+ 5
- 5
modules/juce_core/containers/juce_OwnedArray.h View File

@@ -281,7 +281,7 @@ public:
const int numToMove = numUsed - indexToInsertAt;
if (numToMove > 0)
memmove (e + 1, e, numToMove * sizeof (ObjectClass*));
memmove (e + 1, e, sizeof (ObjectClass*) * (size_t) numToMove);
*e = const_cast <ObjectClass*> (newObject);
++numUsed;
@@ -527,7 +527,7 @@ public:
const int numToShift = numUsed - indexToRemove;
if (numToShift > 0)
memmove (e, e + 1, numToShift * sizeof (ObjectClass*));
memmove (e, e + 1, sizeof (ObjectClass*) * (size_t) numToShift);
}
}
@@ -562,7 +562,7 @@ public:
const int numToShift = numUsed - indexToRemove;
if (numToShift > 0)
memmove (e, e + 1, numToShift * sizeof (ObjectClass*));
memmove (e, e + 1, sizeof (ObjectClass*) * (size_t) numToShift);
if ((numUsed << 1) < data.numAllocated)
minimiseStorageOverheads();
@@ -709,13 +709,13 @@ public:
{
memmove (data.elements + currentIndex,
data.elements + currentIndex + 1,
(newIndex - currentIndex) * sizeof (ObjectClass*));
sizeof (ObjectClass*) * (size_t) (newIndex - currentIndex));
}
else
{
memmove (data.elements + newIndex + 1,
data.elements + newIndex,
(currentIndex - newIndex) * sizeof (ObjectClass*));
sizeof (ObjectClass*) * (size_t) (currentIndex - newIndex));
}
data.elements [newIndex] = value;


+ 5
- 5
modules/juce_core/containers/juce_ReferenceCountedArray.h View File

@@ -329,7 +329,7 @@ public:
const int numToMove = numUsed - indexToInsertAt;
if (numToMove > 0)
memmove (e + 1, e, numToMove * sizeof (ObjectClass*));
memmove (e + 1, e, sizeof (ObjectClass*) * (size_t) numToMove);
*e = newObject;
@@ -538,7 +538,7 @@ public:
const int numberToShift = numUsed - indexToRemove;
if (numberToShift > 0)
memmove (e, e + 1, numberToShift * sizeof (ObjectClass*));
memmove (e, e + 1, sizeof (ObjectClass*) * (size_t) numberToShift);
if ((numUsed << 1) < data.numAllocated)
minimiseStorageOverheads();
@@ -573,7 +573,7 @@ public:
const int numberToShift = numUsed - indexToRemove;
if (numberToShift > 0)
memmove (e, e + 1, numberToShift * sizeof (ObjectClass*));
memmove (e, e + 1, sizeof (ObjectClass*) * (size_t) numberToShift);
if ((numUsed << 1) < data.numAllocated)
minimiseStorageOverheads();
@@ -715,13 +715,13 @@ public:
{
memmove (data.elements + currentIndex,
data.elements + currentIndex + 1,
(newIndex - currentIndex) * sizeof (ObjectClass*));
sizeof (ObjectClass*) * (size_t) (newIndex - currentIndex));
}
else
{
memmove (data.elements + newIndex + 1,
data.elements + newIndex,
(currentIndex - newIndex) * sizeof (ObjectClass*));
sizeof (ObjectClass*) * (size_t) (currentIndex - newIndex));
}
data.elements [newIndex] = value;


+ 2
- 2
modules/juce_core/containers/juce_SortedSet.h View File

@@ -453,7 +453,7 @@ public:
const int numberToShift = numUsed - indexToRemove;
if (numberToShift > 0)
memmove (e, e + 1, numberToShift * sizeof (ElementType));
memmove (e, e + 1, sizeof (ElementType) * (size_t) numberToShift);
if ((numUsed << 1) < data.numAllocated)
minimiseStorageOverheads();
@@ -580,7 +580,7 @@ private:
const int numberToMove = numUsed - indexToInsertAt;
if (numberToMove > 0)
memmove (insertPos + 1, insertPos, numberToMove * sizeof (ElementType));
memmove (insertPos + 1, insertPos, sizeof (ElementType) * (size_t) numberToMove);
*insertPos = newElement;
++numUsed;


+ 1
- 1
modules/juce_core/maths/juce_BigInteger.cpp View File

@@ -705,7 +705,7 @@ void BigInteger::shiftLeft (int bits, const int startBit)
if (wordsToMove > 0)
{
for (int i = (int) top; --i >= 0;)
values [i + wordsToMove] = values [i];
values [(size_t) i + wordsToMove] = values [i];
for (size_t j = 0; j < wordsToMove; ++j)
values [j] = 0;


+ 1
- 1
modules/juce_core/maths/juce_Random.cpp View File

@@ -87,7 +87,7 @@ int64 Random::nextInt64() noexcept
bool Random::nextBool() noexcept
{
return (nextInt() & 0x80000000) != 0;
return (nextInt() & 0x40000000) != 0;
}
float Random::nextFloat() noexcept


+ 3
- 3
modules/juce_core/native/juce_mac_Files.mm View File

@@ -55,7 +55,7 @@ void File::findFileSystemRoots (Array<File>& destArray)
//==============================================================================
namespace FileHelpers
{
bool isFileOnDriveType (const File& f, const char* const* types)
static bool isFileOnDriveType (const File& f, const char* const* types)
{
struct statfs buf;
@@ -71,7 +71,7 @@ namespace FileHelpers
return false;
}
bool isHiddenFile (const String& path)
static bool isHiddenFile (const String& path)
{
#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
JUCE_AUTORELEASEPOOL
@@ -101,7 +101,7 @@ namespace FileHelpers
}
#endif
bool launchExecutable (const String& pathAndArguments)
static bool launchExecutable (const String& pathAndArguments)
{
const char* const argv[4] = { "/bin/sh", "-c", pathAndArguments.toUTF8(), 0 };


+ 1
- 1
modules/juce_core/native/juce_mac_SystemStats.mm View File

@@ -43,7 +43,7 @@ void Logger::outputDebugString (const String& text)
namespace SystemStatsHelpers
{
#if JUCE_INTEL
void doCPUID (uint32& a, uint32& b, uint32& c, uint32& d, uint32 type)
static void doCPUID (uint32& a, uint32& b, uint32& c, uint32& d, uint32 type)
{
uint32 la = a, lb = b, lc = c, ld = d;


+ 5
- 0
modules/juce_core/native/juce_posix_SharedCode.h View File

@@ -566,6 +566,7 @@ MemoryMappedFile::~MemoryMappedFile()
}
//==============================================================================
File juce_getExecutableFile();
File juce_getExecutableFile()
{
#if JUCE_ANDROID
@@ -661,12 +662,14 @@ int File::getVolumeSerialNumber() const
}
//==============================================================================
void juce_runSystemCommand (const String&);
void juce_runSystemCommand (const String& command)
{
int result = system (command.toUTF8());
(void) result;
}
String juce_getOutputFromCommand (const String&);
String juce_getOutputFromCommand (const String& command)
{
// slight bodge here, as we just pipe the output into a temp file and read it...
@@ -805,6 +808,7 @@ void InterProcessLock::exit()
//==============================================================================
void JUCE_API juce_threadEntryPoint (void*);
extern "C" void* threadEntryProc (void*);
extern "C" void* threadEntryProc (void* userData)
{
JUCE_AUTORELEASEPOOL
@@ -857,6 +861,7 @@ void Thread::killThread()
void Thread::setCurrentThreadName (const String& name)
{
#if JUCE_IOS || (JUCE_MAC && defined (MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5)
JUCE_AUTORELEASEPOOL
[[NSThread currentThread] setName: juceStringToNS (name)];
#elif JUCE_LINUX
prctl (PR_SET_NAME, name.toUTF8().getAddress(), 0, 0, 0);


+ 15
- 15
modules/juce_core/network/juce_Socket.cpp View File

@@ -41,7 +41,7 @@
//==============================================================================
namespace SocketHelpers
{
void initSockets()
static void initSockets()
{
#if JUCE_WINDOWS
static bool socketsStarted = false;
@@ -57,7 +57,7 @@ namespace SocketHelpers
#endif
}
bool resetSocketOptions (const int handle, const bool isDatagram, const bool allowBroadcast) noexcept
static bool resetSocketOptions (const int handle, const bool isDatagram, const bool allowBroadcast) noexcept
{
const int sndBufSize = 65536;
const int rcvBufSize = 65536;
@@ -70,7 +70,7 @@ namespace SocketHelpers
: (setsockopt (handle, IPPROTO_TCP, TCP_NODELAY, (const char*) &one, sizeof (one)) == 0));
}
bool bindSocketToPort (const int handle, const int port) noexcept
static bool bindSocketToPort (const int handle, const int port) noexcept
{
if (handle <= 0 || port <= 0)
return false;
@@ -83,10 +83,10 @@ namespace SocketHelpers
return bind (handle, (struct sockaddr*) &servTmpAddr, sizeof (struct sockaddr_in)) >= 0;
}
int readSocket (const int handle,
void* const destBuffer, const int maxBytesToRead,
bool volatile& connected,
const bool blockUntilSpecifiedAmountHasArrived) noexcept
static int readSocket (const int handle,
void* const destBuffer, const int maxBytesToRead,
bool volatile& connected,
const bool blockUntilSpecifiedAmountHasArrived) noexcept
{
int bytesRead = 0;
@@ -121,7 +121,7 @@ namespace SocketHelpers
return bytesRead;
}
int waitForReadiness (const int handle, const bool forReading, const int timeoutMsecs) noexcept
static int waitForReadiness (const int handle, const bool forReading, const int timeoutMsecs) noexcept
{
struct timeval timeout;
struct timeval* timeoutp;
@@ -174,7 +174,7 @@ namespace SocketHelpers
return FD_ISSET (handle, forReading ? &rset : &wset) ? 1 : 0;
}
bool setSocketBlockingState (const int handle, const bool shouldBlock) noexcept
static bool setSocketBlockingState (const int handle, const bool shouldBlock) noexcept
{
#if JUCE_WINDOWS
u_long nonBlocking = shouldBlock ? 0 : (u_long) 1;
@@ -194,12 +194,12 @@ namespace SocketHelpers
#endif
}
bool connectSocket (int volatile& handle,
const bool isDatagram,
struct addrinfo** const serverAddress,
const String& hostName,
const int portNumber,
const int timeOutMillisecs) noexcept
static bool connectSocket (int volatile& handle,
const bool isDatagram,
struct addrinfo** const serverAddress,
const String& hostName,
const int portNumber,
const int timeOutMillisecs) noexcept
{
struct addrinfo hints = { 0 };
hints.ai_family = AF_UNSPEC;


+ 6
- 6
modules/juce_core/network/juce_URL.cpp View File

@@ -104,7 +104,7 @@ URL::~URL()
namespace URLHelpers
{
String getMangledParameters (const URL& url)
static String getMangledParameters (const URL& url)
{
jassert (url.getParameterNames().size() == url.getParameterValues().size());
String p;
@@ -122,7 +122,7 @@ namespace URLHelpers
return p;
}
int findEndOfScheme (const String& url)
static int findEndOfScheme (const String& url)
{
int i = 0;
@@ -133,7 +133,7 @@ namespace URLHelpers
return url[i] == ':' ? i + 1 : 0;
}
int findStartOfNetLocation (const String& url)
static int findStartOfNetLocation (const String& url)
{
int start = findEndOfScheme (url);
while (url[start] == '/')
@@ -142,12 +142,12 @@ namespace URLHelpers
return start;
}
int findStartOfPath (const String& url)
static int findStartOfPath (const String& url)
{
return url.indexOfChar (findStartOfNetLocation (url), '/') + 1;
}
void createHeadersAndPostData (const URL& url, String& headers, MemoryBlock& postData)
static void createHeadersAndPostData (const URL& url, String& headers, MemoryBlock& postData)
{
MemoryOutputStream data (postData, false);
@@ -202,7 +202,7 @@ namespace URLHelpers
}
}
void concatenatePaths (String& path, const String& suffix)
static void concatenatePaths (String& path, const String& suffix)
{
if (! path.endsWithChar ('/'))
path << '/';


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

@@ -347,7 +347,7 @@ String String::charToString (const juce_wchar character)
namespace NumberToStringConverters
{
// pass in a pointer to the END of a buffer..
char* numberToString (char* t, const int64 n) noexcept
static char* numberToString (char* t, const int64 n) noexcept
{
*--t = 0;
int64 v = (n >= 0) ? n : -n;
@@ -365,7 +365,7 @@ namespace NumberToStringConverters
return t;
}
char* numberToString (char* t, uint64 v) noexcept
static char* numberToString (char* t, uint64 v) noexcept
{
*--t = 0;
@@ -379,7 +379,7 @@ namespace NumberToStringConverters
return t;
}
char* numberToString (char* t, const int n) noexcept
static char* numberToString (char* t, const int n) noexcept
{
if (n == (int) 0x80000000) // (would cause an overflow)
return numberToString (t, (int64) n);
@@ -400,7 +400,7 @@ namespace NumberToStringConverters
return t;
}
char* numberToString (char* t, unsigned int v) noexcept
static char* numberToString (char* t, unsigned int v) noexcept
{
*--t = 0;
@@ -414,7 +414,7 @@ namespace NumberToStringConverters
return t;
}
char* doubleToString (char* buffer, const int numChars, double n, int numDecPlaces, size_t& len) noexcept
static char* doubleToString (char* buffer, const int numChars, double n, int numDecPlaces, size_t& len) noexcept
{
if (numDecPlaces > 0 && n > -1.0e20 && n < 1.0e20)
{
@@ -465,7 +465,7 @@ namespace NumberToStringConverters
return StringHolder::createFromFixedLength (start, (size_t) (end - start - 1));
}
String::CharPointerType createFromDouble (const double number, const int numberOfDecimalPlaces)
static String::CharPointerType createFromDouble (const double number, const int numberOfDecimalPlaces)
{
char buffer [48];
size_t len;


+ 4
- 3
modules/juce_core/time/juce_Time.cpp View File

@@ -39,7 +39,7 @@
//==============================================================================
namespace TimeHelpers
{
struct tm millisToLocal (const int64 millis) noexcept
static struct tm millisToLocal (const int64 millis) noexcept
{
struct tm result;
const int64 seconds = millis / 1000;
@@ -93,13 +93,14 @@ namespace TimeHelpers
return result;
}
int extendedModulo (const int64 value, const int modulo) noexcept
static int extendedModulo (const int64 value, const int modulo) noexcept
{
return (int) (value >= 0 ? (value % modulo)
: (value - ((value / modulo) + 1) * modulo));
}
int doFTime (CharPointer_UTF32 dest, const size_t maxChars, const String& format, const struct tm* const tm) noexcept
static int doFTime (CharPointer_UTF32 dest, const size_t maxChars,
const String& format, const struct tm* const tm) noexcept
{
#if JUCE_ANDROID
HeapBlock <char> tempDest;


+ 2
- 2
modules/juce_core/xml/juce_XmlDocument.cpp View File

@@ -65,13 +65,13 @@ void XmlDocument::setEmptyTextElementsIgnored (const bool shouldBeIgnored) noexc
namespace XmlIdentifierChars
{
bool isIdentifierCharSlow (const juce_wchar c) noexcept
static bool isIdentifierCharSlow (const juce_wchar c) noexcept
{
return CharacterFunctions::isLetterOrDigit (c)
|| c == '_' || c == '-' || c == ':' || c == '.';
}
bool isIdentifierChar (const juce_wchar c) noexcept
static bool isIdentifierChar (const juce_wchar c) noexcept
{
static const uint32 legalChars[] = { 0, 0x7ff6000, 0x87fffffe, 0x7fffffe, 0 };


+ 3
- 3
modules/juce_core/xml/juce_XmlElement.cpp View File

@@ -159,7 +159,7 @@ namespace XmlOutputFunctions
}
#endif
bool isLegalXmlChar (const uint32 c) noexcept
static bool isLegalXmlChar (const uint32 c) noexcept
{
static const unsigned char legalChars[] = { 0, 0, 0, 0, 187, 255, 255, 175, 255, 255, 255, 191, 254, 255, 255, 127 };
@@ -167,7 +167,7 @@ namespace XmlOutputFunctions
&& (legalChars [c >> 3] & (1 << (c & 7))) != 0;
}
void escapeIllegalXmlChars (OutputStream& outputStream, const String& text, const bool changeNewLines)
static void escapeIllegalXmlChars (OutputStream& outputStream, const String& text, const bool changeNewLines)
{
String::CharPointerType t (text.getCharPointer());
@@ -207,7 +207,7 @@ namespace XmlOutputFunctions
}
}
void writeSpaces (OutputStream& out, const int numSpaces)
static void writeSpaces (OutputStream& out, const int numSpaces)
{
out.writeRepeatedByte (' ', numSpaces);
}


+ 1
- 0
modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp View File

@@ -268,6 +268,7 @@ bool GZIPDecompressorInputStream::setPosition (int64 newPos)
}
// (This is used as a way for the zip file code to use the crc32 function without including zlib)
unsigned long juce_crc32 (unsigned long, const unsigned char*, unsigned);
unsigned long juce_crc32 (unsigned long crc, const unsigned char* buf, unsigned len)
{
return zlibNamespace::crc32 (crc, buf, len);


+ 6
- 6
modules/juce_cryptography/encryption/juce_Primes.cpp View File

@@ -25,7 +25,7 @@
namespace PrimesHelpers
{
void createSmallSieve (const int numBits, BigInteger& result)
static void createSmallSieve (const int numBits, BigInteger& result)
{
result.setBit (numBits);
result.clearBit (numBits); // to enlarge the array
@@ -43,8 +43,8 @@ namespace PrimesHelpers
while (n <= (numBits >> 1));
}
void bigSieve (const BigInteger& base, const int numBits, BigInteger& result,
const BigInteger& smallSieve, const int smallSieveSize)
static void bigSieve (const BigInteger& base, const int numBits, BigInteger& result,
const BigInteger& smallSieve, const int smallSieveSize)
{
jassert (! base[0]); // must be even!
@@ -81,8 +81,8 @@ namespace PrimesHelpers
while (index < smallSieveSize);
}
bool findCandidate (const BigInteger& base, const BigInteger& sieve,
const int numBits, BigInteger& result, const int certainty)
static bool findCandidate (const BigInteger& base, const BigInteger& sieve,
const int numBits, BigInteger& result, const int certainty)
{
for (int i = 0; i < numBits; ++i)
{
@@ -98,7 +98,7 @@ namespace PrimesHelpers
return false;
}
bool passesMillerRabin (const BigInteger& n, int iterations)
static bool passesMillerRabin (const BigInteger& n, int iterations)
{
const BigInteger one (1), two (2);
const BigInteger nMinusOne (n - one);


+ 1
- 1
modules/juce_cryptography/hashing/juce_SHA256.cpp View File

@@ -123,7 +123,7 @@ public:
uint8 buffer [64];
const int bytesRead = input.read (buffer, (int) jmin (numBytesToRead, (int64) sizeof (buffer)));
if (bytesRead < sizeof (buffer))
if (bytesRead < (int) sizeof (buffer))
{
processFinalBlock (buffer, (unsigned int) bytesRead);
break;


+ 2
- 0
modules/juce_events/messages/juce_MessageManager.cpp View File

@@ -323,12 +323,14 @@ MessageManagerLock::~MessageManagerLock() noexcept
}
//==============================================================================
JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI();
JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI()
{
JUCE_AUTORELEASEPOOL
MessageManager::getInstance();
}
JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI();
JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI()
{
JUCE_AUTORELEASEPOOL


+ 3
- 1
modules/juce_events/native/juce_mac_MessageManager.mm View File

@@ -303,9 +303,10 @@ void MessageManager::stopDispatchLoop()
#if JUCE_MODAL_LOOPS_PERMITTED
bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor)
{
jassert (millisecondsToRunFor >= 0);
jassert (isThisTheMessageThread()); // must only be called by the message thread
uint32 endTime = Time::getMillisecondCounter() + millisecondsToRunFor;
uint32 endTime = Time::getMillisecondCounter() + (uint32) millisecondsToRunFor;
while (! quitMessagePosted)
{
@@ -330,6 +331,7 @@ bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor)
#endif
//==============================================================================
void initialiseNSApplication();
void initialiseNSApplication()
{
JUCE_AUTORELEASEPOOL


+ 2
- 2
modules/juce_graphics/colour/juce_Colour.cpp View File

@@ -25,14 +25,14 @@
namespace ColourHelpers
{
uint8 floatToUInt8 (const float n) noexcept
static uint8 floatToUInt8 (const float n) noexcept
{
return n <= 0.0f ? 0 : (n >= 1.0f ? 255 : (uint8) (n * 255.0f));
}
// This is an adjusted brightness value, based on the way the human
// eye responds to different colour channels..
float getPerceivedBrightness (float r, float g, float b) noexcept
static float getPerceivedBrightness (float r, float g, float b) noexcept
{
return std::sqrt (r * r * 0.241f
+ g * g * 0.691f


+ 1
- 1
modules/juce_graphics/colour/juce_ColourGradient.cpp View File

@@ -168,7 +168,7 @@ void ColourGradient::createLookupTable (PixelARGB* const lookupTable, const int
jassert (index >= 0 && index < numEntries);
lookupTable[index] = pix1;
lookupTable[index].tween (pix2, (uint32) (i << 8) / numToDo);
lookupTable[index].tween (pix2, (uint32) ((i << 8) / numToDo));
++index;
}


+ 19
- 19
modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp View File

@@ -526,7 +526,7 @@ private:
static forcedinline void copyRow (PixelRGB* dest, PixelRGB* src, int width) noexcept
{
memcpy (dest, src, width * sizeof (PixelRGB));
memcpy (dest, src, sizeof (PixelRGB) * (size_t) width);
}
JUCE_DECLARE_NON_COPYABLE (ImageFillEdgeTableRenderer);
@@ -748,17 +748,17 @@ private:
(uint8) (c[PixelARGB::indexB] >> 16));
}
void render2PixelAverageX (PixelARGB* const dest, const uint8* src, const int subPixelX) noexcept
void render2PixelAverageX (PixelARGB* const dest, const uint8* src, const uint32 subPixelX) noexcept
{
uint32 c[4] = { 128, 128, 128, 128 };
uint32 weight = (uint32) (256 - subPixelX);
uint32 weight = 256 - subPixelX;
c[0] += weight * src[0];
c[1] += weight * src[1];
c[2] += weight * src[2];
c[3] += weight * src[3];
weight = (uint32) subPixelX;
weight = subPixelX;
c[0] += weight * src[4];
c[1] += weight * src[5];
c[2] += weight * src[6];
@@ -770,11 +770,11 @@ private:
(uint8) (c[PixelARGB::indexB] >> 8));
}
void render2PixelAverageY (PixelARGB* const dest, const uint8* src, const int subPixelY) noexcept
void render2PixelAverageY (PixelARGB* const dest, const uint8* src, const uint32 subPixelY) noexcept
{
uint32 c[4] = { 128, 128, 128, 128 };
uint32 weight = (uint32) (256 - subPixelY);
uint32 weight = 256 - subPixelY;
c[0] += weight * src[0];
c[1] += weight * src[1];
c[2] += weight * src[2];
@@ -782,7 +782,7 @@ private:
src += this->srcData.lineStride;
weight = (uint32) subPixelY;
weight = subPixelY;
c[0] += weight * src[0];
c[1] += weight * src[1];
c[2] += weight * src[2];
@@ -795,28 +795,28 @@ private:
}
//==============================================================================
void render4PixelAverage (PixelRGB* const dest, const uint8* src, const int subPixelX, const int subPixelY) noexcept
void render4PixelAverage (PixelRGB* const dest, const uint8* src, const uint32 subPixelX, const uint32 subPixelY) noexcept
{
uint32 c[3] = { 256 * 128, 256 * 128, 256 * 128 };
uint32 weight = (uint32) ((256 - subPixelX) * (256 - subPixelY));
uint32 weight = (256 - subPixelX) * (256 - subPixelY);
c[0] += weight * src[0];
c[1] += weight * src[1];
c[2] += weight * src[2];
weight = (uint32) (subPixelX * (256 - subPixelY));
weight = subPixelX * (256 - subPixelY);
c[0] += weight * src[3];
c[1] += weight * src[4];
c[2] += weight * src[5];
src += this->srcData.lineStride;
weight = (uint32) ((256 - subPixelX) * subPixelY);
weight = (256 - subPixelX) * subPixelY;
c[0] += weight * src[0];
c[1] += weight * src[1];
c[2] += weight * src[2];
weight = (uint32) (subPixelX * subPixelY);
weight = subPixelX * subPixelY;
c[0] += weight * src[3];
c[1] += weight * src[4];
c[2] += weight * src[5];
@@ -827,11 +827,11 @@ private:
(uint8) (c[PixelRGB::indexB] >> 16));
}
void render2PixelAverageX (PixelRGB* const dest, const uint8* src, const int subPixelX) noexcept
void render2PixelAverageX (PixelRGB* const dest, const uint8* src, const uint32 subPixelX) noexcept
{
uint32 c[3] = { 128, 128, 128 };
const uint32 weight = (uint32) (256 - subPixelX);
const uint32 weight = 256 - subPixelX;
c[0] += weight * src[0];
c[1] += weight * src[1];
c[2] += weight * src[2];
@@ -846,11 +846,11 @@ private:
(uint8) (c[PixelRGB::indexB] >> 8));
}
void render2PixelAverageY (PixelRGB* const dest, const uint8* src, const int subPixelY) noexcept
void render2PixelAverageY (PixelRGB* const dest, const uint8* src, const uint32 subPixelY) noexcept
{
uint32 c[3] = { 128, 128, 128 };
const uint32 weight = (uint32) (256 - subPixelY);
const uint32 weight = 256 - subPixelY;
c[0] += weight * src[0];
c[1] += weight * src[1];
c[2] += weight * src[2];
@@ -868,7 +868,7 @@ private:
}
//==============================================================================
void render4PixelAverage (PixelAlpha* const dest, const uint8* src, const int subPixelX, const int subPixelY) noexcept
void render4PixelAverage (PixelAlpha* const dest, const uint8* src, const uint32 subPixelX, const uint32 subPixelY) noexcept
{
uint32 c = 256 * 128;
c += src[0] * ((256 - subPixelX) * (256 - subPixelY));
@@ -880,7 +880,7 @@ private:
*((uint8*) dest) = (uint8) (c >> 16);
}
void render2PixelAverageX (PixelAlpha* const dest, const uint8* src, const int subPixelX) noexcept
void render2PixelAverageX (PixelAlpha* const dest, const uint8* src, const uint32 subPixelX) noexcept
{
uint32 c = 128;
c += src[0] * (256 - subPixelX);
@@ -888,7 +888,7 @@ private:
*((uint8*) dest) = (uint8) (c >> 8);
}
void render2PixelAverageY (PixelAlpha* const dest, const uint8* src, const int subPixelY) noexcept
void render2PixelAverageY (PixelAlpha* const dest, const uint8* src, const uint32 subPixelY) noexcept
{
uint32 c = 128;
c += src[0] * (256 - subPixelY);


+ 2
- 2
modules/juce_graphics/fonts/juce_CustomTypeface.cpp View File

@@ -70,7 +70,7 @@ private:
//==============================================================================
namespace CustomTypefaceHelpers
{
juce_wchar readChar (InputStream& in)
static juce_wchar readChar (InputStream& in)
{
uint32 n = (uint32) (uint16) in.readShort();
@@ -85,7 +85,7 @@ namespace CustomTypefaceHelpers
return (juce_wchar) n;
}
void writeChar (OutputStream& out, juce_wchar charToWrite)
static void writeChar (OutputStream& out, juce_wchar charToWrite)
{
if (charToWrite >= 0x10000)
{


+ 1
- 1
modules/juce_graphics/fonts/juce_Font.cpp View File

@@ -25,7 +25,7 @@
namespace FontValues
{
float limitFontHeight (const float height) noexcept
static float limitFontHeight (const float height) noexcept
{
return jlimit (0.1f, 10000.0f, height);
}


+ 1
- 1
modules/juce_graphics/geometry/juce_Path.cpp View File

@@ -32,7 +32,7 @@ namespace PathHelpers
{
const float ellipseAngularIncrement = 0.05f;
String nextToken (String::CharPointerType& t)
static String nextToken (String::CharPointerType& t)
{
t = t.findEndOfWhitespace();


+ 36
- 36
modules/juce_graphics/geometry/juce_PathStrokeType.cpp View File

@@ -66,13 +66,13 @@ bool PathStrokeType::operator!= (const PathStrokeType& other) const noexcept
//==============================================================================
namespace PathStrokeHelpers
{
bool lineIntersection (const float x1, const float y1,
const float x2, const float y2,
const float x3, const float y3,
const float x4, const float y4,
float& intersectionX,
float& intersectionY,
float& distanceBeyondLine1EndSquared) noexcept
static bool lineIntersection (const float x1, const float y1,
const float x2, const float y2,
const float x3, const float y3,
const float x4, const float y4,
float& intersectionX,
float& intersectionY,
float& distanceBeyondLine1EndSquared) noexcept
{
if (x2 != x3 || y2 != y3)
{
@@ -183,14 +183,14 @@ namespace PathStrokeHelpers
return true;
}
void addEdgeAndJoint (Path& destPath,
const PathStrokeType::JointStyle style,
const float maxMiterExtensionSquared, const float width,
const float x1, const float y1,
const float x2, const float y2,
const float x3, const float y3,
const float x4, const float y4,
const float midX, const float midY)
static void addEdgeAndJoint (Path& destPath,
const PathStrokeType::JointStyle style,
const float maxMiterExtensionSquared, const float width,
const float x1, const float y1,
const float x2, const float y2,
const float x3, const float y3,
const float x4, const float y4,
const float midX, const float midY)
{
if (style == PathStrokeType::beveled
|| (x3 == x4 && y3 == y4)
@@ -278,11 +278,11 @@ namespace PathStrokeHelpers
}
}
void addLineEnd (Path& destPath,
const PathStrokeType::EndCapStyle style,
const float x1, const float y1,
const float x2, const float y2,
const float width)
static void addLineEnd (Path& destPath,
const PathStrokeType::EndCapStyle style,
const float x1, const float y1,
const float x2, const float y2,
const float width)
{
if (style == PathStrokeType::butt)
{
@@ -343,12 +343,12 @@ namespace PathStrokeHelpers
float endWidth, endLength;
};
void addArrowhead (Path& destPath,
const float x1, const float y1,
const float x2, const float y2,
const float tipX, const float tipY,
const float width,
const float arrowheadWidth)
static void addArrowhead (Path& destPath,
const float x1, const float y1,
const float x2, const float y2,
const float tipX, const float tipY,
const float width,
const float arrowheadWidth)
{
Line<float> line (x1, y1, x2, y2);
destPath.lineTo (line.getPointAlongLine (-(arrowheadWidth / 2.0f - width), 0));
@@ -364,7 +364,7 @@ namespace PathStrokeHelpers
float rx1, ry1, rx2, ry2; // the right-hand stroke
};
void shortenSubPath (Array<LineSection>& subPath, float amountAtStart, float amountAtEnd)
static void shortenSubPath (Array<LineSection>& subPath, float amountAtStart, float amountAtEnd)
{
while (amountAtEnd > 0 && subPath.size() > 0)
{
@@ -423,10 +423,10 @@ namespace PathStrokeHelpers
}
}
void addSubPath (Path& destPath, Array<LineSection>& subPath,
const bool isClosed, const float width, const float maxMiterExtensionSquared,
const PathStrokeType::JointStyle jointStyle, const PathStrokeType::EndCapStyle endStyle,
const Arrowhead* const arrowhead)
static void addSubPath (Path& destPath, Array<LineSection>& subPath,
const bool isClosed, const float width, const float maxMiterExtensionSquared,
const PathStrokeType::JointStyle jointStyle, const PathStrokeType::EndCapStyle endStyle,
const Arrowhead* const arrowhead)
{
jassert (subPath.size() > 0);
@@ -536,11 +536,11 @@ namespace PathStrokeHelpers
destPath.closeSubPath();
}
void createStroke (const float thickness, const PathStrokeType::JointStyle jointStyle,
const PathStrokeType::EndCapStyle endStyle,
Path& destPath, const Path& source,
const AffineTransform& transform,
const float extraAccuracy, const Arrowhead* const arrowhead)
static void createStroke (const float thickness, const PathStrokeType::JointStyle jointStyle,
const PathStrokeType::EndCapStyle endStyle,
Path& destPath, const Path& source,
const AffineTransform& transform,
const float extraAccuracy, const Arrowhead* const arrowhead)
{
jassert (extraAccuracy > 0);


+ 11
- 11
modules/juce_graphics/image_formats/juce_JPEGLoader.cpp View File

@@ -131,12 +131,12 @@ namespace JPEGHelpers
struct JPEGDecodingFailure {};
void fatalErrorHandler (j_common_ptr) { throw JPEGDecodingFailure(); }
void silentErrorCallback1 (j_common_ptr) {}
void silentErrorCallback2 (j_common_ptr, int) {}
void silentErrorCallback3 (j_common_ptr, char*) {}
static void fatalErrorHandler (j_common_ptr) { throw JPEGDecodingFailure(); }
static void silentErrorCallback1 (j_common_ptr) {}
static void silentErrorCallback2 (j_common_ptr, int) {}
static void silentErrorCallback3 (j_common_ptr, char*) {}
void setupSilentErrorHandler (struct jpeg_error_mgr& err)
static void setupSilentErrorHandler (struct jpeg_error_mgr& err)
{
zerostruct (err);
@@ -148,9 +148,9 @@ namespace JPEGHelpers
}
//==============================================================================
void dummyCallback1 (j_decompress_ptr) {}
static void dummyCallback1 (j_decompress_ptr) {}
void jpegSkip (j_decompress_ptr decompStruct, long num)
static void jpegSkip (j_decompress_ptr decompStruct, long num)
{
decompStruct->src->next_input_byte += num;
@@ -158,7 +158,7 @@ namespace JPEGHelpers
decompStruct->src->bytes_in_buffer -= num;
}
boolean jpegFill (j_decompress_ptr)
static boolean jpegFill (j_decompress_ptr)
{
return 0;
}
@@ -172,9 +172,9 @@ namespace JPEGHelpers
char* buffer;
};
void jpegWriteInit (j_compress_ptr) {}
static void jpegWriteInit (j_compress_ptr) {}
void jpegWriteTerminate (j_compress_ptr cinfo)
static void jpegWriteTerminate (j_compress_ptr cinfo)
{
JuceJpegDest* const dest = static_cast <JuceJpegDest*> (cinfo->dest);
@@ -182,7 +182,7 @@ namespace JPEGHelpers
dest->output->write (dest->buffer, (int) numToWrite);
}
boolean jpegWriteFlush (j_compress_ptr cinfo)
static boolean jpegWriteFlush (j_compress_ptr cinfo)
{
JuceJpegDest* const dest = static_cast <JuceJpegDest*> (cinfo->dest);


+ 3
- 3
modules/juce_graphics/image_formats/juce_PNGLoader.cpp View File

@@ -100,19 +100,19 @@ namespace PNGHelpers
{
using namespace pnglibNamespace;
void JUCE_CDECL readCallback (png_structp png, png_bytep data, png_size_t length)
static void JUCE_CDECL readCallback (png_structp png, png_bytep data, png_size_t length)
{
static_cast<InputStream*> (png_get_io_ptr (png))->read (data, (int) length);
}
void JUCE_CDECL writeDataCallback (png_structp png, png_bytep data, png_size_t length)
static void JUCE_CDECL writeDataCallback (png_structp png, png_bytep data, png_size_t length)
{
static_cast<OutputStream*> (png_get_io_ptr (png))->write (data, (int) length);
}
struct PNGErrorStruct {};
void JUCE_CDECL errorCallback (png_structp, png_const_charp)
static void JUCE_CDECL errorCallback (png_structp, png_const_charp)
{
throw PNGErrorStruct();
}


+ 1
- 0
modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm View File

@@ -843,6 +843,7 @@ Image juce_loadWithCoreImage (InputStream& input)
#endif
#if JUCE_MAC
Image juce_createImageFromCIImage (CIImage*, int, int);
Image juce_createImageFromCIImage (CIImage* im, int w, int h)
{
CoreGraphicsImage* cgImage = new CoreGraphicsImage (Image::ARGB, w, h, false);


+ 6
- 6
modules/juce_graphics/native/juce_mac_Fonts.mm View File

@@ -33,8 +33,8 @@
namespace CoreTextTypeLayout
{
CTFontRef createCTFont (const Font& font, const float fontSize,
const bool applyScaleFactor, bool& needsItalicTransform)
static CTFontRef createCTFont (const Font& font, const float fontSize,
const bool applyScaleFactor, bool& needsItalicTransform)
{
CFStringRef cfName = font.getTypefaceName().toCFString();
CTFontRef ctFontRef = CTFontCreateWithName (cfName, fontSize, nullptr);
@@ -138,7 +138,7 @@ namespace CoreTextTypeLayout
};
//==============================================================================
CFAttributedStringRef createCFAttributedString (const AttributedString& text)
static CFAttributedStringRef createCFAttributedString (const AttributedString& text)
{
#if JUCE_IOS
CGColorSpaceRef rgbColourSpace = CGColorSpaceCreateDeviceRGB();
@@ -238,8 +238,8 @@ namespace CoreTextTypeLayout
return attribString;
}
void drawToCGContext (const AttributedString& text, const Rectangle<float>& area,
const CGContextRef& context, const float flipHeight)
static void drawToCGContext (const AttributedString& text, const Rectangle<float>& area,
const CGContextRef& context, const float flipHeight)
{
CFAttributedStringRef attribString = CoreTextTypeLayout::createCFAttributedString (text);
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString (attribString);
@@ -258,7 +258,7 @@ namespace CoreTextTypeLayout
CFRelease (frame);
}
void createLayout (TextLayout& glyphLayout, const AttributedString& text)
static void createLayout (TextLayout& glyphLayout, const AttributedString& text)
{
CFAttributedStringRef attribString = CoreTextTypeLayout::createCFAttributedString (text);
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString (attribString);


+ 2
- 2
modules/juce_gui_basics/drawables/juce_DrawablePath.cpp View File

@@ -382,7 +382,7 @@ void DrawablePath::ValueTreeWrapper::Element::convertToPathBreak (UndoManager* u
namespace DrawablePathHelpers
{
Point<float> findCubicSubdivisionPoint (float proportion, const Point<float> points[4])
static Point<float> findCubicSubdivisionPoint (float proportion, const Point<float> points[4])
{
const Point<float> mid1 (points[0] + (points[1] - points[0]) * proportion),
mid2 (points[1] + (points[2] - points[1]) * proportion),
@@ -394,7 +394,7 @@ namespace DrawablePathHelpers
return newCp1 + (newCp2 - newCp1) * proportion;
}
Point<float> findQuadraticSubdivisionPoint (float proportion, const Point<float> points[3])
static Point<float> findQuadraticSubdivisionPoint (float proportion, const Point<float> points[3])
{
const Point<float> mid1 (points[0] + (points[1] - points[0]) * proportion),
mid2 (points[1] + (points[2] - points[1]) * proportion);


+ 2
- 2
modules/juce_gui_basics/keyboard/juce_KeyPress.cpp View File

@@ -136,9 +136,9 @@ namespace KeyPressHelpers
{ "cmd", ModifierKeys::commandModifier }
};
const char* numberPadPrefix() noexcept { return "numpad "; }
static const char* numberPadPrefix() noexcept { return "numpad "; }
int getNumpadKeyCode (const String& desc)
static int getNumpadKeyCode (const String& desc)
{
if (desc.containsIgnoreCase (numberPadPrefix()))
{


+ 2
- 2
modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.cpp View File

@@ -79,7 +79,7 @@ namespace KeyboardFocusHelpers
}
}
Component* findFocusContainer (Component* c)
static Component* findFocusContainer (Component* c)
{
c = c->getParentComponent();
@@ -90,7 +90,7 @@ namespace KeyboardFocusHelpers
return c;
}
Component* getIncrementedComponent (Component* const current, const int delta)
static Component* getIncrementedComponent (Component* const current, const int delta)
{
Component* focusContainer = findFocusContainer (current);


+ 7
- 7
modules/juce_gui_basics/layout/juce_ComponentBuilder.cpp View File

@@ -25,12 +25,12 @@
namespace ComponentBuilderHelpers
{
String getStateId (const ValueTree& state)
static String getStateId (const ValueTree& state)
{
return state [ComponentBuilder::idProperty].toString();
}
Component* removeComponentWithID (OwnedArray<Component>& components, const String& compId)
static Component* removeComponentWithID (OwnedArray<Component>& components, const String& compId)
{
jassert (compId.isNotEmpty());
@@ -45,7 +45,7 @@ namespace ComponentBuilderHelpers
return nullptr;
}
Component* findComponentWithID (Component& c, const String& compId)
static Component* findComponentWithID (Component& c, const String& compId)
{
jassert (compId.isNotEmpty());
if (c.getComponentID() == compId)
@@ -62,8 +62,8 @@ namespace ComponentBuilderHelpers
return nullptr;
}
Component* createNewComponent (ComponentBuilder::TypeHandler& type,
const ValueTree& state, Component* parent)
static Component* createNewComponent (ComponentBuilder::TypeHandler& type,
const ValueTree& state, Component* parent)
{
Component* const c = type.addNewComponentFromState (state, parent);
jassert (c != nullptr && c->getParentComponent() == parent);
@@ -71,7 +71,7 @@ namespace ComponentBuilderHelpers
return c;
}
void updateComponent (ComponentBuilder& builder, const ValueTree& state)
static void updateComponent (ComponentBuilder& builder, const ValueTree& state)
{
Component* topLevelComp = builder.getManagedComponent();
@@ -96,7 +96,7 @@ namespace ComponentBuilderHelpers
}
}
void updateComponentColours (Component& component, const ValueTree& colourState)
static void updateComponentColours (Component& component, const ValueTree& colourState)
{
NamedValueSet& properties = component.getProperties();


+ 1
- 1
modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp View File

@@ -115,7 +115,7 @@ MultiDocumentPanel::~MultiDocumentPanel()
//==============================================================================
namespace MultiDocHelpers
{
bool shouldDeleteComp (Component* const c)
static bool shouldDeleteComp (Component* const c)
{
return c->getProperties() ["mdiDocumentDelete_"];
}


+ 3
- 3
modules/juce_gui_basics/layout/juce_TabbedComponent.cpp View File

@@ -27,14 +27,14 @@ namespace TabbedComponentHelpers
{
const Identifier deleteComponentId ("deleteByTabComp_");
void deleteIfNecessary (Component* const comp)
static void deleteIfNecessary (Component* const comp)
{
if (comp != nullptr && (bool) comp->getProperties() [deleteComponentId])
delete comp;
}
Rectangle<int> getTabArea (Rectangle<int>& content, BorderSize<int>& outline,
const TabbedButtonBar::Orientation orientation, const int tabDepth)
static Rectangle<int> getTabArea (Rectangle<int>& content, BorderSize<int>& outline,
const TabbedButtonBar::Orientation orientation, const int tabDepth)
{
switch (orientation)
{


+ 11
- 11
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp View File

@@ -25,12 +25,12 @@
namespace LookAndFeelHelpers
{
void createRoundedPath (Path& p,
const float x, const float y,
const float w, const float h,
const float cs,
const bool curveTopLeft, const bool curveTopRight,
const bool curveBottomLeft, const bool curveBottomRight) noexcept
static void createRoundedPath (Path& p,
const float x, const float y,
const float w, const float h,
const float cs,
const bool curveTopLeft, const bool curveTopRight,
const bool curveBottomLeft, const bool curveBottomRight) noexcept
{
const float cs2 = 2.0f * cs;
@@ -77,10 +77,10 @@ namespace LookAndFeelHelpers
p.closeSubPath();
}
Colour createBaseColour (const Colour& buttonColour,
const bool hasKeyboardFocus,
const bool isMouseOverButton,
const bool isButtonDown) noexcept
static Colour createBaseColour (const Colour& buttonColour,
const bool hasKeyboardFocus,
const bool isMouseOverButton,
const bool isButtonDown) noexcept
{
const float sat = hasKeyboardFocus ? 1.3f : 0.9f;
const Colour baseColour (buttonColour.withMultipliedSaturation (sat));
@@ -93,7 +93,7 @@ namespace LookAndFeelHelpers
return baseColour;
}
TextLayout layoutTooltipText (const String& text, const Colour& colour) noexcept
static TextLayout layoutTooltipText (const String& text, const Colour& colour) noexcept
{
const float tooltipFontSize = 13.0f;
const int maxToolTipWidth = 400;


+ 2
- 2
modules/juce_gui_basics/native/juce_mac_MainMenu.mm View File

@@ -488,7 +488,7 @@ namespace juce
//==============================================================================
namespace MainMenuHelpers
{
NSMenu* createStandardAppMenu (NSMenu* menu, const String& appName, const PopupMenu* extraItems)
static NSMenu* createStandardAppMenu (NSMenu* menu, const String& appName, const PopupMenu* extraItems)
{
if (extraItems != nullptr && JuceMainMenuHandler::instance != nullptr && extraItems->getNumItems() > 0)
{
@@ -547,7 +547,7 @@ namespace MainMenuHelpers
}
// Since our app has no NIB, this initialises a standard app menu...
void rebuildMainMenu (const PopupMenu* extraItems)
static void rebuildMainMenu (const PopupMenu* extraItems)
{
// this can't be used in a plugin!
jassert (JUCEApplication::isStandaloneApp());


+ 1
- 1
modules/juce_gui_basics/positioning/juce_RelativeRectangle.cpp View File

@@ -33,7 +33,7 @@ namespace RelativeRectangleHelpers
++s;
}
bool dependsOnSymbolsOtherThanThis (const Expression& e)
static bool dependsOnSymbolsOtherThanThis (const Expression& e)
{
if (e.getType() == Expression::operatorType && e.getSymbolOrFunction() == ".")
return true;


+ 2
- 2
modules/juce_gui_basics/widgets/juce_Slider.cpp View File

@@ -979,14 +979,14 @@ void Slider::focusOfChildComponentChanged (FocusChangeType)
namespace SliderHelpers
{
double smallestAngleBetween (double a1, double a2) noexcept
static double smallestAngleBetween (double a1, double a2) noexcept
{
return jmin (std::abs (a1 - a2),
std::abs (a1 + double_Pi * 2.0 - a2),
std::abs (a2 + double_Pi * 2.0 - a1));
}
void sliderMenuCallback (int result, Slider* slider)
static void sliderMenuCallback (int result, Slider* slider)
{
if (slider != nullptr)
{


+ 1
- 1
modules/juce_gui_basics/widgets/juce_TextEditor.cpp View File

@@ -950,7 +950,7 @@ namespace TextEditorDefs
const int maxActionsPerTransaction = 100;
int getCharacterCategory (const juce_wchar character)
static int getCharacterCategory (const juce_wchar character)
{
return CharacterFunctions::isLetterOrDigit (character)
? 2 : (CharacterFunctions::isWhitespace (character) ? 0 : 1);


+ 1
- 1
modules/juce_gui_basics/widgets/juce_TreeView.cpp View File

@@ -1455,7 +1455,7 @@ void TreeViewItem::setDrawsInLeftMargin (bool canDrawInLeftMargin) noexcept
namespace TreeViewHelpers
{
int calculateDepth (const TreeViewItem* item, const bool rootIsVisible) noexcept
static int calculateDepth (const TreeViewItem* item, const bool rootIsVisible) noexcept
{
jassert (item != nullptr);
int depth = rootIsVisible ? 0 : -1;


+ 3
- 3
modules/juce_gui_basics/windows/juce_ComponentPeer.cpp View File

@@ -411,9 +411,9 @@ Rectangle<int> ComponentPeer::globalToLocal (const Rectangle<int>& screenPositio
//==============================================================================
namespace ComponentPeerHelpers
{
FileDragAndDropTarget* findDragAndDropTarget (Component* c,
const StringArray& files,
FileDragAndDropTarget* const lastOne)
static FileDragAndDropTarget* findDragAndDropTarget (Component* c,
const StringArray& files,
FileDragAndDropTarget* const lastOne)
{
while (c != nullptr)
{


+ 1
- 0
modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp View File

@@ -116,6 +116,7 @@ private:
juce_ImplementSingleton_SingleThreaded (TopLevelWindowManager)
void juce_CheckCurrentlyFocusedTopLevelWindow();
void juce_CheckCurrentlyFocusedTopLevelWindow()
{
if (TopLevelWindowManager::getInstanceWithoutCreating() != nullptr)


+ 15
- 15
modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniser.cpp View File

@@ -29,19 +29,19 @@ CPlusPlusCodeTokeniser::~CPlusPlusCodeTokeniser() {}
//==============================================================================
namespace CppTokeniser
{
bool isIdentifierStart (const juce_wchar c) noexcept
static bool isIdentifierStart (const juce_wchar c) noexcept
{
return CharacterFunctions::isLetter (c)
|| c == '_' || c == '@';
}
bool isIdentifierBody (const juce_wchar c) noexcept
static bool isIdentifierBody (const juce_wchar c) noexcept
{
return CharacterFunctions::isLetterOrDigit (c)
|| c == '_' || c == '@';
}
bool isReservedKeyword (String::CharPointerType token, const int tokenLength) noexcept
static bool isReservedKeyword (String::CharPointerType token, const int tokenLength) noexcept
{
static const char* const keywords2Char[] =
{ "if", "do", "or", "id", 0 };
@@ -103,7 +103,7 @@ namespace CppTokeniser
return false;
}
int parseIdentifier (CodeDocument::Iterator& source) noexcept
static int parseIdentifier (CodeDocument::Iterator& source) noexcept
{
int tokenLength = 0;
String::CharPointerType::CharType possibleIdentifier [100];
@@ -130,7 +130,7 @@ namespace CppTokeniser
return CPlusPlusCodeTokeniser::tokenType_identifier;
}
bool skipNumberSuffix (CodeDocument::Iterator& source)
static bool skipNumberSuffix (CodeDocument::Iterator& source)
{
const juce_wchar c = source.peekNextChar();
if (c == 'l' || c == 'L' || c == 'u' || c == 'U')
@@ -142,14 +142,14 @@ namespace CppTokeniser
return true;
}
bool isHexDigit (const juce_wchar c) noexcept
static bool isHexDigit (const juce_wchar c) noexcept
{
return (c >= '0' && c <= '9')
|| (c >= 'a' && c <= 'f')
|| (c >= 'A' && c <= 'F');
}
bool parseHexLiteral (CodeDocument::Iterator& source) noexcept
static bool parseHexLiteral (CodeDocument::Iterator& source) noexcept
{
if (source.nextChar() != '0')
return false;
@@ -171,12 +171,12 @@ namespace CppTokeniser
return skipNumberSuffix (source);
}
bool isOctalDigit (const juce_wchar c) noexcept
static bool isOctalDigit (const juce_wchar c) noexcept
{
return c >= '0' && c <= '7';
}
bool parseOctalLiteral (CodeDocument::Iterator& source) noexcept
static bool parseOctalLiteral (CodeDocument::Iterator& source) noexcept
{
if (source.nextChar() != '0')
return false;
@@ -190,12 +190,12 @@ namespace CppTokeniser
return skipNumberSuffix (source);
}
bool isDecimalDigit (const juce_wchar c) noexcept
static bool isDecimalDigit (const juce_wchar c) noexcept
{
return c >= '0' && c <= '9';
}
bool parseDecimalLiteral (CodeDocument::Iterator& source) noexcept
static bool parseDecimalLiteral (CodeDocument::Iterator& source) noexcept
{
int numChars = 0;
while (isDecimalDigit (source.peekNextChar()))
@@ -210,7 +210,7 @@ namespace CppTokeniser
return skipNumberSuffix (source);
}
bool parseFloatLiteral (CodeDocument::Iterator& source) noexcept
static bool parseFloatLiteral (CodeDocument::Iterator& source) noexcept
{
int numDigits = 0;
@@ -267,7 +267,7 @@ namespace CppTokeniser
return true;
}
int parseNumber (CodeDocument::Iterator& source)
static int parseNumber (CodeDocument::Iterator& source)
{
const CodeDocument::Iterator original (source);
@@ -295,7 +295,7 @@ namespace CppTokeniser
return CPlusPlusCodeTokeniser::tokenType_error;
}
void skipQuotedString (CodeDocument::Iterator& source) noexcept
static void skipQuotedString (CodeDocument::Iterator& source) noexcept
{
const juce_wchar quote = source.nextChar();
@@ -311,7 +311,7 @@ namespace CppTokeniser
}
}
void skipComment (CodeDocument::Iterator& source) noexcept
static void skipComment (CodeDocument::Iterator& source) noexcept
{
bool lastWasStar = false;


+ 1
- 1
modules/juce_gui_extra/code_editor/juce_CodeDocument.cpp View File

@@ -631,7 +631,7 @@ bool CodeDocument::hasChangedSinceSavePoint() const noexcept
//==============================================================================
namespace CodeDocumentHelpers
{
int getCharacterType (const juce_wchar character) noexcept
static int getCharacterType (const juce_wchar character) noexcept
{
return (CharacterFunctions::isLetterOrDigit (character) || character == '_')
? 2 : (CharacterFunctions::isWhitespace (character) ? 0 : 1);


+ 1
- 1
modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp View File

@@ -760,7 +760,7 @@ bool CodeEditorComponent::moveCaretToTop (const bool selecting)
namespace CodeEditorHelpers
{
int findFirstNonWhitespaceChar (const String& line) noexcept
static int findFirstNonWhitespaceChar (const String& line) noexcept
{
String::CharPointerType t (line.getCharPointer());
int i = 0;


+ 1
- 0
modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp View File

@@ -2219,6 +2219,7 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NonShaderContext);
};
LowLevelGraphicsContext* createOpenGLContext (const Target&);
LowLevelGraphicsContext* createOpenGLContext (const Target& target)
{
#if JUCE_USE_OPENGL_SHADERS


Loading…
Cancel
Save