Commit 84f7eb18 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

remove more unused variables, remove an unnecessary pointer deref in d_math.c

parent 0c343f4f
......@@ -361,7 +361,7 @@ static t_int *ftom_tilde_perform(t_int *w)
{
t_sample *in = *(t_sample **)(w+1), *out = *(t_sample **)(w+2);
t_int n = *(t_int *)(w+3);
for (; n--; *in++, out++)
for (; n--; in++, out++)
{
t_sample f = *in;
*out = (f > 0 ? 17.3123405046 * log(.12231220585 * f) : -1500);
......
......@@ -231,7 +231,7 @@ int open_soundfile_via_fd(int fd, int headersize,
int *p_bytespersamp, int *p_bigendian, int *p_nchannels, long *p_bytelimit,
long skipframes)
{
int format, nchannels, bigendian, bytespersamp, swap, sysrtn;
int nchannels, bigendian, bytespersamp, swap, sysrtn;
long bytelimit = 0x7fffffff;
errno = 0;
if (headersize >= 0) /* header detection overridden */
......@@ -1633,7 +1633,6 @@ static void *readsf_child_main(void *zz)
}
else if (x->x_requestcode == REQUEST_OPEN)
{
char boo[80];
int sysrtn, wantbytes;
/* copy file stuff out of the data structure so we can
......@@ -1950,7 +1949,7 @@ static t_int *readsf_perform(t_int *w)
t_sample *fp;
if (x->x_state == STATE_STREAM)
{
int wantbytes, nchannels, sfchannels = x->x_sfchannels;
int wantbytes, sfchannels = x->x_sfchannels;
pthread_mutex_lock(&x->x_mutex);
wantbytes = sfchannels * vecsize * bytespersample;
while (
......@@ -2189,14 +2188,10 @@ static void *writesf_child_main(void *zz)
}
else if (x->x_requestcode == REQUEST_OPEN)
{
char boo[80];
int fd, sysrtn, writebytes;
/* copy file stuff out of the data structure so we can
relinquish the mutex while we're in open_soundfile(). */
long onsetframes = x->x_onsetframes;
long bytelimit = 0x7fffffff;
int skipheaderbytes = x->x_skipheaderbytes;
int bytespersample = x->x_bytespersample;
int sfchannels = x->x_sfchannels;
int bigendian = x->x_bigendian;
......@@ -2360,7 +2355,6 @@ static void *writesf_child_main(void *zz)
if (x->x_fd >= 0)
{
int bytesperframe = x->x_bytespersample * x->x_sfchannels;
int bigendian = x->x_bigendian;
char *filename = x->x_filename;
int fd = x->x_fd;
int filetype = x->x_filetype;
......@@ -2397,7 +2391,8 @@ static void *writesf_child_main(void *zz)
/******** the object proper runs in the calling (parent) thread ****/
static void writesf_tick(t_writesf *x);
/* Not sure why this is declared here so commenting it out... */
//static void writesf_tick(t_writesf *x);
static void *writesf_new(t_floatarg fnchannels, t_floatarg fbufsize)
{
......
......@@ -687,7 +687,6 @@ void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv)
t_atom *at = x->b_vec;
int ac = x->b_n;
int nargs, maxnargs = 0;
int at_arg = 0;
//first we need to check if the list of arguments has $@
//fprintf(stderr,"=========\nbinbuf_eval argc:%d ac:%d\n", argc, (int)ac);
......
......@@ -3,6 +3,7 @@
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
#include <stdlib.h>
#include <string.h>
#include "m_pd.h"
#include "m_imp.h"
......
......@@ -220,7 +220,7 @@ static int sys_histphase;
int sys_addhist(int phase)
{
int i, j, phasewas = sys_histphase;
int j, phasewas = sys_histphase;
double newtime = sys_getrealtime();
int msec = (newtime - sys_histtime) * 1000.;
for (j = NBIN-1; j >= 0; j--)
......@@ -259,7 +259,7 @@ static char *(oss_errornames[]) = {
void glob_audiostatus(void)
{
int dev, nresync, nresyncphase, i;
int nresync, nresyncphase, i;
nresync = (oss_nresync >= NRESYNC ? NRESYNC : oss_nresync);
nresyncphase = oss_resyncphase - 1;
post("audio I/O error history:");
......
......@@ -221,7 +221,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 blocksize)
{
int i, *ip;
int i;
int defaultchannels = SYS_DEFAULTCH;
int inchans, outchans, nrealindev, nrealoutdev;
int realindev[MAXAUDIOINDEV], realoutdev[MAXAUDIOOUTDEV];
......@@ -711,7 +711,7 @@ static void sys_listaudiodevs(void )
/* start an audio settings dialog window */
void glob_audio_properties(t_pd *dummy, t_floatarg flongform)
{
char buf[1024 + 2 * MAXNDEV*(DEVDESCSIZE+4)];
//char buf[1024 + 2 * MAXNDEV*(DEVDESCSIZE+4)];
/* these are the devices you're using: */
int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV];
int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV];
......@@ -774,10 +774,10 @@ void glob_audio_properties(t_pd *dummy, t_floatarg flongform)
audiooutchan4 = (naudiooutdev > 3 ? choutdev[3] : 0);
// sprintf(buf,
//"pdtk_audio_dialog %%s \
//%d %d %d %d %d %d %d %d \
//%d %d %d %d %d %d %d %d \
//%d %d %d %d %d %d\n",
//"pdtk_audio_dialog %%s "
//"%d %d %d %d %d %d %d %d "
//"%d %d %d %d %d %d %d %d "
//"%d %d %d %d %d %d\n",
// audioindev1, audioindev2, audioindev3, audioindev4,
// audioinchan1, audioinchan2, audioinchan3, audioinchan4,
// audiooutdev1, audiooutdev2, audiooutdev3, audiooutdev4,
......@@ -834,10 +834,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: */
......@@ -1145,7 +1142,7 @@ int sys_audiodevnametonumber(int output, const char *name)
void sys_audiodevnumbertoname(int output, int devno, char *name, int namesize)
{
char indevlist[MAXNDEV*DEVDESCSIZE], outdevlist[MAXNDEV*DEVDESCSIZE];
int nindevs = 0, noutdevs = 0, i, canmulti, cancallback;
int nindevs = 0, noutdevs = 0, canmulti, cancallback;
if (devno < 0)
{
*name = 0;
......
......@@ -235,12 +235,10 @@ int alsa_open_audio(int naudioindev, int *audioindev, int nchindev,
int *chindev, int naudiooutdev, int *audiooutdev, int nchoutdev,
int *choutdev, int rate, int blocksize)
{
int err, inchans = 0, outchans = 0, subunitdir;
int err, inchans = 0, outchans = 0;
char devname[512];
snd_output_t* out;
int frag_size = (blocksize ? 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 */
......@@ -393,12 +391,12 @@ void alsa_close_audio(void)
int alsa_send_dacs(void)
{
static double timenow;
#ifdef DEBUG_ALSA_XFER
static int xferno = 0;
static int callno = 0;
double timelast = timenow;
#endif
static double timenow;
double timelast;
t_sample *fp1, *fp2;
int i, j, k, iodev, result, ch;
int chansintogo, chansouttogo;
......@@ -414,7 +412,6 @@ int alsa_send_dacs(void)
chansouttogo = sys_outchannels;
transfersize = DEFDACBLKSIZE;
timelast = timenow;
timenow = sys_getrealtime();
#ifdef DEBUG_ALSA_XFER
......
......@@ -493,6 +493,8 @@ static int check_exists(const char*path)
}
#endif
extern void sys_expandpathelems(const char *name, char *result);
void sys_loadpreferences( void)
{
int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV];
......
......@@ -284,6 +284,8 @@ void glob_forward_files_from_secondary_instance(void)
gui_end_vmess();
}
extern void glob_recent_files(t_pd *dummy);
/* this is called from main() in s_entry.c */
int sys_main(int argc, char **argv)
{
......
......@@ -89,7 +89,6 @@ static void dologpost(const void *object, const int level, const char *s)
}
else
{
char obuf[MAXPDSTRING];
//sys_vgui("::pdwindow::logpost {%s} %d {%s}\n",
//strnpointerid(obuf, object, MAXPDSTRING),
//level, strnescape(upbuf, s, MAXPDSTRING));
......@@ -133,8 +132,6 @@ void logpost(const void *object, const int level, const char *fmt, ...)
{
char buf[MAXPDSTRING];
va_list ap;
t_int arg[8];
int i;
va_start(ap, fmt);
vsnprintf(buf, MAXPDSTRING-1, fmt, ap);
va_end(ap);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment