Skip to content

Commit

Permalink
Merge pull request supercollider#127 from kisielk/warnings
Browse files Browse the repository at this point in the history
Fix some clang build warnings
  • Loading branch information
mossheim authored Mar 12, 2017
2 parents d6253b1 + 7bf228a commit c918be8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion source/BatUGens/BatPVUgens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
buf2 = world->mSndBufs + ibufnum2; \
} \
if (buf1->samples != buf2->samples) return; \
int numbins = buf1->samples - 2 >> 1;
int numbins = (buf1->samples - 2) >> 1;

InterfaceTable *ft;

Expand Down
4 changes: 2 additions & 2 deletions source/JoshUGens/JoshPVUGens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ void BinData_next(BinData *unit, int inNumSamples)
World *world = unit->mWorld;
if (ibufnum >= world->mNumSndBufs) ibufnum = 0;
SndBuf *buf = world->mSndBufs + ibufnum;
float fnumbins = (float)(buf->samples - 2 >> 1);
float fnumbins = (float)((buf->samples - 2) >> 1);
int bin = unit->m_bin;
SCPolarBuf *p = ToPolarApx(buf);
float sr = (float)unit->mWorld->mSampleRate; /* we need the audio rate... calc it here */
Expand Down Expand Up @@ -1758,7 +1758,7 @@ float wrapphase(float phase){
unit->m_buf = world->mSndBufs + bufnum; \
} \
SndBuf *buf = unit->m_buf; \
int numbins = buf->samples - 2 >> 1;
int numbins = (buf->samples - 2) >> 1;


#define PV_DATA_INIT_READ \
Expand Down
12 changes: 6 additions & 6 deletions source/MCLDUGens/MCLDFFTUGens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ struct PV_ExtractRepeat : Unit {
} else { \
buf = world->mSndBufs + ibufnum; \
} \
int numbins = buf->samples - 2 >> 1;
int numbins = (buf->samples - 2) >> 1;

// Same as above; but with "output2" as well as "output"
#define FFTAnalyser_GET_BUF_TWOOUTS \
Expand All @@ -179,7 +179,7 @@ struct PV_ExtractRepeat : Unit {
} else { \
buf = world->mSndBufs + ibufnum; \
} \
int numbins = buf->samples - 2 >> 1;
int numbins = (buf->samples - 2) >> 1;

// As above; but for operation on two input buffers
#define FFTAnalyser_GET_BUF2 \
Expand Down Expand Up @@ -214,7 +214,7 @@ struct PV_ExtractRepeat : Unit {
buf2 = world->mSndBufs + ibufnum2; \
} \
if (buf1->samples != buf2->samples) return; \
int numbins = buf1->samples - 2 >> 1;
int numbins = (buf1->samples - 2) >> 1;

// Copied from FFT_UGens.cpp
#define MAKE_TEMP_BUF \
Expand Down Expand Up @@ -426,7 +426,7 @@ void FFTSubbandPower_next(FFTSubbandPower *unit, int inNumSamples)
} else {
buf = world->mSndBufs + ibufnum;
}
int numbins = buf->samples - 2 >> 1;
int numbins = (buf->samples - 2) >> 1;
// End: Multi-output equiv of FFTAnalyser_GET_BUF

int scalemode = unit->m_scalemode;
Expand Down Expand Up @@ -1108,7 +1108,7 @@ void PV_Whiten_next(PV_Whiten *unit, int inNumSamples){
} else {
buf2 = world->mSndBufs + ibufnum2;
}
int numbins = buf1->samples - 2 >> 1;
int numbins = (buf1->samples - 2) >> 1;
// Print("\nibufnum1: %d; ibufnum2: %d", ibufnum1, ibufnum2);
// if (buf1->samples != buf2->samples) return;

Expand Down Expand Up @@ -1213,7 +1213,7 @@ void FFTSubbandFlatness_next(FFTSubbandFlatness *unit, int inNumSamples)
} else {
buf = world->mSndBufs + ibufnum;
}
int numbins = buf->samples - 2 >> 1;
int numbins = (buf->samples - 2) >> 1;
// End: Multi-output equiv of FFTAnalyser_GET_BUF

// Now we create the integer lookup list, if it doesn't already exist
Expand Down
4 changes: 2 additions & 2 deletions source/NCAnalysisUGens/SMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ SCPolarBuf* ToPolarApx2(float* buf, int windowsize=1024)
//assumes it already is complex format
//if (buf->coord == coord_Complex) {
SCComplexBuf* p = (SCComplexBuf*)buf;
int numbins = windowsize - 2 >> 1;
int numbins = (windowsize - 2) >> 1;
for (int i=0; i<numbins; ++i) {
p->bin[i].ToPolarApxInPlace();
}
Expand All @@ -102,7 +102,7 @@ SCComplexBuf* ToComplexApx2(float *buf, int windowsize=1024)
{
//if (buf->coord == coord_Polar) {
SCPolarBuf* p = (SCPolarBuf*)buf; //->data;
int numbins = windowsize - 2 >> 1;
int numbins = (windowsize - 2) >> 1;
for (int i=0; i<numbins; ++i) {
p->bin[i].ToComplexApxInPlace();
}
Expand Down

0 comments on commit c918be8

Please sign in to comment.