Skip to content

Commit c45b832

Browse files
committed
Merge pull request #20 from cstawarz/development
Fix CAR plugin loading on OS X, compiler warnings
2 parents 0fb8ffa + 723b328 commit c45b832

7 files changed

Lines changed: 90 additions & 86 deletions

File tree

JuceLibraryCode/modules/juce_graphics/image_formats/jpglib/jinclude.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,16 @@ static const int extend_test[16] = /* entry n is 2**(n-1) */
180180
{ 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
181181
0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
182182

183+
#define SHIFTED_BITS_PLUS_ONE(n) (int) (((unsigned int) -1) << n) + 1
184+
183185
static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
184-
{ 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
185-
((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
186-
((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
187-
((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
186+
{ 0,
187+
SHIFTED_BITS_PLUS_ONE (1), SHIFTED_BITS_PLUS_ONE (2), SHIFTED_BITS_PLUS_ONE (3), SHIFTED_BITS_PLUS_ONE (4),
188+
SHIFTED_BITS_PLUS_ONE (5), SHIFTED_BITS_PLUS_ONE (6), SHIFTED_BITS_PLUS_ONE (7), SHIFTED_BITS_PLUS_ONE (8),
189+
SHIFTED_BITS_PLUS_ONE (9), SHIFTED_BITS_PLUS_ONE (10), SHIFTED_BITS_PLUS_ONE (11), SHIFTED_BITS_PLUS_ONE (12),
190+
SHIFTED_BITS_PLUS_ONE (13), SHIFTED_BITS_PLUS_ONE (14), SHIFTED_BITS_PLUS_ONE (15) };
191+
192+
#undef SHIFTED_BITS_PLUS_ONE
188193

189194
#endif /* AVOID_TABLES */
190195

Source/Plugins/NetworkEvents/NetworkEvents.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void NetworkEvents::postTimestamppedStringToMidiBuffer(StringTS s, MidiBuffer& e
298298
(uint8) s.len+1,//+8,
299299
msg_with_ts);
300300

301-
delete msg_with_ts;
301+
delete[] msg_with_ts;
302302
}
303303

304304
void NetworkEvents::simulateStopRecord()
@@ -594,7 +594,7 @@ void NetworkEvents::run()
594594

595595

596596
zmq_close(responder);
597-
delete buffer;
597+
delete[] buffer;
598598
threadRunning = false;
599599
return;
600600
#endif

Source/Plugins/SpikeSorter/SpikeSortBoxes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2029,7 +2029,7 @@ void PCAjob::computeCov()
20292029
cov[j][i] = sum / (dim-1);
20302030
}
20312031
}
2032-
delete mean;
2032+
delete[] mean;
20332033

20342034
// delete covariances
20352035
//for (int k = 0; k < dim; k++)

Source/Processors/DataThreads/RhythmNode/RHD2000Editor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,10 +1437,10 @@ void AudioInterface::paint(Graphics& g)
14371437
// Clock Divider options
14381438
ClockDivideInterface::ClockDivideInterface(RHD2000Thread* board_,
14391439
RHD2000Editor* editor_) :
1440-
board(board_)
1441-
, editor(editor_)
1442-
, name("Clock Divider")
1440+
name("Clock Divider")
14431441
, lastDivideRatioString("1")
1442+
, board(board_)
1443+
, editor(editor_)
14441444
, actualDivideRatio(1)
14451445

14461446
{

Source/Processors/Dsp/LinearSmoothedValueAtomic.cpp

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -28,72 +28,3 @@
2828
// Explicit instantiations
2929
template class LinearSmoothedValueAtomic<float>;
3030
template class LinearSmoothedValueAtomic<double>;
31-
32-
33-
template <typename FloatType>
34-
LinearSmoothedValueAtomic<FloatType>::LinearSmoothedValueAtomic() noexcept
35-
: currentValue (0)
36-
, target (0)
37-
, step (0)
38-
, countdown (0)
39-
, stepsToTarget (0)
40-
{
41-
}
42-
43-
44-
template <typename FloatType>
45-
LinearSmoothedValueAtomic<FloatType>::LinearSmoothedValueAtomic (FloatType initialValue) noexcept
46-
47-
: currentValue (initialValue)
48-
, target (initialValue)
49-
, step (0)
50-
, countdown (0)
51-
, stepsToTarget (0)
52-
{
53-
}
54-
55-
56-
template<typename FloatType>
57-
void LinearSmoothedValueAtomic<FloatType>::reset (double sampleRate, double rampLengthInSeconds) noexcept
58-
{
59-
jassert (sampleRate > 0 && rampLengthInSeconds >= 0);
60-
stepsToTarget = (int) std::floor (rampLengthInSeconds * sampleRate);
61-
currentValue = target;
62-
countdown = 0;
63-
}
64-
65-
66-
template<typename FloatType>
67-
void LinearSmoothedValueAtomic<FloatType>::setValue (FloatType newValue) noexcept
68-
{
69-
target.store (newValue);
70-
}
71-
72-
73-
template<typename FloatType>
74-
void LinearSmoothedValueAtomic<FloatType>::updateTarget() noexcept
75-
{
76-
FloatType newTarget = target.load();
77-
if (newTarget != currentTarget)
78-
{
79-
currentTarget = newTarget;
80-
countdown = stepsToTarget;
81-
82-
if (countdown <= 0)
83-
currentValue = currentTarget;
84-
else
85-
step = (currentTarget - currentValue) / (FloatType) countdown;
86-
}
87-
}
88-
89-
90-
template<typename FloatType>
91-
FloatType LinearSmoothedValueAtomic<FloatType>::getNextValue() noexcept
92-
{
93-
if (countdown <= 0)
94-
return currentTarget;
95-
96-
--countdown;
97-
currentValue += step;
98-
return currentValue;
99-
}

Source/Processors/Dsp/LinearSmoothedValueAtomic.h

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,72 @@ class PLUGIN_API LinearSmoothedValueAtomic
8686
};
8787

8888

89+
template <typename FloatType>
90+
LinearSmoothedValueAtomic<FloatType>::LinearSmoothedValueAtomic() noexcept
91+
: target (0)
92+
, currentValue (0)
93+
, step (0)
94+
, countdown (0)
95+
, stepsToTarget (0)
96+
{
97+
}
98+
99+
100+
template <typename FloatType>
101+
LinearSmoothedValueAtomic<FloatType>::LinearSmoothedValueAtomic (FloatType initialValue) noexcept
102+
: target (initialValue)
103+
, currentValue (initialValue)
104+
, step (0)
105+
, countdown (0)
106+
, stepsToTarget (0)
107+
{
108+
}
109+
110+
111+
template<typename FloatType>
112+
void LinearSmoothedValueAtomic<FloatType>::reset (double sampleRate, double rampLengthInSeconds) noexcept
113+
{
114+
jassert (sampleRate > 0 && rampLengthInSeconds >= 0);
115+
stepsToTarget = (int) std::floor (rampLengthInSeconds * sampleRate);
116+
currentValue = target;
117+
countdown = 0;
118+
}
119+
120+
121+
template<typename FloatType>
122+
void LinearSmoothedValueAtomic<FloatType>::setValue (FloatType newValue) noexcept
123+
{
124+
target.store (newValue);
125+
}
126+
127+
128+
template<typename FloatType>
129+
void LinearSmoothedValueAtomic<FloatType>::updateTarget() noexcept
130+
{
131+
FloatType newTarget = target.load();
132+
if (newTarget != currentTarget)
133+
{
134+
currentTarget = newTarget;
135+
countdown = stepsToTarget;
136+
137+
if (countdown <= 0)
138+
currentValue = currentTarget;
139+
else
140+
step = (currentTarget - currentValue) / (FloatType) countdown;
141+
}
142+
}
143+
144+
145+
template<typename FloatType>
146+
FloatType LinearSmoothedValueAtomic<FloatType>::getNextValue() noexcept
147+
{
148+
if (countdown <= 0)
149+
return currentTarget;
150+
151+
--countdown;
152+
currentValue += step;
153+
return currentValue;
154+
}
155+
156+
89157
#endif // JUCE_LINEARSMOOTHEDVALUE_H_INCLUDED

Source/Processors/Editors/ChannelSelector.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ void ChannelSelector::buttonClicked(Button* button)
684684
selectButtonParam->removeListener(this);
685685
deselectButtonParam->removeListener(this);
686686
std::vector<int> getBoxList;
687-
int fa, lim, comd, i, j;
687+
int fa, lim, comd, i;
688688
getBoxList = paramBox->getBoxInfo(parameterButtons.size());
689689
if (getBoxList.size() < 3)
690690
{
@@ -712,7 +712,7 @@ void ChannelSelector::buttonClicked(Button* button)
712712
selectButtonRecord->removeListener(this);
713713
deselectButtonRecord->removeListener(this);
714714
std::vector<int> getBoxList;
715-
int fa, lim, comd, i, j;
715+
int fa, lim, comd, i;
716716
getBoxList = recordBox->getBoxInfo(recordButtons.size());
717717
if (getBoxList.size() < 3)
718718
{
@@ -740,7 +740,7 @@ void ChannelSelector::buttonClicked(Button* button)
740740
selectButtonAudio->removeListener(this);
741741
deselectButtonAudio->removeListener(this);
742742
std::vector<int> getBoxList;
743-
int fa, lim, comd, i, j;
743+
int fa, lim, comd, i;
744744
getBoxList = audioBox->getBoxInfo(audioButtons.size());
745745
if (getBoxList.size() < 3)
746746
{
@@ -768,7 +768,7 @@ void ChannelSelector::buttonClicked(Button* button)
768768
selectButtonParam->removeListener(this);
769769
deselectButtonParam->removeListener(this);
770770
std::vector<int> getBoxList;
771-
int fa, lim, comd, i, j;
771+
int fa, lim, comd, i;
772772
getBoxList = paramBox->getBoxInfo(parameterButtons.size());
773773
if (getBoxList.size() < 3)
774774
{
@@ -796,7 +796,7 @@ void ChannelSelector::buttonClicked(Button* button)
796796
selectButtonRecord->removeListener(this);
797797
deselectButtonRecord->removeListener(this);
798798
std::vector<int> getBoxList;
799-
int fa, lim, comd, i, j;
799+
int fa, lim, comd, i;
800800
getBoxList = recordBox->getBoxInfo(recordButtons.size());
801801
if (getBoxList.size() < 3)
802802
{
@@ -824,7 +824,7 @@ void ChannelSelector::buttonClicked(Button* button)
824824
selectButtonAudio->removeListener(this);
825825
deselectButtonAudio->removeListener(this);
826826
std::vector<int> getBoxList;
827-
int fa, lim, comd, i, j;
827+
int fa, lim, comd, i;
828828
getBoxList = audioBox->getBoxInfo(audioButtons.size());
829829
if (getBoxList.size() < 3)
830830
{
@@ -1239,7 +1239,7 @@ ChannelSelectorBox::~ChannelSelectorBox()
12391239
int ChannelSelectorBox::convertToInteger(std::string s)
12401240
{
12411241
char ar[20];
1242-
int i, j, k = 0;
1242+
int i, k = 0;
12431243
for (i = 0; i < s.size(); i++)
12441244
{
12451245
if (s[i] >= 48 && s[i] <= 57)

0 commit comments

Comments
 (0)