From 8d7a2611c22586372aeaf304a6b588707319cbe7 Mon Sep 17 00:00:00 2001 From: Mathieu L Bouchard <matju@artengine.ca> Date: Sat, 9 Aug 2014 14:07:48 -0400 Subject: [PATCH] remove unused vars --- pd/src/d_ugen.c | 19 ++++++------------- pd/src/s_audio.c | 8 ++------ pd/src/s_audio_alsamm.c | 22 +--------------------- pd/src/s_midi.c | 4 ---- pd/src/s_midi_oss.c | 4 +--- pd/src/u_pdreceive.c | 5 +---- pd/src/u_pdsend.c | 2 ++ 7 files changed, 13 insertions(+), 51 deletions(-) diff --git a/pd/src/d_ugen.c b/pd/src/d_ugen.c index c2b600a0d..fcd2ed083 100644 --- a/pd/src/d_ugen.c +++ b/pd/src/d_ugen.c @@ -362,7 +362,7 @@ static t_signal *signal_usedlist; /* call this when DSP is stopped to free all the signals */ void signal_cleanup(void) { - t_signal **svec, *sig, *sig2; + t_signal *sig; int i; while (sig = signal_usedlist) { @@ -429,9 +429,8 @@ void signal_makereusable(t_signal *sig) t_signal *signal_new(int n, t_float sr) { - int logn, n2, vecsize = 0; + int logn, vecsize = 0; t_signal *ret, **whichlist; - t_sample *fp; logn = ilog2(n); if (n) { @@ -555,8 +554,6 @@ static t_dspcontext *ugen_currentcontext; void ugen_stop(void) { - t_signal *s; - int i; if (dsp_chain) { freebytes(dsp_chain, dsp_chainsize * sizeof (t_int)); @@ -612,8 +609,6 @@ t_dspcontext *ugen_start_graph(int toplevel, t_signal **sp, int ninlets, int noutlets) { t_dspcontext *dc = (t_dspcontext *)getbytes(sizeof(*dc)); - t_float parent_srate, srate; - int parent_vecsize, vecsize; if (ugen_loud) post("ugen_start_graph..."); @@ -707,7 +702,7 @@ static void ugen_doit(t_dspcontext *dc, t_ugenbox *u) { t_sigoutlet *uout; t_siginlet *uin; - t_sigoutconnect *oc, *oc2; + t_sigoutconnect *oc; t_class *class = pd_class(&u->u_obj->ob_pd); int i, n; /* suppress creating new signals for the outputs of signal @@ -860,7 +855,7 @@ static void ugen_doit(t_dspcontext *dc, t_ugenbox *u) void ugen_done_graph(t_dspcontext *dc) { - t_ugenbox *u, *u2; + t_ugenbox *u; t_sigoutlet *uout; t_siginlet *uin; t_sigoutconnect *oc, *oc2; @@ -869,7 +864,7 @@ void ugen_done_graph(t_dspcontext *dc) t_dspcontext *parent_context = dc->dc_parentcontext; t_float parent_srate; int parent_vecsize; - int period, frequency, phase, vecsize, calcsize; + int period, frequency, vecsize, calcsize; t_float srate; int chainblockbegin; /* DSP chain onset before block prolog code */ int chainblockend; /* and after block epilog code */ @@ -936,7 +931,6 @@ void ugen_done_graph(t_dspcontext *dc) (parent_vecsize * realoverlap * upsample); frequency = (parent_vecsize * realoverlap * upsample)/ (vecsize * downsample); - phase = blk->x_phase; srate = parent_srate * realoverlap * upsample / downsample; if (period < 1) period = 1; if (frequency < 1) frequency = 1; @@ -956,7 +950,6 @@ void ugen_done_graph(t_dspcontext *dc) calcsize = (parent_context ? parent_context->dc_calcsize : vecsize); downsample = upsample = 1; period = frequency = 1; - phase = 0; if (!parent_context) reblock = 1; switched = 0; } @@ -1004,7 +997,7 @@ void ugen_done_graph(t_dspcontext *dc) for (u = dc->dc_ugenlist; u; u = u->u_next) { t_pd *zz = &u->u_obj->ob_pd; - t_signal **insigs = dc->dc_iosigs, **outsigs = dc->dc_iosigs; + t_signal **outsigs = dc->dc_iosigs; if (outsigs) outsigs += dc->dc_ninlets; if (pd_class(zz) == vinlet_class) diff --git a/pd/src/s_audio.c b/pd/src/s_audio.c index 0a479c664..1dce94ca5 100644 --- a/pd/src/s_audio.c +++ b/pd/src/s_audio.c @@ -155,7 +155,6 @@ static void audio_init( void) void sys_setchsr(int chin, int chout, int sr) { - int nblk; int inbytes = (chin ? chin : 2) * (DEFDACBLKSIZE*sizeof(t_sample)); int outbytes = (chout ? chout : 2) * @@ -199,7 +198,7 @@ void sys_set_audio_settings(int naudioindev, int *audioindev, int nchindev, int *chindev, int naudiooutdev, int *audiooutdev, int nchoutdev, int *choutdev, int rate, int advance, int callback) { - int i, *ip; + int i; int defaultchannels = SYS_DEFAULTCH; int inchans, outchans, nrealindev, nrealoutdev; int realindev[MAXAUDIOINDEV], realoutdev[MAXAUDIOOUTDEV]; @@ -729,10 +728,7 @@ extern int pa_foo; /* new values from dialog window */ void glob_audio_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) { - int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; - int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; - int rate, advance, audioon, i, nindev, noutdev; - int audioindev1, audioinchan1, audiooutdev1, audiooutchan1; + int i, nindev, noutdev; int newaudioindev[4], newaudioinchan[4], newaudiooutdev[4], newaudiooutchan[4]; /* the new values the dialog came back with: */ diff --git a/pd/src/s_audio_alsamm.c b/pd/src/s_audio_alsamm.c index 3bc4b3692..9401d20a5 100644 --- a/pd/src/s_audio_alsamm.c +++ b/pd/src/s_audio_alsamm.c @@ -81,11 +81,6 @@ so i will change it maybe in future... */ -static int alsamm_incards = 0; -static t_alsa_dev *alsamm_indevice[ALSA_MAXDEV]; -static int alsamm_outcards = 0; -static t_alsa_dev *alsamm_outdevice[ALSA_MAXDEV]; - /* we need same samplerate, buffertime and so on for each card soo we use global vars... @@ -163,8 +158,6 @@ static void show_availist(void) #endif /* protos */ -static char *alsamm_getdev(int nr); - static int set_hwparams(snd_pcm_t *handle, snd_pcm_hw_params_t *params, int *chs); static int set_swparams(snd_pcm_t *handle, @@ -184,22 +177,15 @@ static void check_error(int err, const char *why) int alsamm_open_audio(int rate) { - int err; - char devname[80]; - char *cardname; + int err, i; snd_pcm_hw_params_t* hw_params; snd_pcm_sw_params_t* sw_params; - /* fragsize is an old concept now use periods, used to be called fragments. */ /* Be aware in ALSA periodsize can be in bytes, where buffersize is in frames, but sometimes buffersize is in bytes and periods in frames, crazy alsa... ...we use periodsize and buffersize in frames */ - int i; - short* tmp_buf; - unsigned int tmp_uint; - snd_pcm_hw_params_alloca(&hw_params); snd_pcm_sw_params_alloca(&sw_params); @@ -322,8 +308,6 @@ int alsamm_open_audio(int rate) /* check for linked handles of input for each output*/ for(i=0; i<(alsa_noutdev < alsa_nindev ? alsa_noutdev:alsa_nindev); i++){ - t_alsa_dev *ad = &alsa_outdev[i]; - if (alsa_outdev[i].a_devno == alsa_indev[i].a_devno){ if ((err = snd_pcm_link (alsa_indev[i].a_handle, alsa_outdev[i].a_handle)) == 0){ @@ -430,7 +414,6 @@ static int set_hwparams(snd_pcm_t *handle, snd_pcm_hw_params_t *params,int *chs) #ifndef ALSAAPI9 unsigned int rrate; int err, dir; - int channels_allocated = 0; /* choose all parameters */ err = snd_pcm_hw_params_any(handle, params); @@ -848,8 +831,6 @@ static int alsamm_start() int devno; int chn,nchns; - const snd_pcm_channel_area_t *mm_areas; - #ifdef ALSAMM_DEBUG if(sys_verbose) post("start audio with %d out cards and %d incards",alsamm_outcards,alsamm_incards); @@ -1354,7 +1335,6 @@ void alsamm_showstat(snd_pcm_t *handle) { int err; snd_pcm_status_t *status; - snd_output_t *output = NULL; snd_pcm_status_alloca(&status); if ((err = snd_pcm_status(handle, status)) < 0) { diff --git a/pd/src/s_midi.c b/pd/src/s_midi.c index fa2921e2d..c850097c2 100644 --- a/pd/src/s_midi.c +++ b/pd/src/s_midi.c @@ -163,7 +163,6 @@ void sys_pollmidioutqueue( void) static void sys_queuemidimess(int portno, int onebyte, int a, int b, int c) { - t_midiqelem *midiqelem; int newhead = midi_outhead +1; if (newhead == MIDIQSIZE) newhead = 0; @@ -448,7 +447,6 @@ void sys_pollmidiinqueue( void) void sys_midibytein(int portno, int byte) { static int warned = 0; - t_midiqelem *midiqelem; int newhead = midi_inhead +1; if (newhead == MIDIQSIZE) newhead = 0; @@ -730,8 +728,6 @@ void glob_midi_properties(t_pd *dummy, t_floatarg flongform) /* new values from dialog window */ void glob_midi_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) { - int nmidiindev, midiindev[MAXMIDIINDEV]; - int nmidioutdev, midioutdev[MAXMIDIOUTDEV]; int i, nindev, noutdev; int newmidiindev[4], newmidioutdev[4]; int alsadevin, alsadevout; diff --git a/pd/src/s_midi_oss.c b/pd/src/s_midi_oss.c index 361bb0ad3..05c98b0cb 100644 --- a/pd/src/s_midi_oss.c +++ b/pd/src/s_midi_oss.c @@ -233,11 +233,9 @@ void sys_poll_midi(void) void sys_poll_midi(void) { int i, throttle = 100; - struct timeval timout; - int did = 1, maxfd = 0; + int did = 1; while (did) { - fd_set readset, writeset, exceptset; did = 0; if (throttle-- < 0) break; diff --git a/pd/src/u_pdreceive.c b/pd/src/u_pdreceive.c index e61397edf..279ce90cd 100644 --- a/pd/src/u_pdreceive.c +++ b/pd/src/u_pdreceive.c @@ -52,7 +52,6 @@ int main(int argc, char **argv) { int portno; struct sockaddr_in server; - int nretry = 10; #ifdef MSW short version = MAKEWORD(2, 0); WSADATA nobby; @@ -119,7 +118,6 @@ usage: static void addport(int fd) { - int nfd = nfdpoll; t_fdpoll *fp; fdpoll = (t_fdpoll *)realloc(fdpoll, (nfdpoll+1) * sizeof(t_fdpoll)); @@ -138,8 +136,7 @@ static void addport(int fd) static void rmport(t_fdpoll *x) { - int nfd = nfdpoll; - int i, size = nfdpoll * sizeof(t_fdpoll); + int i; t_fdpoll *fp; for (i = nfdpoll, fp = fdpoll; i--; fp++) { diff --git a/pd/src/u_pdsend.c b/pd/src/u_pdsend.c index e36ad94a2..05090420a 100644 --- a/pd/src/u_pdsend.c +++ b/pd/src/u_pdsend.c @@ -32,7 +32,9 @@ int main(int argc, char **argv) struct sockaddr_in server; struct hostent *hp; char *hostname; +#if 0 int nretry = 10; +#endif #ifdef MSW short version = MAKEWORD(2, 0); WSADATA nobby; -- GitLab