From a12bc329798ef2a2569d255e37721385a0db3510 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Fri, 26 Jul 2019 12:58:04 +0100 Subject: [PATCH] Fixed some warnings on the latest compilers --- examples/Audio/SimpleFFTDemo.h | 2 +- examples/GUI/BouncingBallWavetableDemo.h | 2 +- .../buffers/juce_AudioDataConverters.h | 48 +++++++++---------- .../VST3/juce_VST3_Wrapper.cpp | 2 +- .../VST3_SDK/pluginterfaces/base/falignpush.h | 4 +- .../protocol/juce_BlocksProtocolDefinitions.h | 26 +++++----- .../protocol/juce_HostPacketBuilder.h | 8 ++-- .../protocol/juce_HostPacketDecoder.h | 12 ++--- modules/juce_core/xml/juce_XmlElement.cpp | 8 ++-- modules/juce_gui_basics/layout/juce_Grid.cpp | 4 +- 10 files changed, 58 insertions(+), 58 deletions(-) diff --git a/examples/Audio/SimpleFFTDemo.h b/examples/Audio/SimpleFFTDemo.h index a087a21efa..8160901791 100644 --- a/examples/Audio/SimpleFFTDemo.h +++ b/examples/Audio/SimpleFFTDemo.h @@ -163,7 +163,7 @@ public: for (auto y = 1; y < imageHeight; ++y) { 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); spectrogramImage.setPixelAt (rightHandEdge, y, Colour::fromHSV (level, 1.0f, level, 1.0f)); diff --git a/examples/GUI/BouncingBallWavetableDemo.h b/examples/GUI/BouncingBallWavetableDemo.h index f3c50f900a..ad186515c5 100644 --- a/examples/GUI/BouncingBallWavetableDemo.h +++ b/examples/GUI/BouncingBallWavetableDemo.h @@ -217,7 +217,7 @@ public: 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; waveValues[1][index] = yToAmplitude (p.y); diff --git a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h index 47edc642db..e8e1fed627 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h +++ b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h @@ -102,9 +102,9 @@ public: inline void advance() noexcept { ++data; } 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 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 int32 getAsInt32LE() const noexcept { return (int) (*((uint8*) data) << 24); } inline int32 getAsInt32BE() const noexcept { return getAsInt32LE(); } @@ -127,9 +127,9 @@ public: inline void advance() noexcept { ++data; } 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 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 int32 getAsInt32LE() const noexcept { return (int) (((uint8) (*data - 128)) << 24); } inline int32 getAsInt32BE() const noexcept { return getAsInt32LE(); } @@ -152,10 +152,10 @@ public: inline void advance() noexcept { ++data; } 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 getAsInt32BE() const noexcept { return (int32) (ByteOrder::swapIfLittleEndian ((uint16) *data) << 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 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 getAsInt32BE() const noexcept { return (int32) (((unsigned int) ByteOrder::bigEndian24Bit (data)) << 8); } inline void setAsInt32LE (int32 newValue) noexcept { ByteOrder::littleEndian24BitToChars (newValue >> 8, data); } @@ -202,10 +202,10 @@ public: inline void advance() noexcept { ++data; } 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 getAsInt32BE() const noexcept { return (int32) ByteOrder::swapIfLittleEndian (*data); } inline void setAsInt32LE (int32 newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint32) newValue); } @@ -226,10 +226,10 @@ public: public: 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 getAsInt32BE() const noexcept { return (int32) ByteOrder::swapIfLittleEndian (*data) << 8; } inline void setAsInt32LE (int32 newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint32) newValue >> 8); } @@ -261,8 +261,8 @@ public: #endif 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 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 clearMultiple (int num) noexcept { zeromem (data, (size_t) (num * bytesPerSample)) ;} template inline void copyFromLE (SourceType& source) noexcept { setAsFloatLE (source.getAsFloat()); } @@ -528,8 +528,8 @@ public: if (v < mn) mn = v; } - return Range (mn * (float) (1.0 / (1.0 + Int32::maxValue)), - mx * (float) (1.0 / (1.0 + Int32::maxValue))); + return Range (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 */ diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp index 097b3e77ec..cd06128abd 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -928,7 +928,7 @@ private: enum { numMIDIChannels = 16 }; Vst::ParamID parameterToMidiControllerOffset; - MidiController parameterToMidiController[numMIDIChannels * Vst::kCountCtrlNumber]; + MidiController parameterToMidiController[(int) numMIDIChannels * (int) Vst::kCountCtrlNumber]; Vst::ParamID midiControllerToParameter[numMIDIChannels][Vst::kCountCtrlNumber]; //============================================================================== diff --git a/modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/falignpush.h b/modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/falignpush.h index d4ebbade80..bd768939bf 100644 --- a/modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/falignpush.h +++ b/modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/falignpush.h @@ -16,6 +16,7 @@ //---------------------------------------------------------------------------------------------- #if SMTG_OS_MACOS + #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunknown-warning-option" #pragma GCC diagnostic ignored "-Wpragma-pack" #if SMTG_PLATFORM_64 @@ -23,8 +24,7 @@ #else #pragma pack(push, 1) #endif - #pragma GCC diagnostic default "-Wpragma-pack" - #pragma GCC diagnostic default "-Wunknown-warning-option" + #pragma GCC diagnostic pop #elif defined __BORLANDC__ #pragma -a8 #elif SMTG_OS_WINDOWS diff --git a/modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h b/modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h index 984a8b2472..4a38c41683 100644 --- a/modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h +++ b/modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h @@ -471,25 +471,25 @@ static constexpr uint32 controlBlockStackSize = 800; /** Contains the number of bits required to encode various items in the packets */ 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, }; //============================================================================== diff --git a/modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h b/modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h index f84a6d438b..16e016dd9f 100644 --- a/modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h +++ b/modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h @@ -58,7 +58,7 @@ struct HostPacketBuilder //============================================================================== bool deviceControlMessage (DeviceCommand command) noexcept { - if (! data.hasCapacity (MessageType::bits + DeviceCommand::bits)) + if (! data.hasCapacity ((int) MessageType::bits + (int) DeviceCommand::bits)) return false; writeMessageType (MessageFromHost::deviceCommandMessage); @@ -69,7 +69,7 @@ struct HostPacketBuilder //============================================================================== 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; writeMessageType (MessageFromHost::sharedDataChange); @@ -255,7 +255,7 @@ struct HostPacketBuilder bool addRequestFactorySyncMessage() { - if (! data.hasCapacity (MessageType::bits + ConfigCommand::bits)) + if (! data.hasCapacity ((int) MessageType::bits + (int) ConfigCommand::bits)) return false; writeMessageType (MessageFromHost::configMessage); @@ -266,7 +266,7 @@ struct HostPacketBuilder bool addRequestUserSyncMessage() { - if (! data.hasCapacity (MessageType::bits + ConfigCommand::bits)) + if (! data.hasCapacity ((int) MessageType::bits + (int) ConfigCommand::bits)) return false; writeMessageType (MessageFromHost::configMessage); diff --git a/modules/juce_blocks_basics/protocol/juce_HostPacketDecoder.h b/modules/juce_blocks_basics/protocol/juce_HostPacketDecoder.h index 7db57e2f85..0304105ebc 100644 --- a/modules/juce_blocks_basics/protocol/juce_HostPacketDecoder.h +++ b/modules/juce_blocks_basics/protocol/juce_HostPacketDecoder.h @@ -104,7 +104,7 @@ struct HostPacketDecoder 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! return false; @@ -220,7 +220,7 @@ struct HostPacketDecoder static bool handleTouch (Handler& handler, Packed7BitArrayReader& reader, TopologyIndex deviceIndex, 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! return false; @@ -240,7 +240,7 @@ struct HostPacketDecoder static bool handleTouchWithVelocity (Handler& handler, Packed7BitArrayReader& reader, TopologyIndex deviceIndex, 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! return false; @@ -269,7 +269,7 @@ struct HostPacketDecoder static bool handleButtonDownOrUp (Handler& handler, Packed7BitArrayReader& reader, TopologyIndex deviceIndex, 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! return false; @@ -285,7 +285,7 @@ struct HostPacketDecoder static bool handleCustomMessage (Handler& handler, Packed7BitArrayReader& reader, 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! return false; @@ -302,7 +302,7 @@ struct HostPacketDecoder 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! return false; diff --git a/modules/juce_core/xml/juce_XmlElement.cpp b/modules/juce_core/xml/juce_XmlElement.cpp index f5eacfccd8..1e3bdd4b29 100644 --- a/modules/juce_core/xml/juce_XmlElement.cpp +++ b/modules/juce_core/xml/juce_XmlElement.cpp @@ -188,10 +188,10 @@ namespace XmlOutputFunctions template struct Byte { - enum { v = Bit::v | Bit::v - | Bit::v | Bit::v - | Bit::v | Bit::v - | Bit::v | Bit::v }; + enum { v = (int) Bit::v | (int) Bit::v + | (int) Bit::v | (int) Bit::v + | (int) Bit::v | (int) Bit::v + | (int) Bit::v | (int) Bit::v }; }; static bool isLegal (uint32 c) noexcept diff --git a/modules/juce_gui_basics/layout/juce_Grid.cpp b/modules/juce_gui_basics/layout/juce_Grid.cpp index 25ae5f6748..b357411123 100644 --- a/modules/juce_gui_basics/layout/juce_Grid.cpp +++ b/modules/juce_gui_basics/layout/juce_Grid.cpp @@ -918,10 +918,10 @@ struct Grid::BoxAlignment // align and justify auto r = area; - if (item.width != GridItem::notAssigned) + if (item.width != (float) GridItem::notAssigned) r.setWidth (item.width); - if (item.height != GridItem::notAssigned) + if (item.height != (float) GridItem::notAssigned) r.setHeight (item.height); if (alignType == Grid::AlignItems::start && justifyType == Grid::JustifyItems::start)