diff --git a/src/frontend/com_fft.c b/src/frontend/com_fft.c index 8eeabce98..6943a71c0 100644 --- a/src/frontend/com_fft.c +++ b/src/frontend/com_fft.c @@ -32,7 +32,7 @@ com_fft(wordlist *wl) ngcomplex_t **fdvec = NULL; double **tdvec = NULL; double *freq, *win = NULL, *time; - double delta_t, span; + double span; int fpts, i, j, tlen, ngood; struct dvec *f, *vlist, *lv = NULL, *vec; struct pnode *pn, *names = NULL; @@ -58,7 +58,6 @@ com_fft(wordlist *wl) tlen = (plot_cur->pl_scale)->v_length; time = (plot_cur->pl_scale)->v_realdata; span = time[tlen-1] - time[0]; - delta_t = span/(tlen - 1); #ifdef GREEN // size of input vector is power of two and larger than spice vector @@ -284,7 +283,7 @@ com_psd(wordlist *wl) ngcomplex_t **fdvec = NULL; double **tdvec = NULL; double *freq, *win = NULL, *time, *ave; - double delta_t, span, noipower; + double span, noipower; int mm; unsigned long size, ngood, fpts, i, j, tlen, jj, smooth, hsmooth; char *s; @@ -292,7 +291,7 @@ com_psd(wordlist *wl) struct pnode *pn, *names = NULL; double *reald = NULL, *imagd = NULL; - int sign, isreal; + int sign; double scaling, sum; int order; double scale, sigma; @@ -310,7 +309,6 @@ com_psd(wordlist *wl) tlen = (plot_cur->pl_scale)->v_length; time = (plot_cur->pl_scale)->v_realdata; span = time[tlen-1] - time[0]; - delta_t = span/(tlen - 1); // get filter length from parameter input s = wl->wl_word; @@ -500,7 +498,6 @@ com_psd(wordlist *wl) printf("PSD: Freq. resolution: %g Hz, output length: %lu\n", 1.0/span*tlen/size, fpts); sign = 1; - isreal = 1; reald = TMALLOC(double, size); imagd = TMALLOC(double, size); diff --git a/src/frontend/device.c b/src/frontend/device.c index de51688da..3f5b80dae 100644 --- a/src/frontend/device.c +++ b/src/frontend/device.c @@ -256,7 +256,7 @@ all_show(wordlist *wl, int mode) wordlist *params, *nextgroup, *thisgroup; wordlist *prev, *next, *w; int screen_width; - dgen *dg, *listdg; + dgen *dg; int instances; int i, j, n; int param_flag, dev_flag; @@ -364,8 +364,6 @@ all_show(wordlist *wl, int mode) fprintf(cp_out, "%s:\n", dg->instance->GENname); fprintf(cp_out, " %-19s= %s\n", "model", dg->model->GENmodName); - listdg = dg; - if (param_flag) param_forall(dg, param_flag); else if (!params) @@ -420,7 +418,7 @@ all_show_old(wordlist *wl, int mode) wordlist *params, *nextgroup, *thisgroup; wordlist *prev, *next, *w; int screen_width; - dgen *dg, *listdg; + dgen *dg; int instances; int i, j, n; int param_flag, dev_flag; @@ -544,7 +542,6 @@ all_show_old(wordlist *wl, int mode) fprintf(cp_out, "\n"); } while (j); } - listdg = dg; if (param_flag) param_forall_old(dg, param_flag); @@ -626,12 +623,10 @@ printstr_m(dgen *dg, IFparm *p, int i) void param_forall(dgen *dg, int flags) { - int i, j, k, found; + int i, j, k; int xcount; IFparm *plist; - found = 0; - if (dg->flags & DGEN_INSTANCE) { xcount = *ft_sim->devices[dg->dev_type_no]->numInstanceParms; plist = ft_sim->devices[dg->dev_type_no]->instanceParms; @@ -663,12 +658,10 @@ param_forall(dgen *dg, int flags) void param_forall_old(dgen *dg, int flags) { - int i, j, k, found; + int i, j, k; int xcount; IFparm *plist; - found = 0; - if (dg->flags & DGEN_INSTANCE) { xcount = *ft_sim->devices[dg->dev_type_no]->numInstanceParms; plist = ft_sim->devices[dg->dev_type_no]->instanceParms; @@ -1135,7 +1128,7 @@ com_alter_common(wordlist *wl, int do_model) char **arglist; int i = 0, step = 0, n, wlen, maxelem = 3; wordlist *wl2 = NULL, *wlin, *rhs; - bool eqfound = FALSE, vecfound = FALSE; + bool eqfound = FALSE; if (!ft_curckt) { fprintf(cp_err, "Error: no circuit loaded\n"); @@ -1230,7 +1223,6 @@ com_alter_common(wordlist *wl, int do_model) wlin = wlin->wl_prev; maxelem++; if (eq(wlin->wl_word, "[")) { - vecfound = TRUE; break; } if (wlin->wl_prev == NULL) { diff --git a/src/frontend/gens.c b/src/frontend/gens.c index d5afdc12b..128d0721e 100644 --- a/src/frontend/gens.c +++ b/src/frontend/gens.c @@ -27,7 +27,6 @@ dgen * dgen_init(GENcircuit *ckt, wordlist *wl, int nomix, int flag, int model) { dgen *dg, *dg_save; - wordlist **prevp; NG_IGNORE(nomix); @@ -40,8 +39,6 @@ dgen_init(GENcircuit *ckt, wordlist *wl, int nomix, int flag, int model) dg->flags = 0; dg_save = dg; /* va: save, to avoid memory leak */ - prevp = &wl; - if (model) dg->flags = (DGEN_ALL & ~ DGEN_INSTANCE) | DGEN_INIT; else diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 351412a90..d7f9d6b1f 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -5140,7 +5140,7 @@ static void inp_bsource_compat(struct line *deck) { char *equal_ptr, *str_ptr, *tmp_char, *new_str, *final_str; - char actchar, prevchar = ' '; + char actchar; struct line *card, *new_line, *tmp_ptr; wordlist *wl = NULL, *wlist = NULL; char buf[512]; @@ -5374,7 +5374,6 @@ inp_bsource_compat(struct line *deck) wl->wl_word = copy(buf); str_ptr++; } - prevchar = actchar; } new_str = wl_flatten(wlist); diff --git a/src/frontend/plotting/graf.c b/src/frontend/plotting/graf.c index f06c13af7..d398dbc3c 100644 --- a/src/frontend/plotting/graf.c +++ b/src/frontend/plotting/graf.c @@ -1023,7 +1023,7 @@ gr_end_iplot(void) double * readtics(char *string) { - int i, k; + int k; char *words, *worde; double *tics, *ticsk; @@ -1031,7 +1031,7 @@ readtics(char *string) ticsk = tics; words = string; - for (i = k = 0; *words && k < MAXTICS; words = worde) { + for (k = 0; *words && k < MAXTICS; words = worde) { while (isspace(*words)) words++; diff --git a/src/frontend/plotting/grid.c b/src/frontend/plotting/grid.c index 0d1a21371..f2d1d6602 100644 --- a/src/frontend/plotting/grid.c +++ b/src/frontend/plotting/grid.c @@ -224,7 +224,7 @@ lingrid(GRAPH *graph, double lo, double hi, double delta, int type, Axis axis) int mag, mag2, mag3; double hmt, lmt, dst; int nsp; - double tenpowmag = 0.0, tenpowmag2, step, spacing; + double tenpowmag = 0.0, tenpowmag2, spacing; bool onedec = FALSE; int margin; int max; @@ -438,7 +438,6 @@ lingrid(GRAPH *graph, double lo, double hi, double delta, int type, Axis axis) nsp = (int)((hi - lo) / delta); if (nsp > 100) nsp = 100; - step = (max - margin) * delta / (hi - lo); } spacing = (max - margin) / nsp; @@ -757,7 +756,6 @@ polargrid(GRAPH *graph) double d, mx, my, tenpowmag; int hmt, lmt, mag; double minrad, maxrad; - bool centered = FALSE; /* Make sure that our area is square. */ if (graph->viewport.width > graph->viewport.height) @@ -793,11 +791,6 @@ polargrid(GRAPH *graph) (graph->data.xmax > 0) && (graph->data.ymax > 0)) minrad = 0; - if ((graph->data.xmin == - graph->data.xmax) && - (graph->data.ymin == -graph->data.ymax) && - (graph->data.xmin == graph->data.ymin)) - centered = TRUE; - mag = (int)floor(mylog10(maxrad)); tenpowmag = pow(10.0, (double) mag); hmt = (int)(maxrad / tenpowmag); @@ -839,14 +832,13 @@ drawpolargrid(GRAPH *graph) int hmt, lmt, i, step, mag; int relcx, relcy, relrad, dist, degs; int x1, y1, x2, y2; - double minrad, maxrad, pixperunit; + double minrad, pixperunit; char buf[64]; hmt = graph->grid.xaxis.circular.hmt; lmt = graph->grid.xaxis.circular.lmt; mag = graph->grid.xaxis.circular.mag; tenpowmag = pow(10.0, (double) mag); - maxrad = hmt * tenpowmag; minrad = lmt * tenpowmag; if ((minrad == 0) && ((hmt - lmt) > 5)) { @@ -1049,7 +1041,6 @@ static void smithgrid(GRAPH *graph) { double mx, my; - bool centered = FALSE; SetLinestyle(0); @@ -1108,11 +1099,6 @@ smithgrid(GRAPH *graph) graph->datawindow.xmax += (my - mx) / 2; } - if ((graph->datawindow.xmin == - graph->datawindow.xmax) && - (graph->datawindow.ymin == - graph->datawindow.ymax) && - (graph->datawindow.xmin == graph->datawindow.ymin)) - centered = TRUE; - /* Issue a warning if our data range is not normalized */ if (graph->datawindow.ymax > 1.1) { printf("\nwarning: exceeding range for smith chart"); @@ -1127,7 +1113,7 @@ smithgrid(GRAPH *graph) static void drawsmithgrid(GRAPH *graph) { - double mx, my, tenpowmag, d, dphi[CMAX], minrad, maxrad, rnorm[CMAX]; + double mx, my, d, dphi[CMAX], maxrad, rnorm[CMAX]; double pixperunit; int mag, i = 0, j = 0, k; double ir[CMAX], rr[CMAX], ki[CMAX], kr[CMAX], ks[CMAX]; @@ -1140,10 +1126,8 @@ drawsmithgrid(GRAPH *graph) my = (graph->datawindow.ymin + graph->datawindow.ymax) / 2; d = sqrt(mx * mx + my * my); maxrad = d + (graph->datawindow.xmax - graph->datawindow.xmin) / 2; - minrad = d - (graph->datawindow.xmax - graph->datawindow.xmin) / 2; mag = (int)floor(mylog10(maxrad)); - tenpowmag = pow(10.0, (double) mag); pixperunit = graph->viewport.width / (graph->datawindow.xmax - graph->datawindow.xmin); diff --git a/src/frontend/rawfile.c b/src/frontend/rawfile.c index a60801324..7553f927b 100644 --- a/src/frontend/rawfile.c +++ b/src/frontend/rawfile.c @@ -708,7 +708,7 @@ void spar_write(char *name, struct plot *pl, double Rbaseval) { FILE *fp; - int length, numdims; + int length; int i, prec; struct dvec *v, *lv; @@ -723,7 +723,7 @@ spar_write(char *name, struct plot *pl, double Rbaseval) else prec = 6; - numdims = length = 0; + length = 0; for (v = pl->pl_dvecs; v; v = v->v_next) { /* All vectors have to have same length, diff --git a/src/maths/misc/norm.c b/src/maths/misc/norm.c index cae748dd7..72c02fd45 100644 --- a/src/maths/misc/norm.c +++ b/src/maths/misc/norm.c @@ -13,19 +13,15 @@ maxNorm(double *vector, int size) { double norm = 0.0; double candidate; - int index, nIndex; + int index; - nIndex = 1; for( index = 1; index <= size; index++ ) { candidate = fabs(vector[ index ]); if( candidate > norm ) { norm = candidate; - nIndex = index; } } - /* - printf("\n maxNorm: index = %d", nIndex); - */ + return( norm ); } diff --git a/src/spicelib/analysis/cktnames.c b/src/spicelib/analysis/cktnames.c index 9b248587b..78e39d905 100644 --- a/src/spicelib/analysis/cktnames.c +++ b/src/spicelib/analysis/cktnames.c @@ -34,9 +34,7 @@ int CKTdnames(CKTcircuit *ckt) { CKTnode *here; - int i; - i=0; for (here = ckt->CKTnodes->next; here; here = here->next) { printf("%03d: %s\n", here->number, here->name); } diff --git a/src/spicelib/analysis/cktpzstr.c b/src/spicelib/analysis/cktpzstr.c index 595da3f7c..4f5d12e97 100644 --- a/src/spicelib/analysis/cktpzstr.c +++ b/src/spicelib/analysis/cktpzstr.c @@ -520,7 +520,7 @@ CKTpzRunTrial(CKTcircuit *ckt, PZtrial **new_trialp, PZtrial **set) { PZAN *job = (PZAN *) ckt->CKTcurJob; - PZtrial *match, *base, *new_trial; + PZtrial *match, *new_trial; PZtrial *p, *prev; SPcomplex def_frac, diff_frac; double reltol, abstol; @@ -550,7 +550,6 @@ CKTpzRunTrial(CKTcircuit *ckt, PZtrial **new_trialp, PZtrial **set) shifted = 0; prev = NULL; - base = NULL; match = NULL; for (p = Trials; p != NULL; p = p->next) { @@ -560,8 +559,6 @@ CKTpzRunTrial(CKTcircuit *ckt, PZtrial **new_trialp, PZtrial **set) if (diff_frac.real < 0.0 || (diff_frac.real == 0.0 && diff_frac.imag < 0.0)) { prev = p; - if (p->flags & ISAMINIMA) - base = p; } if (p->flags & ISAROOT) { diff --git a/src/spicelib/devices/asrc/asrcacld.c b/src/spicelib/devices/asrc/asrcacld.c index 248dedef6..653fe4349 100644 --- a/src/spicelib/devices/asrc/asrcacld.c +++ b/src/spicelib/devices/asrc/asrcacld.c @@ -28,7 +28,6 @@ ASRCacLoad(GENmodel *inModel, CKTcircuit *ckt) ASRCinstance *here; int i, j; double *derivs; - double rhs; double difference; double factor; @@ -57,7 +56,6 @@ ASRCacLoad(GENmodel *inModel, CKTcircuit *ckt) j=0; derivs = here->ASRCacValues; - rhs = (here->ASRCacValues)[here->ASRCtree->numVars]; if( here->ASRCtype == ASRC_VOLTAGE) { *(here->ASRCposptr[j++]) += 1.0; diff --git a/src/spicelib/parser/inpgtok.c b/src/spicelib/parser/inpgtok.c index 2b328aedd..dce183443 100644 --- a/src/spicelib/parser/inpgtok.c +++ b/src/spicelib/parser/inpgtok.c @@ -149,7 +149,6 @@ int INPgetNetTok(char **line, char **token, int gobble) /* eat non-whitespace trash AFTER token? */ { char *point; - int signstate; int diffpoints; /* scan along throwing away garbage characters until end of line @@ -176,7 +175,6 @@ int INPgetNetTok(char **line, char **token, int gobble) /* now find all good characters up to next occurance of a separation character. INPgetNetTok is very liberal about what it accepts. */ - signstate = 0; for (point = *line; *point != '\0'; point++) { if (*point == ' ') break;