From ad921fce9eea40cce5b14d73f95eeddf88becc86 Mon Sep 17 00:00:00 2001 From: Mathieu L Bouchard <matju@artengine.ca> Date: Sun, 10 Aug 2014 13:59:42 -0400 Subject: [PATCH] remove unused vars --- pd/src/d_ctl.c | 1 - pd/src/d_dac.c | 4 ++-- pd/src/d_delay.c | 3 --- pd/src/d_osc.c | 4 ++-- pd/src/s_audio_alsa.c | 10 ++++------ pd/src/s_audio_oss.c | 19 ++++--------------- pd/src/s_loader.c | 2 +- pd/src/s_path.c | 7 +------ pd/src/t_main.c | 2 -- pd/src/t_tkcmd.c | 4 +--- 10 files changed, 15 insertions(+), 41 deletions(-) diff --git a/pd/src/d_ctl.c b/pd/src/d_ctl.c index bbc2042ab..6e854b512 100644 --- a/pd/src/d_ctl.c +++ b/pd/src/d_ctl.c @@ -260,7 +260,6 @@ static t_int *vline_tilde_perform(t_int *w) double f = x->x_value; double inc = x->x_inc; double msecpersamp = x->x_msecpersamp; - double samppermsec = x->x_samppermsec; double timenow = clock_gettimesince(x->x_referencetime) - n * msecpersamp; t_vseg *s = x->x_list; for (i = 0; i < n; i++) diff --git a/pd/src/d_dac.c b/pd/src/d_dac.c index 9d206c757..f5515fb0a 100644 --- a/pd/src/d_dac.c +++ b/pd/src/d_dac.c @@ -22,7 +22,7 @@ typedef struct _dac static void *dac_new(t_symbol *s, int argc, t_atom *argv) { t_dac *x = (t_dac *)pd_new(dac_class); - t_atom defarg[2], *ap; + t_atom defarg[2]; int i; if (!argc) { @@ -83,7 +83,7 @@ typedef struct _adc static void *adc_new(t_symbol *s, int argc, t_atom *argv) { t_adc *x = (t_adc *)pd_new(adc_class); - t_atom defarg[2], *ap; + t_atom defarg[2]; int i; if (!argc) { diff --git a/pd/src/d_delay.c b/pd/src/d_delay.c index 93ed90e8a..0a7d2d2c8 100644 --- a/pd/src/d_delay.c +++ b/pd/src/d_delay.c @@ -9,7 +9,6 @@ extern int ugen_getsortno(void); #define DEFDELVS 64 /* LATER get this from canvas at DSP time */ -static int delread_zero = 0; /* four bytes of zero for delread~, vd~ */ /* ----------------------------- delwrite~ ----------------------------- */ static t_class *sigdelwrite_class; @@ -169,13 +168,11 @@ static void *sigdelread_new(t_symbol *s, t_floatarg f) static void sigdelread_float(t_sigdelread *x, t_float f) { - int samps; t_sigdelwrite *delwriter = (t_sigdelwrite *)pd_findbyclass(x->x_sym, sigdelwrite_class); x->x_deltime = f; if (delwriter) { - int delsize = delwriter->x_cspace.c_n; x->x_delsamps = (int)(0.5 + x->x_sr * x->x_deltime) + x->x_n - x->x_zerodel; if (x->x_delsamps < x->x_n) x->x_delsamps = x->x_n; diff --git a/pd/src/d_osc.c b/pd/src/d_osc.c index 100167e33..9f863f832 100644 --- a/pd/src/d_osc.c +++ b/pd/src/d_osc.c @@ -57,7 +57,7 @@ union tabfudge }; /* -------------------------- phasor~ ------------------------------ */ -static t_class *phasor_class, *scalarphasor_class; +static t_class *phasor_class; #if 1 /* in the style of R. Hoeldrich (ICMC 1995 Banff) */ @@ -237,7 +237,7 @@ static void cos_setup(void) /* ------------------------ osc~ ----------------------------- */ -static t_class *osc_class, *scalarosc_class; +static t_class *osc_class; typedef struct _osc { diff --git a/pd/src/s_audio_alsa.c b/pd/src/s_audio_alsa.c index a5034c8dc..7366c0eff 100644 --- a/pd/src/s_audio_alsa.c +++ b/pd/src/s_audio_alsa.c @@ -237,10 +237,8 @@ int alsa_open_audio(int naudioindev, int *audioindev, int nchindev, { int err, inchans = 0, outchans = 0, subunitdir; char devname[512]; - snd_output_t* out; int frag_size = (sys_blocksize ? sys_blocksize : ALSA_DEFFRAGSIZE); int nfrags, i, iodev, dev2; - int wantinchans, wantoutchans, device; nfrags = sys_schedadvance * (float)rate / (1e6 * frag_size); /* save our belief as to ALSA's buffer size for later */ @@ -394,8 +392,8 @@ int alsa_send_dacs(void) #endif static double timenow; double timelast; - t_sample *fp, *fp1, *fp2; - int i, j, k, err, iodev, result, ch; + t_sample *fp1, *fp2; + int i, j, k, iodev, result, ch; int chansintogo, chansouttogo; unsigned int transfersize; @@ -611,7 +609,7 @@ int alsa_send_dacs(void) void alsa_printstate( void) { - int i, result, iodev = 0; + int result, iodev = 0; snd_pcm_sframes_t indelay, outdelay; if (sys_audioapi != API_ALSA) { @@ -695,7 +693,7 @@ void alsa_getzeros(int iodev, int n) /* call this only if both input and output are open */ static void alsa_checkiosync( void) { - int i, result, giveup = 1000, alreadylogged = 0, iodev = 0; + int result, giveup = 1000, alreadylogged = 0, iodev = 0; snd_pcm_sframes_t minphase, maxphase, thisphase, outdelay; while (1) diff --git a/pd/src/s_audio_oss.c b/pd/src/s_audio_oss.c index 73f916ce2..8c2da61d6 100644 --- a/pd/src/s_audio_oss.c +++ b/pd/src/s_audio_oss.c @@ -41,9 +41,6 @@ typedef int32_t t_oss_int32; #define OSS_XFERSIZE(chans, width) (DEFDACBLKSIZE * (chans) * (width)) /* GLOBALS */ -static int linux_meters; /* true if we're metering */ -static t_sample linux_inmax; /* max input amplitude */ -static t_sample linux_outmax; /* max output amplitude */ static int linux_fragsize = 0; /* for block mode; block size (sample frames) */ /* our device handles */ @@ -70,7 +67,6 @@ t_sample *sys_soundin; /* OSS-specific private variables */ static int oss_blockmode = 1; /* flag to use "blockmode" */ -static char ossdsp[] = "/dev/dsp%d"; /* don't assume we can turn all 31 bits when doing float-to-fix; otherwise some audio drivers (e.g. Midiman/ALSA) wrap around. */ @@ -123,9 +119,8 @@ int oss_reset(int fd) { void oss_configure(t_oss_dev *dev, int srate, int dac, int skipblocksize) { - int orig, param, nblk, fd = dev->d_fd, wantformat; + int orig, param, fd = dev->d_fd, wantformat; int nchannels = dev->d_nchannels; - int advwas = sys_schedadvance; audio_buf_info ainfo; @@ -239,7 +234,7 @@ static int oss_setchannels(int fd, int wantchannels, char *devname) } } param = wantchannels; -whynot: +//whynot: while (param > 1) { int save = param; @@ -263,11 +258,8 @@ int oss_open_audio(int nindev, int *indev, int nchin, int *chin, char devname[20]; int n, i, fd, flags; char buf[OSS_MAXSAMPLEWIDTH * DEFDACBLKSIZE * OSS_MAXCHPERDEV]; - int num_devs = 0; int wantmore=0; - int spread = 0; - audio_buf_info ainfo; - + linux_nindevs = linux_noutdevs = 0; /* mark devices unopened */ for (i = 0; i < OSS_MAXDEV; i++) @@ -541,7 +533,7 @@ in audio output and/or input. */ static void oss_doresync( void) { - int dev, zeroed = 0, wantsize; + int dev, zeroed = 0; char buf[OSS_MAXSAMPLEWIDTH * DEFDACBLKSIZE * OSS_MAXCHPERDEV]; audio_buf_info ainfo; @@ -620,11 +612,9 @@ static void oss_doresync( void) int oss_send_dacs(void) { t_sample *fp1, *fp2; - long fill; int i, j, dev, rtnval = SENDDACS_YES; char buf[OSS_MAXSAMPLEWIDTH * DEFDACBLKSIZE * OSS_MAXCHPERDEV]; t_oss_int16 *sp; - t_oss_int32 *lp; /* the maximum number of samples we should have in the ADC buffer */ int idle = 0; int thischan; @@ -665,7 +655,6 @@ int oss_send_dacs(void) for (dev = 0;dev < linux_nindevs; dev++) if (linux_adcs[dev].d_space == 0) { - audio_buf_info ainfo; sys_microsleep(2000); oss_calcspace(); if (linux_adcs[dev].d_space != 0) continue; diff --git a/pd/src/s_loader.c b/pd/src/s_loader.c index 209891cbf..788f9cb2c 100644 --- a/pd/src/s_loader.c +++ b/pd/src/s_loader.c @@ -89,7 +89,7 @@ void class_set_extern_dir(t_symbol *s); static int sys_do_load_lib(t_canvas *canvas, char *objectname) { char symname[MAXPDSTRING], filename[FILENAME_MAX], dirbuf[FILENAME_MAX], - *classname, *nameptr, altsymname[MAXPDSTRING]; + *classname, *nameptr; void *dlobj; t_xxx makeout = NULL; int i, hexmunge = 0, fd; diff --git a/pd/src/s_path.c b/pd/src/s_path.c index 59454b46c..e44a83c82 100644 --- a/pd/src/s_path.c +++ b/pd/src/s_path.c @@ -82,7 +82,6 @@ static void sys_path_replace( ) { size_t const replen = strlen(replacement); size_t const patlen = strlen(pattern); - size_t const orilen = strlen(original); size_t patcnt = 0; const char * oriptr; @@ -96,8 +95,6 @@ static void sys_path_replace( { // allocate memory for the new string - size_t const retlen = orilen + patcnt * (replen - patlen); - if (returned != NULL) { // copy the original string, @@ -253,7 +250,7 @@ t_namelist *namelist_append_files(t_namelist *listwas, const char *s) { const char *npos; char temp[MAXPDSTRING]; - t_namelist *nl = listwas, *rtn = listwas; + t_namelist *nl = listwas; npos = s; do @@ -519,10 +516,8 @@ int sys_rcfile(void) { FILE* file; int i; - int k; int rcargc; char* rcargv[NUMARGS]; - char* buffer; char fname[FILENAME_MAX], buf[1000], *home = getenv("HOME"); int retval = 1; /* that's what we will return at the end; for now, let's think it'll be an error */ diff --git a/pd/src/t_main.c b/pd/src/t_main.c index d38336674..501c1eccf 100644 --- a/pd/src/t_main.c +++ b/pd/src/t_main.c @@ -92,8 +92,6 @@ int Tcl_AppInit(interp) Tcl_Interp *interp; /* Interpreter for application. */ { - Tk_Window mainwindow; - if (Tcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } diff --git a/pd/src/t_tkcmd.c b/pd/src/t_tkcmd.c index 8114a51ed..11d76f24a 100644 --- a/pd/src/t_tkcmd.c +++ b/pd/src/t_tkcmd.c @@ -355,11 +355,9 @@ static void pd_startfromgui( void) char cmdbuf[1000], pdbuf[1000], *lastchar; const char *arg0; struct sockaddr_in server; - int msgsock; - int len = sizeof(server), nchar; + int len = sizeof(server); int ntry = 0, portno = FIRSTPORTNUM; int xsock = -1; - char morebuf[256]; #ifdef MSW short version = MAKEWORD(2, 0); WSADATA nobby; -- GitLab