Fixed build problems with GCC 6

This commit is contained in:
Javier Serrano Polo
2016-04-30 00:00:09 +02:00
parent 96a011d396
commit a06cb0126c
5 changed files with 29 additions and 22 deletions

View File

@@ -540,7 +540,8 @@ uint32_t multibandlimiter_audio_module::process(uint32_t offset, uint32_t numsam
} // process single strip with filter
// write multiband coefficient to buffer
buffer[pos] = std::min(*params[param_limit] / std::max(fabs(sum_left), fabs(sum_right)), 1.0);
float pre_buffer = *params[param_limit] / std::max(fabs(sum_left), fabs(sum_right));
buffer[pos] = std::min(pre_buffer, 1.0f);
for (int i = 0; i < strips; i++) {
// process gain reduction

View File

@@ -653,21 +653,21 @@ static void init_timetables( FM_OPL *OPL , int ARRATE , int DRRATE ) {
double rate;
/* make attack rate & decay rate tables */
for ( i = 0; i < 4; i++ ) OPL->AR_TABLE[i] = OPL->DR_TABLE[i] = 0; {
for (i = 4; i <= 60; i++) {
rate = OPL->freqbase; /* frequency rate */
if( i < 60 ) {
rate *= 1.0+(i&3)*0.25; /* b0-1 : x1 , x1.25 , x1.5 , x1.75 */
}
rate *= 1<<((i>>2)-1); /* b2-5 : shift bit */
rate *= (double)(EG_ENT<<ENV_BITS);
OPL->AR_TABLE[i] = rate / ARRATE;
OPL->DR_TABLE[i] = rate / DRRATE;
}
for ( i = 60; i < 75; i++ ) {
OPL->AR_TABLE[i] = EG_AED-1;
OPL->DR_TABLE[i] = OPL->DR_TABLE[60];
for ( i = 0; i < 4; i++ ) OPL->AR_TABLE[i] = OPL->DR_TABLE[i] = 0;
for (i = 4; i <= 60; i++) {
rate = OPL->freqbase; /* frequency rate */
if( i < 60 ) {
rate *= 1.0+(i&3)*0.25; /* b0-1 : x1 , x1.25 , x1.5 , x1.75 */
}
rate *= 1<<((i>>2)-1); /* b2-5 : shift bit */
rate *= (double)(EG_ENT<<ENV_BITS);
OPL->AR_TABLE[i] = rate / ARRATE;
OPL->DR_TABLE[i] = rate / DRRATE;
}
for ( i = 60; i < 75; i++ ) {
OPL->AR_TABLE[i] = EG_AED-1;
OPL->DR_TABLE[i] = OPL->DR_TABLE[60];
}
#if 0
for ( i = 0; i < 64 ; i++ ) { /* make for overflow area */
LOG(LOG_WAR,("rate %2d , ar %f ms , dr %f ms \n",i,
@@ -675,7 +675,6 @@ static void init_timetables( FM_OPL *OPL , int ARRATE , int DRRATE ) {
((double)(EG_ENT<<ENV_BITS) / OPL->DR_TABLE[i]) * (1000.0 / OPL->rate) ));
}
#endif
}
}
/* ---------- generic table initialize ---------- */

View File

@@ -204,12 +204,14 @@ if (event==FL_RELEASE){
if ((event==FL_DRAG)&&(currentpoint>=0)){
int ny=127-(int) (y_*127.0/h());
if (ny<0) ny=0;if (ny>127) ny=127;
if (ny<0) ny=0;
if (ny>127) ny=127;
env->Penvval[currentpoint]=ny;
int dx=(int)((x_-cpx)*0.1);
int newdt=cpdt+dx;
if (newdt<0) newdt=0;if (newdt>127) newdt=127;
if (newdt<0) newdt=0;
if (newdt>127) newdt=127;
if (currentpoint!=0) env->Penvdt[currentpoint]=newdt;
else env->Penvdt[currentpoint]=0;

View File

@@ -133,8 +133,10 @@ if ( (x_>=0)&&(x_<w()) && (y_>=0)&&(y_<h())){
if ((event==FL_PUSH)||(event==FL_DRAG)){
int leftbutton=1;
if (Fl::event_button()==FL_RIGHT_MOUSE) leftbutton=0;
if (x_<0) x_=0;if (y_<0) y_=0;
if (x_>=w()) x_=w();if (y_>=h()-1) y_=h()-1;
if (x_<0) x_=0;
if (y_<0) y_=0;
if (x_>=w()) x_=w();
if (y_>=h()-1) y_=h()-1;
if ((oldx<0)||(oldx==x_)){
int sn=(int)(x_*1.0/w()*N_RES_POINTS);

View File

@@ -154,7 +154,8 @@ float DrumSynth::waveform(float ph, int form)
case 1: w = (float)fabs(2.0f*(float)sin(fmod(0.5f*ph,TwoPi)))-1.f; break; //sine^2
case 2: while(ph<TwoPi) ph+=TwoPi;
w = 0.6366197f * (float)fmod(ph,TwoPi) - 1.f; //tri
if(w>1.f) w=2.f-w; break;
if(w>1.f) w=2.f-w;
break;
case 3: w = ph - TwoPi * (float)(int)(ph / TwoPi); //saw
w = (0.3183098f * w) - 1.f; break;
default: w = (sin(fmod(ph,TwoPi))>0.0)? 1.f: -1.f; break; //square
@@ -428,7 +429,9 @@ int DrumSynth::GetDSFileSamples(const char *dsfile, int16_t *&wave, int channels
strcpy(sec, "Distortion");
chkOn[5] = GetPrivateProfileInt(sec,"On",0,dsfile); DiON = chkOn[5];
DStep = 1 + GetPrivateProfileInt(sec,"Rate",0,dsfile);
if(DStep==7) DStep=20; if(DStep==6) DStep=10; if(DStep==5) DStep=8;
if(DStep==7) DStep=20;
if(DStep==6) DStep=10;
if(DStep==5) DStep=8;
clippoint = 32700;
DAtten = 1.0f;