+2004-02-17 Takashi Iwai <tiwai@suse.de>
+
+ * interface/alsaseq_c.c,gtk_i.c,ncurs_c.c,soundspec.c,tk_c.c,
+ x_wrdwindow.c, libunimod/mloader.c, timidity/aiff_a.c,alsa_a.c,
+ common.c,effect.c,freq.c,instrum.c,jack_a.c,mfi.c,mix.c,
+ mod2midi.c,oss_a.c,playmidi.c,rcp.c,readmidi.c,resample.c,
+ reverb.c,smplfile.c,tables.c,timidity.c,vorbis_a.c:
+ Fix compile warnings with the recent gcc.
+
2004-02-17 Kouji 'kekyo' Suzuki <k@kekyo.net>
* configs/msc7-project.zip:
#include "timer.h"
+void readmidi_read_init(void);
+
#define MAX_PORTS 16
#define TICKTIME_HZ 100
static void alsa_set_timestamping(struct seq_context *ctxp, int port)
{
#if HAVE_SND_SEQ_PORT_INFO_SET_TIMESTAMPING
- int q;
+ int q = 0;
snd_seq_port_info_t *pinfo;
if (ctxp->queue < 0) {
if (parse_sysex_event(aevp->data.ext.ptr + 1,
aevp->data.ext.len - 1, &ev))
seq_play_event(&ev);
- if (ne = parse_sysex_event_multi(aevp->data.ext.ptr + 1,
- aevp->data.ext.len - 1, evm))
+ if ((ne = parse_sysex_event_multi(aevp->data.ext.ptr + 1,
+ aevp->data.ext.len - 1, evm)) > 0)
for (i = 0; i < ne; i++)
seq_play_event(&evm[i]);
break;
static void
playlist_cb(GtkWidget *widget, guint data)
{
- gchar *pldir, *plpatt;
+ const gchar *pldir;
+ gchar *plpatt;
if( ! plfilesel ) {
plfilesel = gtk_file_selection_new("");
{
char filename[255], title[255];
char *pc;
- int i;
gtk_pipe_string_read(filename);
lastoffset = ko;
if (ctl_ncurs_mode != NCURS_MODE_TRACE)
return;
- adj = tk + 8 & 0x20, tk = (tk + 8) % 32 - 8;
+ adj = (tk + 8) & 0x20, tk = (tk + 8) % 32 - 8;
i = tk + ((tk < 8) ? 7 : -6);
if (ko > 0)
for (j = 0; j < ko; j++)
return k;
}
+#if 0
static int highbit(unsigned long ul)
{
int i; unsigned long hb;
;
return i;
}
+#endif
static unsigned long AllocRGBColor(
Display *disp,
return TCL_ERROR;
}
- Tcl_CreateCommand(interp, "TraceCreate", TraceCreate,
+ Tcl_CreateCommand(interp, "TraceCreate", (Tcl_CmdProc*) TraceCreate,
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
- Tcl_CreateCommand(interp, "TraceUpdate", TraceUpdate,
+ Tcl_CreateCommand(interp, "TraceUpdate", (Tcl_CmdProc*) TraceUpdate,
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
- Tcl_CreateCommand(interp, "TraceReset", TraceReset,
+ Tcl_CreateCommand(interp, "TraceReset", (Tcl_CmdProc*) TraceReset,
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
- Tcl_CreateCommand(interp, "ExitAll", ExitAll,
+ Tcl_CreateCommand(interp, "ExitAll", (Tcl_CmdProc*) ExitAll,
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
- Tcl_CreateCommand(interp, "TraceUpdate", TraceUpdate,
+ Tcl_CreateCommand(interp, "TraceUpdate", (Tcl_CmdProc*) TraceUpdate,
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
return TCL_OK;
}
kill(getppid(), SIGTERM);
for (;;)
sleep(1000);
+ return TCL_OK;
}
/* evaluate Tcl script */
return my_interp->result;
}
-static char *v_get2(char *v1, char *v2)
+static const char *v_get2(const char *v1, const char *v2)
{
return Tcl_GetVar2(my_interp, v1, v2, 0);
}
static int TraceUpdate(ClientData clientData, Tcl_Interp *interp,
int argc, char *argv[])
{
- char *playing = v_get2("Stat", "Playing");
+ const char *playing = v_get2("Stat", "Playing");
if (playing && *playing != '0') {
if (Panel->reset_panel) {
v_eval("TraceReset");
}else if(prevattr&CATTR_BGCOLORED){
int tcol;
tcol=(prevattr&CATTR_TXTCOL_MASK)>>CATTR_TXTCOL_MASK_SHIFT;
- DrawStringFunc=(DrawStringFunc==XDrawString)?DrawReverseString:DrawReverseString16;
+ DrawStringFunc=(DrawStringFunc==XDrawString)?(int(*)())DrawReverseString:(int(*)())DrawReverseString16;
XSetForeground(mywin.d,mywin.gc,
mywin.txtcolor[tcol].pixel);
}
}
ITPACK;
+#ifdef MAX_SAMPLESPACE
static void SL_HalveSample (SAMPLOAD *);
+#endif
static void SL_Sample8to16 (SAMPLOAD *);
static void SL_Sample16to8 (SAMPLOAD *);
static void SL_SampleSigned (SAMPLOAD *);
}
/* Returns the total amount of memory required by the musiclist queue. */
+#ifdef MAX_SAMPLESPACE
static ULONG
SampleTotal ()
{
{
return (s->sample->speed / (s->scalefactor ? s->scalefactor : 1));
}
+#endif
BOOL
SL_LoadSamples (void)
s->sample->flags = (s->sample->flags & ~SF_FORMATMASK) | s->outfmt;
}
+#ifdef MAX_SAMPLESPACE
void
SL_HalveSample (SAMPLOAD * s)
{
s->sample->loopstart = s->loopstart / s->scalefactor;
s->sample->loopend = s->loopend / s->scalefactor;
}
+#endif
CHAR *
static int aiff_output_open(const char *fname)
{
int t, compressed;
- const char *compressionName;
+ const char *compressionName = "";
char compressionNamePad;
uint8 compressionNameLength;
#if ALSA_LIB > 5
static char *alsa_device_name(void)
{
- static char name[32];
if (dpm.name && *dpm.name)
return dpm.name;
else
int orig_rate = dpm.rate;
int ret_val = 0;
int tmp, frags, r, pfds;
- int buf_time, rate;
+ int rate;
snd_pcm_hw_params_t *pinfo;
snd_pcm_sw_params_t *swpinfo;
static int acntl(int request, void *arg)
{
- int i;
snd_pcm_status_t *status;
snd_pcm_sframes_t delay;
if(decompress)
{
static char *decompressor_list[] = DECOMPRESSOR_LIST, **dec;
- char tmp[1024], *tmpname;
+ char tmp[1024];
/* Check if it's a compressed file */
for(dec = decompressor_list; *dec; dec += 2)
if(decompress == 2)
{
static char *decompressor_list[] = PATCH_CONVERTERS, **dec;
- char tmp[1024], *tmpname;
+ char tmp[1024];
/* Check if it's a compressed file */
for(dec = decompressor_list; *dec; dec += 2)
do_mono_reverb(buf, count);
/* for static reverb / chorus level */
if (opt_reverb_control == 2 || opt_reverb_control == 4
- || opt_reverb_control < 0 && ! (opt_reverb_control & 0x80)
+ || (opt_reverb_control < 0 && ! (opt_reverb_control & 0x80))
|| opt_chorus_control < 0) {
set_dry_signal(buf, nsamples);
/* chorus sounds horrible
set_ch_chorus(buf, nsamples, -opt_chorus_control);
#endif
if (opt_reverb_control == 2 || opt_reverb_control == 4
- || opt_reverb_control < 0 && ! (opt_reverb_control & 0x80))
+ || (opt_reverb_control < 0 && ! (opt_reverb_control & 0x80)))
set_ch_reverb(buf, nsamples, reverb_level);
mix_dry_signal(buf, nsamples);
/* chorus sounds horrible
do_ch_chorus(buf, nsamples);
#endif
if (opt_reverb_control == 2 || opt_reverb_control == 4
- || opt_reverb_control < 0 && ! (opt_reverb_control & 0x80))
+ || (opt_reverb_control < 0 && ! (opt_reverb_control & 0x80)))
do_ch_reverb(buf, nsamples);
}
/* L/R Delay */
(f)ifth, rotate back 1, rotate back 2
*/
int chord_table[4][3][3] = {
- 0, 4, 7, -5, 0, 4, -8, -5, 0,
- 0, 3, 7, -5, 0, 3, -9, -5, 0,
- 0, 3, 6, -6, 0, 3, -9, -6, 0,
- 0, 5, 7, -5, 0, 5, -7, -5, 0
+ {{ 0, 4, 7 }, { -5, 0, 4 }, { -8, -5, 0 }},
+ {{ 0, 3, 7 }, { -5, 0, 3 }, { -9, -5, 0 }},
+ {{ 0, 3, 6 }, { -6, 0, 3 }, { -9, -6, 0 }},
+ {{ 0, 5, 7 }, { -5, 0, 5 }, { -7, -5, 0 }}
};
* 44100 / play_mode->rate * control_ratio) << fast_decay : 0;
}
+#if 0
static int32 to_control(int control)
{
return (int32) (0x2000 / pow(2.0, control / 31.0));
}
+#endif
static void apply_bank_parameter(Instrument *ip, ToneBankElement *tone)
{
#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#ifndef NO_STRING_H /* for memmove */
#include <string.h>
ctx->running = 1;
nframes -= size1;
if (! nframes)
- return;
+ return 0;
buf += size1 << ctx->shift;
size -= size1;
}
int length, dataLength, infoLength, dataType;
uint32 type;
uint8 numTracks;
- int i;
if (tf_read_beint32(&dataLength, tf) != 1
|| tf_read_beint16(&infoLength, tf) != 1
}
else
StoreLastNoteInfo(lastNotes, channel, pos, data[2], note, velocity);
- silent: ;
NOTE_EVENT_DEBUGSTR(channel, note_name[note % 12], note / 12, velocity, data[2]);
}
else /* controls */
offset = vp->sample->envelope_offset[stage];
rate = vp->sample->envelope_rate[stage];
if (vp->envelope_volume == offset
- || stage > EG_GUS_SUSTAIN && vp->envelope_volume < offset)
+ || (stage > EG_GUS_SUSTAIN && vp->envelope_volume < offset))
return recompute_envelope(v);
ch = vp->channel;
/* there is some difference between GUS patch and Soundfont at envelope. */
void load_module_samples (SAMPLE * s, int numsamples, int ntsc)
{
- int i, j;
+ int i;
for(i = 1; numsamples--; i++, s++)
{
if((n = write(dpm.fd, buf, nbytes)) == -1)
{
#if 0
- if(errno != ???) /* I don't know what error should be ignored.
- * ??? := EWOULDBLOCK??
+ if(errno != XXX) /* I don't know what error should be ignored.
+ * XXX := EWOULDBLOCK??
*/
{
usleep(100000);
* so that it must be reduced in advance.
*/
if (! (play_mode->encoding & PE_MONO)
- && (opt_reverb_control || opt_chorus_control || opt_delay_control
- || opt_eq_control && (eq_status_gs.low_gain != 0x40
- || eq_status_gs.high_gain != 0x40) || opt_insertion_effect))
+ && (opt_reverb_control || opt_chorus_control || opt_delay_control
+ || (opt_eq_control && (eq_status_gs.low_gain != 0x40
+ || eq_status_gs.high_gain != 0x40))
+ || opt_insertion_effect))
tempamp *= 1.35f * 0.55f;
else
tempamp *= 1.35f;
if ((def_play_note = dbank->tone[note].play_note) == -1)
return 1.0;
if (play_note >= def_play_note)
- return bend_coarse[play_note - def_play_note & 0x7f];
+ return bend_coarse[(play_note - def_play_note) & 0x7f];
else
- return 1 / bend_coarse[def_play_note - play_note & 0x7f];
+ return 1 / bend_coarse[(def_play_note - play_note) & 0x7f];
}
/* Only one instance of a note can be playing on a single channel. */
}
for (i = 0; i < upper_voices; i++)
if (voice[i].status != VOICE_FREE && voice[i].channel == ch) {
- if (voice[i].note == note && voice[i].status & status_check
- || mono_check
- || altassign && find_altassign(altassign, voice[i].note))
+ if ((voice[i].note == note && (voice[i].status & status_check))
+ || mono_check
+ || (altassign && find_altassign(altassign, voice[i].note)))
kill_note(i);
- else if (voice[i].note == note && (channel[ch].assign_mode == 0
- || channel[ch].assign_mode == 1
- && voice[i].proximate_flag == 0))
+ else if (voice[i].note == note &&
+ (channel[ch].assign_mode == 0
+ || (channel[ch].assign_mode == 1
+ && voice[i].proximate_flag == 0)))
kill_note(i);
}
for (i = 0; i < upper_voices; i++)
static void init_voice_tremolo(int v)
{
Voice *vp = &(voice[v]);
- int ch = vp->channel;
vp->tremolo_delay = vp->sample->tremolo_delay;
vp->tremolo_phase = 0;
}
/*! pseudo Delay Effect without DSP */
+#ifndef USE_DSP_EFFECT
static void new_delay_voice(int v1, int level)
{
int v2, ch = voice[v1].channel;
*/
recompute_freq(v2);
}
+#endif /* !USE_DSP_EFFECT */
+
/* Yet another chorus implementation
* by Eric A. Welsh <ewelsh@gpc.wustl.edu>.
return -opt_chorus_control;
}
+#ifndef USE_DSP_EFFECT
static void make_rvid(void)
{
int i, j, lv, maxrv;
}
}
}
+#endif /* !USE_DSP_EFFECT */
void free_drum_effect(int ch)
{
case ME_TEMPER_KEYSIG:
current_temper_keysig = (current_event->a + 8) % 32 - 8;
- temper_adj = (current_event->a + 8 & 0x20) ? 1 : 0;
+ temper_adj = ((current_event->a + 8) & 0x20) ? 1 : 0;
break;
case ME_TEMPER_TYPE:
/* are effects valid? / don't supported in mono */
channel_reverb = (stereo && (opt_reverb_control == 1
|| opt_reverb_control == 3
- || opt_reverb_control < 0 && opt_reverb_control & 0x80));
+ || (opt_reverb_control < 0 && opt_reverb_control & 0x80)));
channel_chorus = (stereo && opt_chorus_control);
channel_delay = (stereo && opt_delay_control > 0);
case ME_TEMPER_KEYSIG:
current_temper_keysig = (current_event->a + 8) % 32 - 8;
- temper_adj = (current_event->a + 8 & 0x20) ? 1 : 0;
+ temper_adj = ((current_event->a + 8) & 0x20) ? 1 : 0;
ctl_mode_event(CTLE_TEMPER_KEYSIG, 1, current_event->a, 0);
i = current_temper_keysig + ((current_temper_keysig < 8) ? 7 : -9);
j = 0;
else {channel[ch].rx &= ~rx;}
}
+#if 0
static int32 get_rx(int ch, int32 rx)
{
return (channel[ch].rx & rx);
}
+#endif
static void init_rx_drum(struct DrumParts *p)
{
ev.time = at;
readmidi_add_event(&ev);
}
- if (ne = parse_sysex_event_multi(val, len, evm))
+ if ((ne = parse_sysex_event_multi(val, len, evm)) > 0)
for (i = 0; i < ne; i++) {
evm[i].time = at;
readmidi_add_event(&evm[i]);
(msb >= 0x14)) /* NO EFFECT */
{
ctl->cmsg(CMSG_INFO,VERB_NOISY,"XG Set Reverb Type (NO EFFECT %d %d)", msb, lsb);
- return;
+ return -1;
}
switch(msb)
(msb >= 0x49)) /* NO EFFECT */
{
ctl->cmsg(CMSG_INFO,VERB_NOISY,"XG Set Chorus Type (NO EFFECT %d %d)", msb, lsb);
- return;
+ return -1;
}
switch(msb)
case 0x01: /* Reverb Type LSB */
xg_reverb_type_lsb = *body;
v = set_xg_reverb_type(xg_reverb_type_msb, xg_reverb_type_lsb);
- SETMIDIEVENT(evm[num_events], 0, ME_SYSEX_GS_LSB, p, v, 0x05);
- num_events++;
+ if (v >= 0) {
+ SETMIDIEVENT(evm[num_events], 0, ME_SYSEX_GS_LSB, p, v, 0x05);
+ num_events++;
+ }
break;
case 0x20: /* Chorus Type MSB */
case 0x21: /* Chorus Type LSB */
xg_chorus_type_lsb = *body;
v = set_xg_chorus_type(xg_chorus_type_msb, xg_chorus_type_lsb);
- SETMIDIEVENT(evm[num_events], 0, ME_SYSEX_GS_LSB, p, v, 0x0D);
- num_events++;
+ if (v >= 0) {
+ SETMIDIEVENT(evm[num_events], 0, ME_SYSEX_GS_LSB, p, v, 0x0D);
+ num_events++;
+ }
break;
case 0x0C: /* Reverb Return */
{
MidiEventList *e;
int32 i, n, at, lasttime, meas, beat;
- uint8 num, denom, a, b;
+ uint8 num = 0, denom = 1, a, b;
e = evlist;
for (i = n = 0; i < event_count - 1 && n < 256 - 1; i++, e = e->next)
num = timesig[n].a, denom = timesig[n].b, n++;
}
a = meas & 0xff;
- b = (meas >> 8 & 0x0f) + (beat + 1 << 4);
+ b = ((meas >> 8) & 0x0f) + ((beat + 1) << 4);
MIDIEVENT(at, ME_NOTE_STEP, 0, a, b);
if (++beat == num)
meas++, beat = 0;
p->feedback_ratio = (double)(p->feedback - 64) * (0.763f * 2.0f / 100.0f);
p->send_reverb_ratio = (double)p->send_reverb * (0.787f / 100.0f);
- if(p->level_left != 0 || p->level_right != 0 && p->type == 0) {
+ if(p->level_left != 0 || (p->level_right != 0 && p->type == 0)) {
p->type = 1; /* it needs 3-tap delay effect. */
}
static int32 newt_old_trunc_x = -1;
static int newt_grow = -1;
static int newt_max = 13;
-static double newt_divd[60][60] = {0};
+static double newt_divd[60][60];
static double newt_recip[60] = { 0, 1, 1.0/2, 1.0/3, 1.0/4, 1.0/5, 1.0/6, 1.0/7,
1.0/8, 1.0/9, 1.0/10, 1.0/11, 1.0/12, 1.0/13, 1.0/14,
1.0/15, 1.0/16, 1.0/17, 1.0/18, 1.0/19, 1.0/20, 1.0/21,
return val;
}
+#if 0
/*! modulated delay with allpass interpolation (for Chorus Effect,...) */
static void free_mod_delay(mod_delay *delay)
{
delay->size = size;
memset(delay->buf, 0, sizeof(int32) * delay->size);
}
+#endif
#define do_mod_delay(_stream, _buf, _size, _rindex, _windex, _ndelay, _depth, _lfoval, _hist) \
{ \
/* Old non-freeverb must be initialized for mono reverb not to crash */
if (! (play_mode->encoding & PE_MONO)
&& (opt_reverb_control == 3 || opt_reverb_control == 4
- || opt_reverb_control < 0 && ! (opt_reverb_control & 0x100))) {
+ || (opt_reverb_control < 0 && ! (opt_reverb_control & 0x100)))) {
switch(reverb_status.character) { /* select reverb algorithm */
case 5: /* Plate Reverb */
do_ch_plate_reverb(NULL, MAGIC_INIT_EFFECT_INFO, &(reverb_status.info_plate_reverb));
{
#ifdef SYS_EFFECT_PRE_LPF
if ((opt_reverb_control == 3 || opt_reverb_control == 4
- || opt_reverb_control < 0 && ! (opt_reverb_control & 0x100)) && reverb_status.pre_lpf)
+ || (opt_reverb_control < 0 && ! (opt_reverb_control & 0x100))) && reverb_status.pre_lpf)
do_filter_lowpass1_stereo(reverb_effect_buffer, count, &(reverb_status.lpf));
#endif /* SYS_EFFECT_PRE_LPF */
if (opt_reverb_control == 3 || opt_reverb_control == 4
- || opt_reverb_control < 0 && ! (opt_reverb_control & 0x100)) {
+ || (opt_reverb_control < 0 && ! (opt_reverb_control & 0x100))) {
switch(reverb_status.character) { /* select reverb algorithm */
case 5: /* Plate Reverb */
do_ch_plate_reverb(buf, count, &(reverb_status.info_plate_reverb));
{
#ifdef SYS_EFFECT_PRE_LPF
if ((opt_reverb_control == 3 || opt_reverb_control == 4
- || opt_reverb_control < 0 && ! (opt_reverb_control & 0x100)) && delay_status.pre_lpf)
+ || (opt_reverb_control < 0 && ! (opt_reverb_control & 0x100))) && delay_status.pre_lpf)
do_filter_lowpass1_stereo(delay_effect_buffer, count, &(delay_status.lpf));
#endif /* SYS_EFFECT_PRE_LPF */
switch (delay_status.type) {
{
#ifdef SYS_EFFECT_PRE_LPF
if ((opt_reverb_control == 3 || opt_reverb_control == 4
- || opt_reverb_control < 0 && ! (opt_reverb_control & 0x100)) && chorus_param.chorus_pre_lpf)
+ || (opt_reverb_control < 0 && ! (opt_reverb_control & 0x100))) && chorus_param.chorus_pre_lpf)
do_filter_lowpass1_stereo(chorus_effect_buffer, count, &(chorus_param.lpf));
#endif /* SYS_EFFECT_PRE_LPF */
#define BLOCK_READ_BEGIN(stype, sbyte, fch) { /* sbyte may sizeof(stype) */ \
stype data[WAVE_BUF_SIZE / sizeof(stype)]; \
- int j, c; \
+ int j; \
for(block_frame_count = (sizeof data / sbyte / fch); block_frame_count != 0; block_frame_count >>= 1) { \
while(i <= frames - block_frame_count) { \
READ_WAVE_FRAME(data, sbyte, block_frame_count); \
if (flags & SAMPLE_BIG_ENDIAN) {
BLOCK_READ_BEGIN(uint16, 2, channels)
{
+ int c;
for(c = 0; c < channels; c++, j++)
sdata[c][i] = BE_SHORT(data[j]);
}
} else {
BLOCK_READ_BEGIN(uint16, 2, channels)
{
+ int c;
for(c = 0; c < channels; c++, j++)
sdata[c][i] = LE_SHORT(data[j]);
}
if (flags & SAMPLE_8BIT_UNSIGNED) {
BLOCK_READ_BEGIN(uint8, 1, channels)
{
+ int c;
for(c = 0; c < channels; c++, j++)
sdata[c][i] = BITS_U8_TO_16(data[j]);
}
} else {
BLOCK_READ_BEGIN(uint8, 1, channels)
{
+ int c;
for(c = 0; c < channels; c++, j++)
sdata[c][i] = BITS_S8_TO_16(data[j]);
}
void init_tables(void)
{
- int i;
-
#ifdef LOOKUP_HACK
- int j,v;
+ int i,j,v;
mixup = (int32 *)safe_malloc(1<<(7+8+2)); /* Give your cache a workout! */
for (i=0; i<128; i++)
/* count num */
*num = 1, p = cp;
- while (p = strchr(p, ','))
+ while ((p = strchr(p, ',')) != NULL)
(*num)++, p++;
/* alloc */
tune_list = (float *) safe_malloc((*num) * sizeof(float));
/* count num */
*num = 1, p = cp;
- while (p = strchr(p, ','))
+ while ((p = strchr(p, ',')) != NULL)
(*num)++, p++;
/* alloc */
list = (int16 *) safe_malloc((*num) * sizeof(int16));
/* count num */
*num = 1, p = cp;
- while (p = strchr(p, ','))
+ while ((p = strchr(p, ',')) != NULL)
(*num)++, p++;
/* alloc */
env_list = (int **) safe_malloc((*num) * sizeof(int *));
/* count num */
*num = 1, p = cp;
- while (p = strchr(p, ','))
+ while ((p = strchr(p, ',')) != NULL)
(*num)++, p++;
/* alloc */
mod_list = (Quantity **) safe_malloc((*num) * sizeof(Quantity *));
ToneBank *bank = NULL;
int i, j, k, line = 0, words, errcnt = 0;
static int rcf_count = 0;
- int dr = 0, bankno = 0, mapid = INST_NO_MAP, origbankno;
+ int dr = 0, bankno = 0, mapid = INST_NO_MAP, origbankno = 0;
int extension_flag, param_parse_err;
if(rcf_count > 50)
return 1;
}
/* bits */
- if (p = strchr(arg, ',')) {
+ if ((p = strchr(arg, ',')) != NULL) {
if (set_value(&audio_buffer_bits, atoi(++p), 1, AUDIO_BUFFER_BITS,
"Buffer Fragments (bit)"))
return 1;
if (set_value(&prog, atoi(arg), 0, 0x7f, "Program number"))
return 1;
- if (p = strchr(arg, '/')) {
+ if ((p = strchr(arg, '/')) != NULL) {
if (set_value(&i, atoi(++p), 1, MAX_CHANNELS, "Program channel"))
return 1;
default_program[i - 1] = prog;
return 1;
if (ctl->opened)
set_default_program(def_prog);
- if (p = strchr(arg, '/')) {
+ if ((p = strchr(arg, '/')) != NULL) {
if (set_value(&i, atoi(++p), 1, MAX_CHANNELS, "Program channel"))
return 1;
default_program[i - 1] = SPECIAL_PROGRAM;
effect_lr_mode = 2;
break;
}
- if (p = strchr(arg, ','))
+ if ((p = strchr(arg, ',')) != NULL)
if ((effect_lr_delay_msec = atoi(++p)) < 0) {
effect_lr_delay_msec = 0;
effect_lr_mode = -1;
case '2':
case 's': /* surround */
opt_surround_chorus = (*arg == '2' || *arg == 's') ? 1 : 0;
- if (p = strchr(arg, ',')) {
+ if ((p = strchr(arg, ',')) != NULL) {
if (set_value(&opt_chorus_control, atoi(++p), 0, 0x7f,
"Chorus level"))
return 1;
break;
case '1':
case 'n': /* normal */
- if (p = strchr(arg, ',')) {
+ if ((p = strchr(arg, ',')) != NULL) {
if (set_value(&opt_reverb_control, atoi(++p), 1, 0x7f,
"Reverb level"))
return 1;
break;
case '2':
case 'g': /* global */
- if (p = strchr(arg, ',')) {
+ if ((p = strchr(arg, ',')) != NULL) {
if (set_value(&opt_reverb_control, atoi(++p), 1, 0x7f,
"Reverb level"))
return 1;
break;
case '3':
case 'f': /* freeverb */
- if (p = strchr(arg, ',')) {
+ if ((p = strchr(arg, ',')) != NULL) {
if (set_value(&opt_reverb_control, atoi(++p), 1, 0x7f,
"Reverb level"))
return 1;
break;
case '4':
case 'G': /* global freeverb */
- if (p = strchr(arg, ',')) {
+ if ((p = strchr(arg, ',')) != NULL) {
if (set_value(&opt_reverb_control, atoi(++p), 1, 0x7f,
"Reverb level"))
return 1;
help_args[0] = timidity_version;
help_args[1] = program_name;
help_args[2] = NULL;
- for (i = 0, j = 0; h = help_list[i]; i++) {
+ for (i = 0, j = 0; (h = help_list[i]) != NULL; i++) {
if (strchr(h, '%')) {
if (*(strchr(h, '%') + 1) != '%')
fprintf(fp, h, help_args[j++]);
#endif
fputs(NLS, fp);
fputs("Available interfaces (-i, --interface option):" NLS, fp);
- for (cmpp = ctl_list; cmp = *cmpp; cmpp++)
+ for (cmpp = ctl_list; (cmp = *cmpp) != NULL; cmpp++)
#ifdef IA_DYNAMIC
if (cmp->id_character != dynamic_interface_id)
fprintf(fp, " -i%c %s" NLS,
fprintf(fp, "Supported dynamic load interfaces (%s):" NLS,
dynamic_lib_root);
memset(mark, 0, sizeof(mark));
- for (cmpp = ctl_list; cmp = *cmpp; cmpp++)
+ for (cmpp = ctl_list; (cmp = *cmpp) != NULL; cmpp++)
mark[(int) cmp->id_character] = 1;
if (dynamic_interface_id != 0)
mark[(int) dynamic_interface_id] = 0;
#endif
fputs(NLS, fp);
fputs("Available output modes (-O, --output-mode option):" NLS, fp);
- for (pmpp = play_mode_list; pmp = *pmpp; pmpp++)
+ for (pmpp = play_mode_list; (pmp = *pmpp) != NULL; pmpp++)
fprintf(fp, " -O%c %s" NLS,
pmp->id_character, pmp->id_name);
fputs(NLS, fp);
" --[no-]output-swab" NLS, fp);
fputs(NLS, fp);
fputs("Available WRD interfaces (-W, --wrd option):" NLS, fp);
- for (wlpp = wrdt_list; wlp = *wlpp; wlpp++)
+ for (wlpp = wrdt_list; (wlp = *wlpp) != NULL; wlpp++)
fprintf(fp, " -W%c %s" NLS, wlp->id, wlp->name);
fputs(NLS, fp);
close_pager(fp);
ControlMode *cmp, **cmpp;
int found = 0;
- for (cmpp = ctl_list; cmp = *cmpp; cmpp++) {
+ for (cmpp = ctl_list; (cmp = *cmpp) != NULL; cmpp++) {
if (cmp->id_character == *arg) {
found = 1;
ctl = cmp;
PlayMode *pmp, **pmpp;
int found = 0;
- for (pmpp = play_mode_list; pmp = *pmpp; pmpp++)
+ for (pmpp = play_mode_list; (pmp = *pmpp) != NULL; pmpp++)
if (pmp->id_character == *arg) {
found = 1;
play_mode = pmp;
return parse_opt_Q1(arg);
if (set_channel_flag(&quietchannels, atoi(arg), "Quiet channel"))
return 1;
- while (p = strchr(p, ','))
+ while ((p = strchr(p, ',')) != NULL)
if (set_channel_flag(&quietchannels, atoi(++p), "Quiet channel"))
return 1;
return 0;
if (set_value(&prog, atoi(arg), 0, 7, "Temperament program number"))
return 1;
temper_type_mute |= 1 << prog;
- while (p = strchr(p, ',')) {
+ while ((p = strchr(p, ',')) != NULL) {
if (set_value(&prog, atoi(++p), 0, 7, "Temperament program number"))
return 1;
temper_type_mute |= 1 << prog;
put_string_table(&wrd_read_opts, arg + 1, strlen(arg + 1));
return 0;
}
- for (wlpp = wrdt_list; wlp = *wlpp; wlpp++)
+ for (wlpp = wrdt_list; (wlp = *wlpp) != NULL; wlpp++)
if (wlp->id == *arg) {
wrdt = wlp;
if (wrdt_open_opts)
#include <stdlib.h>
#include <io.h>
#include <ctype.h>
-#include <time.h>
extern int load_ogg_dll(void);
extern void free_ogg_dll(void);
extern int load_vorbis_dll(void);
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
+#include <time.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif