Skip to content

Commit e01adf1

Browse files
committed
More type-conversion fixes
1 parent 483c107 commit e01adf1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

include/signalsmith-basics/crunch.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct CrunchSTFX : public BaseEffect {
6868
config.auxInputs.resize(0);
6969
config.auxOutputs.resize(0);
7070

71-
oversampler.resize(channels, config.maxBlockSize, oversampleHalfLatency, std::min(0.45, 21000/config.sampleRate));
71+
oversampler.resize(int(channels), int(config.maxBlockSize), oversampleHalfLatency, std::min(0.45, 21000/config.sampleRate));
7272
gainshapers.resize(channels);
7373
cutFilters.resize(channels);
7474
toneFilters.resize(channels);
@@ -103,7 +103,7 @@ struct CrunchSTFX : public BaseEffect {
103103
}
104104
auto outputGain = block.smooth(outputGainFrom, outputGainTo);
105105

106-
for (int c = 0; c < channels; ++c) {
106+
for (size_t c = 0; c < channels; ++c) {
107107
auto &cutFilter = cutFilters[c];
108108
cutFilter.highpass(cutHz/(config.sampleRate*2));
109109
auto &gainshaper = gainshapers[c];
@@ -113,21 +113,21 @@ struct CrunchSTFX : public BaseEffect {
113113
auto &outputFilter = outputFilters[c];
114114
outputFilter.highpass((10 + 40*fuzz)/(config.sampleRate*2)); // more aggressive when fuzz is enabled, since it's very asymmetrical
115115

116-
oversampler.upChannel(c, io.input[c], block.length);
116+
oversampler.upChannel(c, io.input[c], int(block.length));
117117
Sample *samples = oversampler[c];
118-
for (int i = 0; i < block.length*2; ++i) {
118+
for (size_t i = 0; i < block.length*2; ++i) {
119119
double hi = i*0.5;
120120
Sample x = samples[i]*inputGain.at(hi);
121121
Sample gain = gainshaper(cutFilter(x))*outputGain.at(hi);
122122
Sample y = x*toneFilter(gain);
123123
samples[i] = outputFilter(y);
124124
}
125-
oversampler.downChannel(c, io.output[c], block.length);
125+
oversampler.downChannel(c, io.output[c], int(block.length));
126126
}
127127
}
128128

129129
private:
130-
int channels = 0;
130+
size_t channels = 0;
131131
signalsmith::rates::Oversampler2xFIR<Sample> oversampler;
132132
struct GainshapeADAA {
133133
Sample prevX = 0, prevIntegral = 0;

include/signalsmith-basics/freq-shifter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct FreqShifterSTFX : public BaseEffect {
6060
config.auxInputs.resize(0);
6161
config.auxOutputs.resize(0);
6262

63-
hilbert = {Sample(config.sampleRate), channels};
63+
hilbert = {Sample(config.sampleRate), int(channels)};
6464
}
6565

6666
void reset() {

include/signalsmith-basics/limiter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ struct LimiterSTFX : public BaseEffect {
190190
io.output[c][i] = delayed*gain;
191191
}
192192
}
193-
multiBuffer += block.length;
193+
multiBuffer += int(block.length);
194194
}
195195

196196
private:

0 commit comments

Comments
 (0)