diff --git a/JuceLibraryCode/modules/juce_graphics/image_formats/jpglib/jinclude.h b/JuceLibraryCode/modules/juce_graphics/image_formats/jpglib/jinclude.h index ab660087df5cc8abdad13da2de8c96290c432910..bccfd54422eb5139048dd22ec837d755f5b7e71e 100755 --- a/JuceLibraryCode/modules/juce_graphics/image_formats/jpglib/jinclude.h +++ b/JuceLibraryCode/modules/juce_graphics/image_formats/jpglib/jinclude.h @@ -180,11 +180,16 @@ static const int extend_test[16] = /* entry n is 2**(n-1) */ { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; +#define SHIFTED_BITS_PLUS_ONE(n) (int) (((unsigned int) -1) << n) + 1 + static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ - { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, - ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, - ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, - ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; + { 0, + SHIFTED_BITS_PLUS_ONE (1), SHIFTED_BITS_PLUS_ONE (2), SHIFTED_BITS_PLUS_ONE (3), SHIFTED_BITS_PLUS_ONE (4), + SHIFTED_BITS_PLUS_ONE (5), SHIFTED_BITS_PLUS_ONE (6), SHIFTED_BITS_PLUS_ONE (7), SHIFTED_BITS_PLUS_ONE (8), + SHIFTED_BITS_PLUS_ONE (9), SHIFTED_BITS_PLUS_ONE (10), SHIFTED_BITS_PLUS_ONE (11), SHIFTED_BITS_PLUS_ONE (12), + SHIFTED_BITS_PLUS_ONE (13), SHIFTED_BITS_PLUS_ONE (14), SHIFTED_BITS_PLUS_ONE (15) }; + +#undef SHIFTED_BITS_PLUS_ONE #endif /* AVOID_TABLES */ diff --git a/Source/Plugins/NetworkEvents/NetworkEvents.cpp b/Source/Plugins/NetworkEvents/NetworkEvents.cpp index 0dcfa935322079232e0d4e0a35be12e6a0195b65..0982e85d85acd260b2329ba808304b55f513da87 100644 --- a/Source/Plugins/NetworkEvents/NetworkEvents.cpp +++ b/Source/Plugins/NetworkEvents/NetworkEvents.cpp @@ -298,7 +298,7 @@ void NetworkEvents::postTimestamppedStringToMidiBuffer(StringTS s, MidiBuffer& e (uint8) s.len+1,//+8, msg_with_ts); - delete msg_with_ts; + delete[] msg_with_ts; } void NetworkEvents::simulateStopRecord() @@ -594,7 +594,7 @@ void NetworkEvents::run() zmq_close(responder); - delete buffer; + delete[] buffer; threadRunning = false; return; #endif diff --git a/Source/Plugins/SpikeSorter/SpikeSortBoxes.cpp b/Source/Plugins/SpikeSorter/SpikeSortBoxes.cpp index 835c972e47685d400b612d3151904d45a31126c0..6158a63fa29e45212bb1ab8656e6054e83e9e9c7 100644 --- a/Source/Plugins/SpikeSorter/SpikeSortBoxes.cpp +++ b/Source/Plugins/SpikeSorter/SpikeSortBoxes.cpp @@ -2029,7 +2029,7 @@ void PCAjob::computeCov() cov[j][i] = sum / (dim-1); } } - delete mean; + delete[] mean; // delete covariances //for (int k = 0; k < dim; k++) diff --git a/Source/Processors/DataThreads/RhythmNode/RHD2000Editor.cpp b/Source/Processors/DataThreads/RhythmNode/RHD2000Editor.cpp index f2e842cda2573d009c5b8cfcfcd152a089126f4e..cc87903c33c9797b58dce989e256fa5f7c66161e 100644 --- a/Source/Processors/DataThreads/RhythmNode/RHD2000Editor.cpp +++ b/Source/Processors/DataThreads/RhythmNode/RHD2000Editor.cpp @@ -1437,10 +1437,10 @@ void AudioInterface::paint(Graphics& g) // Clock Divider options ClockDivideInterface::ClockDivideInterface(RHD2000Thread* board_, RHD2000Editor* editor_) : - board(board_) - , editor(editor_) - , name("Clock Divider") + name("Clock Divider") , lastDivideRatioString("1") + , board(board_) + , editor(editor_) , actualDivideRatio(1) { diff --git a/Source/Processors/Dsp/LinearSmoothedValueAtomic.cpp b/Source/Processors/Dsp/LinearSmoothedValueAtomic.cpp index d9b83e757650e8c270f36904760524967d384b15..7da6842e03a3a6882407b605a1990992ac77dc94 100644 --- a/Source/Processors/Dsp/LinearSmoothedValueAtomic.cpp +++ b/Source/Processors/Dsp/LinearSmoothedValueAtomic.cpp @@ -28,72 +28,3 @@ // Explicit instantiations template class LinearSmoothedValueAtomic<float>; template class LinearSmoothedValueAtomic<double>; - - -template <typename FloatType> -LinearSmoothedValueAtomic<FloatType>::LinearSmoothedValueAtomic() noexcept - : currentValue (0) - , target (0) - , step (0) - , countdown (0) - , stepsToTarget (0) -{ -} - - -template <typename FloatType> -LinearSmoothedValueAtomic<FloatType>::LinearSmoothedValueAtomic (FloatType initialValue) noexcept - - : currentValue (initialValue) - , target (initialValue) - , step (0) - , countdown (0) - , stepsToTarget (0) -{ -} - - -template<typename FloatType> -void LinearSmoothedValueAtomic<FloatType>::reset (double sampleRate, double rampLengthInSeconds) noexcept -{ - jassert (sampleRate > 0 && rampLengthInSeconds >= 0); - stepsToTarget = (int) std::floor (rampLengthInSeconds * sampleRate); - currentValue = target; - countdown = 0; -} - - -template<typename FloatType> -void LinearSmoothedValueAtomic<FloatType>::setValue (FloatType newValue) noexcept -{ - target.store (newValue); -} - - -template<typename FloatType> -void LinearSmoothedValueAtomic<FloatType>::updateTarget() noexcept -{ - FloatType newTarget = target.load(); - if (newTarget != currentTarget) - { - currentTarget = newTarget; - countdown = stepsToTarget; - - if (countdown <= 0) - currentValue = currentTarget; - else - step = (currentTarget - currentValue) / (FloatType) countdown; - } -} - - -template<typename FloatType> -FloatType LinearSmoothedValueAtomic<FloatType>::getNextValue() noexcept -{ - if (countdown <= 0) - return currentTarget; - - --countdown; - currentValue += step; - return currentValue; -} diff --git a/Source/Processors/Dsp/LinearSmoothedValueAtomic.h b/Source/Processors/Dsp/LinearSmoothedValueAtomic.h index adf81b478c6528601e98ef7bf55c4e1e94ff3fe3..b936f12eec2ee92bd699364bed175a002d2d393e 100644 --- a/Source/Processors/Dsp/LinearSmoothedValueAtomic.h +++ b/Source/Processors/Dsp/LinearSmoothedValueAtomic.h @@ -86,4 +86,72 @@ private: }; +template <typename FloatType> +LinearSmoothedValueAtomic<FloatType>::LinearSmoothedValueAtomic() noexcept + : target (0) + , currentValue (0) + , step (0) + , countdown (0) + , stepsToTarget (0) +{ +} + + +template <typename FloatType> +LinearSmoothedValueAtomic<FloatType>::LinearSmoothedValueAtomic (FloatType initialValue) noexcept + : target (initialValue) + , currentValue (initialValue) + , step (0) + , countdown (0) + , stepsToTarget (0) +{ +} + + +template<typename FloatType> +void LinearSmoothedValueAtomic<FloatType>::reset (double sampleRate, double rampLengthInSeconds) noexcept +{ + jassert (sampleRate > 0 && rampLengthInSeconds >= 0); + stepsToTarget = (int) std::floor (rampLengthInSeconds * sampleRate); + currentValue = target; + countdown = 0; +} + + +template<typename FloatType> +void LinearSmoothedValueAtomic<FloatType>::setValue (FloatType newValue) noexcept +{ + target.store (newValue); +} + + +template<typename FloatType> +void LinearSmoothedValueAtomic<FloatType>::updateTarget() noexcept +{ + FloatType newTarget = target.load(); + if (newTarget != currentTarget) + { + currentTarget = newTarget; + countdown = stepsToTarget; + + if (countdown <= 0) + currentValue = currentTarget; + else + step = (currentTarget - currentValue) / (FloatType) countdown; + } +} + + +template<typename FloatType> +FloatType LinearSmoothedValueAtomic<FloatType>::getNextValue() noexcept +{ + if (countdown <= 0) + return currentTarget; + + --countdown; + currentValue += step; + return currentValue; +} + + #endif // JUCE_LINEARSMOOTHEDVALUE_H_INCLUDED diff --git a/Source/Processors/Editors/ChannelSelector.cpp b/Source/Processors/Editors/ChannelSelector.cpp index 6caf21b16e690bfc83dfc596f8cbe530dbd5e9a6..70d4cdec49b7ad7a4a146beb9b9b991845cf823f 100755 --- a/Source/Processors/Editors/ChannelSelector.cpp +++ b/Source/Processors/Editors/ChannelSelector.cpp @@ -684,7 +684,7 @@ void ChannelSelector::buttonClicked(Button* button) selectButtonParam->removeListener(this); deselectButtonParam->removeListener(this); std::vector<int> getBoxList; - int fa, lim, comd, i, j; + int fa, lim, comd, i; getBoxList = paramBox->getBoxInfo(parameterButtons.size()); if (getBoxList.size() < 3) { @@ -712,7 +712,7 @@ void ChannelSelector::buttonClicked(Button* button) selectButtonRecord->removeListener(this); deselectButtonRecord->removeListener(this); std::vector<int> getBoxList; - int fa, lim, comd, i, j; + int fa, lim, comd, i; getBoxList = recordBox->getBoxInfo(recordButtons.size()); if (getBoxList.size() < 3) { @@ -740,7 +740,7 @@ void ChannelSelector::buttonClicked(Button* button) selectButtonAudio->removeListener(this); deselectButtonAudio->removeListener(this); std::vector<int> getBoxList; - int fa, lim, comd, i, j; + int fa, lim, comd, i; getBoxList = audioBox->getBoxInfo(audioButtons.size()); if (getBoxList.size() < 3) { @@ -768,7 +768,7 @@ void ChannelSelector::buttonClicked(Button* button) selectButtonParam->removeListener(this); deselectButtonParam->removeListener(this); std::vector<int> getBoxList; - int fa, lim, comd, i, j; + int fa, lim, comd, i; getBoxList = paramBox->getBoxInfo(parameterButtons.size()); if (getBoxList.size() < 3) { @@ -796,7 +796,7 @@ void ChannelSelector::buttonClicked(Button* button) selectButtonRecord->removeListener(this); deselectButtonRecord->removeListener(this); std::vector<int> getBoxList; - int fa, lim, comd, i, j; + int fa, lim, comd, i; getBoxList = recordBox->getBoxInfo(recordButtons.size()); if (getBoxList.size() < 3) { @@ -824,7 +824,7 @@ void ChannelSelector::buttonClicked(Button* button) selectButtonAudio->removeListener(this); deselectButtonAudio->removeListener(this); std::vector<int> getBoxList; - int fa, lim, comd, i, j; + int fa, lim, comd, i; getBoxList = audioBox->getBoxInfo(audioButtons.size()); if (getBoxList.size() < 3) { @@ -1239,7 +1239,7 @@ ChannelSelectorBox::~ChannelSelectorBox() int ChannelSelectorBox::convertToInteger(std::string s) { char ar[20]; - int i, j, k = 0; + int i, k = 0; for (i = 0; i < s.size(); i++) { if (s[i] >= 48 && s[i] <= 57)