| @@ -1112,6 +1112,7 @@ static const unsigned char temp_ee6f0c0f[] = | |||||
| const char* juce_icon_png = (const 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() | const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw() | ||||
| { | { | ||||
| int hash = 0; | int hash = 0; | ||||
| @@ -175,6 +175,7 @@ bool ResourceFile::write (const File& cppFile, OutputStream& cpp, OutputStream& | |||||
| cpp << newLine | cpp << newLine | ||||
| << newLine | << newLine | ||||
| << "const char* getNamedResource (const char*, int&) throw();" << newLine | |||||
| << "const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw()" << newLine | << "const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw()" << newLine | ||||
| << "{" << newLine; | << "{" << newLine; | ||||
| @@ -30,7 +30,7 @@ | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace FileHelpers | namespace FileHelpers | ||||
| { | { | ||||
| int64 calculateMemoryHashCode (const void* data, const int numBytes) | |||||
| static int64 calculateMemoryHashCode (const void* data, const int numBytes) | |||||
| { | { | ||||
| int64 t = 0; | int64 t = 0; | ||||
| @@ -112,7 +112,7 @@ namespace FileHelpers | |||||
| return path.replaceCharacter ('/', '\\'); | return path.replaceCharacter ('/', '\\'); | ||||
| } | } | ||||
| String appendPath (const String& path, const String& subpath) | |||||
| static String appendPath (const String& path, const String& subpath) | |||||
| { | { | ||||
| if (File::isAbsolutePath (subpath) | if (File::isAbsolutePath (subpath) | ||||
| || subpath.startsWithChar ('$') | || subpath.startsWithChar ('$') | ||||
| @@ -2142,6 +2142,7 @@ static const unsigned char temp_816ae700[] = | |||||
| const char* treedemo_xml = (const 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() | const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw() | ||||
| { | { | ||||
| int hash = 0; | int hash = 0; | ||||
| @@ -509,6 +509,7 @@ static const unsigned char temp_2dcb70c7[] = | |||||
| const char* prefs_misc_png = (const 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() | const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw() | ||||
| { | { | ||||
| int hash = 0; | int hash = 0; | ||||
| @@ -82,7 +82,7 @@ void AudioDataConverters::convertFloatToInt24LE (const float* source, void* dest | |||||
| { | { | ||||
| for (int i = 0; i < numSamples; ++i) | 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; | intData += destBytesPerSample; | ||||
| } | } | ||||
| } | } | ||||
| @@ -93,7 +93,7 @@ void AudioDataConverters::convertFloatToInt24LE (const float* source, void* dest | |||||
| for (int i = numSamples; --i >= 0;) | for (int i = numSamples; --i >= 0;) | ||||
| { | { | ||||
| intData -= destBytesPerSample; | 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) | 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; | intData += destBytesPerSample; | ||||
| } | } | ||||
| } | } | ||||
| @@ -118,7 +118,7 @@ void AudioDataConverters::convertFloatToInt24BE (const float* source, void* dest | |||||
| for (int i = numSamples; --i >= 0;) | for (int i = numSamples; --i >= 0;) | ||||
| { | { | ||||
| intData -= destBytesPerSample; | intData -= destBytesPerSample; | ||||
| ByteOrder::bigEndian24BitToChars ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])), intData); | |||||
| ByteOrder::bigEndian24BitToChars (roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])), intData); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -39,7 +39,7 @@ AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) noexcept | |||||
| size (other.size) | size (other.size) | ||||
| { | { | ||||
| allocateData(); | allocateData(); | ||||
| const size_t numBytes = size * sizeof (float); | |||||
| const size_t numBytes = sizeof (float) * (size_t) size; | |||||
| for (int i = 0; i < numChannels; ++i) | for (int i = 0; i < numChannels; ++i) | ||||
| memcpy (channels[i], other.channels[i], numBytes); | memcpy (channels[i], other.channels[i], numBytes); | ||||
| @@ -47,8 +47,8 @@ AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) noexcept | |||||
| void AudioSampleBuffer::allocateData() | 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); | allocatedData.malloc (allocatedBytes); | ||||
| channels = reinterpret_cast <float**> (allocatedData.getData()); | channels = reinterpret_cast <float**> (allocatedData.getData()); | ||||
| @@ -109,7 +109,7 @@ void AudioSampleBuffer::allocateChannels (float** const dataToReferTo, int offse | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| allocatedData.malloc (numChannels + 1, sizeof (float*)); | |||||
| allocatedData.malloc ((size_t) numChannels + 1, sizeof (float*)); | |||||
| channels = reinterpret_cast <float**> (allocatedData.getData()); | channels = reinterpret_cast <float**> (allocatedData.getData()); | ||||
| } | } | ||||
| @@ -130,7 +130,7 @@ AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& other) | |||||
| { | { | ||||
| setSize (other.getNumChannels(), other.getNumSamples(), false, false, false); | 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) | for (int i = 0; i < numChannels; ++i) | ||||
| memcpy (channels[i], other.channels[i], numBytes); | memcpy (channels[i], other.channels[i], numBytes); | ||||
| @@ -154,15 +154,15 @@ void AudioSampleBuffer::setSize (const int newNumChannels, | |||||
| if (newNumSamples != size || newNumChannels != numChannels) | 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) | if (keepExistingContent) | ||||
| { | { | ||||
| HeapBlock <char, true> newData; | HeapBlock <char, true> newData; | ||||
| newData.allocate (newTotalBytes, clearExtraSpace); | 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** const newChannels = reinterpret_cast <float**> (newData.getData()); | ||||
| float* newChan = reinterpret_cast <float*> (newData + channelListSize); | float* newChan = reinterpret_cast <float*> (newData + channelListSize); | ||||
| @@ -178,7 +178,7 @@ void AudioSampleBuffer::setSize (const int newNumChannels, | |||||
| memcpy (newChannels[i], channels[i], numBytesToCopy); | memcpy (newChannels[i], channels[i], numBytesToCopy); | ||||
| allocatedData.swapWith (newData); | allocatedData.swapWith (newData); | ||||
| allocatedBytes = (int) newTotalBytes; | |||||
| allocatedBytes = newTotalBytes; | |||||
| channels = newChannels; | channels = newChannels; | ||||
| } | } | ||||
| else | else | ||||
| @@ -212,7 +212,7 @@ void AudioSampleBuffer::setSize (const int newNumChannels, | |||||
| void AudioSampleBuffer::clear() noexcept | void AudioSampleBuffer::clear() noexcept | ||||
| { | { | ||||
| for (int i = 0; i < numChannels; ++i) | 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, | void AudioSampleBuffer::clear (const int startSample, | ||||
| @@ -221,7 +221,7 @@ void AudioSampleBuffer::clear (const int startSample, | |||||
| jassert (startSample >= 0 && startSample + numSamples <= size); | jassert (startSample >= 0 && startSample + numSamples <= size); | ||||
| for (int i = 0; i < numChannels; ++i) | 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, | void AudioSampleBuffer::clear (const int channel, | ||||
| @@ -231,7 +231,7 @@ void AudioSampleBuffer::clear (const int channel, | |||||
| jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
| jassert (startSample >= 0 && startSample + numSamples <= size); | 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, | void AudioSampleBuffer::applyGain (const int channel, | ||||
| @@ -248,7 +248,7 @@ void AudioSampleBuffer::applyGain (const int channel, | |||||
| if (gain == 0.0f) | if (gain == 0.0f) | ||||
| { | { | ||||
| zeromem (d, sizeof (float) * numSamples); | |||||
| zeromem (d, sizeof (float) * (size_t) numSamples); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -403,7 +403,7 @@ void AudioSampleBuffer::copyFrom (const int destChannel, | |||||
| { | { | ||||
| memcpy (channels [destChannel] + destStartSample, | memcpy (channels [destChannel] + destStartSample, | ||||
| source.channels [sourceChannel] + sourceStartSample, | 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, | memcpy (channels [destChannel] + destStartSample, | ||||
| source, | source, | ||||
| sizeof (float) * numSamples); | |||||
| sizeof (float) * (size_t) numSamples); | |||||
| } | } | ||||
| } | } | ||||
| @@ -442,7 +442,7 @@ void AudioSampleBuffer::copyFrom (const int destChannel, | |||||
| { | { | ||||
| if (gain == 0) | if (gain == 0) | ||||
| { | { | ||||
| zeromem (d, sizeof (float) * numSamples); | |||||
| zeromem (d, sizeof (float) * (size_t) numSamples); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -452,7 +452,7 @@ void AudioSampleBuffer::copyFrom (const int destChannel, | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| memcpy (d, source, sizeof (float) * numSamples); | |||||
| memcpy (d, source, sizeof (float) * (size_t) numSamples); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -40,7 +40,7 @@ namespace MidiBufferHelpers | |||||
| return getEventDataSize (d) + sizeof (int) + sizeof (uint16); | 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; | unsigned int byte = (unsigned int) *data; | ||||
| int size = 0; | int size = 0; | ||||
| @@ -126,7 +126,7 @@ void MidiBuffer::clear (const int startSample, const int numSamples) | |||||
| const int bytesToMove = bytesUsed - (int) (end - getData()); | const int bytesToMove = bytesUsed - (int) (end - getData()); | ||||
| if (bytesToMove > 0) | if (bytesToMove > 0) | ||||
| memmove (start, end, bytesToMove); | |||||
| memmove (start, end, (size_t) bytesToMove); | |||||
| bytesUsed -= (int) (end - start); | bytesUsed -= (int) (end - start); | ||||
| } | } | ||||
| @@ -143,23 +143,23 @@ void MidiBuffer::addEvent (const void* const newData, const int maxBytes, const | |||||
| if (numBytes > 0) | 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); | uint8* d = findEventAfter (getData(), sampleNumber); | ||||
| const int bytesToMove = bytesUsed - (int) (d - getData()); | const int bytesToMove = bytesUsed - (int) (d - getData()); | ||||
| if (bytesToMove > 0) | 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; | *reinterpret_cast <int*> (d) = sampleNumber; | ||||
| d += sizeof (int); | d += sizeof (int); | ||||
| *reinterpret_cast <uint16*> (d) = (uint16) numBytes; | *reinterpret_cast <uint16*> (d) = (uint16) numBytes; | ||||
| d += sizeof (uint16); | 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; | |||||
| } | } | ||||
| } | } | ||||
| @@ -25,7 +25,7 @@ | |||||
| namespace MidiFileHelpers | namespace MidiFileHelpers | ||||
| { | { | ||||
| void writeVariableLengthInt (OutputStream& out, unsigned int v) | |||||
| static void writeVariableLengthInt (OutputStream& out, unsigned int v) | |||||
| { | { | ||||
| unsigned int buffer = v & 0x7f; | 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; | data += 4; | ||||
| if (ch != ByteOrder::bigEndianInt ("MThd")) | if (ch != ByteOrder::bigEndianInt ("MThd")) | ||||
| @@ -88,9 +88,9 @@ namespace MidiFileHelpers | |||||
| return true; | 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) | if (timeFormat > 0) | ||||
| { | { | ||||
| @@ -261,7 +261,7 @@ bool MidiFile::readFrom (InputStream& sourceStream) | |||||
| if (size > 16 && MidiFileHelpers::parseMidiHeader (d, timeFormat, fileType, expectedTracks)) | 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; | int track = 0; | ||||
| @@ -278,7 +278,7 @@ bool MidiFile::readFrom (InputStream& sourceStream) | |||||
| if (chunkType == (int) ByteOrder::bigEndianInt ("MTrk")) | if (chunkType == (int) ByteOrder::bigEndianInt ("MTrk")) | ||||
| readNextTrack (d, chunkSize); | readNextTrack (d, chunkSize); | ||||
| size -= chunkSize + 8; | |||||
| size -= (size_t) chunkSize + 8; | |||||
| d += chunkSize; | d += chunkSize; | ||||
| ++track; | ++track; | ||||
| } | } | ||||
| @@ -384,7 +384,7 @@ void MidiFile::writeTrack (OutputStream& mainOut, const int trackNum) | |||||
| { | { | ||||
| const int tick = roundToInt (mm.getTimeStamp()); | const int tick = roundToInt (mm.getTimeStamp()); | ||||
| const int delta = jmax (0, tick - lastTick); | const int delta = jmax (0, tick - lastTick); | ||||
| MidiFileHelpers::writeVariableLengthInt (out, delta); | |||||
| MidiFileHelpers::writeVariableLengthInt (out, (uint32) delta); | |||||
| lastTick = tick; | lastTick = tick; | ||||
| const uint8* data = mm.getRawData(); | const uint8* data = mm.getRawData(); | ||||
| @@ -407,7 +407,7 @@ void MidiFile::writeTrack (OutputStream& mainOut, const int trackNum) | |||||
| ++data; | ++data; | ||||
| --dataSize; | --dataSize; | ||||
| MidiFileHelpers::writeVariableLengthInt (out, dataSize); | |||||
| MidiFileHelpers::writeVariableLengthInt (out, (uint32) dataSize); | |||||
| } | } | ||||
| out.write (data, dataSize); | out.write (data, dataSize); | ||||
| @@ -115,7 +115,7 @@ MidiMessage::MidiMessage (const void* const d, const int dataSize, const double | |||||
| else | else | ||||
| data = new uint8 [dataSize]; | data = new uint8 [dataSize]; | ||||
| memcpy (data, d, dataSize); | |||||
| memcpy (data, d, (size_t) dataSize); | |||||
| // check that the length matches the data.. | // check that the length matches the data.. | ||||
| jassert (size > 3 || data[0] >= 0xf0 || getMessageLengthFromFirstByte (data[0]) == size); | jassert (size > 3 || data[0] >= 0xf0 || getMessageLengthFromFirstByte (data[0]) == size); | ||||
| @@ -164,7 +164,7 @@ MidiMessage::MidiMessage (const MidiMessage& other) | |||||
| if (other.usesAllocatedData()) | if (other.usesAllocatedData()) | ||||
| { | { | ||||
| data = new uint8 [size]; | data = new uint8 [size]; | ||||
| memcpy (data, other.data, size); | |||||
| memcpy (data, other.data, (size_t) size); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -180,7 +180,7 @@ MidiMessage::MidiMessage (const MidiMessage& other, const double newTimeStamp) | |||||
| if (other.usesAllocatedData()) | if (other.usesAllocatedData()) | ||||
| { | { | ||||
| data = new uint8 [size]; | data = new uint8 [size]; | ||||
| memcpy (data, other.data, size); | |||||
| memcpy (data, other.data, (size_t) size); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -247,7 +247,7 @@ MidiMessage::MidiMessage (const void* src_, int sz, int& numBytesUsed, const uin | |||||
| data = new uint8 [size - numVariableLengthSysexBytes]; | data = new uint8 [size - numVariableLengthSysexBytes]; | ||||
| *data = (uint8) byte; | *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) | else if (byte == 0xff) | ||||
| { | { | ||||
| @@ -257,7 +257,7 @@ MidiMessage::MidiMessage (const void* src_, int sz, int& numBytesUsed, const uin | |||||
| data = new uint8 [size]; | data = new uint8 [size]; | ||||
| *data = (uint8) byte; | *data = (uint8) byte; | ||||
| memcpy (data + 1, src, size - 1); | |||||
| memcpy (data + 1, src, (size_t) size - 1); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -295,7 +295,7 @@ MidiMessage& MidiMessage::operator= (const MidiMessage& other) | |||||
| if (other.usesAllocatedData()) | if (other.usesAllocatedData()) | ||||
| { | { | ||||
| data = new uint8 [size]; | data = new uint8 [size]; | ||||
| memcpy (data, other.data, size); | |||||
| memcpy (data, other.data, (size_t) size); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -404,7 +404,7 @@ int MidiMessage::getNoteNumber() const noexcept | |||||
| void MidiMessage::setNoteNumber (const int newNoteNumber) noexcept | void MidiMessage::setNoteNumber (const int newNoteNumber) noexcept | ||||
| { | { | ||||
| if (isNoteOnOrOff()) | if (isNoteOnOrOff()) | ||||
| data[1] = (char) (newNoteNumber & 127); | |||||
| data[1] = (uint8) (newNoteNumber & 127); | |||||
| } | } | ||||
| uint8 MidiMessage::getVelocity() const noexcept | uint8 MidiMessage::getVelocity() const noexcept | ||||
| @@ -622,10 +622,10 @@ bool MidiMessage::isSysEx() const noexcept | |||||
| MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const int dataSize) | MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const int dataSize) | ||||
| { | { | ||||
| HeapBlock<uint8> m (dataSize + 2); | |||||
| HeapBlock<uint8> m ((size_t) dataSize + 2); | |||||
| m[0] = 0xf0; | m[0] = 0xf0; | ||||
| memcpy (m + 1, sysexData, dataSize); | |||||
| memcpy (m + 1, sysexData, (size_t) dataSize); | |||||
| m[dataSize + 1] = 0xf7; | m[dataSize + 1] = 0xf7; | ||||
| return MidiMessage (m, dataSize + 2); | return MidiMessage (m, dataSize + 2); | ||||
| @@ -682,7 +682,7 @@ bool MidiMessage::isTextMetaEvent() const noexcept | |||||
| String MidiMessage::getTextFromTextMetaEvent() const | 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); } | bool MidiMessage::isTrackNameEvent() const noexcept { return (data[1] == 3) && (*data == 0xff); } | ||||
| @@ -59,9 +59,9 @@ void ResamplingAudioSource::prepareToPlay (int samplesPerBlockExpected, | |||||
| bufferPos = 0; | bufferPos = 0; | ||||
| subSampleOffset = 0.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); | createLowPass (ratio); | ||||
| resetFilters(); | resetFilters(); | ||||
| } | } | ||||
| @@ -228,7 +228,7 @@ void ResamplingAudioSource::setFilterCoefficients (double c1, double c2, double | |||||
| void ResamplingAudioSource::resetFilters() | void ResamplingAudioSource::resetFilters() | ||||
| { | { | ||||
| filterStates.clear (numChannels); | |||||
| filterStates.clear ((size_t) numChannels); | |||||
| } | } | ||||
| void ResamplingAudioSource::applyFilter (float* samples, int num, FilterState& fs) | void ResamplingAudioSource::applyFilter (float* samples, int num, FilterState& fs) | ||||
| @@ -79,10 +79,10 @@ public: | |||||
| void allocateTempBuffers() | void allocateTempBuffers() | ||||
| { | { | ||||
| const int tempBufSize = bufferSize + 4; | 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; | int i, count = 0; | ||||
| for (i = 0; i < numInputChans; ++i) | for (i = 0; i < numInputChans; ++i) | ||||
| @@ -110,7 +110,7 @@ public: | |||||
| if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, bufList))) | 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) | for (int i = 0; i < numStreams; ++i) | ||||
| { | { | ||||
| @@ -123,11 +123,11 @@ public: | |||||
| { | { | ||||
| char channelName [256] = { 0 }; | char channelName [256] = { 0 }; | ||||
| UInt32 nameSize = sizeof (channelName); | UInt32 nameSize = sizeof (channelName); | ||||
| UInt32 channelNum = chanNum + 1; | |||||
| UInt32 channelNum = (UInt32) chanNum + 1; | |||||
| pa.mSelector = kAudioDevicePropertyChannelName; | pa.mSelector = kAudioDevicePropertyChannelName; | ||||
| if (AudioObjectGetPropertyData (deviceID, &pa, sizeof (channelNum), &channelNum, &nameSize, channelName) == noErr) | if (AudioObjectGetPropertyData (deviceID, &pa, sizeof (channelNum), &channelNum, &nameSize, channelName) == noErr) | ||||
| name = String::fromUTF8 (channelName, nameSize); | |||||
| name = String::fromUTF8 (channelName, (int) nameSize); | |||||
| } | } | ||||
| if (input) | if (input) | ||||
| @@ -135,8 +135,8 @@ public: | |||||
| if (activeInputChans[chanNum]) | if (activeInputChans[chanNum]) | ||||
| { | { | ||||
| inputChannelInfo [numInputChannelInfos].streamNum = i; | 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; | ++numInputChannelInfos; | ||||
| } | } | ||||
| @@ -150,8 +150,8 @@ public: | |||||
| if (activeOutputChans[chanNum]) | if (activeOutputChans[chanNum]) | ||||
| { | { | ||||
| outputChannelInfo [numOutputChannelInfos].streamNum = i; | 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; | ++numOutputChannelInfos; | ||||
| } | } | ||||
| @@ -199,7 +199,7 @@ public: | |||||
| pa.mSelector = kAudioDevicePropertyBufferFrameSize; | pa.mSelector = kAudioDevicePropertyBufferFrameSize; | ||||
| if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, &framesPerBuf))) | if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, &framesPerBuf))) | ||||
| { | { | ||||
| bufferSize = framesPerBuf; | |||||
| bufferSize = (int) framesPerBuf; | |||||
| allocateTempBuffers(); | allocateTempBuffers(); | ||||
| } | } | ||||
| @@ -294,10 +294,10 @@ public: | |||||
| inChanNames.clear(); | inChanNames.clear(); | ||||
| outChanNames.clear(); | outChanNames.clear(); | ||||
| inputChannelInfo.calloc (numInputChans + 2); | |||||
| inputChannelInfo.calloc ((size_t) numInputChans + 2); | |||||
| numInputChannelInfos = 0; | numInputChannelInfos = 0; | ||||
| outputChannelInfo.calloc (numOutputChans + 2); | |||||
| outputChannelInfo.calloc ((size_t) numOutputChans + 2); | |||||
| numOutputChannelInfos = 0; | numOutputChannelInfos = 0; | ||||
| fillInChannelInfo (true); | fillInChannelInfo (true); | ||||
| @@ -431,7 +431,7 @@ public: | |||||
| else | else | ||||
| { | { | ||||
| // change buffer size | // change buffer size | ||||
| UInt32 framesPerBuf = bufferSizeSamples; | |||||
| UInt32 framesPerBuf = (UInt32) bufferSizeSamples; | |||||
| pa.mSelector = kAudioDevicePropertyBufferFrameSize; | pa.mSelector = kAudioDevicePropertyBufferFrameSize; | ||||
| if (! OK (AudioObjectSetPropertyData (deviceID, &pa, 0, 0, sizeof (framesPerBuf), &framesPerBuf))) | if (! OK (AudioObjectSetPropertyData (deviceID, &pa, 0, 0, sizeof (framesPerBuf), &framesPerBuf))) | ||||
| @@ -1233,7 +1233,7 @@ private: | |||||
| if (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, bufList) == noErr) | 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) | for (int i = 0; i < numStreams; ++i) | ||||
| { | { | ||||
| @@ -25,7 +25,7 @@ | |||||
| namespace CoreMidiHelpers | namespace CoreMidiHelpers | ||||
| { | { | ||||
| bool logError (const OSStatus err, const int lineNum) | |||||
| static bool logError (const OSStatus err, const int lineNum) | |||||
| { | { | ||||
| if (err == noErr) | if (err == noErr) | ||||
| return true; | return true; | ||||
| @@ -39,7 +39,7 @@ namespace CoreMidiHelpers | |||||
| #define CHECK_ERROR(a) CoreMidiHelpers::logError (a, __LINE__) | #define CHECK_ERROR(a) CoreMidiHelpers::logError (a, __LINE__) | ||||
| //============================================================================== | //============================================================================== | ||||
| String getEndpointName (MIDIEndpointRef endpoint, bool isExternal) | |||||
| static String getEndpointName (MIDIEndpointRef endpoint, bool isExternal) | |||||
| { | { | ||||
| String result; | String result; | ||||
| CFStringRef str = 0; | CFStringRef str = 0; | ||||
| @@ -101,7 +101,7 @@ namespace CoreMidiHelpers | |||||
| return result; | return result; | ||||
| } | } | ||||
| String getConnectedEndpointName (MIDIEndpointRef endpoint) | |||||
| static String getConnectedEndpointName (MIDIEndpointRef endpoint) | |||||
| { | { | ||||
| String result; | String result; | ||||
| @@ -113,7 +113,7 @@ namespace CoreMidiHelpers | |||||
| if (connections != 0) | if (connections != 0) | ||||
| { | { | ||||
| numConnections = (int) (CFDataGetLength (connections) / sizeof (MIDIUniqueID)); | |||||
| numConnections = ((int) CFDataGetLength (connections)) / (int) sizeof (MIDIUniqueID); | |||||
| if (numConnections > 0) | if (numConnections > 0) | ||||
| { | { | ||||
| @@ -121,7 +121,7 @@ namespace CoreMidiHelpers | |||||
| for (int i = 0; i < numConnections; ++i, ++pid) | for (int i = 0; i < numConnections; ++i, ++pid) | ||||
| { | { | ||||
| MIDIUniqueID uid = ByteOrder::swapIfLittleEndian ((uint32) *pid); | |||||
| MIDIUniqueID uid = (MIDIUniqueID) ByteOrder::swapIfLittleEndian ((uint32) *pid); | |||||
| MIDIObjectRef connObject; | MIDIObjectRef connObject; | ||||
| MIDIObjectType connObjectType; | MIDIObjectType connObjectType; | ||||
| OSStatus err = MIDIObjectFindByUniqueID (uid, &connObject, &connObjectType); | OSStatus err = MIDIObjectFindByUniqueID (uid, &connObject, &connObjectType); | ||||
| @@ -170,7 +170,7 @@ namespace CoreMidiHelpers | |||||
| return getEndpointName (endpoint, false); | return getEndpointName (endpoint, false); | ||||
| } | } | ||||
| MIDIClientRef getGlobalMidiClient() | |||||
| static MIDIClientRef getGlobalMidiClient() | |||||
| { | { | ||||
| static MIDIClientRef globalMidiClient = 0; | static MIDIClientRef globalMidiClient = 0; | ||||
| @@ -273,7 +273,7 @@ namespace CoreMidiHelpers | |||||
| MidiDataConcatenator concatenator; | 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); | static_cast <MidiPortAndCallback*> (readProcRefCon)->handlePackets (pktlist); | ||||
| } | } | ||||
| @@ -313,7 +313,7 @@ MidiOutput* MidiOutput::openDevice (int index) | |||||
| if (isPositiveAndBelow (index, (int) MIDIGetNumberOfDestinations())) | if (isPositiveAndBelow (index, (int) MIDIGetNumberOfDestinations())) | ||||
| { | { | ||||
| MIDIEndpointRef endPoint = MIDIGetDestination (index); | |||||
| MIDIEndpointRef endPoint = MIDIGetDestination ((ItemCount) index); | |||||
| CFStringRef pname; | CFStringRef pname; | ||||
| if (CHECK_ERROR (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) | if (CHECK_ERROR (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) | ||||
| @@ -373,15 +373,15 @@ void MidiOutput::sendMessageNow (const MidiMessage& message) | |||||
| int pos = 0, bytesLeft = message.getRawDataSize(); | int pos = 0, bytesLeft = message.getRawDataSize(); | ||||
| const int numPackets = (bytesLeft + maxPacketSize - 1) / maxPacketSize; | const int numPackets = (bytesLeft + maxPacketSize - 1) / maxPacketSize; | ||||
| HeapBlock <MIDIPacketList> packets; | 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; | MIDIPacket* p = packets->packet; | ||||
| for (int i = 0; i < numPackets; ++i) | for (int i = 0; i < numPackets; ++i) | ||||
| { | { | ||||
| p->timeStamp = timeStamp; | p->timeStamp = timeStamp; | ||||
| p->length = jmin (maxPacketSize, bytesLeft); | |||||
| p->length = (UInt16) jmin (maxPacketSize, bytesLeft); | |||||
| memcpy (p->data, message.getRawData() + pos, p->length); | memcpy (p->data, message.getRawData() + pos, p->length); | ||||
| pos += p->length; | pos += p->length; | ||||
| bytesLeft -= p->length; | bytesLeft -= p->length; | ||||
| @@ -395,7 +395,7 @@ void MidiOutput::sendMessageNow (const MidiMessage& message) | |||||
| MIDIPacketList packets; | MIDIPacketList packets; | ||||
| packets.numPackets = 1; | packets.numPackets = 1; | ||||
| packets.packet[0].timeStamp = timeStamp; | 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(); | *(int*) (packets.packet[0].data) = *(const int*) message.getRawData(); | ||||
| mpe->send (&packets); | mpe->send (&packets); | ||||
| @@ -439,7 +439,7 @@ MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) | |||||
| if (isPositiveAndBelow (index, (int) MIDIGetNumberOfSources())) | if (isPositiveAndBelow (index, (int) MIDIGetNumberOfSources())) | ||||
| { | { | ||||
| MIDIEndpointRef endPoint = MIDIGetSource (index); | |||||
| MIDIEndpointRef endPoint = MIDIGetSource ((ItemCount) index); | |||||
| if (endPoint != 0) | if (endPoint != 0) | ||||
| { | { | ||||
| @@ -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) | 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); | 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) | FLaC__INLINE FLAC__bool FLAC__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br) | ||||
| @@ -1422,6 +1422,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_streamable_subset(FLAC__StreamEncod | |||||
| return true; | 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_API FLAC__bool FLAC__stream_encoder_set_do_md5(FLAC__StreamEncoder *encoder, FLAC__bool value) | ||||
| { | { | ||||
| FLAC__ASSERT(0 != encoder); | 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 | * These three functions are not static, but not publically exposed in | ||||
| * include/FLAC/ either. They are used by the test suite. | * 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_API FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value) | ||||
| { | { | ||||
| FLAC__ASSERT(0 != encoder); | FLAC__ASSERT(0 != encoder); | ||||
| @@ -1761,6 +1763,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__Stream | |||||
| return true; | 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_API FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value) | ||||
| { | { | ||||
| FLAC__ASSERT(0 != encoder); | FLAC__ASSERT(0 != encoder); | ||||
| @@ -1772,6 +1775,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEnc | |||||
| return true; | 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_API FLAC__bool FLAC__stream_encoder_disable_verbatim_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value) | ||||
| { | { | ||||
| FLAC__ASSERT(0 != encoder); | 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; | 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_API FLAC__bool FLAC__stream_encoder_get_do_md5(const FLAC__StreamEncoder *encoder) | ||||
| { | { | ||||
| FLAC__ASSERT(0 != encoder); | FLAC__ASSERT(0 != encoder); | ||||
| @@ -86,7 +86,7 @@ namespace AiffFileHelpers | |||||
| { | { | ||||
| if (values.getAllKeys().contains ("MidiUnityNote", true)) | 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()); | InstChunk* const inst = static_cast <InstChunk*> (block.getData()); | ||||
| inst->baseNote = (int8) values.getValue ("MidiUnityNote", "60").getIntValue(); | inst->baseNote = (int8) values.getValue ("MidiUnityNote", "60").getIntValue(); | ||||
| @@ -117,7 +117,7 @@ namespace AiffFileHelpers | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace MarkChunk | namespace MarkChunk | ||||
| { | { | ||||
| bool metaDataContainsZeroIdentifiers (const StringPairArray& values) | |||||
| static bool metaDataContainsZeroIdentifiers (const StringPairArray& values) | |||||
| { | { | ||||
| // (zero cue identifiers are valid for WAV but not for AIFF) | // (zero cue identifiers are valid for WAV but not for AIFF) | ||||
| const String cueString ("Cue"); | const String cueString ("Cue"); | ||||
| @@ -145,7 +145,7 @@ namespace AiffFileHelpers | |||||
| return false; | 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(); | const int numCues = values.getValue ("NumCuePoints", "0").getIntValue(); | ||||
| @@ -205,7 +205,7 @@ namespace AiffFileHelpers | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace COMTChunk | 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(); | const int numNotes = values.getValue ("NumCueNotes", "0").getIntValue(); | ||||
| @@ -321,7 +321,7 @@ public: | |||||
| const int offset = input->readIntBigEndian(); | const int offset = input->readIntBigEndian(); | ||||
| dataChunkStart = input->getPosition() + 4 + offset; | 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")) | else if (type == chunkName ("MARK")) | ||||
| { | { | ||||
| @@ -407,7 +407,7 @@ public: | |||||
| { | { | ||||
| for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
| if (destSamples[i] != nullptr) | if (destSamples[i] != nullptr) | ||||
| zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * numSamples); | |||||
| zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples); | |||||
| numSamples = (int) samplesAvailable; | numSamples = (int) samplesAvailable; | ||||
| } | } | ||||
| @@ -517,7 +517,7 @@ public: | |||||
| if (writeFailed) | if (writeFailed) | ||||
| return false; | 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); | tempBlock.ensureSize ((size_t) bytes, false); | ||||
| switch (bitsPerSample) | switch (bitsPerSample) | ||||
| @@ -530,7 +530,7 @@ public: | |||||
| } | } | ||||
| if (bytesWritten + bytes >= (size_t) 0xfff00000 | 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. | // 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 | // If it's just run out of disk space, then if it does manage | ||||
| @@ -542,7 +542,7 @@ public: | |||||
| else | else | ||||
| { | { | ||||
| bytesWritten += bytes; | bytesWritten += bytes; | ||||
| lengthInSamples += numSamples; | |||||
| lengthInSamples += (uint64) numSamples; | |||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -550,7 +550,7 @@ public: | |||||
| private: | private: | ||||
| MemoryBlock tempBlock, markChunk, comtChunk, instChunk; | MemoryBlock tempBlock, markChunk, comtChunk, instChunk; | ||||
| uint32 lengthInSamples, bytesWritten; | |||||
| uint64 lengthInSamples, bytesWritten; | |||||
| int64 headerPosition; | int64 headerPosition; | ||||
| bool writeFailed; | bool writeFailed; | ||||
| @@ -129,7 +129,7 @@ public: | |||||
| { | { | ||||
| for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
| if (destSamples[i] != nullptr) | if (destSamples[i] != nullptr) | ||||
| zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * numSamples); | |||||
| zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples); | |||||
| numSamples = (int) samplesAvailable; | numSamples = (int) samplesAvailable; | ||||
| } | } | ||||
| @@ -149,20 +149,20 @@ public: | |||||
| while (numSamples > 0) | while (numSamples > 0) | ||||
| { | { | ||||
| const int numThisTime = jmin (8192, numSamples); | 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); | audioDataBlock.ensureSize (numBytes * numChannels, false); | ||||
| float* data = static_cast<float*> (audioDataBlock.getData()); | 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].mNumberChannels = 1; | ||||
| bufferList->mBuffers[j].mDataByteSize = numBytes; | |||||
| bufferList->mBuffers[j].mDataByteSize = (UInt32) numBytes; | |||||
| bufferList->mBuffers[j].mData = data; | bufferList->mBuffers[j].mData = data; | ||||
| data += numThisTime; | data += numThisTime; | ||||
| } | } | ||||
| UInt32 numFramesToRead = numThisTime; | |||||
| UInt32 numFramesToRead = (UInt32) numThisTime; | |||||
| OSStatus status = ExtAudioFileRead (audioFileRef, &numFramesToRead, bufferList); | OSStatus status = ExtAudioFileRead (audioFileRef, &numFramesToRead, bufferList); | ||||
| if (status != noErr) | if (status != noErr) | ||||
| return false; | return false; | ||||
| @@ -171,7 +171,7 @@ public: | |||||
| { | { | ||||
| if (destSamples[i] != nullptr) | if (destSamples[i] != nullptr) | ||||
| { | { | ||||
| if (i < numChannels) | |||||
| if (i < (int) numChannels) | |||||
| memcpy (destSamples[i] + startOffsetInDestBuffer, bufferList->mBuffers[i].mData, numBytes); | memcpy (destSamples[i] + startOffsetInDestBuffer, bufferList->mBuffers[i].mData, numBytes); | ||||
| else | else | ||||
| zeromem (destSamples[i] + startOffsetInDestBuffer, numBytes); | zeromem (destSamples[i] + startOffsetInDestBuffer, numBytes); | ||||
| @@ -210,7 +210,7 @@ private: | |||||
| CoreAudioReader* const reader = static_cast<CoreAudioReader*> (inClientData); | CoreAudioReader* const reader = static_cast<CoreAudioReader*> (inClientData); | ||||
| reader->input->setPosition (inPosition); | reader->input->setPosition (inPosition); | ||||
| *actualCount = reader->input->read (buffer, requestCount); | |||||
| *actualCount = (UInt32) reader->input->read (buffer, (int) requestCount); | |||||
| return noErr; | return noErr; | ||||
| } | } | ||||
| @@ -131,7 +131,7 @@ public: | |||||
| lengthInSamples = (unsigned int) info.total_samples; | lengthInSamples = (unsigned int) info.total_samples; | ||||
| numChannels = info.channels; | 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 | // returns the number of samples read | ||||
| @@ -157,7 +157,7 @@ public: | |||||
| if (destSamples[i] != nullptr) | if (destSamples[i] != nullptr) | ||||
| memcpy (destSamples[i] + startOffsetInDestBuffer, | memcpy (destSamples[i] + startOffsetInDestBuffer, | ||||
| reservoir.getSampleData (i, (int) (startSampleInFile - reservoirStart)), | reservoir.getSampleData (i, (int) (startSampleInFile - reservoirStart)), | ||||
| sizeof (int) * num); | |||||
| sizeof (int) * (size_t) num); | |||||
| startOffsetInDestBuffer += num; | startOffsetInDestBuffer += num; | ||||
| startSampleInFile += num; | startSampleInFile += num; | ||||
| @@ -194,7 +194,7 @@ public: | |||||
| { | { | ||||
| for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
| if (destSamples[i] != nullptr) | if (destSamples[i] != nullptr) | ||||
| zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * numSamples); | |||||
| zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples); | |||||
| } | } | ||||
| return true; | 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) | static FlacNamespace::FLAC__StreamDecoderTellStatus tellCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__uint64* absolute_byte_offset, void* client_data) | ||||
| { | { | ||||
| using namespace FlacNamespace; | 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; | return FLAC__STREAM_DECODER_TELL_STATUS_OK; | ||||
| } | } | ||||
| static FlacNamespace::FLAC__StreamDecoderLengthStatus lengthCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__uint64* stream_length, void* client_data) | static FlacNamespace::FLAC__StreamDecoderLengthStatus lengthCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__uint64* stream_length, void* client_data) | ||||
| { | { | ||||
| using namespace FlacNamespace; | 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; | return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; | ||||
| } | } | ||||
| @@ -274,7 +274,7 @@ public: | |||||
| void* client_data) | void* client_data) | ||||
| { | { | ||||
| using namespace FlacNamespace; | 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; | return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; | ||||
| } | } | ||||
| @@ -305,7 +305,7 @@ class FlacWriter : public AudioFormatWriter | |||||
| public: | public: | ||||
| //============================================================================== | //============================================================================== | ||||
| FlacWriter (OutputStream* const out, double sampleRate_, | FlacWriter (OutputStream* const out, double sampleRate_, | ||||
| int numChannels_, int bitsPerSample_, int qualityOptionIndex) | |||||
| uint32 numChannels_, uint32 bitsPerSample_, int qualityOptionIndex) | |||||
| : AudioFormatWriter (out, TRANS (flacFormatName), | : AudioFormatWriter (out, TRANS (flacFormatName), | ||||
| sampleRate_, numChannels_, bitsPerSample_) | sampleRate_, numChannels_, bitsPerSample_) | ||||
| { | { | ||||
| @@ -313,7 +313,7 @@ public: | |||||
| encoder = FLAC__stream_encoder_new(); | encoder = FLAC__stream_encoder_new(); | ||||
| if (qualityOptionIndex > 0) | 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_do_mid_side_stereo (encoder, numChannels == 2); | ||||
| FLAC__stream_encoder_set_loose_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*> channels; | ||||
| HeapBlock<int> temp; | HeapBlock<int> temp; | ||||
| const int bitsToShift = 32 - bitsPerSample; | |||||
| const int bitsToShift = 32 - (int) bitsPerSample; | |||||
| if (bitsToShift > 0) | if (bitsToShift > 0) | ||||
| { | { | ||||
| temp.malloc (numSamples * numChannels); | |||||
| temp.malloc (numChannels * (size_t) numSamples); | |||||
| channels.calloc (numChannels + 1); | channels.calloc (numChannels + 1); | ||||
| for (unsigned int i = 0; i < numChannels; ++i) | for (unsigned int i = 0; i < numChannels; ++i) | ||||
| @@ -366,7 +366,7 @@ public: | |||||
| if (samplesToWrite[i] == nullptr) | if (samplesToWrite[i] == nullptr) | ||||
| break; | break; | ||||
| int* const destData = temp.getData() + i * numSamples; | |||||
| int* const destData = temp.getData() + i * (size_t) numSamples; | |||||
| channels[i] = destData; | channels[i] = destData; | ||||
| for (int j = 0; j < numSamples; ++j) | for (int j = 0; j < numSamples; ++j) | ||||
| @@ -376,7 +376,7 @@ public: | |||||
| samplesToWrite = const_cast <const int**> (channels.getData()); | 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 | bool writeData (const void* const data, const int size) const | ||||
| @@ -518,8 +518,8 @@ AudioFormatWriter* FlacAudioFormat::createWriterFor (OutputStream* out, | |||||
| { | { | ||||
| if (getPossibleBitDepths().contains (bitsPerSample)) | 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) | if (w->ok) | ||||
| return w.release(); | return w.release(); | ||||
| } | } | ||||
| @@ -358,8 +358,8 @@ namespace WavFileHelpers | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace ListChunk | 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 String label (values.getValue (prefix + "Text", prefix)); | ||||
| const int labelLength = label.getNumBytesAsUTF8() + 1; | const int labelLength = label.getNumBytesAsUTF8() + 1; | ||||
| @@ -374,7 +374,7 @@ namespace WavFileHelpers | |||||
| out.writeByte (0); | 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)); | const String text (values.getValue (prefix + "Text", prefix)); | ||||
| @@ -396,7 +396,7 @@ namespace WavFileHelpers | |||||
| out.writeByte (0); | 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 numCueLabels = values.getValue ("NumCueLabels", "0").getIntValue(); | ||||
| const int numCueNotes = values.getValue ("NumCueNotes", "0").getIntValue(); | const int numCueNotes = values.getValue ("NumCueNotes", "0").getIntValue(); | ||||
| @@ -1032,7 +1032,7 @@ AudioFormatWriter* WavAudioFormat::createWriterFor (OutputStream* out, double sa | |||||
| namespace WavFileHelpers | namespace WavFileHelpers | ||||
| { | { | ||||
| bool slowCopyWavFileWithNewMetadata (const File& file, const StringPairArray& metadata) | |||||
| static bool slowCopyWavFileWithNewMetadata (const File& file, const StringPairArray& metadata) | |||||
| { | { | ||||
| TemporaryFile tempFile (file); | TemporaryFile tempFile (file); | ||||
| @@ -50,7 +50,7 @@ public: | |||||
| if (bytesRead != nullptr) | if (bytesRead != nullptr) | ||||
| *bytesRead = numRead; | *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) | JUCE_COMRESULT Seek (LARGE_INTEGER position, DWORD origin, ULARGE_INTEGER* resultPosition) | ||||
| @@ -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; | vorbis_info *vi=v->vi; | ||||
| codec_setup_info *ci=(codec_setup_info*) vi->codec_setup; | codec_setup_info *ci=(codec_setup_info*) vi->codec_setup; | ||||
| int hs=ci->halfrate_flag; | int hs=ci->halfrate_flag; | ||||
| @@ -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){ | if(i){ | ||||
| memset(i,0,sizeof(*i)); | memset(i,0,sizeof(*i)); | ||||
| _ogg_free(i); | _ogg_free(i); | ||||
| @@ -66,7 +66,7 @@ typedef struct { | |||||
| } vorbis_look_residue0; | } 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; | vorbis_info_residue0 *info=(vorbis_info_residue0 *)i; | ||||
| if(info){ | if(info){ | ||||
| memset(info,0,sizeof(*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; | int j; | ||||
| if(i){ | 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; | vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr; | ||||
| int j,acc=0; | int j,acc=0; | ||||
| oggpack_write(opb,info->begin,24); | 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 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; | int j,acc=0; | ||||
| vorbis_info_residue0 *info=(vorbis_info_residue0*) _ogg_calloc(1,sizeof(*info)); | vorbis_info_residue0 *info=(vorbis_info_residue0*) _ogg_calloc(1,sizeof(*info)); | ||||
| codec_setup_info *ci=(codec_setup_info*) vi->codec_setup; | 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); | 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_residue *vr){ | ||||
| vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr; | vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr; | ||||
| vorbis_look_residue0 *look=(vorbis_look_residue0 *)_ogg_calloc(1,sizeof(*look)); | 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); | 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){ | float **in,int *nonzero,int ch){ | ||||
| int i,used=0; | int i,used=0; | ||||
| for(i=0;i<ch;i++) | for(i=0;i<ch;i++) | ||||
| @@ -728,7 +728,7 @@ int res0_inverse(vorbis_block *vb,vorbis_look_residue *vl, | |||||
| return(0); | 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 **in,int *nonzero,int ch, long **partword, int submap){ | ||||
| int i,used=0; | int i,used=0; | ||||
| for(i=0;i<ch;i++) | 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 **in,int *nonzero,int ch){ | ||||
| int i,used=0; | int i,used=0; | ||||
| for(i=0;i<ch;i++) | for(i=0;i<ch;i++) | ||||
| @@ -754,7 +754,7 @@ long **res1_class(vorbis_block *vb,vorbis_look_residue *vl, | |||||
| return(0); | 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){ | float **in,int *nonzero,int ch){ | ||||
| int i,used=0; | int i,used=0; | ||||
| for(i=0;i<ch;i++) | for(i=0;i<ch;i++) | ||||
| @@ -766,7 +766,7 @@ int res1_inverse(vorbis_block *vb,vorbis_look_residue *vl, | |||||
| return(0); | 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 **in,int *nonzero,int ch){ | ||||
| int i,used=0; | int i,used=0; | ||||
| for(i=0;i<ch;i++) | 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 | /* res2 is slightly more different; all the channels are interleaved | ||||
| into a single vector and encoded. */ | 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, | vorbis_block *vb,vorbis_look_residue *vl, | ||||
| int **in,int *nonzero,int ch, long **partword,int submap){ | int **in,int *nonzero,int ch, long **partword,int submap){ | ||||
| long i,j,k,n=vb->pcmend/2,used=0; | 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 */ | /* 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){ | float **in,int *nonzero,int ch){ | ||||
| long i,k,l,s; | long i,k,l,s; | ||||
| vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl; | vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl; | ||||
| @@ -70,7 +70,7 @@ float _float32_unpack(long val){ | |||||
| /* given a list of word lengths, generate a list of codewords. Works | /* given a list of word lengths, generate a list of codewords. Works | ||||
| for length ordered or unordered, always assigns the lowest valued | for length ordered or unordered, always assigns the lowest valued | ||||
| codewords first. Extended to handle unused entries (length 0) */ | 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; | long i,j,count=0; | ||||
| ogg_uint32_t marker[33]; | ogg_uint32_t marker[33]; | ||||
| ogg_uint32_t *r=(ogg_uint32_t*)_ogg_malloc((sparsecount?sparsecount:n)*sizeof(*r)); | ogg_uint32_t *r=(ogg_uint32_t*)_ogg_malloc((sparsecount?sparsecount:n)*sizeof(*r)); | ||||
| @@ -42,7 +42,7 @@ typedef struct { | |||||
| } ogg_page; | } 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>>16)&0x0000ffffUL) | ((x<<16)&0xffff0000UL); | ||||
| x= ((x>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL); | x= ((x>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL); | ||||
| x= ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL); | x= ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL); | ||||
| @@ -56,7 +56,7 @@ bool AudioFormatReader::read (int* const* destSamples, | |||||
| for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
| if (destSamples[i] != nullptr) | if (destSamples[i] != nullptr) | ||||
| zeromem (destSamples[i], sizeof (int) * silence); | |||||
| zeromem (destSamples[i], sizeof (int) * (size_t) silence); | |||||
| startOffsetInDestBuffer += silence; | startOffsetInDestBuffer += silence; | ||||
| numSamplesToRead -= silence; | numSamplesToRead -= silence; | ||||
| @@ -89,13 +89,13 @@ bool AudioFormatReader::read (int* const* destSamples, | |||||
| if (lastFullChannel != nullptr) | if (lastFullChannel != nullptr) | ||||
| for (int i = (int) numChannels; i < numDestChannels; ++i) | for (int i = (int) numChannels; i < numDestChannels; ++i) | ||||
| if (destSamples[i] != nullptr) | if (destSamples[i] != nullptr) | ||||
| memcpy (destSamples[i], lastFullChannel, sizeof (int) * numSamplesToRead); | |||||
| memcpy (destSamples[i], lastFullChannel, sizeof (int) * (size_t) numSamplesToRead); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| for (int i = (int) numChannels; i < numDestChannels; ++i) | for (int i = (int) numChannels; i < numDestChannels; ++i) | ||||
| if (destSamples[i] != nullptr) | 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.. | // if this is a stereo buffer and the source was mono, dupe the first channel.. | ||||
| memcpy (buffer->getSampleData (1, startSample), | memcpy (buffer->getSampleData (1, startSample), | ||||
| buffer->getSampleData (0, startSample), | buffer->getSampleData (0, startSample), | ||||
| sizeof (float) * numSamples); | |||||
| sizeof (float) * (size_t) numSamples); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -151,14 +151,15 @@ bool AudioFormatWriter::writeFromAudioSampleBuffer (const AudioSampleBuffer& sou | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| tempBuffer.malloc (numSamples * numChannels); | |||||
| tempBuffer.malloc (((size_t) numSamples) * (size_t) numChannels); | |||||
| for (unsigned int i = 0; i < numChannels; ++i) | for (unsigned int i = 0; i < numChannels; ++i) | ||||
| { | { | ||||
| typedef AudioData::Pointer <AudioData::Int32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> DestSampleType; | typedef AudioData::Pointer <AudioData::Int32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> DestSampleType; | ||||
| typedef AudioData::Pointer <AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const> SourceSampleType; | 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)); | SourceSampleType sourceData (source.getSampleData ((int) i, startSample)); | ||||
| destData.convertSamples (sourceData, numSamples); | destData.convertSamples (sourceData, numSamples); | ||||
| } | } | ||||
| @@ -55,7 +55,7 @@ bool AudioSubsectionReader::readSamples (int** destSamples, int numDestChannels, | |||||
| { | { | ||||
| for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
| if (destSamples[i] != nullptr) | if (destSamples[i] != nullptr) | ||||
| zeromem (destSamples[i], sizeof (int) * numSamples); | |||||
| zeromem (destSamples[i], sizeof (int) * (size_t) numSamples); | |||||
| numSamples = jmin (numSamples, (int) (length - startSampleInFile)); | numSamples = jmin (numSamples, (int) (length - startSampleInFile)); | ||||
| @@ -52,6 +52,10 @@ | |||||
| #endif | #endif | ||||
| #endif | #endif | ||||
| #if JUCE_PLUGINHOST_VST && JUCE_LINUX | |||||
| #include <X11/Xlib.h> | |||||
| #endif | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace juce | namespace juce | ||||
| { | { | ||||
| @@ -91,14 +91,14 @@ void AudioProcessorPlayer::audioDeviceIOCallback (const float** const inputChann | |||||
| for (i = 0; i < numOutputChannels; ++i) | for (i = 0; i < numOutputChannels; ++i) | ||||
| { | { | ||||
| channels[totalNumChans] = outputChannelData[i]; | channels[totalNumChans] = outputChannelData[i]; | ||||
| memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * numSamples); | |||||
| memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * (size_t) numSamples); | |||||
| ++totalNumChans; | ++totalNumChans; | ||||
| } | } | ||||
| for (i = numOutputChannels; i < numInputChannels; ++i) | for (i = numOutputChannels; i < numInputChannels; ++i) | ||||
| { | { | ||||
| channels[totalNumChans] = tempBuffer.getSampleData (i - numOutputChannels, 0); | 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; | ++totalNumChans; | ||||
| } | } | ||||
| } | } | ||||
| @@ -107,14 +107,14 @@ void AudioProcessorPlayer::audioDeviceIOCallback (const float** const inputChann | |||||
| for (i = 0; i < numInputChannels; ++i) | for (i = 0; i < numInputChannels; ++i) | ||||
| { | { | ||||
| channels[totalNumChans] = outputChannelData[i]; | channels[totalNumChans] = outputChannelData[i]; | ||||
| memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * numSamples); | |||||
| memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * (size_t) numSamples); | |||||
| ++totalNumChans; | ++totalNumChans; | ||||
| } | } | ||||
| for (i = numInputChannels; i < numOutputChannels; ++i) | for (i = numInputChannels; i < numOutputChannels; ++i) | ||||
| { | { | ||||
| channels[totalNumChans] = outputChannelData[i]; | channels[totalNumChans] = outputChannelData[i]; | ||||
| zeromem (channels[totalNumChans], sizeof (float) * numSamples); | |||||
| zeromem (channels[totalNumChans], sizeof (float) * (size_t) numSamples); | |||||
| ++totalNumChans; | ++totalNumChans; | ||||
| } | } | ||||
| } | } | ||||
| @@ -130,7 +130,7 @@ void AudioProcessorPlayer::audioDeviceIOCallback (const float** const inputChann | |||||
| if (processor->isSuspended()) | if (processor->isSuspended()) | ||||
| { | { | ||||
| for (i = 0; i < numOutputChannels; ++i) | for (i = 0; i < numOutputChannels; ++i) | ||||
| zeromem (outputChannelData[i], sizeof (float) * numSamples); | |||||
| zeromem (outputChannelData[i], sizeof (float) * (size_t) numSamples); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -390,7 +390,7 @@ public: | |||||
| const int numberToMove = numUsed - indexToInsertAt; | const int numberToMove = numUsed - indexToInsertAt; | ||||
| if (numberToMove > 0) | if (numberToMove > 0) | ||||
| memmove (insertPos + 1, insertPos, numberToMove * sizeof (ElementType)); | |||||
| memmove (insertPos + 1, insertPos, ((size_t) numberToMove) * sizeof (ElementType)); | |||||
| new (insertPos) ElementType (newElement); | new (insertPos) ElementType (newElement); | ||||
| ++numUsed; | ++numUsed; | ||||
| @@ -426,7 +426,7 @@ public: | |||||
| { | { | ||||
| insertPos = data.elements + indexToInsertAt; | insertPos = data.elements + indexToInsertAt; | ||||
| const int numberToMove = numUsed - indexToInsertAt; | const int numberToMove = numUsed - indexToInsertAt; | ||||
| memmove (insertPos + numberOfTimesToInsertIt, insertPos, numberToMove * sizeof (ElementType)); | |||||
| memmove (insertPos + numberOfTimesToInsertIt, insertPos, ((size_t) numberToMove) * sizeof (ElementType)); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -731,7 +731,7 @@ public: | |||||
| const int numberToShift = numUsed - indexToRemove; | const int numberToShift = numUsed - indexToRemove; | ||||
| if (numberToShift > 0) | if (numberToShift > 0) | ||||
| memmove (e, e + 1, numberToShift * sizeof (ElementType)); | |||||
| memmove (e, e + 1, ((size_t) numberToShift) * sizeof (ElementType)); | |||||
| if ((numUsed << 1) < data.numAllocated) | if ((numUsed << 1) < data.numAllocated) | ||||
| minimiseStorageOverheads(); | minimiseStorageOverheads(); | ||||
| @@ -795,7 +795,7 @@ public: | |||||
| const int numToShift = numUsed - endIndex; | const int numToShift = numUsed - endIndex; | ||||
| if (numToShift > 0) | if (numToShift > 0) | ||||
| memmove (e, e + numberToRemove, numToShift * sizeof (ElementType)); | |||||
| memmove (e, e + numberToRemove, ((size_t) numToShift) * sizeof (ElementType)); | |||||
| numUsed -= numberToRemove; | numUsed -= numberToRemove; | ||||
| @@ -932,13 +932,13 @@ public: | |||||
| { | { | ||||
| memmove (data.elements + currentIndex, | memmove (data.elements + currentIndex, | ||||
| data.elements + currentIndex + 1, | data.elements + currentIndex + 1, | ||||
| (newIndex - currentIndex) * sizeof (ElementType)); | |||||
| sizeof (ElementType) * (size_t) (newIndex - currentIndex)); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| memmove (data.elements + newIndex + 1, | memmove (data.elements + newIndex + 1, | ||||
| data.elements + newIndex, | data.elements + newIndex, | ||||
| (currentIndex - newIndex) * sizeof (ElementType)); | |||||
| sizeof (ElementType) * (size_t) (currentIndex - newIndex)); | |||||
| } | } | ||||
| memcpy (data.elements + newIndex, tempCopy, sizeof (ElementType)); | memcpy (data.elements + newIndex, tempCopy, sizeof (ElementType)); | ||||
| @@ -281,7 +281,7 @@ public: | |||||
| const int numToMove = numUsed - indexToInsertAt; | const int numToMove = numUsed - indexToInsertAt; | ||||
| if (numToMove > 0) | if (numToMove > 0) | ||||
| memmove (e + 1, e, numToMove * sizeof (ObjectClass*)); | |||||
| memmove (e + 1, e, sizeof (ObjectClass*) * (size_t) numToMove); | |||||
| *e = const_cast <ObjectClass*> (newObject); | *e = const_cast <ObjectClass*> (newObject); | ||||
| ++numUsed; | ++numUsed; | ||||
| @@ -527,7 +527,7 @@ public: | |||||
| const int numToShift = numUsed - indexToRemove; | const int numToShift = numUsed - indexToRemove; | ||||
| if (numToShift > 0) | 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; | const int numToShift = numUsed - indexToRemove; | ||||
| if (numToShift > 0) | if (numToShift > 0) | ||||
| memmove (e, e + 1, numToShift * sizeof (ObjectClass*)); | |||||
| memmove (e, e + 1, sizeof (ObjectClass*) * (size_t) numToShift); | |||||
| if ((numUsed << 1) < data.numAllocated) | if ((numUsed << 1) < data.numAllocated) | ||||
| minimiseStorageOverheads(); | minimiseStorageOverheads(); | ||||
| @@ -709,13 +709,13 @@ public: | |||||
| { | { | ||||
| memmove (data.elements + currentIndex, | memmove (data.elements + currentIndex, | ||||
| data.elements + currentIndex + 1, | data.elements + currentIndex + 1, | ||||
| (newIndex - currentIndex) * sizeof (ObjectClass*)); | |||||
| sizeof (ObjectClass*) * (size_t) (newIndex - currentIndex)); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| memmove (data.elements + newIndex + 1, | memmove (data.elements + newIndex + 1, | ||||
| data.elements + newIndex, | data.elements + newIndex, | ||||
| (currentIndex - newIndex) * sizeof (ObjectClass*)); | |||||
| sizeof (ObjectClass*) * (size_t) (currentIndex - newIndex)); | |||||
| } | } | ||||
| data.elements [newIndex] = value; | data.elements [newIndex] = value; | ||||
| @@ -329,7 +329,7 @@ public: | |||||
| const int numToMove = numUsed - indexToInsertAt; | const int numToMove = numUsed - indexToInsertAt; | ||||
| if (numToMove > 0) | if (numToMove > 0) | ||||
| memmove (e + 1, e, numToMove * sizeof (ObjectClass*)); | |||||
| memmove (e + 1, e, sizeof (ObjectClass*) * (size_t) numToMove); | |||||
| *e = newObject; | *e = newObject; | ||||
| @@ -538,7 +538,7 @@ public: | |||||
| const int numberToShift = numUsed - indexToRemove; | const int numberToShift = numUsed - indexToRemove; | ||||
| if (numberToShift > 0) | if (numberToShift > 0) | ||||
| memmove (e, e + 1, numberToShift * sizeof (ObjectClass*)); | |||||
| memmove (e, e + 1, sizeof (ObjectClass*) * (size_t) numberToShift); | |||||
| if ((numUsed << 1) < data.numAllocated) | if ((numUsed << 1) < data.numAllocated) | ||||
| minimiseStorageOverheads(); | minimiseStorageOverheads(); | ||||
| @@ -573,7 +573,7 @@ public: | |||||
| const int numberToShift = numUsed - indexToRemove; | const int numberToShift = numUsed - indexToRemove; | ||||
| if (numberToShift > 0) | if (numberToShift > 0) | ||||
| memmove (e, e + 1, numberToShift * sizeof (ObjectClass*)); | |||||
| memmove (e, e + 1, sizeof (ObjectClass*) * (size_t) numberToShift); | |||||
| if ((numUsed << 1) < data.numAllocated) | if ((numUsed << 1) < data.numAllocated) | ||||
| minimiseStorageOverheads(); | minimiseStorageOverheads(); | ||||
| @@ -715,13 +715,13 @@ public: | |||||
| { | { | ||||
| memmove (data.elements + currentIndex, | memmove (data.elements + currentIndex, | ||||
| data.elements + currentIndex + 1, | data.elements + currentIndex + 1, | ||||
| (newIndex - currentIndex) * sizeof (ObjectClass*)); | |||||
| sizeof (ObjectClass*) * (size_t) (newIndex - currentIndex)); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| memmove (data.elements + newIndex + 1, | memmove (data.elements + newIndex + 1, | ||||
| data.elements + newIndex, | data.elements + newIndex, | ||||
| (currentIndex - newIndex) * sizeof (ObjectClass*)); | |||||
| sizeof (ObjectClass*) * (size_t) (currentIndex - newIndex)); | |||||
| } | } | ||||
| data.elements [newIndex] = value; | data.elements [newIndex] = value; | ||||
| @@ -453,7 +453,7 @@ public: | |||||
| const int numberToShift = numUsed - indexToRemove; | const int numberToShift = numUsed - indexToRemove; | ||||
| if (numberToShift > 0) | if (numberToShift > 0) | ||||
| memmove (e, e + 1, numberToShift * sizeof (ElementType)); | |||||
| memmove (e, e + 1, sizeof (ElementType) * (size_t) numberToShift); | |||||
| if ((numUsed << 1) < data.numAllocated) | if ((numUsed << 1) < data.numAllocated) | ||||
| minimiseStorageOverheads(); | minimiseStorageOverheads(); | ||||
| @@ -580,7 +580,7 @@ private: | |||||
| const int numberToMove = numUsed - indexToInsertAt; | const int numberToMove = numUsed - indexToInsertAt; | ||||
| if (numberToMove > 0) | if (numberToMove > 0) | ||||
| memmove (insertPos + 1, insertPos, numberToMove * sizeof (ElementType)); | |||||
| memmove (insertPos + 1, insertPos, sizeof (ElementType) * (size_t) numberToMove); | |||||
| *insertPos = newElement; | *insertPos = newElement; | ||||
| ++numUsed; | ++numUsed; | ||||
| @@ -705,7 +705,7 @@ void BigInteger::shiftLeft (int bits, const int startBit) | |||||
| if (wordsToMove > 0) | if (wordsToMove > 0) | ||||
| { | { | ||||
| for (int i = (int) top; --i >= 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) | for (size_t j = 0; j < wordsToMove; ++j) | ||||
| values [j] = 0; | values [j] = 0; | ||||
| @@ -87,7 +87,7 @@ int64 Random::nextInt64() noexcept | |||||
| bool Random::nextBool() noexcept | bool Random::nextBool() noexcept | ||||
| { | { | ||||
| return (nextInt() & 0x80000000) != 0; | |||||
| return (nextInt() & 0x40000000) != 0; | |||||
| } | } | ||||
| float Random::nextFloat() noexcept | float Random::nextFloat() noexcept | ||||
| @@ -55,7 +55,7 @@ void File::findFileSystemRoots (Array<File>& destArray) | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace FileHelpers | namespace FileHelpers | ||||
| { | { | ||||
| bool isFileOnDriveType (const File& f, const char* const* types) | |||||
| static bool isFileOnDriveType (const File& f, const char* const* types) | |||||
| { | { | ||||
| struct statfs buf; | struct statfs buf; | ||||
| @@ -71,7 +71,7 @@ namespace FileHelpers | |||||
| return false; | 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 | #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 | ||||
| JUCE_AUTORELEASEPOOL | JUCE_AUTORELEASEPOOL | ||||
| @@ -101,7 +101,7 @@ namespace FileHelpers | |||||
| } | } | ||||
| #endif | #endif | ||||
| bool launchExecutable (const String& pathAndArguments) | |||||
| static bool launchExecutable (const String& pathAndArguments) | |||||
| { | { | ||||
| const char* const argv[4] = { "/bin/sh", "-c", pathAndArguments.toUTF8(), 0 }; | const char* const argv[4] = { "/bin/sh", "-c", pathAndArguments.toUTF8(), 0 }; | ||||
| @@ -43,7 +43,7 @@ void Logger::outputDebugString (const String& text) | |||||
| namespace SystemStatsHelpers | namespace SystemStatsHelpers | ||||
| { | { | ||||
| #if JUCE_INTEL | #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; | uint32 la = a, lb = b, lc = c, ld = d; | ||||
| @@ -566,6 +566,7 @@ MemoryMappedFile::~MemoryMappedFile() | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| File juce_getExecutableFile(); | |||||
| File juce_getExecutableFile() | File juce_getExecutableFile() | ||||
| { | { | ||||
| #if JUCE_ANDROID | #if JUCE_ANDROID | ||||
| @@ -661,12 +662,14 @@ int File::getVolumeSerialNumber() const | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| void juce_runSystemCommand (const String&); | |||||
| void juce_runSystemCommand (const String& command) | void juce_runSystemCommand (const String& command) | ||||
| { | { | ||||
| int result = system (command.toUTF8()); | int result = system (command.toUTF8()); | ||||
| (void) result; | (void) result; | ||||
| } | } | ||||
| String juce_getOutputFromCommand (const String&); | |||||
| String juce_getOutputFromCommand (const String& command) | String juce_getOutputFromCommand (const String& command) | ||||
| { | { | ||||
| // slight bodge here, as we just pipe the output into a temp file and read it... | // 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*); | void JUCE_API juce_threadEntryPoint (void*); | ||||
| extern "C" void* threadEntryProc (void*); | |||||
| extern "C" void* threadEntryProc (void* userData) | extern "C" void* threadEntryProc (void* userData) | ||||
| { | { | ||||
| JUCE_AUTORELEASEPOOL | JUCE_AUTORELEASEPOOL | ||||
| @@ -857,6 +861,7 @@ void Thread::killThread() | |||||
| void Thread::setCurrentThreadName (const String& name) | 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) | #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)]; | [[NSThread currentThread] setName: juceStringToNS (name)]; | ||||
| #elif JUCE_LINUX | #elif JUCE_LINUX | ||||
| prctl (PR_SET_NAME, name.toUTF8().getAddress(), 0, 0, 0); | prctl (PR_SET_NAME, name.toUTF8().getAddress(), 0, 0, 0); | ||||
| @@ -41,7 +41,7 @@ | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace SocketHelpers | namespace SocketHelpers | ||||
| { | { | ||||
| void initSockets() | |||||
| static void initSockets() | |||||
| { | { | ||||
| #if JUCE_WINDOWS | #if JUCE_WINDOWS | ||||
| static bool socketsStarted = false; | static bool socketsStarted = false; | ||||
| @@ -57,7 +57,7 @@ namespace SocketHelpers | |||||
| #endif | #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 sndBufSize = 65536; | ||||
| const int rcvBufSize = 65536; | const int rcvBufSize = 65536; | ||||
| @@ -70,7 +70,7 @@ namespace SocketHelpers | |||||
| : (setsockopt (handle, IPPROTO_TCP, TCP_NODELAY, (const char*) &one, sizeof (one)) == 0)); | : (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) | if (handle <= 0 || port <= 0) | ||||
| return false; | return false; | ||||
| @@ -83,10 +83,10 @@ namespace SocketHelpers | |||||
| return bind (handle, (struct sockaddr*) &servTmpAddr, sizeof (struct sockaddr_in)) >= 0; | 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; | int bytesRead = 0; | ||||
| @@ -121,7 +121,7 @@ namespace SocketHelpers | |||||
| return bytesRead; | 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 timeout; | ||||
| struct timeval* timeoutp; | struct timeval* timeoutp; | ||||
| @@ -174,7 +174,7 @@ namespace SocketHelpers | |||||
| return FD_ISSET (handle, forReading ? &rset : &wset) ? 1 : 0; | 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 | #if JUCE_WINDOWS | ||||
| u_long nonBlocking = shouldBlock ? 0 : (u_long) 1; | u_long nonBlocking = shouldBlock ? 0 : (u_long) 1; | ||||
| @@ -194,12 +194,12 @@ namespace SocketHelpers | |||||
| #endif | #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 }; | struct addrinfo hints = { 0 }; | ||||
| hints.ai_family = AF_UNSPEC; | hints.ai_family = AF_UNSPEC; | ||||
| @@ -104,7 +104,7 @@ URL::~URL() | |||||
| namespace URLHelpers | namespace URLHelpers | ||||
| { | { | ||||
| String getMangledParameters (const URL& url) | |||||
| static String getMangledParameters (const URL& url) | |||||
| { | { | ||||
| jassert (url.getParameterNames().size() == url.getParameterValues().size()); | jassert (url.getParameterNames().size() == url.getParameterValues().size()); | ||||
| String p; | String p; | ||||
| @@ -122,7 +122,7 @@ namespace URLHelpers | |||||
| return p; | return p; | ||||
| } | } | ||||
| int findEndOfScheme (const String& url) | |||||
| static int findEndOfScheme (const String& url) | |||||
| { | { | ||||
| int i = 0; | int i = 0; | ||||
| @@ -133,7 +133,7 @@ namespace URLHelpers | |||||
| return url[i] == ':' ? i + 1 : 0; | return url[i] == ':' ? i + 1 : 0; | ||||
| } | } | ||||
| int findStartOfNetLocation (const String& url) | |||||
| static int findStartOfNetLocation (const String& url) | |||||
| { | { | ||||
| int start = findEndOfScheme (url); | int start = findEndOfScheme (url); | ||||
| while (url[start] == '/') | while (url[start] == '/') | ||||
| @@ -142,12 +142,12 @@ namespace URLHelpers | |||||
| return start; | return start; | ||||
| } | } | ||||
| int findStartOfPath (const String& url) | |||||
| static int findStartOfPath (const String& url) | |||||
| { | { | ||||
| return url.indexOfChar (findStartOfNetLocation (url), '/') + 1; | 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); | 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 ('/')) | if (! path.endsWithChar ('/')) | ||||
| path << '/'; | path << '/'; | ||||
| @@ -347,7 +347,7 @@ String String::charToString (const juce_wchar character) | |||||
| namespace NumberToStringConverters | namespace NumberToStringConverters | ||||
| { | { | ||||
| // pass in a pointer to the END of a buffer.. | // 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; | *--t = 0; | ||||
| int64 v = (n >= 0) ? n : -n; | int64 v = (n >= 0) ? n : -n; | ||||
| @@ -365,7 +365,7 @@ namespace NumberToStringConverters | |||||
| return t; | return t; | ||||
| } | } | ||||
| char* numberToString (char* t, uint64 v) noexcept | |||||
| static char* numberToString (char* t, uint64 v) noexcept | |||||
| { | { | ||||
| *--t = 0; | *--t = 0; | ||||
| @@ -379,7 +379,7 @@ namespace NumberToStringConverters | |||||
| return t; | 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) | if (n == (int) 0x80000000) // (would cause an overflow) | ||||
| return numberToString (t, (int64) n); | return numberToString (t, (int64) n); | ||||
| @@ -400,7 +400,7 @@ namespace NumberToStringConverters | |||||
| return t; | return t; | ||||
| } | } | ||||
| char* numberToString (char* t, unsigned int v) noexcept | |||||
| static char* numberToString (char* t, unsigned int v) noexcept | |||||
| { | { | ||||
| *--t = 0; | *--t = 0; | ||||
| @@ -414,7 +414,7 @@ namespace NumberToStringConverters | |||||
| return t; | 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) | if (numDecPlaces > 0 && n > -1.0e20 && n < 1.0e20) | ||||
| { | { | ||||
| @@ -465,7 +465,7 @@ namespace NumberToStringConverters | |||||
| return StringHolder::createFromFixedLength (start, (size_t) (end - start - 1)); | 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]; | char buffer [48]; | ||||
| size_t len; | size_t len; | ||||
| @@ -39,7 +39,7 @@ | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace TimeHelpers | namespace TimeHelpers | ||||
| { | { | ||||
| struct tm millisToLocal (const int64 millis) noexcept | |||||
| static struct tm millisToLocal (const int64 millis) noexcept | |||||
| { | { | ||||
| struct tm result; | struct tm result; | ||||
| const int64 seconds = millis / 1000; | const int64 seconds = millis / 1000; | ||||
| @@ -93,13 +93,14 @@ namespace TimeHelpers | |||||
| return result; | 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) | return (int) (value >= 0 ? (value % modulo) | ||||
| : (value - ((value / modulo) + 1) * 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 | #if JUCE_ANDROID | ||||
| HeapBlock <char> tempDest; | HeapBlock <char> tempDest; | ||||
| @@ -65,13 +65,13 @@ void XmlDocument::setEmptyTextElementsIgnored (const bool shouldBeIgnored) noexc | |||||
| namespace XmlIdentifierChars | namespace XmlIdentifierChars | ||||
| { | { | ||||
| bool isIdentifierCharSlow (const juce_wchar c) noexcept | |||||
| static bool isIdentifierCharSlow (const juce_wchar c) noexcept | |||||
| { | { | ||||
| return CharacterFunctions::isLetterOrDigit (c) | return CharacterFunctions::isLetterOrDigit (c) | ||||
| || c == '_' || c == '-' || c == ':' || 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 }; | static const uint32 legalChars[] = { 0, 0x7ff6000, 0x87fffffe, 0x7fffffe, 0 }; | ||||
| @@ -159,7 +159,7 @@ namespace XmlOutputFunctions | |||||
| } | } | ||||
| #endif | #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 }; | 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; | && (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()); | 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); | out.writeRepeatedByte (' ', numSpaces); | ||||
| } | } | ||||
| @@ -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) | // (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) | unsigned long juce_crc32 (unsigned long crc, const unsigned char* buf, unsigned len) | ||||
| { | { | ||||
| return zlibNamespace::crc32 (crc, buf, len); | return zlibNamespace::crc32 (crc, buf, len); | ||||
| @@ -25,7 +25,7 @@ | |||||
| namespace PrimesHelpers | namespace PrimesHelpers | ||||
| { | { | ||||
| void createSmallSieve (const int numBits, BigInteger& result) | |||||
| static void createSmallSieve (const int numBits, BigInteger& result) | |||||
| { | { | ||||
| result.setBit (numBits); | result.setBit (numBits); | ||||
| result.clearBit (numBits); // to enlarge the array | result.clearBit (numBits); // to enlarge the array | ||||
| @@ -43,8 +43,8 @@ namespace PrimesHelpers | |||||
| while (n <= (numBits >> 1)); | 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! | jassert (! base[0]); // must be even! | ||||
| @@ -81,8 +81,8 @@ namespace PrimesHelpers | |||||
| while (index < smallSieveSize); | 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) | for (int i = 0; i < numBits; ++i) | ||||
| { | { | ||||
| @@ -98,7 +98,7 @@ namespace PrimesHelpers | |||||
| return false; | 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 one (1), two (2); | ||||
| const BigInteger nMinusOne (n - one); | const BigInteger nMinusOne (n - one); | ||||
| @@ -123,7 +123,7 @@ public: | |||||
| uint8 buffer [64]; | uint8 buffer [64]; | ||||
| const int bytesRead = input.read (buffer, (int) jmin (numBytesToRead, (int64) sizeof (buffer))); | 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); | processFinalBlock (buffer, (unsigned int) bytesRead); | ||||
| break; | break; | ||||
| @@ -323,12 +323,14 @@ MessageManagerLock::~MessageManagerLock() noexcept | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI(); | |||||
| JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI() | JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI() | ||||
| { | { | ||||
| JUCE_AUTORELEASEPOOL | JUCE_AUTORELEASEPOOL | ||||
| MessageManager::getInstance(); | MessageManager::getInstance(); | ||||
| } | } | ||||
| JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI(); | |||||
| JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI() | JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI() | ||||
| { | { | ||||
| JUCE_AUTORELEASEPOOL | JUCE_AUTORELEASEPOOL | ||||
| @@ -303,9 +303,10 @@ void MessageManager::stopDispatchLoop() | |||||
| #if JUCE_MODAL_LOOPS_PERMITTED | #if JUCE_MODAL_LOOPS_PERMITTED | ||||
| bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor) | bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor) | ||||
| { | { | ||||
| jassert (millisecondsToRunFor >= 0); | |||||
| jassert (isThisTheMessageThread()); // must only be called by the message thread | jassert (isThisTheMessageThread()); // must only be called by the message thread | ||||
| uint32 endTime = Time::getMillisecondCounter() + millisecondsToRunFor; | |||||
| uint32 endTime = Time::getMillisecondCounter() + (uint32) millisecondsToRunFor; | |||||
| while (! quitMessagePosted) | while (! quitMessagePosted) | ||||
| { | { | ||||
| @@ -330,6 +331,7 @@ bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor) | |||||
| #endif | #endif | ||||
| //============================================================================== | //============================================================================== | ||||
| void initialiseNSApplication(); | |||||
| void initialiseNSApplication() | void initialiseNSApplication() | ||||
| { | { | ||||
| JUCE_AUTORELEASEPOOL | JUCE_AUTORELEASEPOOL | ||||
| @@ -25,14 +25,14 @@ | |||||
| namespace ColourHelpers | 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)); | 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 | // This is an adjusted brightness value, based on the way the human | ||||
| // eye responds to different colour channels.. | // 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 | return std::sqrt (r * r * 0.241f | ||||
| + g * g * 0.691f | + g * g * 0.691f | ||||
| @@ -168,7 +168,7 @@ void ColourGradient::createLookupTable (PixelARGB* const lookupTable, const int | |||||
| jassert (index >= 0 && index < numEntries); | jassert (index >= 0 && index < numEntries); | ||||
| lookupTable[index] = pix1; | lookupTable[index] = pix1; | ||||
| lookupTable[index].tween (pix2, (uint32) (i << 8) / numToDo); | |||||
| lookupTable[index].tween (pix2, (uint32) ((i << 8) / numToDo)); | |||||
| ++index; | ++index; | ||||
| } | } | ||||
| @@ -526,7 +526,7 @@ private: | |||||
| static forcedinline void copyRow (PixelRGB* dest, PixelRGB* src, int width) noexcept | 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); | JUCE_DECLARE_NON_COPYABLE (ImageFillEdgeTableRenderer); | ||||
| @@ -748,17 +748,17 @@ private: | |||||
| (uint8) (c[PixelARGB::indexB] >> 16)); | (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 c[4] = { 128, 128, 128, 128 }; | ||||
| uint32 weight = (uint32) (256 - subPixelX); | |||||
| uint32 weight = 256 - subPixelX; | |||||
| c[0] += weight * src[0]; | c[0] += weight * src[0]; | ||||
| c[1] += weight * src[1]; | c[1] += weight * src[1]; | ||||
| c[2] += weight * src[2]; | c[2] += weight * src[2]; | ||||
| c[3] += weight * src[3]; | c[3] += weight * src[3]; | ||||
| weight = (uint32) subPixelX; | |||||
| weight = subPixelX; | |||||
| c[0] += weight * src[4]; | c[0] += weight * src[4]; | ||||
| c[1] += weight * src[5]; | c[1] += weight * src[5]; | ||||
| c[2] += weight * src[6]; | c[2] += weight * src[6]; | ||||
| @@ -770,11 +770,11 @@ private: | |||||
| (uint8) (c[PixelARGB::indexB] >> 8)); | (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 c[4] = { 128, 128, 128, 128 }; | ||||
| uint32 weight = (uint32) (256 - subPixelY); | |||||
| uint32 weight = 256 - subPixelY; | |||||
| c[0] += weight * src[0]; | c[0] += weight * src[0]; | ||||
| c[1] += weight * src[1]; | c[1] += weight * src[1]; | ||||
| c[2] += weight * src[2]; | c[2] += weight * src[2]; | ||||
| @@ -782,7 +782,7 @@ private: | |||||
| src += this->srcData.lineStride; | src += this->srcData.lineStride; | ||||
| weight = (uint32) subPixelY; | |||||
| weight = subPixelY; | |||||
| c[0] += weight * src[0]; | c[0] += weight * src[0]; | ||||
| c[1] += weight * src[1]; | c[1] += weight * src[1]; | ||||
| c[2] += weight * src[2]; | 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 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[0] += weight * src[0]; | ||||
| c[1] += weight * src[1]; | c[1] += weight * src[1]; | ||||
| c[2] += weight * src[2]; | c[2] += weight * src[2]; | ||||
| weight = (uint32) (subPixelX * (256 - subPixelY)); | |||||
| weight = subPixelX * (256 - subPixelY); | |||||
| c[0] += weight * src[3]; | c[0] += weight * src[3]; | ||||
| c[1] += weight * src[4]; | c[1] += weight * src[4]; | ||||
| c[2] += weight * src[5]; | c[2] += weight * src[5]; | ||||
| src += this->srcData.lineStride; | src += this->srcData.lineStride; | ||||
| weight = (uint32) ((256 - subPixelX) * subPixelY); | |||||
| weight = (256 - subPixelX) * subPixelY; | |||||
| c[0] += weight * src[0]; | c[0] += weight * src[0]; | ||||
| c[1] += weight * src[1]; | c[1] += weight * src[1]; | ||||
| c[2] += weight * src[2]; | c[2] += weight * src[2]; | ||||
| weight = (uint32) (subPixelX * subPixelY); | |||||
| weight = subPixelX * subPixelY; | |||||
| c[0] += weight * src[3]; | c[0] += weight * src[3]; | ||||
| c[1] += weight * src[4]; | c[1] += weight * src[4]; | ||||
| c[2] += weight * src[5]; | c[2] += weight * src[5]; | ||||
| @@ -827,11 +827,11 @@ private: | |||||
| (uint8) (c[PixelRGB::indexB] >> 16)); | (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 }; | uint32 c[3] = { 128, 128, 128 }; | ||||
| const uint32 weight = (uint32) (256 - subPixelX); | |||||
| const uint32 weight = 256 - subPixelX; | |||||
| c[0] += weight * src[0]; | c[0] += weight * src[0]; | ||||
| c[1] += weight * src[1]; | c[1] += weight * src[1]; | ||||
| c[2] += weight * src[2]; | c[2] += weight * src[2]; | ||||
| @@ -846,11 +846,11 @@ private: | |||||
| (uint8) (c[PixelRGB::indexB] >> 8)); | (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 }; | uint32 c[3] = { 128, 128, 128 }; | ||||
| const uint32 weight = (uint32) (256 - subPixelY); | |||||
| const uint32 weight = 256 - subPixelY; | |||||
| c[0] += weight * src[0]; | c[0] += weight * src[0]; | ||||
| c[1] += weight * src[1]; | c[1] += weight * src[1]; | ||||
| c[2] += weight * src[2]; | 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; | uint32 c = 256 * 128; | ||||
| c += src[0] * ((256 - subPixelX) * (256 - subPixelY)); | c += src[0] * ((256 - subPixelX) * (256 - subPixelY)); | ||||
| @@ -880,7 +880,7 @@ private: | |||||
| *((uint8*) dest) = (uint8) (c >> 16); | *((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; | uint32 c = 128; | ||||
| c += src[0] * (256 - subPixelX); | c += src[0] * (256 - subPixelX); | ||||
| @@ -888,7 +888,7 @@ private: | |||||
| *((uint8*) dest) = (uint8) (c >> 8); | *((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; | uint32 c = 128; | ||||
| c += src[0] * (256 - subPixelY); | c += src[0] * (256 - subPixelY); | ||||
| @@ -70,7 +70,7 @@ private: | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace CustomTypefaceHelpers | namespace CustomTypefaceHelpers | ||||
| { | { | ||||
| juce_wchar readChar (InputStream& in) | |||||
| static juce_wchar readChar (InputStream& in) | |||||
| { | { | ||||
| uint32 n = (uint32) (uint16) in.readShort(); | uint32 n = (uint32) (uint16) in.readShort(); | ||||
| @@ -85,7 +85,7 @@ namespace CustomTypefaceHelpers | |||||
| return (juce_wchar) n; | return (juce_wchar) n; | ||||
| } | } | ||||
| void writeChar (OutputStream& out, juce_wchar charToWrite) | |||||
| static void writeChar (OutputStream& out, juce_wchar charToWrite) | |||||
| { | { | ||||
| if (charToWrite >= 0x10000) | if (charToWrite >= 0x10000) | ||||
| { | { | ||||
| @@ -25,7 +25,7 @@ | |||||
| namespace FontValues | namespace FontValues | ||||
| { | { | ||||
| float limitFontHeight (const float height) noexcept | |||||
| static float limitFontHeight (const float height) noexcept | |||||
| { | { | ||||
| return jlimit (0.1f, 10000.0f, height); | return jlimit (0.1f, 10000.0f, height); | ||||
| } | } | ||||
| @@ -32,7 +32,7 @@ namespace PathHelpers | |||||
| { | { | ||||
| const float ellipseAngularIncrement = 0.05f; | const float ellipseAngularIncrement = 0.05f; | ||||
| String nextToken (String::CharPointerType& t) | |||||
| static String nextToken (String::CharPointerType& t) | |||||
| { | { | ||||
| t = t.findEndOfWhitespace(); | t = t.findEndOfWhitespace(); | ||||
| @@ -66,13 +66,13 @@ bool PathStrokeType::operator!= (const PathStrokeType& other) const noexcept | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace PathStrokeHelpers | 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) | if (x2 != x3 || y2 != y3) | ||||
| { | { | ||||
| @@ -183,14 +183,14 @@ namespace PathStrokeHelpers | |||||
| return true; | 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 | if (style == PathStrokeType::beveled | ||||
| || (x3 == x4 && y3 == y4) | || (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) | if (style == PathStrokeType::butt) | ||||
| { | { | ||||
| @@ -343,12 +343,12 @@ namespace PathStrokeHelpers | |||||
| float endWidth, endLength; | 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); | Line<float> line (x1, y1, x2, y2); | ||||
| destPath.lineTo (line.getPointAlongLine (-(arrowheadWidth / 2.0f - width), 0)); | destPath.lineTo (line.getPointAlongLine (-(arrowheadWidth / 2.0f - width), 0)); | ||||
| @@ -364,7 +364,7 @@ namespace PathStrokeHelpers | |||||
| float rx1, ry1, rx2, ry2; // the right-hand stroke | 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) | 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); | jassert (subPath.size() > 0); | ||||
| @@ -536,11 +536,11 @@ namespace PathStrokeHelpers | |||||
| destPath.closeSubPath(); | 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); | jassert (extraAccuracy > 0); | ||||
| @@ -131,12 +131,12 @@ namespace JPEGHelpers | |||||
| struct JPEGDecodingFailure {}; | 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); | 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; | decompStruct->src->next_input_byte += num; | ||||
| @@ -158,7 +158,7 @@ namespace JPEGHelpers | |||||
| decompStruct->src->bytes_in_buffer -= num; | decompStruct->src->bytes_in_buffer -= num; | ||||
| } | } | ||||
| boolean jpegFill (j_decompress_ptr) | |||||
| static boolean jpegFill (j_decompress_ptr) | |||||
| { | { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -172,9 +172,9 @@ namespace JPEGHelpers | |||||
| char* buffer; | 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); | JuceJpegDest* const dest = static_cast <JuceJpegDest*> (cinfo->dest); | ||||
| @@ -182,7 +182,7 @@ namespace JPEGHelpers | |||||
| dest->output->write (dest->buffer, (int) numToWrite); | 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); | JuceJpegDest* const dest = static_cast <JuceJpegDest*> (cinfo->dest); | ||||
| @@ -100,19 +100,19 @@ namespace PNGHelpers | |||||
| { | { | ||||
| using namespace pnglibNamespace; | 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); | 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); | static_cast<OutputStream*> (png_get_io_ptr (png))->write (data, (int) length); | ||||
| } | } | ||||
| struct PNGErrorStruct {}; | struct PNGErrorStruct {}; | ||||
| void JUCE_CDECL errorCallback (png_structp, png_const_charp) | |||||
| static void JUCE_CDECL errorCallback (png_structp, png_const_charp) | |||||
| { | { | ||||
| throw PNGErrorStruct(); | throw PNGErrorStruct(); | ||||
| } | } | ||||
| @@ -843,6 +843,7 @@ Image juce_loadWithCoreImage (InputStream& input) | |||||
| #endif | #endif | ||||
| #if JUCE_MAC | #if JUCE_MAC | ||||
| Image juce_createImageFromCIImage (CIImage*, int, int); | |||||
| Image juce_createImageFromCIImage (CIImage* im, int w, int h) | Image juce_createImageFromCIImage (CIImage* im, int w, int h) | ||||
| { | { | ||||
| CoreGraphicsImage* cgImage = new CoreGraphicsImage (Image::ARGB, w, h, false); | CoreGraphicsImage* cgImage = new CoreGraphicsImage (Image::ARGB, w, h, false); | ||||
| @@ -33,8 +33,8 @@ | |||||
| namespace CoreTextTypeLayout | 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(); | CFStringRef cfName = font.getTypefaceName().toCFString(); | ||||
| CTFontRef ctFontRef = CTFontCreateWithName (cfName, fontSize, nullptr); | 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 | #if JUCE_IOS | ||||
| CGColorSpaceRef rgbColourSpace = CGColorSpaceCreateDeviceRGB(); | CGColorSpaceRef rgbColourSpace = CGColorSpaceCreateDeviceRGB(); | ||||
| @@ -238,8 +238,8 @@ namespace CoreTextTypeLayout | |||||
| return attribString; | 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); | CFAttributedStringRef attribString = CoreTextTypeLayout::createCFAttributedString (text); | ||||
| CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString (attribString); | CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString (attribString); | ||||
| @@ -258,7 +258,7 @@ namespace CoreTextTypeLayout | |||||
| CFRelease (frame); | CFRelease (frame); | ||||
| } | } | ||||
| void createLayout (TextLayout& glyphLayout, const AttributedString& text) | |||||
| static void createLayout (TextLayout& glyphLayout, const AttributedString& text) | |||||
| { | { | ||||
| CFAttributedStringRef attribString = CoreTextTypeLayout::createCFAttributedString (text); | CFAttributedStringRef attribString = CoreTextTypeLayout::createCFAttributedString (text); | ||||
| CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString (attribString); | CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString (attribString); | ||||
| @@ -382,7 +382,7 @@ void DrawablePath::ValueTreeWrapper::Element::convertToPathBreak (UndoManager* u | |||||
| namespace DrawablePathHelpers | 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), | const Point<float> mid1 (points[0] + (points[1] - points[0]) * proportion), | ||||
| mid2 (points[1] + (points[2] - points[1]) * proportion), | mid2 (points[1] + (points[2] - points[1]) * proportion), | ||||
| @@ -394,7 +394,7 @@ namespace DrawablePathHelpers | |||||
| return newCp1 + (newCp2 - newCp1) * proportion; | 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), | const Point<float> mid1 (points[0] + (points[1] - points[0]) * proportion), | ||||
| mid2 (points[1] + (points[2] - points[1]) * proportion); | mid2 (points[1] + (points[2] - points[1]) * proportion); | ||||
| @@ -136,9 +136,9 @@ namespace KeyPressHelpers | |||||
| { "cmd", ModifierKeys::commandModifier } | { "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())) | if (desc.containsIgnoreCase (numberPadPrefix())) | ||||
| { | { | ||||
| @@ -79,7 +79,7 @@ namespace KeyboardFocusHelpers | |||||
| } | } | ||||
| } | } | ||||
| Component* findFocusContainer (Component* c) | |||||
| static Component* findFocusContainer (Component* c) | |||||
| { | { | ||||
| c = c->getParentComponent(); | c = c->getParentComponent(); | ||||
| @@ -90,7 +90,7 @@ namespace KeyboardFocusHelpers | |||||
| return c; | return c; | ||||
| } | } | ||||
| Component* getIncrementedComponent (Component* const current, const int delta) | |||||
| static Component* getIncrementedComponent (Component* const current, const int delta) | |||||
| { | { | ||||
| Component* focusContainer = findFocusContainer (current); | Component* focusContainer = findFocusContainer (current); | ||||
| @@ -25,12 +25,12 @@ | |||||
| namespace ComponentBuilderHelpers | namespace ComponentBuilderHelpers | ||||
| { | { | ||||
| String getStateId (const ValueTree& state) | |||||
| static String getStateId (const ValueTree& state) | |||||
| { | { | ||||
| return state [ComponentBuilder::idProperty].toString(); | 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()); | jassert (compId.isNotEmpty()); | ||||
| @@ -45,7 +45,7 @@ namespace ComponentBuilderHelpers | |||||
| return nullptr; | return nullptr; | ||||
| } | } | ||||
| Component* findComponentWithID (Component& c, const String& compId) | |||||
| static Component* findComponentWithID (Component& c, const String& compId) | |||||
| { | { | ||||
| jassert (compId.isNotEmpty()); | jassert (compId.isNotEmpty()); | ||||
| if (c.getComponentID() == compId) | if (c.getComponentID() == compId) | ||||
| @@ -62,8 +62,8 @@ namespace ComponentBuilderHelpers | |||||
| return nullptr; | 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); | Component* const c = type.addNewComponentFromState (state, parent); | ||||
| jassert (c != nullptr && c->getParentComponent() == parent); | jassert (c != nullptr && c->getParentComponent() == parent); | ||||
| @@ -71,7 +71,7 @@ namespace ComponentBuilderHelpers | |||||
| return c; | return c; | ||||
| } | } | ||||
| void updateComponent (ComponentBuilder& builder, const ValueTree& state) | |||||
| static void updateComponent (ComponentBuilder& builder, const ValueTree& state) | |||||
| { | { | ||||
| Component* topLevelComp = builder.getManagedComponent(); | 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(); | NamedValueSet& properties = component.getProperties(); | ||||
| @@ -115,7 +115,7 @@ MultiDocumentPanel::~MultiDocumentPanel() | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace MultiDocHelpers | namespace MultiDocHelpers | ||||
| { | { | ||||
| bool shouldDeleteComp (Component* const c) | |||||
| static bool shouldDeleteComp (Component* const c) | |||||
| { | { | ||||
| return c->getProperties() ["mdiDocumentDelete_"]; | return c->getProperties() ["mdiDocumentDelete_"]; | ||||
| } | } | ||||
| @@ -27,14 +27,14 @@ namespace TabbedComponentHelpers | |||||
| { | { | ||||
| const Identifier deleteComponentId ("deleteByTabComp_"); | const Identifier deleteComponentId ("deleteByTabComp_"); | ||||
| void deleteIfNecessary (Component* const comp) | |||||
| static void deleteIfNecessary (Component* const comp) | |||||
| { | { | ||||
| if (comp != nullptr && (bool) comp->getProperties() [deleteComponentId]) | if (comp != nullptr && (bool) comp->getProperties() [deleteComponentId]) | ||||
| delete comp; | 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) | switch (orientation) | ||||
| { | { | ||||
| @@ -25,12 +25,12 @@ | |||||
| namespace LookAndFeelHelpers | 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; | const float cs2 = 2.0f * cs; | ||||
| @@ -77,10 +77,10 @@ namespace LookAndFeelHelpers | |||||
| p.closeSubPath(); | 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 float sat = hasKeyboardFocus ? 1.3f : 0.9f; | ||||
| const Colour baseColour (buttonColour.withMultipliedSaturation (sat)); | const Colour baseColour (buttonColour.withMultipliedSaturation (sat)); | ||||
| @@ -93,7 +93,7 @@ namespace LookAndFeelHelpers | |||||
| return baseColour; | 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 float tooltipFontSize = 13.0f; | ||||
| const int maxToolTipWidth = 400; | const int maxToolTipWidth = 400; | ||||
| @@ -488,7 +488,7 @@ namespace juce | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace MainMenuHelpers | 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) | 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... | // 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! | // this can't be used in a plugin! | ||||
| jassert (JUCEApplication::isStandaloneApp()); | jassert (JUCEApplication::isStandaloneApp()); | ||||
| @@ -33,7 +33,7 @@ namespace RelativeRectangleHelpers | |||||
| ++s; | ++s; | ||||
| } | } | ||||
| bool dependsOnSymbolsOtherThanThis (const Expression& e) | |||||
| static bool dependsOnSymbolsOtherThanThis (const Expression& e) | |||||
| { | { | ||||
| if (e.getType() == Expression::operatorType && e.getSymbolOrFunction() == ".") | if (e.getType() == Expression::operatorType && e.getSymbolOrFunction() == ".") | ||||
| return true; | return true; | ||||
| @@ -979,14 +979,14 @@ void Slider::focusOfChildComponentChanged (FocusChangeType) | |||||
| namespace SliderHelpers | namespace SliderHelpers | ||||
| { | { | ||||
| double smallestAngleBetween (double a1, double a2) noexcept | |||||
| static double smallestAngleBetween (double a1, double a2) noexcept | |||||
| { | { | ||||
| return jmin (std::abs (a1 - a2), | return jmin (std::abs (a1 - a2), | ||||
| std::abs (a1 + double_Pi * 2.0 - a2), | std::abs (a1 + double_Pi * 2.0 - a2), | ||||
| std::abs (a2 + double_Pi * 2.0 - a1)); | std::abs (a2 + double_Pi * 2.0 - a1)); | ||||
| } | } | ||||
| void sliderMenuCallback (int result, Slider* slider) | |||||
| static void sliderMenuCallback (int result, Slider* slider) | |||||
| { | { | ||||
| if (slider != nullptr) | if (slider != nullptr) | ||||
| { | { | ||||
| @@ -950,7 +950,7 @@ namespace TextEditorDefs | |||||
| const int maxActionsPerTransaction = 100; | const int maxActionsPerTransaction = 100; | ||||
| int getCharacterCategory (const juce_wchar character) | |||||
| static int getCharacterCategory (const juce_wchar character) | |||||
| { | { | ||||
| return CharacterFunctions::isLetterOrDigit (character) | return CharacterFunctions::isLetterOrDigit (character) | ||||
| ? 2 : (CharacterFunctions::isWhitespace (character) ? 0 : 1); | ? 2 : (CharacterFunctions::isWhitespace (character) ? 0 : 1); | ||||
| @@ -1455,7 +1455,7 @@ void TreeViewItem::setDrawsInLeftMargin (bool canDrawInLeftMargin) noexcept | |||||
| namespace TreeViewHelpers | namespace TreeViewHelpers | ||||
| { | { | ||||
| int calculateDepth (const TreeViewItem* item, const bool rootIsVisible) noexcept | |||||
| static int calculateDepth (const TreeViewItem* item, const bool rootIsVisible) noexcept | |||||
| { | { | ||||
| jassert (item != nullptr); | jassert (item != nullptr); | ||||
| int depth = rootIsVisible ? 0 : -1; | int depth = rootIsVisible ? 0 : -1; | ||||
| @@ -411,9 +411,9 @@ Rectangle<int> ComponentPeer::globalToLocal (const Rectangle<int>& screenPositio | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace ComponentPeerHelpers | 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) | while (c != nullptr) | ||||
| { | { | ||||
| @@ -116,6 +116,7 @@ private: | |||||
| juce_ImplementSingleton_SingleThreaded (TopLevelWindowManager) | juce_ImplementSingleton_SingleThreaded (TopLevelWindowManager) | ||||
| void juce_CheckCurrentlyFocusedTopLevelWindow(); | |||||
| void juce_CheckCurrentlyFocusedTopLevelWindow() | void juce_CheckCurrentlyFocusedTopLevelWindow() | ||||
| { | { | ||||
| if (TopLevelWindowManager::getInstanceWithoutCreating() != nullptr) | if (TopLevelWindowManager::getInstanceWithoutCreating() != nullptr) | ||||
| @@ -29,19 +29,19 @@ CPlusPlusCodeTokeniser::~CPlusPlusCodeTokeniser() {} | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace CppTokeniser | namespace CppTokeniser | ||||
| { | { | ||||
| bool isIdentifierStart (const juce_wchar c) noexcept | |||||
| static bool isIdentifierStart (const juce_wchar c) noexcept | |||||
| { | { | ||||
| return CharacterFunctions::isLetter (c) | return CharacterFunctions::isLetter (c) | ||||
| || c == '_' || c == '@'; | || c == '_' || c == '@'; | ||||
| } | } | ||||
| bool isIdentifierBody (const juce_wchar c) noexcept | |||||
| static bool isIdentifierBody (const juce_wchar c) noexcept | |||||
| { | { | ||||
| return CharacterFunctions::isLetterOrDigit (c) | return CharacterFunctions::isLetterOrDigit (c) | ||||
| || c == '_' || 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[] = | static const char* const keywords2Char[] = | ||||
| { "if", "do", "or", "id", 0 }; | { "if", "do", "or", "id", 0 }; | ||||
| @@ -103,7 +103,7 @@ namespace CppTokeniser | |||||
| return false; | return false; | ||||
| } | } | ||||
| int parseIdentifier (CodeDocument::Iterator& source) noexcept | |||||
| static int parseIdentifier (CodeDocument::Iterator& source) noexcept | |||||
| { | { | ||||
| int tokenLength = 0; | int tokenLength = 0; | ||||
| String::CharPointerType::CharType possibleIdentifier [100]; | String::CharPointerType::CharType possibleIdentifier [100]; | ||||
| @@ -130,7 +130,7 @@ namespace CppTokeniser | |||||
| return CPlusPlusCodeTokeniser::tokenType_identifier; | return CPlusPlusCodeTokeniser::tokenType_identifier; | ||||
| } | } | ||||
| bool skipNumberSuffix (CodeDocument::Iterator& source) | |||||
| static bool skipNumberSuffix (CodeDocument::Iterator& source) | |||||
| { | { | ||||
| const juce_wchar c = source.peekNextChar(); | const juce_wchar c = source.peekNextChar(); | ||||
| if (c == 'l' || c == 'L' || c == 'u' || c == 'U') | if (c == 'l' || c == 'L' || c == 'u' || c == 'U') | ||||
| @@ -142,14 +142,14 @@ namespace CppTokeniser | |||||
| return true; | return true; | ||||
| } | } | ||||
| bool isHexDigit (const juce_wchar c) noexcept | |||||
| static bool isHexDigit (const juce_wchar c) noexcept | |||||
| { | { | ||||
| return (c >= '0' && c <= '9') | return (c >= '0' && c <= '9') | ||||
| || (c >= 'a' && c <= 'f') | || (c >= 'a' && c <= 'f') | ||||
| || (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') | if (source.nextChar() != '0') | ||||
| return false; | return false; | ||||
| @@ -171,12 +171,12 @@ namespace CppTokeniser | |||||
| return skipNumberSuffix (source); | return skipNumberSuffix (source); | ||||
| } | } | ||||
| bool isOctalDigit (const juce_wchar c) noexcept | |||||
| static bool isOctalDigit (const juce_wchar c) noexcept | |||||
| { | { | ||||
| return c >= '0' && c <= '7'; | return c >= '0' && c <= '7'; | ||||
| } | } | ||||
| bool parseOctalLiteral (CodeDocument::Iterator& source) noexcept | |||||
| static bool parseOctalLiteral (CodeDocument::Iterator& source) noexcept | |||||
| { | { | ||||
| if (source.nextChar() != '0') | if (source.nextChar() != '0') | ||||
| return false; | return false; | ||||
| @@ -190,12 +190,12 @@ namespace CppTokeniser | |||||
| return skipNumberSuffix (source); | return skipNumberSuffix (source); | ||||
| } | } | ||||
| bool isDecimalDigit (const juce_wchar c) noexcept | |||||
| static bool isDecimalDigit (const juce_wchar c) noexcept | |||||
| { | { | ||||
| return c >= '0' && c <= '9'; | return c >= '0' && c <= '9'; | ||||
| } | } | ||||
| bool parseDecimalLiteral (CodeDocument::Iterator& source) noexcept | |||||
| static bool parseDecimalLiteral (CodeDocument::Iterator& source) noexcept | |||||
| { | { | ||||
| int numChars = 0; | int numChars = 0; | ||||
| while (isDecimalDigit (source.peekNextChar())) | while (isDecimalDigit (source.peekNextChar())) | ||||
| @@ -210,7 +210,7 @@ namespace CppTokeniser | |||||
| return skipNumberSuffix (source); | return skipNumberSuffix (source); | ||||
| } | } | ||||
| bool parseFloatLiteral (CodeDocument::Iterator& source) noexcept | |||||
| static bool parseFloatLiteral (CodeDocument::Iterator& source) noexcept | |||||
| { | { | ||||
| int numDigits = 0; | int numDigits = 0; | ||||
| @@ -267,7 +267,7 @@ namespace CppTokeniser | |||||
| return true; | return true; | ||||
| } | } | ||||
| int parseNumber (CodeDocument::Iterator& source) | |||||
| static int parseNumber (CodeDocument::Iterator& source) | |||||
| { | { | ||||
| const CodeDocument::Iterator original (source); | const CodeDocument::Iterator original (source); | ||||
| @@ -295,7 +295,7 @@ namespace CppTokeniser | |||||
| return CPlusPlusCodeTokeniser::tokenType_error; | return CPlusPlusCodeTokeniser::tokenType_error; | ||||
| } | } | ||||
| void skipQuotedString (CodeDocument::Iterator& source) noexcept | |||||
| static void skipQuotedString (CodeDocument::Iterator& source) noexcept | |||||
| { | { | ||||
| const juce_wchar quote = source.nextChar(); | 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; | bool lastWasStar = false; | ||||
| @@ -631,7 +631,7 @@ bool CodeDocument::hasChangedSinceSavePoint() const noexcept | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace CodeDocumentHelpers | namespace CodeDocumentHelpers | ||||
| { | { | ||||
| int getCharacterType (const juce_wchar character) noexcept | |||||
| static int getCharacterType (const juce_wchar character) noexcept | |||||
| { | { | ||||
| return (CharacterFunctions::isLetterOrDigit (character) || character == '_') | return (CharacterFunctions::isLetterOrDigit (character) || character == '_') | ||||
| ? 2 : (CharacterFunctions::isWhitespace (character) ? 0 : 1); | ? 2 : (CharacterFunctions::isWhitespace (character) ? 0 : 1); | ||||
| @@ -760,7 +760,7 @@ bool CodeEditorComponent::moveCaretToTop (const bool selecting) | |||||
| namespace CodeEditorHelpers | namespace CodeEditorHelpers | ||||
| { | { | ||||
| int findFirstNonWhitespaceChar (const String& line) noexcept | |||||
| static int findFirstNonWhitespaceChar (const String& line) noexcept | |||||
| { | { | ||||
| String::CharPointerType t (line.getCharPointer()); | String::CharPointerType t (line.getCharPointer()); | ||||
| int i = 0; | int i = 0; | ||||
| @@ -2219,6 +2219,7 @@ private: | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NonShaderContext); | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NonShaderContext); | ||||
| }; | }; | ||||
| LowLevelGraphicsContext* createOpenGLContext (const Target&); | |||||
| LowLevelGraphicsContext* createOpenGLContext (const Target& target) | LowLevelGraphicsContext* createOpenGLContext (const Target& target) | ||||
| { | { | ||||
| #if JUCE_USE_OPENGL_SHADERS | #if JUCE_USE_OPENGL_SHADERS | ||||