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

Fixed some compiler warnings

This commit is contained in:
Tom Poole 2018-06-27 17:02:25 +01:00
parent 9ab9b28f46
commit 102ed4a9f2
15 changed files with 115 additions and 107 deletions

View file

@ -64,9 +64,9 @@ void ThreadedAnalyticsDestination::stopAnalyticsThread (int timeout)
saveUnloggedEvents (dispatcher.eventQueue);
}
ThreadedAnalyticsDestination::EventDispatcher::EventDispatcher (const String& threadName,
ThreadedAnalyticsDestination::EventDispatcher::EventDispatcher (const String& dispatcherThreadName,
ThreadedAnalyticsDestination& destination)
: Thread (threadName),
: Thread (dispatcherThreadName),
parent (destination)
{}

View file

@ -175,7 +175,7 @@ bool AudioPluginInstance::isMetaParameter (int parameterIndex) const
if (auto* param = getParameters()[parameterIndex])
return param->isMetaParameter();
return false;
return false;
}
AudioProcessorParameter::Category AudioPluginInstance::getParameterCategory (int parameterIndex) const

View file

@ -32,8 +32,8 @@ class ParameterListener : private AudioProcessorParameter::Listener,
private Timer
{
public:
ParameterListener (AudioProcessor& p, AudioProcessorParameter& param)
: processor (p), parameter (param)
ParameterListener (AudioProcessor& proc, AudioProcessorParameter& param)
: processor (proc), parameter (param)
{
if (LegacyAudioParameter::isLegacy (&parameter))
processor.addListener (this);
@ -101,8 +101,8 @@ class BooleanParameterComponent final : public Component,
private ParameterListener
{
public:
BooleanParameterComponent (AudioProcessor& processor, AudioProcessorParameter& param)
: ParameterListener (processor, param)
BooleanParameterComponent (AudioProcessor& proc, AudioProcessorParameter& param)
: ParameterListener (proc, param)
{
// Set the initial value.
handleNewParameterValue();
@ -154,8 +154,8 @@ class SwitchParameterComponent final : public Component,
private ParameterListener
{
public:
SwitchParameterComponent (AudioProcessor& processor, AudioProcessorParameter& param)
: ParameterListener (processor, param)
SwitchParameterComponent (AudioProcessor& proc, AudioProcessorParameter& param)
: ParameterListener (proc, param)
{
auto* leftButton = buttons.add (new TextButton());
auto* rightButton = buttons.add (new TextButton());
@ -259,8 +259,8 @@ class ChoiceParameterComponent final : public Component,
private ParameterListener
{
public:
ChoiceParameterComponent (AudioProcessor& processor, AudioProcessorParameter& param)
: ParameterListener (processor, param),
ChoiceParameterComponent (AudioProcessor& proc, AudioProcessorParameter& param)
: ParameterListener (proc, param),
parameterValues (getParameter().getAllValueStrings())
{
box.addItemList (parameterValues, 1);
@ -321,8 +321,8 @@ class SliderParameterComponent final : public Component,
private ParameterListener
{
public:
SliderParameterComponent (AudioProcessor& processor, AudioProcessorParameter& param)
: ParameterListener (processor, param)
SliderParameterComponent (AudioProcessor& proc, AudioProcessorParameter& param)
: ParameterListener (proc, param)
{
if (getParameter().getNumSteps() != AudioProcessor::getDefaultNumParameterSteps())
slider.setRange (0.0, 1.0, 1.0 / (getParameter().getNumSteps() - 1.0));

View file

@ -38,9 +38,9 @@ struct AudioProcessorValueTreeState::Parameter : public AudioProcessorParamete
bool meta,
bool automatable,
bool discrete,
AudioProcessorParameter::Category category,
AudioProcessorParameter::Category paramCategory,
bool boolean)
: AudioProcessorParameterWithID (parameterID, paramName, labelText, category),
: AudioProcessorParameterWithID (parameterID, paramName, labelText, paramCategory),
owner (s), valueToTextFunction (valueToText), textToValueFunction (textToValue),
range (r), value (defaultVal), defaultValue (defaultVal),
listenersNeedCalling (true),

View file

@ -30,9 +30,9 @@ namespace juce
// This is an AudioTransportSource which will own it's assigned source
struct AudioSourceOwningTransportSource : public AudioTransportSource
{
AudioSourceOwningTransportSource (PositionableAudioSource* s, double sampleRate) : source (s)
AudioSourceOwningTransportSource (PositionableAudioSource* s, double sr) : source (s)
{
AudioTransportSource::setSource (s, 0, nullptr, sampleRate);
AudioTransportSource::setSource (s, 0, nullptr, sr);
}
~AudioSourceOwningTransportSource()

View file

@ -231,7 +231,7 @@ struct Program
uint16 calculateChecksum() const noexcept
{
auto size = getProgramSize();
uint16 n = (uint16) size;
auto n = (uint16) size;
for (uint32 i = 2; i < size; ++i)
n += (n * 2) + programStart[i];

View file

@ -1432,10 +1432,10 @@ struct PhysicalTopologySource::Internal
private MIDIDeviceConnection::Listener,
private Timer
{
BlockImplementation (const BlocksProtocol::BlockSerialNumber& serial, Detector& detectorToUse, BlocksProtocol::VersionNumber version, BlocksProtocol::BlockName name, bool master)
: Block (juce::String ((const char*) serial.serial, sizeof (serial.serial)),
BlockImplementation (const BlocksProtocol::BlockSerialNumber& serial, Detector& detectorToUse, BlocksProtocol::VersionNumber version, BlocksProtocol::BlockName blockName, bool master)
: Block (juce::String ((const char*) serial.serial, sizeof (serial.serial)),
juce::String ((const char*) version.version, version.length),
juce::String ((const char*) name.name, name.length)),
juce::String ((const char*) blockName.name, blockName.length)),
modelData (serial),
remoteHeap (modelData.programAndHeapSize),
detector (detectorToUse),

View file

@ -1280,7 +1280,7 @@ private:
static String createHex (uint64);
template <typename Type>
static String createHex (Type n) { return createHex (static_cast<typename TypeHelpers::UnsignedTypeWithSize<sizeof (n)>::type> (n)); }
static String createHex (Type n) { return createHex (static_cast<typename TypeHelpers::UnsignedTypeWithSize<(int) sizeof (n)>::type> (n)); }
};
//==============================================================================

View file

@ -496,7 +496,7 @@ struct SIMDNativeOps<int32_t>
tmp = _mm256_hadd_epi32 (tmp, tmp);
#if JUCE_GCC
return tmp[0] + tmp[2];
return (int32_t) (tmp[0] + tmp[2]);
#else
constexpr int mask = (2 << 0) | (3 << 2) | (0 << 4) | (1 << 6);

View file

@ -61,7 +61,7 @@ struct SIMDFallbackOps
{
static constexpr size_t n = sizeof (vSIMDType) / sizeof (ScalarType);
static constexpr size_t mask = (sizeof (vSIMDType) / sizeof (ScalarType)) - 1;
static constexpr size_t bits = SIMDInternal::Log2Helper<n>::value;
static constexpr size_t bits = SIMDInternal::Log2Helper<(int) n>::value;
// helper types
using MaskType = typename SIMDInternal::MaskTypeFor<ScalarType>::type;

View file

@ -38,9 +38,8 @@ class OversamplingEngine
public:
//===============================================================================
OversamplingEngine (size_t newNumChannels, size_t newFactor)
: numChannels (newNumChannels), factor (newFactor)
{
numChannels = newNumChannels;
factor = newFactor;
}
virtual ~OversamplingEngine() {}
@ -70,8 +69,7 @@ public:
protected:
//===============================================================================
AudioBuffer<SampleType> buffer;
size_t factor;
size_t numChannels;
size_t numChannels, factor;
};
@ -80,11 +78,11 @@ protected:
signal, which could be equivalent to a "one time" oversampling processing.
*/
template <typename SampleType>
class OversamplingDummy : public OversamplingEngine<SampleType>
class OversamplingDummy : public OversamplingEngine<SampleType>
{
public:
//===============================================================================
OversamplingDummy (size_t numChannels) : OversamplingEngine<SampleType> (numChannels, 1) {}
OversamplingDummy (size_t numChans) : OversamplingEngine<SampleType> (numChans, 1) {}
~OversamplingDummy() {}
//===============================================================================
@ -98,7 +96,7 @@ public:
jassert (inputBlock.getNumChannels() <= static_cast<size_t> (OversamplingEngine<SampleType>::buffer.getNumChannels()));
jassert (inputBlock.getNumSamples() * OversamplingEngine<SampleType>::factor <= static_cast<size_t> (OversamplingEngine<SampleType>::buffer.getNumSamples()));
for (size_t channel = 0; channel < inputBlock.getNumChannels(); channel++)
for (size_t channel = 0; channel < inputBlock.getNumChannels(); ++channel)
OversamplingEngine<SampleType>::buffer.copyFrom (static_cast<int> (channel), 0,
inputBlock.getChannelPointer (channel), static_cast<int> (inputBlock.getNumSamples()));
}
@ -127,26 +125,27 @@ class Oversampling2TimesEquirippleFIR : public OversamplingEngine<SampleType>
{
public:
//===============================================================================
Oversampling2TimesEquirippleFIR (size_t numChannels,
Oversampling2TimesEquirippleFIR (size_t numChans,
SampleType normalizedTransitionWidthUp,
SampleType stopbandAttenuationdBUp,
SampleType normalizedTransitionWidthDown,
SampleType stopbandAttenuationdBDown) : OversamplingEngine<SampleType> (numChannels, 2)
SampleType stopbandAttenuationdBDown)
: OversamplingEngine<SampleType> (numChans, 2)
{
coefficientsUp = *dsp::FilterDesign<SampleType>::designFIRLowpassHalfBandEquirippleMethod (normalizedTransitionWidthUp, stopbandAttenuationdBUp);
coefficientsDown = *dsp::FilterDesign<SampleType>::designFIRLowpassHalfBandEquirippleMethod (normalizedTransitionWidthDown, stopbandAttenuationdBDown);
auto N = coefficientsUp.getFilterOrder() + 1;
stateUp.setSize (static_cast<int> (numChannels), static_cast<int> (N));
stateUp.setSize (static_cast<int> (this->numChannels), static_cast<int> (N));
N = coefficientsDown.getFilterOrder() + 1;
auto Ndiv2 = N / 2;
auto Ndiv4 = Ndiv2 / 2;
stateDown.setSize (static_cast<int> (numChannels), static_cast<int> (N));
stateDown2.setSize (static_cast<int> (numChannels), static_cast<int> (Ndiv4 + 1));
stateDown.setSize (static_cast<int> (this->numChannels), static_cast<int> (N));
stateDown2.setSize (static_cast<int> (this->numChannels), static_cast<int> (Ndiv4 + 1));
position.resize (static_cast<int> (numChannels));
position.resize (static_cast<int> (this->numChannels));
}
~Oversampling2TimesEquirippleFIR() {}
@ -180,13 +179,13 @@ public:
auto numSamples = inputBlock.getNumSamples();
// Processing
for (size_t channel = 0; channel < inputBlock.getNumChannels(); channel++)
for (size_t channel = 0; channel < inputBlock.getNumChannels(); ++channel)
{
auto bufferSamples = OversamplingEngine<SampleType>::buffer.getWritePointer (static_cast<int> (channel));
auto buf = stateUp.getWritePointer (static_cast<int> (channel));
auto samples = inputBlock.getChannelPointer (channel);
for (size_t i = 0; i < numSamples; i++)
for (size_t i = 0; i < numSamples; ++i)
{
// Input
buf[N - 1] = 2 * samples[i];
@ -220,7 +219,7 @@ public:
auto numSamples = outputBlock.getNumSamples();
// Processing
for (size_t channel = 0; channel < outputBlock.getNumChannels(); channel++)
for (size_t channel = 0; channel < outputBlock.getNumChannels(); ++channel)
{
auto bufferSamples = OversamplingEngine<SampleType>::buffer.getWritePointer (static_cast<int> (channel));
auto buf = stateDown.getWritePointer (static_cast<int> (channel));
@ -228,7 +227,7 @@ public:
auto samples = outputBlock.getChannelPointer (channel);
auto pos = position.getUnchecked (static_cast<int> (channel));
for (size_t i = 0; i < numSamples; i++)
for (size_t i = 0; i < numSamples; ++i)
{
// Input
buf[N - 1] = bufferSamples[i << 1];
@ -245,7 +244,7 @@ public:
samples[i] = out;
// Shift data
for (size_t k = 0; k < N - 2; k++)
for (size_t k = 0; k < N - 2; ++k)
buf[k] = buf[k + 2];
// Circular buffer
@ -278,11 +277,12 @@ class Oversampling2TimesPolyphaseIIR : public OversamplingEngine<SampleType>
{
public:
//===============================================================================
Oversampling2TimesPolyphaseIIR (size_t numChannels,
Oversampling2TimesPolyphaseIIR (size_t numChans,
SampleType normalizedTransitionWidthUp,
SampleType stopbandAttenuationdBUp,
SampleType normalizedTransitionWidthDown,
SampleType stopbandAttenuationdBDown) : OversamplingEngine<SampleType> (numChannels, 2)
SampleType stopbandAttenuationdBDown)
: OversamplingEngine<SampleType> (numChans, 2)
{
auto structureUp = dsp::FilterDesign<SampleType>::designIIRLowpassHalfBandPolyphaseAllpassMethod (normalizedTransitionWidthUp, stopbandAttenuationdBUp);
dsp::IIR::Coefficients<SampleType> coeffsUp = getCoefficients (structureUp);
@ -292,21 +292,21 @@ public:
dsp::IIR::Coefficients<SampleType> coeffsDown = getCoefficients (structureDown);
latency += static_cast<SampleType> (-(coeffsDown.getPhaseForFrequency (0.0001, 1.0)) / (0.0001 * MathConstants<double>::twoPi));
for (auto i = 0; i < structureUp.directPath.size(); i++)
for (auto i = 0; i < structureUp.directPath.size(); ++i)
coefficientsUp.add (structureUp.directPath[i].coefficients[0]);
for (auto i = 1; i < structureUp.delayedPath.size(); i++)
for (auto i = 1; i < structureUp.delayedPath.size(); ++i)
coefficientsUp.add (structureUp.delayedPath[i].coefficients[0]);
for (auto i = 0; i < structureDown.directPath.size(); i++)
for (auto i = 0; i < structureDown.directPath.size(); ++i)
coefficientsDown.add (structureDown.directPath[i].coefficients[0]);
for (auto i = 1; i < structureDown.delayedPath.size(); i++)
for (auto i = 1; i < structureDown.delayedPath.size(); ++i)
coefficientsDown.add (structureDown.delayedPath[i].coefficients[0]);
v1Up.setSize (static_cast<int> (numChannels), coefficientsUp.size());
v1Down.setSize (static_cast<int> (numChannels), coefficientsDown.size());
delayDown.resize (static_cast<int> (numChannels));
v1Up.setSize (static_cast<int> (this->numChannels), coefficientsUp.size());
v1Down.setSize (static_cast<int> (this->numChannels), coefficientsDown.size());
delayDown.resize (static_cast<int> (this->numChannels));
}
~Oversampling2TimesPolyphaseIIR() {}
@ -339,17 +339,17 @@ public:
auto numSamples = inputBlock.getNumSamples();
// Processing
for (size_t channel = 0; channel < inputBlock.getNumChannels(); channel++)
for (size_t channel = 0; channel < inputBlock.getNumChannels(); ++channel)
{
auto bufferSamples = OversamplingEngine<SampleType>::buffer.getWritePointer (static_cast<int> (channel));
auto lv1 = v1Up.getWritePointer (static_cast<int> (channel));
auto samples = inputBlock.getChannelPointer (channel);
for (size_t i = 0; i < numSamples; i++)
for (size_t i = 0; i < numSamples; ++i)
{
// Direct path cascaded allpass filters
auto input = samples[i];
for (auto n = 0; n < directStages; n++)
for (auto n = 0; n < directStages; ++n)
{
auto alpha = coeffs[n];
auto output = alpha * input + lv1[n];
@ -362,7 +362,7 @@ public:
// Delayed path cascaded allpass filters
input = samples[i];
for (auto n = directStages; n < numStages; n++)
for (auto n = directStages; n < numStages; ++n)
{
auto alpha = coeffs[n];
auto output = alpha * input + lv1[n];
@ -392,18 +392,18 @@ public:
auto numSamples = outputBlock.getNumSamples();
// Processing
for (size_t channel = 0; channel < outputBlock.getNumChannels(); channel++)
for (size_t channel = 0; channel < outputBlock.getNumChannels(); ++channel)
{
auto bufferSamples = OversamplingEngine<SampleType>::buffer.getWritePointer (static_cast<int> (channel));
auto lv1 = v1Down.getWritePointer (static_cast<int> (channel));
auto samples = outputBlock.getChannelPointer (channel);
auto delay = delayDown.getUnchecked (static_cast<int> (channel));
for (size_t i = 0; i < numSamples; i++)
for (size_t i = 0; i < numSamples; ++i)
{
// Direct path cascaded allpass filters
auto input = bufferSamples[i << 1];
for (auto n = 0; n < directStages; n++)
for (auto n = 0; n < directStages; ++n)
{
auto alpha = coeffs[n];
auto output = alpha * input + lv1[n];
@ -414,7 +414,7 @@ public:
// Delayed path cascaded allpass filters
input = bufferSamples[(i << 1) + 1];
for (auto n = directStages; n < numStages; n++)
for (auto n = directStages; n < numStages; ++n)
{
auto alpha = coeffs[n];
auto output = alpha * input + lv1[n];
@ -438,23 +438,23 @@ public:
{
if (snapUpProcessing)
{
for (auto channel = 0; channel < OversamplingEngine<SampleType>::buffer.getNumChannels(); channel++)
for (auto channel = 0; channel < OversamplingEngine<SampleType>::buffer.getNumChannels(); ++channel)
{
auto lv1 = v1Up.getWritePointer (channel);
auto numStages = coefficientsUp.size();
for (auto n = 0; n < numStages; n++)
for (auto n = 0; n < numStages; ++n)
util::snapToZero (lv1[n]);
}
}
else
{
for (auto channel = 0; channel < OversamplingEngine<SampleType>::buffer.getNumChannels(); channel++)
for (auto channel = 0; channel < OversamplingEngine<SampleType>::buffer.getNumChannels(); ++channel)
{
auto lv1 = v1Down.getWritePointer (channel);
auto numStages = coefficientsDown.size();
for (auto n = 0; n < numStages; n++)
for (auto n = 0; n < numStages; ++n)
util::snapToZero (lv1[n]);
}
}
@ -474,7 +474,7 @@ private:
dsp::Polynomial<SampleType> temp;
for (auto n = 0; n < structure.directPath.size(); n++)
for (auto n = 0; n < structure.directPath.size(); ++n)
{
auto* coeffs = structure.directPath.getReference (n).getRawCoefficients();
@ -496,7 +496,7 @@ private:
}
}
for (auto n = 0; n < structure.delayedPath.size(); n++)
for (auto n = 0; n < structure.delayedPath.size(); ++n)
{
auto* coeffs = structure.delayedPath.getReference (n).getRawCoefficients();
@ -528,10 +528,10 @@ private:
coeffs.coefficients.clear();
auto inversion = static_cast<SampleType> (1.0) / denominator[0];
for (auto i = 0; i <= numerator.getOrder(); i++)
for (auto i = 0; i <= numerator.getOrder(); ++i)
coeffs.coefficients.add (numerator[i] * inversion);
for (auto i = 1; i <= denominator.getOrder(); i++)
for (auto i = 1; i <= denominator.getOrder(); ++i)
coeffs.coefficients.add (denominator[i] * inversion);
return coeffs;
@ -569,15 +569,15 @@ Oversampling<SampleType>::Oversampling (size_t newNumChannels, size_t newFactor,
{
numStages = newFactor;
for (size_t n = 0; n < numStages; n++)
for (size_t n = 0; n < numStages; ++n)
{
auto twUp = (isMaximumQuality ? 0.10f : 0.12f) * (n == 0 ? 0.5f : 1.f);
auto twUp = (isMaximumQuality ? 0.10f : 0.12f) * (n == 0 ? 0.5f : 1.f);
auto twDown = (isMaximumQuality ? 0.12f : 0.15f) * (n == 0 ? 0.5f : 1.f);
auto gaindBStartUp = (isMaximumQuality ? -75.f : -65.f);
auto gaindBStartDown = (isMaximumQuality ? -70.f : -60.f);
auto gaindBFactorUp = (isMaximumQuality ? 10.f : 8.f);
auto gaindBFactorDown = (isMaximumQuality ? 10.f : 8.f);
auto gaindBStartUp = (isMaximumQuality ? -75.f : -65.f);
auto gaindBStartDown = (isMaximumQuality ? -70.f : -60.f);
auto gaindBFactorUp = (isMaximumQuality ? 10.f : 8.f);
auto gaindBFactorDown = (isMaximumQuality ? 10.f : 8.f);
engines.add (new Oversampling2TimesPolyphaseIIR<SampleType> (numChannels,
twUp, gaindBStartUp + gaindBFactorUp * n,
@ -588,7 +588,7 @@ Oversampling<SampleType>::Oversampling (size_t newNumChannels, size_t newFactor,
{
numStages = newFactor;
for (size_t n = 0; n < numStages; n++)
for (size_t n = 0; n < numStages; ++n)
{
auto twUp = (isMaximumQuality ? 0.10f : 0.12f) * (n == 0 ? 0.5f : 1.f);
auto twDown = (isMaximumQuality ? 0.12f : 0.15f) * (n == 0 ? 0.5f : 1.f);
@ -618,7 +618,7 @@ SampleType Oversampling<SampleType>::getLatencyInSamples() noexcept
auto latency = static_cast<SampleType> (0);
size_t order = 1;
for (size_t n = 0; n < numStages; n++)
for (size_t n = 0; n < numStages; ++n)
{
auto& engine = *engines[static_cast<int> (n)];
@ -642,7 +642,7 @@ void Oversampling<SampleType>::initProcessing (size_t maximumNumberOfSamplesBefo
jassert (! engines.isEmpty());
auto currentNumSamples = maximumNumberOfSamplesBeforeOversampling;
for (size_t n = 0; n < numStages; n++)
for (size_t n = 0; n < numStages; ++n)
{
auto& engine = *engines[static_cast<int> (n)];
@ -660,7 +660,7 @@ void Oversampling<SampleType>::reset() noexcept
jassert (! engines.isEmpty());
if (isReady)
for (auto n = 0; n < engines.size(); n++)
for (auto n = 0; n < engines.size(); ++n)
engines[n]->reset();
}
@ -674,7 +674,7 @@ typename dsp::AudioBlock<SampleType> Oversampling<SampleType>::processSamplesUp
dsp::AudioBlock<SampleType> audioBlock = inputBlock;
for (size_t n = 0; n < numStages; n++)
for (size_t n = 0; n < numStages; ++n)
{
auto& engine = *engines[static_cast<int> (n)];
engine.processSamplesUp (audioBlock);
@ -694,10 +694,10 @@ void Oversampling<SampleType>::processSamplesDown (dsp::AudioBlock<SampleType> &
auto currentNumSamples = outputBlock.getNumSamples();
for (size_t n = 0; n < numStages - 1; n++)
for (size_t n = 0; n < numStages - 1; ++n)
currentNumSamples *= engines[static_cast<int> (n)]->getFactor();
for (size_t n = numStages - 1; n > 0; n--)
for (size_t n = numStages - 1; n > 0; --n)
{
auto& engine = *engines[static_cast<int> (n)];

View file

@ -35,18 +35,23 @@ namespace juce
namespace jpeglibNamespace
{
#if JUCE_INCLUDE_JPEGLIB_CODE || ! defined (JUCE_INCLUDE_JPEGLIB_CODE)
#if JUCE_MINGW
typedef unsigned char boolean;
#endif
#if JUCE_CLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wdeprecated-register"
#if __has_warning("-Wcomma")
#pragma clang diagnostic ignored "-Wcomma"
#if JUCE_MINGW
typedef unsigned char boolean;
#endif
#if JUCE_CLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wdeprecated-register"
#if __has_warning("-Wcomma")
#pragma clang diagnostic ignored "-Wcomma"
#endif
#endif
#if JUCE_GCC && __GNUC__ > 5
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshift-negative-value"
#endif
#endif
#define JPEG_INTERNALS
#undef FAR
@ -121,9 +126,13 @@ namespace jpeglibNamespace
#include "jpglib/jutils.c"
#include "jpglib/transupp.c"
#if JUCE_CLANG
#pragma clang diagnostic pop
#endif
#if JUCE_CLANG
#pragma clang diagnostic pop
#endif
#if JUCE_GCC && __GNUC__ > 5
#pragma GCC diagnostic pop
#endif
#else
#define JPEG_INTERNALS
#undef FAR

View file

@ -580,7 +580,7 @@ namespace EdgeTableFillers
SolidColour (const Image::BitmapData& image, PixelARGB colour)
: destData (image), sourceColour (colour)
{
if (sizeof (PixelType) == 3 && destData.pixelStride == sizeof (PixelType))
if (sizeof (PixelType) == 3 && (size_t) destData.pixelStride == sizeof (PixelType))
{
areRGBComponentsEqual = sourceColour.getRed() == sourceColour.getGreen()
&& sourceColour.getGreen() == sourceColour.getBlue();
@ -689,7 +689,7 @@ namespace EdgeTableFillers
forcedinline void replaceLine (PixelRGB* dest, PixelARGB colour, int width) const noexcept
{
if (destData.pixelStride == sizeof (*dest))
if ((size_t) destData.pixelStride == sizeof (*dest))
{
if (areRGBComponentsEqual) // if all the component values are the same, we can cheat..
{
@ -734,7 +734,7 @@ namespace EdgeTableFillers
forcedinline void replaceLine (PixelAlpha* dest, const PixelARGB colour, int width) const noexcept
{
if (destData.pixelStride == sizeof (*dest))
if ((size_t) destData.pixelStride == sizeof (*dest))
memset (dest, colour.getAlpha(), (size_t) width);
else
JUCE_PERFORM_PIXEL_OP_LOOP (setAlpha (colour.getAlpha()))

View file

@ -27,16 +27,15 @@
namespace juce
{
struct GridTests : public juce::UnitTest
struct GridTests : public UnitTest
{
GridTests() : juce::UnitTest ("Grid class") {}
GridTests() : UnitTest ("Grid class") {}
void runTest() override
{
using Fr = juce::Grid::Fr;
using Tr = juce::Grid::TrackInfo;
using Rect = juce::Rectangle<float>;
using Grid = juce::Grid;
using Fr = Grid::Fr;
using Tr = Grid::TrackInfo;
using Rect = Rectangle<float>;
{
Grid grid;
@ -47,7 +46,7 @@ struct GridTests : public juce::UnitTest
grid.items.addArray ({ GridItem().withArea (1, 1),
GridItem().withArea (2, 1) });
grid.performLayout (juce::Rectangle<int> (200, 400));
grid.performLayout (Rectangle<int> (200, 400));
beginTest ("Layout calculation test: 1 column x 2 rows: no gap");
expect (grid.items[0].currentBounds == Rect (0.0f, 0.0f, 200.f, 20.0f));
@ -61,7 +60,7 @@ struct GridTests : public juce::UnitTest
GridItem().withArea (3, 1),
GridItem().withArea (3, 2) });
grid.performLayout (juce::Rectangle<int> (150, 170));
grid.performLayout (Rectangle<int> (150, 170));
beginTest ("Layout calculation test: 2 columns x 3 rows: no gap");
expect (grid.items[0].currentBounds == Rect (0.0f, 0.0f, 100.0f, 20.0f));
@ -74,7 +73,7 @@ struct GridTests : public juce::UnitTest
grid.columnGap = 20_px;
grid.rowGap = 10_px;
grid.performLayout (juce::Rectangle<int> (200, 310));
grid.performLayout (Rectangle<int> (200, 310));
beginTest ("Layout calculation test: 2 columns x 3 rows: rowGap of 10 and columnGap of 20");
expect (grid.items[0].currentBounds == Rect (0.0f, 0.0f, 130.0f, 20.0f));

View file

@ -321,7 +321,7 @@ namespace
struct OSCReceiver::Pimpl : private Thread,
private MessageListener
{
Pimpl (const String& threadName) : Thread (threadName)
Pimpl (const String& oscThreadName) : Thread (oscThreadName)
{
}