From 8851f67efdaaee8d5bea6220a282d224e0552844 Mon Sep 17 00:00:00 2001 From: rlar Date: Tue, 20 Jul 2010 18:52:19 +0000 Subject: [PATCH] Change remaining code to use the new usage pattern cp_getvar(,CP_BOOL,NULL) --- ChangeLog | 10 ++++++++++ src/frontend/inp.c | 9 ++++----- src/frontend/misccoms.c | 2 +- src/frontend/plotting/agraf.c | 5 +++-- src/frontend/postcoms.c | 8 ++++---- src/frontend/rawfile.c | 5 +---- src/frontend/spec.c | 2 +- src/frontend/subckt.c | 4 ++-- 8 files changed, 26 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index f148bfc34..64f033818 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2010-07-20 Robert Larice + * src/frontend/inp.c , + * src/frontend/misccoms.c , + * src/frontend/postcoms.c , + * src/frontend/rawfile.c , + * src/frontend/spec.c , + * src/frontend/subckt.c , + * src/frontend/plotting/agraf.c : + Change remaining code to use the new usage pattern cp_getvar(,CP_BOOL,NULL) + 2010-07-20 Robert Larice * src/frontend/com_display.c , * src/frontend/device.c , diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 35156c422..872110d63 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -150,7 +150,7 @@ inp_list(FILE *file, struct line *deck, struct line *extras, int type) if (useout) out_init(); - cp_getvar("renumber", CP_BOOL, (char *) &renumber); + renumber = cp_getvar("renumber", CP_BOOL, NULL); if (type == LS_LOGICAL) { top1: for (here = deck; here; here = here->li_next) { @@ -698,7 +698,6 @@ inp_dodeck( struct variable *eev = NULL; wordlist *wl; bool noparse, ii; - bool brief; int print_listing; static int one; @@ -721,7 +720,7 @@ inp_dodeck( } ft_curckt = ct = alloc(struct circ); } - cp_getvar("noparse", CP_BOOL, (char *) &noparse); + noparse = cp_getvar("noparse", CP_BOOL, NULL); /* We check preliminary for the scale option. This special processing @@ -821,8 +820,8 @@ inp_dodeck( } /* for (dd = deck; dd; dd = dd->li_next) */ /* Only print out netlist if brief is FALSE */ - cp_getvar( "brief", CP_BOOL, (bool *) &brief ); - if(brief==FALSE) { + + if(!cp_getvar( "brief", CP_BOOL, NULL )) { /* output deck */ out_printf( "\nProcessed Netlist\n" ); out_printf( "=================\n" ); diff --git a/src/frontend/misccoms.c b/src/frontend/misccoms.c index d3d1eb204..6392270f4 100644 --- a/src/frontend/misccoms.c +++ b/src/frontend/misccoms.c @@ -35,7 +35,7 @@ com_quit(wordlist *wl) char buf[64]; bool noask; - (void) cp_getvar("noaskquit", CP_BOOL, (char *) &noask); + noask = cp_getvar("noaskquit", CP_BOOL, NULL); gr_clean(); cp_ccon(FALSE); if(wl) diff --git a/src/frontend/plotting/agraf.c b/src/frontend/plotting/agraf.c index c64c023d8..54aad977b 100644 --- a/src/frontend/plotting/agraf.c +++ b/src/frontend/plotting/agraf.c @@ -55,7 +55,8 @@ ft_agraf(double *xlims, double *ylims, struct dvec *xscale, struct plot *plot, s /* Make sure the margin is correct */ omargin = margin; - if (!cp_getvar("noasciiplotvalue", CP_BOOL, (char *) &novalue) && + novalue = cp_getvar("noasciiplotvalue", CP_BOOL, NULL); + if (!novalue && !vec_eq(xscale, vecs)) { margin *= 2; } else @@ -71,7 +72,7 @@ ft_agraf(double *xlims, double *ylims, struct dvec *xscale, struct plot *plot, s if (ft_nopage) nobreakp = TRUE; else - cp_getvar("nobreak", CP_BOOL, (char *) &nobreakp); + nobreakp = cp_getvar("nobreak", CP_BOOL, NULL); maxy -= (margin + FUDGE); maxx = xscale->v_length; xrange[0] = xlims[0]; diff --git a/src/frontend/postcoms.c b/src/frontend/postcoms.c index f9df97f76..df1dee5f6 100644 --- a/src/frontend/postcoms.c +++ b/src/frontend/postcoms.c @@ -234,12 +234,12 @@ com_print(wordlist *wl) height = i; if (height < 20) height = 20; - if (!cp_getvar("nobreak", CP_BOOL, (char *) &nobreak) && !ft_nopage) + nobreak = cp_getvar("nobreak", CP_BOOL, NULL); + if (!nobreak && !ft_nopage) nobreak = FALSE; else nobreak = TRUE; - (void) cp_getvar("noprintscale", CP_BOOL, (char *) - &noprintscale); + noprintscale = cp_getvar("noprintscale", CP_BOOL, NULL); bv = vecs; nextpage: /* Make the first vector of every page be the scale... */ @@ -423,7 +423,7 @@ com_write(wordlist *wl) else fprintf(cp_err, "Warning: strange file type %s\n", buf); } - (void) cp_getvar("appendwrite", CP_BOOL, (char *) &appendwrite); + appendwrite = cp_getvar("appendwrite", CP_BOOL, NULL); if (wl) names = ft_getpnames(wl, TRUE); diff --git a/src/frontend/rawfile.c b/src/frontend/rawfile.c index 06e0c87aa..3c545f21c 100644 --- a/src/frontend/rawfile.c +++ b/src/frontend/rawfile.c @@ -47,10 +47,7 @@ raw_write(char *name, struct plot *pl, bool app, bool binary) char buf[BSIZE_SP]; char *branch; - if (!cp_getvar("nopadding", CP_BOOL, (char *) &raw_padding)) - raw_padding = FALSE; - /* Invert since we want to know if we should pad. */ - raw_padding = !raw_padding; + raw_padding = !cp_getvar("nopadding", CP_BOOL, NULL); /* Why bother printing out an empty plot? */ if (!pl->pl_dvecs) { diff --git a/src/frontend/spec.c b/src/frontend/spec.c index 8686ef291..8a86cc461 100644 --- a/src/frontend/spec.c +++ b/src/frontend/spec.c @@ -237,7 +237,7 @@ com_spec(wordlist *wl) dc[i] += tdvec[i][k]*amp; } } - cp_getvar("spectrace", CP_BOOL, &trace); + trace = cp_getvar("spectrace", CP_BOOL, NULL); for (j = (startf==0 ? 1 : 0); j