Browse Source

Fixed some warnings on the latest compilers

tags/2021-05-28
Tom Poole 6 years ago
parent
commit
a12bc32979
10 changed files with 58 additions and 58 deletions
  1. +1
    -1
      examples/Audio/SimpleFFTDemo.h
  2. +1
    -1
      examples/GUI/BouncingBallWavetableDemo.h
  3. +24
    -24
      modules/juce_audio_basics/buffers/juce_AudioDataConverters.h
  4. +1
    -1
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  5. +2
    -2
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/falignpush.h
  6. +13
    -13
      modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h
  7. +4
    -4
      modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h
  8. +6
    -6
      modules/juce_blocks_basics/protocol/juce_HostPacketDecoder.h
  9. +4
    -4
      modules/juce_core/xml/juce_XmlElement.cpp
  10. +2
    -2
      modules/juce_gui_basics/layout/juce_Grid.cpp

+ 1
- 1
examples/Audio/SimpleFFTDemo.h View File

@@ -163,7 +163,7 @@ public:
for (auto y = 1; y < imageHeight; ++y) for (auto y = 1; y < imageHeight; ++y)
{ {
auto skewedProportionY = 1.0f - std::exp (std::log (y / (float) imageHeight) * 0.2f); auto skewedProportionY = 1.0f - std::exp (std::log (y / (float) imageHeight) * 0.2f);
auto fftDataIndex = jlimit (0, fftSize / 2, (int) (skewedProportionY * fftSize / 2));
auto fftDataIndex = jlimit (0, fftSize / 2, (int) (skewedProportionY * (int) fftSize / 2));
auto level = jmap (fftData[fftDataIndex], 0.0f, jmax (maxLevel.getEnd(), 1e-5f), 0.0f, 1.0f); auto level = jmap (fftData[fftDataIndex], 0.0f, jmax (maxLevel.getEnd(), 1e-5f), 0.0f, 1.0f);
spectrogramImage.setPixelAt (rightHandEdge, y, Colour::fromHSV (level, 1.0f, level, 1.0f)); spectrogramImage.setPixelAt (rightHandEdge, y, Colour::fromHSV (level, 1.0f, level, 1.0f));


+ 1
- 1
examples/GUI/BouncingBallWavetableDemo.h View File

@@ -217,7 +217,7 @@ public:
for (auto i = 0; i < steps; ++i) for (auto i = 0; i < steps; ++i)
{ {
auto p = start + ((finish - start) * i) / steps;
auto p = start + ((finish - start) * i) / (int) steps;
auto index = (bufferIndex + i) % wavetableSize; auto index = (bufferIndex + i) % wavetableSize;
waveValues[1][index] = yToAmplitude (p.y); waveValues[1][index] = yToAmplitude (p.y);


+ 24
- 24
modules/juce_audio_basics/buffers/juce_AudioDataConverters.h View File

@@ -102,9 +102,9 @@ public:
inline void advance() noexcept { ++data; } inline void advance() noexcept { ++data; }
inline void skip (int numSamples) noexcept { data += numSamples; } inline void skip (int numSamples) noexcept { data += numSamples; }
inline float getAsFloatLE() const noexcept { return (float) (*data * (1.0 / (1.0 + maxValue))); }
inline float getAsFloatLE() const noexcept { return (float) (*data * (1.0 / (1.0 + (double) maxValue))); }
inline float getAsFloatBE() const noexcept { return getAsFloatLE(); } inline float getAsFloatBE() const noexcept { return getAsFloatLE(); }
inline void setAsFloatLE (float newValue) noexcept { *data = (int8) jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue))); }
inline void setAsFloatLE (float newValue) noexcept { *data = (int8) jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + (double) maxValue))); }
inline void setAsFloatBE (float newValue) noexcept { setAsFloatLE (newValue); } inline void setAsFloatBE (float newValue) noexcept { setAsFloatLE (newValue); }
inline int32 getAsInt32LE() const noexcept { return (int) (*((uint8*) data) << 24); } inline int32 getAsInt32LE() const noexcept { return (int) (*((uint8*) data) << 24); }
inline int32 getAsInt32BE() const noexcept { return getAsInt32LE(); } inline int32 getAsInt32BE() const noexcept { return getAsInt32LE(); }
@@ -127,9 +127,9 @@ public:
inline void advance() noexcept { ++data; } inline void advance() noexcept { ++data; }
inline void skip (int numSamples) noexcept { data += numSamples; } inline void skip (int numSamples) noexcept { data += numSamples; }
inline float getAsFloatLE() const noexcept { return (float) ((*data - 128) * (1.0 / (1.0 + maxValue))); }
inline float getAsFloatLE() const noexcept { return (float) ((*data - 128) * (1.0 / (1.0 + (double) maxValue))); }
inline float getAsFloatBE() const noexcept { return getAsFloatLE(); } inline float getAsFloatBE() const noexcept { return getAsFloatLE(); }
inline void setAsFloatLE (float newValue) noexcept { *data = (uint8) jlimit (0, 255, 128 + roundToInt (newValue * (1.0 + maxValue))); }
inline void setAsFloatLE (float newValue) noexcept { *data = (uint8) jlimit (0, 255, 128 + roundToInt (newValue * (1.0 + (double) maxValue))); }
inline void setAsFloatBE (float newValue) noexcept { setAsFloatLE (newValue); } inline void setAsFloatBE (float newValue) noexcept { setAsFloatLE (newValue); }
inline int32 getAsInt32LE() const noexcept { return (int) (((uint8) (*data - 128)) << 24); } inline int32 getAsInt32LE() const noexcept { return (int) (((uint8) (*data - 128)) << 24); }
inline int32 getAsInt32BE() const noexcept { return getAsInt32LE(); } inline int32 getAsInt32BE() const noexcept { return getAsInt32LE(); }
@@ -152,10 +152,10 @@ public:
inline void advance() noexcept { ++data; } inline void advance() noexcept { ++data; }
inline void skip (int numSamples) noexcept { data += numSamples; } inline void skip (int numSamples) noexcept { data += numSamples; }
inline float getAsFloatLE() const noexcept { return (float) ((1.0 / (1.0 + maxValue)) * (int16) ByteOrder::swapIfBigEndian (*data)); }
inline float getAsFloatBE() const noexcept { return (float) ((1.0 / (1.0 + maxValue)) * (int16) ByteOrder::swapIfLittleEndian (*data)); }
inline void setAsFloatLE (float newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint16) jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue)))); }
inline void setAsFloatBE (float newValue) noexcept { *data = ByteOrder::swapIfLittleEndian ((uint16) jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue)))); }
inline float getAsFloatLE() const noexcept { return (float) ((1.0 / (1.0 + (double) maxValue)) * (int16) ByteOrder::swapIfBigEndian (*data)); }
inline float getAsFloatBE() const noexcept { return (float) ((1.0 / (1.0 + (double) maxValue)) * (int16) ByteOrder::swapIfLittleEndian (*data)); }
inline void setAsFloatLE (float newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint16) jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + (double) maxValue)))); }
inline void setAsFloatBE (float newValue) noexcept { *data = ByteOrder::swapIfLittleEndian ((uint16) jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + (double) maxValue)))); }
inline int32 getAsInt32LE() const noexcept { return (int32) (ByteOrder::swapIfBigEndian ((uint16) *data) << 16); } inline int32 getAsInt32LE() const noexcept { return (int32) (ByteOrder::swapIfBigEndian ((uint16) *data) << 16); }
inline int32 getAsInt32BE() const noexcept { return (int32) (ByteOrder::swapIfLittleEndian ((uint16) *data) << 16); } inline int32 getAsInt32BE() const noexcept { return (int32) (ByteOrder::swapIfLittleEndian ((uint16) *data) << 16); }
inline void setAsInt32LE (int32 newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint16) (newValue >> 16)); } inline void setAsInt32LE (int32 newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint16) (newValue >> 16)); }
@@ -177,10 +177,10 @@ public:
inline void advance() noexcept { data += 3; } inline void advance() noexcept { data += 3; }
inline void skip (int numSamples) noexcept { data += 3 * numSamples; } inline void skip (int numSamples) noexcept { data += 3 * numSamples; }
inline float getAsFloatLE() const noexcept { return (float) (ByteOrder::littleEndian24Bit (data) * (1.0 / (1.0 + maxValue))); }
inline float getAsFloatBE() const noexcept { return (float) (ByteOrder::bigEndian24Bit (data) * (1.0 / (1.0 + maxValue))); }
inline void setAsFloatLE (float newValue) noexcept { ByteOrder::littleEndian24BitToChars (jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue))), data); }
inline void setAsFloatBE (float newValue) noexcept { ByteOrder::bigEndian24BitToChars (jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue))), data); }
inline float getAsFloatLE() const noexcept { return (float) (ByteOrder::littleEndian24Bit (data) * (1.0 / (1.0 + (double) maxValue))); }
inline float getAsFloatBE() const noexcept { return (float) (ByteOrder::bigEndian24Bit (data) * (1.0 / (1.0 + (double) maxValue))); }
inline void setAsFloatLE (float newValue) noexcept { ByteOrder::littleEndian24BitToChars (jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + (double) maxValue))), data); }
inline void setAsFloatBE (float newValue) noexcept { ByteOrder::bigEndian24BitToChars (jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + (double) maxValue))), data); }
inline int32 getAsInt32LE() const noexcept { return (int32) (((unsigned int) ByteOrder::littleEndian24Bit (data)) << 8); } inline int32 getAsInt32LE() const noexcept { return (int32) (((unsigned int) ByteOrder::littleEndian24Bit (data)) << 8); }
inline int32 getAsInt32BE() const noexcept { return (int32) (((unsigned int) ByteOrder::bigEndian24Bit (data)) << 8); } inline int32 getAsInt32BE() const noexcept { return (int32) (((unsigned int) ByteOrder::bigEndian24Bit (data)) << 8); }
inline void setAsInt32LE (int32 newValue) noexcept { ByteOrder::littleEndian24BitToChars (newValue >> 8, data); } inline void setAsInt32LE (int32 newValue) noexcept { ByteOrder::littleEndian24BitToChars (newValue >> 8, data); }
@@ -202,10 +202,10 @@ public:
inline void advance() noexcept { ++data; } inline void advance() noexcept { ++data; }
inline void skip (int numSamples) noexcept { data += numSamples; } inline void skip (int numSamples) noexcept { data += numSamples; }
inline float getAsFloatLE() const noexcept { return (float) ((1.0 / (1.0 + maxValue)) * (int32) ByteOrder::swapIfBigEndian (*data)); }
inline float getAsFloatBE() const noexcept { return (float) ((1.0 / (1.0 + maxValue)) * (int32) ByteOrder::swapIfLittleEndian (*data)); }
inline void setAsFloatLE (float newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint32) (int32) (maxValue * jlimit (-1.0, 1.0, (double) newValue))); }
inline void setAsFloatBE (float newValue) noexcept { *data = ByteOrder::swapIfLittleEndian ((uint32) (int32) (maxValue * jlimit (-1.0, 1.0, (double) newValue))); }
inline float getAsFloatLE() const noexcept { return (float) ((1.0 / (1.0 + (double) maxValue)) * (int32) ByteOrder::swapIfBigEndian (*data)); }
inline float getAsFloatBE() const noexcept { return (float) ((1.0 / (1.0 + (double) maxValue)) * (int32) ByteOrder::swapIfLittleEndian (*data)); }
inline void setAsFloatLE (float newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint32) (int32) ((double) maxValue * jlimit (-1.0, 1.0, (double) newValue))); }
inline void setAsFloatBE (float newValue) noexcept { *data = ByteOrder::swapIfLittleEndian ((uint32) (int32) ((double) maxValue * jlimit (-1.0, 1.0, (double) newValue))); }
inline int32 getAsInt32LE() const noexcept { return (int32) ByteOrder::swapIfBigEndian (*data); } inline int32 getAsInt32LE() const noexcept { return (int32) ByteOrder::swapIfBigEndian (*data); }
inline int32 getAsInt32BE() const noexcept { return (int32) ByteOrder::swapIfLittleEndian (*data); } inline int32 getAsInt32BE() const noexcept { return (int32) ByteOrder::swapIfLittleEndian (*data); }
inline void setAsInt32LE (int32 newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint32) newValue); } inline void setAsInt32LE (int32 newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint32) newValue); }
@@ -226,10 +226,10 @@ public:
public: public:
inline Int24in32 (void* d) noexcept : Int32 (d) {} inline Int24in32 (void* d) noexcept : Int32 (d) {}
inline float getAsFloatLE() const noexcept { return (float) ((1.0 / (1.0 + maxValue)) * (int32) ByteOrder::swapIfBigEndian (*data)); }
inline float getAsFloatBE() const noexcept { return (float) ((1.0 / (1.0 + maxValue)) * (int32) ByteOrder::swapIfLittleEndian (*data)); }
inline void setAsFloatLE (float newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint32) (maxValue * jlimit (-1.0, 1.0, (double) newValue))); }
inline void setAsFloatBE (float newValue) noexcept { *data = ByteOrder::swapIfLittleEndian ((uint32) (maxValue * jlimit (-1.0, 1.0, (double) newValue))); }
inline float getAsFloatLE() const noexcept { return (float) ((1.0 / (1.0 + (double) maxValue)) * (int32) ByteOrder::swapIfBigEndian (*data)); }
inline float getAsFloatBE() const noexcept { return (float) ((1.0 / (1.0 + (double) maxValue)) * (int32) ByteOrder::swapIfLittleEndian (*data)); }
inline void setAsFloatLE (float newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint32) ((double) maxValue * jlimit (-1.0, 1.0, (double) newValue))); }
inline void setAsFloatBE (float newValue) noexcept { *data = ByteOrder::swapIfLittleEndian ((uint32) ((double) maxValue * jlimit (-1.0, 1.0, (double) newValue))); }
inline int32 getAsInt32LE() const noexcept { return (int32) ByteOrder::swapIfBigEndian (*data) << 8; } inline int32 getAsInt32LE() const noexcept { return (int32) ByteOrder::swapIfBigEndian (*data) << 8; }
inline int32 getAsInt32BE() const noexcept { return (int32) ByteOrder::swapIfLittleEndian (*data) << 8; } inline int32 getAsInt32BE() const noexcept { return (int32) ByteOrder::swapIfLittleEndian (*data) << 8; }
inline void setAsInt32LE (int32 newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint32) newValue >> 8); } inline void setAsInt32LE (int32 newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint32) newValue >> 8); }
@@ -261,8 +261,8 @@ public:
#endif #endif
inline int32 getAsInt32LE() const noexcept { return (int32) roundToInt (jlimit (-1.0, 1.0, (double) getAsFloatLE()) * (double) maxValue); } inline int32 getAsInt32LE() const noexcept { return (int32) roundToInt (jlimit (-1.0, 1.0, (double) getAsFloatLE()) * (double) maxValue); }
inline int32 getAsInt32BE() const noexcept { return (int32) roundToInt (jlimit (-1.0, 1.0, (double) getAsFloatBE()) * (double) maxValue); } inline int32 getAsInt32BE() const noexcept { return (int32) roundToInt (jlimit (-1.0, 1.0, (double) getAsFloatBE()) * (double) maxValue); }
inline void setAsInt32LE (int32 newValue) noexcept { setAsFloatLE ((float) (newValue * (1.0 / (1.0 + maxValue)))); }
inline void setAsInt32BE (int32 newValue) noexcept { setAsFloatBE ((float) (newValue * (1.0 / (1.0 + maxValue)))); }
inline void setAsInt32LE (int32 newValue) noexcept { setAsFloatLE ((float) (newValue * (1.0 / (1.0 + (double) maxValue)))); }
inline void setAsInt32BE (int32 newValue) noexcept { setAsFloatBE ((float) (newValue * (1.0 / (1.0 + (double) maxValue)))); }
inline void clear() noexcept { *data = 0; } inline void clear() noexcept { *data = 0; }
inline void clearMultiple (int num) noexcept { zeromem (data, (size_t) (num * bytesPerSample)) ;} inline void clearMultiple (int num) noexcept { zeromem (data, (size_t) (num * bytesPerSample)) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsFloatLE (source.getAsFloat()); } template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsFloatLE (source.getAsFloat()); }
@@ -528,8 +528,8 @@ public:
if (v < mn) mn = v; if (v < mn) mn = v;
} }
return Range<float> (mn * (float) (1.0 / (1.0 + Int32::maxValue)),
mx * (float) (1.0 / (1.0 + Int32::maxValue)));
return Range<float> (mn * (float) (1.0 / (1.0 + (double) Int32::maxValue)),
mx * (float) (1.0 / (1.0 + (double) Int32::maxValue)));
} }
/** Scans a block of data, returning the lowest and highest levels as floats */ /** Scans a block of data, returning the lowest and highest levels as floats */


+ 1
- 1
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -928,7 +928,7 @@ private:
enum { numMIDIChannels = 16 }; enum { numMIDIChannels = 16 };
Vst::ParamID parameterToMidiControllerOffset; Vst::ParamID parameterToMidiControllerOffset;
MidiController parameterToMidiController[numMIDIChannels * Vst::kCountCtrlNumber];
MidiController parameterToMidiController[(int) numMIDIChannels * (int) Vst::kCountCtrlNumber];
Vst::ParamID midiControllerToParameter[numMIDIChannels][Vst::kCountCtrlNumber]; Vst::ParamID midiControllerToParameter[numMIDIChannels][Vst::kCountCtrlNumber];
//============================================================================== //==============================================================================


+ 2
- 2
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/falignpush.h View File

@@ -16,6 +16,7 @@


//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
#if SMTG_OS_MACOS #if SMTG_OS_MACOS
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-warning-option" #pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wpragma-pack" #pragma GCC diagnostic ignored "-Wpragma-pack"
#if SMTG_PLATFORM_64 #if SMTG_PLATFORM_64
@@ -23,8 +24,7 @@
#else #else
#pragma pack(push, 1) #pragma pack(push, 1)
#endif #endif
#pragma GCC diagnostic default "-Wpragma-pack"
#pragma GCC diagnostic default "-Wunknown-warning-option"
#pragma GCC diagnostic pop
#elif defined __BORLANDC__ #elif defined __BORLANDC__
#pragma -a8 #pragma -a8
#elif SMTG_OS_WINDOWS #elif SMTG_OS_WINDOWS


+ 13
- 13
modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h View File

@@ -471,25 +471,25 @@ static constexpr uint32 controlBlockStackSize = 800;
/** Contains the number of bits required to encode various items in the packets */ /** Contains the number of bits required to encode various items in the packets */
enum BitSizes enum BitSizes
{ {
topologyMessageHeader = MessageType::bits + ProtocolVersion::bits + DeviceCount::bits + ConnectionCount::bits,
topologyDeviceInfo = BlockSerialNumber::maxLength * 7 + BatteryLevel::bits + BatteryCharging::bits,
topologyConnectionInfo = topologyIndexBits + ConnectorPort::bits + topologyIndexBits + ConnectorPort::bits,
topologyMessageHeader = (int) MessageType::bits + (int) ProtocolVersion::bits + (int) DeviceCount::bits + (int) ConnectionCount::bits,
topologyDeviceInfo = (int) BlockSerialNumber::maxLength * 7 + (int) BatteryLevel::bits + (int) BatteryCharging::bits,
topologyConnectionInfo = topologyIndexBits + (int) ConnectorPort::bits + topologyIndexBits + (int) ConnectorPort::bits,
typeDeviceAndTime = MessageType::bits + PacketTimestampOffset::bits,
typeDeviceAndTime = (int) MessageType::bits + (int) PacketTimestampOffset::bits,
touchMessage = typeDeviceAndTime + TouchIndex::bits + TouchPosition::bits,
touchMessageWithVelocity = touchMessage + TouchVelocity::bits,
touchMessage = (int) typeDeviceAndTime + (int) TouchIndex::bits + (int) TouchPosition::bits,
touchMessageWithVelocity = (int) touchMessage + (int) TouchVelocity::bits,
programEventMessage = MessageType::bits + 32 * numProgramMessageInts,
packetACK = MessageType::bits + PacketCounter::bits,
programEventMessage = (int) MessageType::bits + 32 * numProgramMessageInts,
packetACK = (int) MessageType::bits + (int) PacketCounter::bits,
firmwareUpdateACK = MessageType::bits + FirmwareUpdateACKCode::bits + FirmwareUpdateACKDetail::bits,
firmwareUpdateACK = (int) MessageType::bits + (int) FirmwareUpdateACKCode::bits + (int) FirmwareUpdateACKDetail::bits,
controlButtonMessage = typeDeviceAndTime + ControlButtonID::bits,
controlButtonMessage = (int) typeDeviceAndTime + (int) ControlButtonID::bits,
configSetMessage = MessageType::bits + ConfigCommand::bits + ConfigItemIndex::bits + ConfigItemValue::bits,
configRespMessage = MessageType::bits + ConfigCommand::bits + ConfigItemIndex::bits + (ConfigItemValue::bits * 3),
configSyncEndMessage = MessageType::bits + ConfigCommand::bits,
configSetMessage = (int) MessageType::bits + (int) ConfigCommand::bits + (int) ConfigItemIndex::bits + (int) ConfigItemValue::bits,
configRespMessage = (int) MessageType::bits + (int) ConfigCommand::bits + (int) ConfigItemIndex::bits + ((int) ConfigItemValue::bits * 3),
configSyncEndMessage = (int) MessageType::bits + (int) ConfigCommand::bits,
}; };
//============================================================================== //==============================================================================


+ 4
- 4
modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h View File

@@ -58,7 +58,7 @@ struct HostPacketBuilder
//============================================================================== //==============================================================================
bool deviceControlMessage (DeviceCommand command) noexcept bool deviceControlMessage (DeviceCommand command) noexcept
{ {
if (! data.hasCapacity (MessageType::bits + DeviceCommand::bits))
if (! data.hasCapacity ((int) MessageType::bits + (int) DeviceCommand::bits))
return false; return false;
writeMessageType (MessageFromHost::deviceCommandMessage); writeMessageType (MessageFromHost::deviceCommandMessage);
@@ -69,7 +69,7 @@ struct HostPacketBuilder
//============================================================================== //==============================================================================
bool beginDataChanges (PacketIndex packetIndex) noexcept bool beginDataChanges (PacketIndex packetIndex) noexcept
{ {
if (! data.hasCapacity (MessageType::bits + PacketIndex::bits + DataChangeCommand::bits))
if (! data.hasCapacity ((int) MessageType::bits + (int) PacketIndex::bits + (int) DataChangeCommand::bits))
return false; return false;
writeMessageType (MessageFromHost::sharedDataChange); writeMessageType (MessageFromHost::sharedDataChange);
@@ -255,7 +255,7 @@ struct HostPacketBuilder
bool addRequestFactorySyncMessage() bool addRequestFactorySyncMessage()
{ {
if (! data.hasCapacity (MessageType::bits + ConfigCommand::bits))
if (! data.hasCapacity ((int) MessageType::bits + (int) ConfigCommand::bits))
return false; return false;
writeMessageType (MessageFromHost::configMessage); writeMessageType (MessageFromHost::configMessage);
@@ -266,7 +266,7 @@ struct HostPacketBuilder
bool addRequestUserSyncMessage() bool addRequestUserSyncMessage()
{ {
if (! data.hasCapacity (MessageType::bits + ConfigCommand::bits))
if (! data.hasCapacity ((int) MessageType::bits + (int) ConfigCommand::bits))
return false; return false;
writeMessageType (MessageFromHost::configMessage); writeMessageType (MessageFromHost::configMessage);


+ 6
- 6
modules/juce_blocks_basics/protocol/juce_HostPacketDecoder.h View File

@@ -104,7 +104,7 @@ struct HostPacketDecoder
static bool handleTopology (Handler& handler, Packed7BitArrayReader& reader, bool newTopology) static bool handleTopology (Handler& handler, Packed7BitArrayReader& reader, bool newTopology)
{ {
if (reader.getRemainingBits() < DeviceCount::bits + ConnectionCount::bits)
if (reader.getRemainingBits() < (int) DeviceCount::bits + (int) ConnectionCount::bits)
{ {
jassertfalse; // not enough data available for this message type! jassertfalse; // not enough data available for this message type!
return false; return false;
@@ -220,7 +220,7 @@ struct HostPacketDecoder
static bool handleTouch (Handler& handler, Packed7BitArrayReader& reader, TopologyIndex deviceIndex, static bool handleTouch (Handler& handler, Packed7BitArrayReader& reader, TopologyIndex deviceIndex,
PacketTimestamp packetTimestamp, bool isStart, bool isEnd) PacketTimestamp packetTimestamp, bool isStart, bool isEnd)
{ {
if (reader.getRemainingBits() < BitSizes::touchMessage - MessageType::bits)
if (reader.getRemainingBits() < (int) BitSizes::touchMessage - (int) MessageType::bits)
{ {
jassertfalse; // not enough data available for this message type! jassertfalse; // not enough data available for this message type!
return false; return false;
@@ -240,7 +240,7 @@ struct HostPacketDecoder
static bool handleTouchWithVelocity (Handler& handler, Packed7BitArrayReader& reader, TopologyIndex deviceIndex, static bool handleTouchWithVelocity (Handler& handler, Packed7BitArrayReader& reader, TopologyIndex deviceIndex,
PacketTimestamp packetTimestamp, bool isStart, bool isEnd) PacketTimestamp packetTimestamp, bool isStart, bool isEnd)
{ {
if (reader.getRemainingBits() < BitSizes::touchMessageWithVelocity - MessageType::bits)
if (reader.getRemainingBits() < (int) BitSizes::touchMessageWithVelocity - (int) MessageType::bits)
{ {
jassertfalse; // not enough data available for this message type! jassertfalse; // not enough data available for this message type!
return false; return false;
@@ -269,7 +269,7 @@ struct HostPacketDecoder
static bool handleButtonDownOrUp (Handler& handler, Packed7BitArrayReader& reader, TopologyIndex deviceIndex, static bool handleButtonDownOrUp (Handler& handler, Packed7BitArrayReader& reader, TopologyIndex deviceIndex,
PacketTimestamp packetTimestamp, bool isDown) PacketTimestamp packetTimestamp, bool isDown)
{ {
if (reader.getRemainingBits() < BitSizes::controlButtonMessage - MessageType::bits)
if (reader.getRemainingBits() < (int) BitSizes::controlButtonMessage - (int) MessageType::bits)
{ {
jassertfalse; // not enough data available for this message type! jassertfalse; // not enough data available for this message type!
return false; return false;
@@ -285,7 +285,7 @@ struct HostPacketDecoder
static bool handleCustomMessage (Handler& handler, Packed7BitArrayReader& reader, static bool handleCustomMessage (Handler& handler, Packed7BitArrayReader& reader,
TopologyIndex deviceIndex, PacketTimestamp packetTimestamp) TopologyIndex deviceIndex, PacketTimestamp packetTimestamp)
{ {
if (reader.getRemainingBits() < BitSizes::programEventMessage - MessageType::bits)
if (reader.getRemainingBits() < BitSizes::programEventMessage - (int) MessageType::bits)
{ {
jassertfalse; // not enough data available for this message type! jassertfalse; // not enough data available for this message type!
return false; return false;
@@ -302,7 +302,7 @@ struct HostPacketDecoder
static bool handlePacketACK (Handler& handler, Packed7BitArrayReader& reader, TopologyIndex deviceIndex) static bool handlePacketACK (Handler& handler, Packed7BitArrayReader& reader, TopologyIndex deviceIndex)
{ {
if (reader.getRemainingBits() < BitSizes::packetACK - MessageType::bits)
if (reader.getRemainingBits() < BitSizes::packetACK - (int) MessageType::bits)
{ {
jassertfalse; // not enough data available for this message type! jassertfalse; // not enough data available for this message type!
return false; return false;


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

@@ -188,10 +188,10 @@ namespace XmlOutputFunctions
template <int tableIndex> template <int tableIndex>
struct Byte struct Byte
{ {
enum { v = Bit<tableIndex * 8 + 0>::v | Bit<tableIndex * 8 + 1>::v
| Bit<tableIndex * 8 + 2>::v | Bit<tableIndex * 8 + 3>::v
| Bit<tableIndex * 8 + 4>::v | Bit<tableIndex * 8 + 5>::v
| Bit<tableIndex * 8 + 6>::v | Bit<tableIndex * 8 + 7>::v };
enum { v = (int) Bit<tableIndex * 8 + 0>::v | (int) Bit<tableIndex * 8 + 1>::v
| (int) Bit<tableIndex * 8 + 2>::v | (int) Bit<tableIndex * 8 + 3>::v
| (int) Bit<tableIndex * 8 + 4>::v | (int) Bit<tableIndex * 8 + 5>::v
| (int) Bit<tableIndex * 8 + 6>::v | (int) Bit<tableIndex * 8 + 7>::v };
}; };
static bool isLegal (uint32 c) noexcept static bool isLegal (uint32 c) noexcept


+ 2
- 2
modules/juce_gui_basics/layout/juce_Grid.cpp View File

@@ -918,10 +918,10 @@ struct Grid::BoxAlignment
// align and justify // align and justify
auto r = area; auto r = area;
if (item.width != GridItem::notAssigned)
if (item.width != (float) GridItem::notAssigned)
r.setWidth (item.width); r.setWidth (item.width);
if (item.height != GridItem::notAssigned)
if (item.height != (float) GridItem::notAssigned)
r.setHeight (item.height); r.setHeight (item.height);
if (alignType == Grid::AlignItems::start && justifyType == Grid::JustifyItems::start) if (alignType == Grid::AlignItems::start && justifyType == Grid::JustifyItems::start)


Loading…
Cancel
Save