diff --git a/ChangeLog b/ChangeLog index 139e1496c..0ff4b7184 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-05-03 Arno W. Peters + + * source tree: removed most of `#ifdef notdef' and made converted + some function calls from K&R -> ANSI. + 2000-05-01 Arno W. Peters * Added .cvsignore files to prevent CVS from marking generated diff --git a/man/man1/nutmeg.1 b/man/man1/nutmeg.1 index 3fe2e70ed..28572b1a2 100644 --- a/man/man1/nutmeg.1 +++ b/man/man1/nutmeg.1 @@ -22,13 +22,19 @@ Arguments are: Don't try to load the default data file ("rawspice") if no other files are given. .TP -\fB-n\fR (or \fB-N\fR) +\fB-n\fR (or \fB--no-spiceinit\fR) Don't try to source the file ".spiceinit" upon startup. Normally \fBnutmeg\fR tries to find the file in the current directory, and if it is not found then in the user's home directory. .TP -\fB-t term\fR (or \fB-T term\fR) +\fB-t term\fR (or \fB--term=term\fR) The program is being run on a terminal with \fImfb\fR name \fBterm\fR. +.TP +\fB-h\fR (or \fB--help\fR) +Display a verbose help on the arguments available to the program. +.TP +\fB-v\fR (or \fB--version\fR) +Display a version number and copyright information of the program. .PP Further arguments are taken to be data files in binary or ascii format (see \fBsconvert\fR(1)) which are loaded into nutmeg. If the file diff --git a/man/man1/spice.1 b/man/man1/spice.1 index 1a70aac5b..51385b861 100644 --- a/man/man1/spice.1 +++ b/man/man1/spice.1 @@ -20,34 +20,46 @@ are described here. You should be familiar with the manual page for .PP Arguments are: .TP -\fB-n\fR (or \fB-N\fR) +\fB-n\fR (or \fB--no-spiceinit\fR) Don't try to source the file ".spiceinit" upon startup. Normally \*S tries to find the file in the current directory, and if it is not found then in the user's home directory. .TP -\fB-t term\fR (or \fB-T term\fR) +\fB-q\fR (or \fB--completion\fR) +Enable command completion. +.TP +\fB-t term\fR (or \fB--term=term\fR) The program is being run on a terminal with \fImfb\fR name \fBterm\fR. .TP -\fB-b\fR (or \fB-B\fR) +\fB-b\fR (or \fB--batch\fR) Run in batch mode. \*S will read the standard input or the specified input file and do the simulation. Note that if the standard input is not a terminal, \*S will default to batch mode, unless the -i flag is given. .TP -\fB-s\fR (or \fB-S\fR) +\fB-s\fR (or \fB--server\fR) Run in server mode. This is like batch mode, except that a temporary rawfile is used and then written to the standard output, preceded by a line with a single "@", after the simulation is done. This mode is used by the spice daemon. .TP -\fB-i\fR (or \fB-I\fR) +\fB-i\fR (or \fB--interactive\fR) Run in interactive mode. This is useful if the standard input is not a terminal but interactive mode is desired. Command completion is not available unless the standard input is a terminal, however. .TP -\fB-r rawfile\fR (or \fB-R rawfile\fR) +\fB-r rawfile\fR (or \fB--rawfile=file\fR) Use \fBrawfile\fR as the default file into which the results of the simulation are saved. +.TP +\fB-c circuitfile\fR (or \fB--circuitfile=circuitfile\fR) +Use \fBcircuitfile\fR as the default input deck. +.TP +\fB-h\fR (or \fB--help\fR) +Display a verbose help on the arguments available to the program. +.TP +\fB-v\fR (or \fB--version\fR) +Display a version number and copyright information of the program. .PP Further arguments are taken to be \*S input decks, which are read and saved. (If batch mode is requested then they are run immediately.) diff --git a/src/analysis/cktinit.c b/src/analysis/cktinit.c index c796ef697..9db6958d7 100644 --- a/src/analysis/cktinit.c +++ b/src/analysis/cktinit.c @@ -27,10 +27,6 @@ CKTinit(void **ckt) (sckt)->CKTnodes = (CKTnode *)NULL; (sckt)->CKTlastNode = (CKTnode *)NULL; sckt->CKTmatrix = NULL; -#ifdef notdef - error = NIinit(sckt); - if(error) return(error); -#endif (sckt)->CKTgmin = 1e-12; (sckt)->CKTabstol = 1e-12; diff --git a/src/analysis/cktpzld.c b/src/analysis/cktpzld.c index 0abbf31eb..d724d99f6 100644 --- a/src/analysis/cktpzld.c +++ b/src/analysis/cktpzld.c @@ -52,11 +52,6 @@ combine: } #endif /* PARALLEL_ARCH */ -#ifdef notdef - printf("*** Before PZ adjustments *\n"); - SMPprint(ckt->CKTmatrix, stdout); -#endif - if (pzan->PZbalance_col && pzan->PZsolution_col) { SMPcAddCol(ckt->CKTmatrix, pzan->PZbalance_col, pzan->PZsolution_col); /* AC sources ?? XXX */ @@ -72,10 +67,5 @@ combine: if (pzan->PZdrive_nptr) *pzan->PZdrive_nptr = -1.0; -#ifdef notdef - printf("*** After PZ adjustments *\n"); - SMPprint(ckt->CKTmatrix, stdout); -#endif - return(OK); } diff --git a/src/analysis/cktpzstr.c b/src/analysis/cktpzstr.c index 7f70fa7d6..607271df8 100644 --- a/src/analysis/cktpzstr.c +++ b/src/analysis/cktpzstr.c @@ -636,14 +636,6 @@ CKTpzRunTrial(CKTcircuit *ckt, PZtrial **new_trialp, PZtrial **set) #endif if (!(p->flags & ISAROOT) && CKTpzTrapped == 3 && NIpzK != 0.0 && NIpzK_mag > -10) { -#ifdef notdef - if (p->flags & ISAROOT) { - /* Ugh! muller doesn't work right */ - new_trial->flags = ISAMINIMA; - new_trial->s.imag = scalb(NIpzK, (int) (NIpzK_mag / 2)); - pretest = 0; - } else { -#endif p->flags |= ISAMINIMA; free(new_trial); *new_trialp = p; diff --git a/src/analysis/cktsens.c b/src/analysis/cktsens.c index 7ebc8e824..d658a74aa 100644 --- a/src/analysis/cktsens.c +++ b/src/analysis/cktsens.c @@ -77,22 +77,6 @@ int sens_sens(CKTcircuit *ckt, int restart) int type; #ifndef notdef -#ifdef notdef - for (sg = sgen_init(ckt, 0); sg; sgen_next(&sg)) { - if (sg->is_instparam) - printf("%s:%s:%s -> param %s\n", - DEVices[sg->dev]->DEVpublic.name, - sg->model->GENmodName, - sg->instance->GENname, - sg->ptable[sg->param].keyword); - else - printf("%s:%s:%s -> mparam %s\n", - DEVices[sg->dev]->DEVpublic.name, - sg->model->GENmodName, - sg->instance->GENname, - sg->ptable[sg->param].keyword); - } -#endif #ifdef ASDEBUG DEBUG(1) printf(">>> restart : %d\n", restart); @@ -117,10 +101,6 @@ int sens_sens(CKTcircuit *ckt, int restart) (ckt->CKTmode & MODEUIC) | MODEDCOP | MODEINITFLOAT, ckt->CKTdcMaxIter); -#ifdef notdef - ckt->CKTmode = (ckt->CKTmode & MODEUIC) - | MODEDCOP | MODEINITSMSIG; -#endif if (error) return error; @@ -230,13 +210,6 @@ int sens_sens(CKTcircuit *ckt, int restart) } #endif -#ifdef notdef - for (j = 0; j <= ckt->CKTmaxOrder + 1; j++) { - save_states[j] = ckt->CKTstates[j]; - ckt->CKTstates[j] = NULL; - } -#endif - for (i = 0; i < nfreqs; i++) { /* XXX handle restart */ @@ -275,12 +248,6 @@ int sens_sens(CKTcircuit *ckt, int restart) E = ckt->CKTrhs; iE = ckt->CKTirhs; Y = ckt->CKTmatrix; -#ifdef notdef - for (j = 0; j <= ckt->CKTmaxOrder + 1; j++) { - /* XXX Free new states */ - ckt->CKTstates[j] = save_states[j]; - } -#endif error = CKTtemp(ckt); if (error) return error; @@ -291,13 +258,6 @@ int sens_sens(CKTcircuit *ckt, int restart) if (error) return error; -#ifdef notdef - /* XXX Why? */ - for (j = 0; j <= ckt->CKTmaxOrder + 1; j++) { - ckt->CKTstates[j] = NULL; - } -#endif - } /* Use a different vector & matrix */ @@ -370,9 +330,7 @@ int sens_sens(CKTcircuit *ckt, int restart) #ifdef ASDEBUG DEBUG(1) printf("Original value: %g\n", sg->value); -#endif -#ifdef ASDEBUG DEBUG(2) { printf("Effect of device:\n"); spPrint(delta_Y, 0, 1, 1); @@ -571,13 +529,6 @@ int sens_sens(CKTcircuit *ckt, int restart) ckt->CKTmatrix = Y; ckt->CKTbypass = bypass; -#ifdef notdef - for (j = 0; j <= ckt->CKTmaxOrder + 1; j++) { - if (ckt->CKTstates[j]) - FREE(ckt->CKTstates[j]); - ckt->CKTstates[j] = save_states[j]; - } -#endif #endif return OK; diff --git a/src/analysis/sensaskq.c b/src/analysis/sensaskq.c index caff46c98..6cf457c8e 100644 --- a/src/analysis/sensaskq.c +++ b/src/analysis/sensaskq.c @@ -45,12 +45,6 @@ SENSask(CKTcircuit *ckt, void *anal, int which, IFvalue *value) value->rValue = sinfo->defperturb; break; -#ifdef notdef - case SENS_TYPE: - value->sValue = sinfo->type; - break; -#endif - default: return(E_BADPARM); } diff --git a/src/analysis/senssetp.c b/src/analysis/senssetp.c index 879e4c06b..d7751619f 100644 --- a/src/analysis/senssetp.c +++ b/src/analysis/senssetp.c @@ -99,33 +99,6 @@ static IFparm SENSparms[] = { { "oct", SENS_OCT, IF_SET|IF_FLAG, "step by octaves" }, { "lin", SENS_LIN, IF_SET|IF_FLAG, "step linearly" }, { "dc", SENS_DC, IF_SET|IF_FLAG, "analysis at DC" }, - -#ifdef notdef - /* Future coding */ - /* perturbation limits */ - /* defaults for the analysis */ - { "deftol", SENS_DEFTOL, IF_SET|IF_REAL, "default tolerance" }, - { "defperturb", SENS_DEFPERT, IF_SET|IF_REAL, "default perterbation" }, - { "type", SENS_TYPE, IF_SET|IF_INTEGER, - "describe device, model or element parameters" }, - - { "device", SENS_DEVICE, IF_STRING, "type of model or device" }, - { "devdeftol", SENS_DEVDEFTOL, IF_SET|IF_REAL, - "default tolerance (device type)" }, - { "devdefperturb",SENS_DEVDEFPERT, IF_SET|IF_REAL, - "default perturbation (device type)" }, - { "moddeftol", SENS_DEVDEFTOL, IF_SET|IF_REAL, - "default tolerance (model)" }, - { "moddefperturb",SENS_DEVDEFPERT, IF_SET|IF_REAL, - "default perturbation (model)" }, - - /*{ "name", SENS_NAME, IF_SET|IF_STRING, - "name of model or element" }, */ - { "param", SENS_PARAM,IF_SET|IF_STRING, "name of parameter" }, - { "tol", SENS_TOL, IF_SET|IF_REAL, "tolerance" }, - { "perturb", SENS_PERT, IF_SET|IF_REAL, "perturbation" } -#endif - }; SPICEanalysis SENSinfo = { diff --git a/src/analysis/tfanal.c b/src/analysis/tfanal.c index 8effddfa1..e6af2655f 100644 --- a/src/analysis/tfanal.c +++ b/src/analysis/tfanal.c @@ -46,16 +46,6 @@ TFanal(CKTcircuit *ckt, int restart) (ckt->CKTmode & MODEUIC) | MODEDCOP | MODEINITFLOAT, ckt->CKTdcMaxIter); -#ifdef notdef - /* don't need this any more since newconvtest leaves the matrix factored */ - ckt->CKTmode = (ckt->CKTmode & MODEUIC) | MODEDCOP | MODEINITFLOAT; - error = CKTload(ckt); - if(error) return(error); - - error=SMPluFac(ckt->CKTmatrix,ckt->CKTpivotAbsTol,ckt->CKTdiagGmin); - if(error) return(error); -#endif /* notdef */ - Itype = CKTtypelook("Isource"); Vtype = CKTtypelook("Vsource"); if(Itype != -1) { diff --git a/src/circuit/inpgtok.c b/src/circuit/inpgtok.c index 925ee3803..b73ad06fc 100644 --- a/src/circuit/inpgtok.c +++ b/src/circuit/inpgtok.c @@ -76,13 +76,6 @@ INPgetTok(char **line, char **token, int gobble) if(**line == '\t') continue; if((**line == '=') && gobble) continue; if((**line == ',') && gobble) continue; -#ifdef notdef - /* This is the wrong thing to do for expression-valued parameters. The - parens will get taken out at the beginning, leave them here for - parse trees */ - if((**line == /* (match */')') && gobble) continue; - if((**line == '(' /* match) */) && gobble) continue; -#endif break; } /*printf("found token (%s) and rest of line (%s)\n",*token,*line);*/ diff --git a/src/circuit/inpptree.c b/src/circuit/inpptree.c index 80721bd28..a438bf188 100644 --- a/src/circuit/inpptree.c +++ b/src/circuit/inpptree.c @@ -896,10 +896,6 @@ PTlexer(char **line) char *sbuf, *s; sbuf = *line; -#ifdef notdef - printf("entering lexer, sbuf = '%s', lastoken = %d, lasttype = %d\n", - sbuf, lasttoken, lasttype); -#endif while ((*sbuf == ' ') || (*sbuf == '\t') || (*sbuf == '=')) sbuf++; @@ -991,19 +987,15 @@ PTlexer(char **line) return (&el); } -#ifdef notdef +#if 0 /* Debugging stuff. */ -#ifdef __STDC__ + void printTree(INPparseNode*); -#else /* stdc */ -void printTree(); -#endif /* stdc */ + void -INPptPrint(str, ptree) - char *str; - IFparseTree *ptree; +INPptPrint(char *str, IFparseTree *ptree) { int i; @@ -1019,8 +1011,7 @@ INPptPrint(str, ptree) } void -printTree(pt) - INPparseNode *pt; +printTree(INPparseNode *pt) { switch (pt->type) { case PT_CONSTANT: diff --git a/src/circuit/sperror.c b/src/circuit/sperror.c index 17760307e..1d66d68b7 100644 --- a/src/circuit/sperror.c +++ b/src/circuit/sperror.c @@ -129,9 +129,5 @@ SPerror(int type) if (val) { (void) strcpy(val, msg); } -#ifdef notdef - else - (*(SPfrontEnd->IFerror))(ERR_PANIC,nomem,(IFuid *)NULL); -#endif return(val); } diff --git a/src/frontend/aspice.c b/src/frontend/aspice.c index 1e4aadc1c..f8bef98d8 100644 --- a/src/frontend/aspice.c +++ b/src/frontend/aspice.c @@ -293,12 +293,6 @@ com_rspice(wordlist *wl) pid = fork( ); if (pid == 0) { -#ifdef notdef - char com_buf[200]; - - sprintf(com_buf, "%s %s %s -s", remote_shell, rhost, program); - printf("executing: \"%s\"\n", com_buf); -#endif /* I am the "server" process */ close(to_serv[1]); close(from_serv[0]); @@ -381,10 +375,6 @@ com_rspice(wordlist *wl) fprintf(stderr, "Error reading rawdata: %s\n", buf); continue; } -#ifdef notdef - fprintf(stderr, "adjusting rawfile: write \"%d\" at %ld\n", - num, pos); -#endif if (fseek(out, pos, SEEK_SET)) fprintf(stderr, "Error adjusting rawfile: write \"%d\" at %ld\n", diff --git a/src/frontend/device.c b/src/frontend/device.c index 373ae20f2..86131d5df 100644 --- a/src/frontend/device.c +++ b/src/frontend/device.c @@ -566,10 +566,6 @@ com_altermod(wordlist *wl) void com_alter_common(wordlist *wl, int do_model) { -#ifdef notdef - struct variable var, *nv, *prev; - double *dd; -#endif wordlist *eqword, *words; char *dev, *p; char *param; @@ -650,78 +646,6 @@ com_alter_common(wordlist *wl, int do_model) /* Vector data (dv) should get garbage-collected. */ return; - -#ifdef notdef - while (wl) { - param = wl->wl_word; - wl = wl->wl_next; - - if (!wl) { - val = param; - param = NULL; - } else { - val = wl->wl_word; - wl = wl->wl_next; - } - - /* Now figure out what the value should be... */ - if (eq(val, "TRUE")) { - var.va_type = VT_BOOL; - var.va_bool = TRUE; - } else if (eq(val, "FALSE")) { - var.va_type = VT_BOOL; - var.va_bool = FALSE; - } else if (eq(val, "[")) { - var.va_type = VT_LIST; - prev = NULL; - while (wl && !eq(wl->wl_word, "]")) { - val = wl->wl_word; - nv = alloc(struct variable); - if (dd = ft_numparse(&val, FALSE)) { - nv->va_type = VT_REAL; - nv->va_real = *dd; - } else { - fprintf(cp_err, "Error: \"%s\" is not a number\n", val); - break; - } - if (!prev) - var.va_vlist = nv; - else - prev->va_next = nv; - nv->va_next = NULL; - wl = wl->wl_next; - prev = nv; - } - if (wl && eq(wl->wl_word, "]")) { - wl = wl->wl_next; - } else { - while (nv) { - prev = nv->va_next; - tfree(nv); - nv = prev; - } - return; - } - } else if (dd = ft_numparse(&val, FALSE)) { - var.va_type = VT_REAL; - var.va_real = *dd; - } else { - var.va_type = VT_STRING; - var.va_string = val; - } - - if_setparam(ft_curckt->ci_ckt, &dev, param, &var, do_model); - - if (var.va_type == VT_LIST) { - for (nv = var.va_vlist; nv; nv = prev) { - prev = nv->va_next; - tfree(nv); - } - } - - } -#endif - } /* Given a device name, possibly with wildcards, return the matches. */ diff --git a/src/frontend/display.c b/src/frontend/display.c index 6f2006f42..898468270 100644 --- a/src/frontend/display.c +++ b/src/frontend/display.c @@ -276,19 +276,6 @@ void DatatoScreen(GRAPH *graph, double x, double y, int *screenx, int *screeny) } -#ifdef notdef -/* -NDCtoScreen(x0, y0, px, py) - double x0, y0; - int *px, *py; -{ - - (*(dispdev->NDCtoScreen))(x0, y0, px, py); - -} -*/ -#endif - void Input(REQUEST *request, RESPONSE *response) { diff --git a/src/frontend/doplot.c b/src/frontend/doplot.c index 310978bda..32e1bb61e 100644 --- a/src/frontend/doplot.c +++ b/src/frontend/doplot.c @@ -762,37 +762,12 @@ plotit(wordlist *wl, char *hcopy, char *devname) /* Figure out the proper x- and y-axis limits. */ if (ylim) { -#ifdef notdef - if (gtype == GRID_SMITH) { - if (xlim) { - SMITH_tfm(xlim[0], ylim[0], &dummy, &ylims[0]); - SMITH_tfm(xlim[1], ylim[1], &dummy, &ylims[1]); - } else { - SMITH_tfm(0.0, ylim[0], &dummy, &ylims[0]); - SMITH_tfm(0.0, ylim[1], &dummy, &ylims[1]); - } - } else { - } -#endif ylims[0] = ylim[0]; ylims[1] = ylim[1]; } else if (oneval) { ylims[0] = HUGE; ylims[1] = - ylims[0]; for (d = vecs; d; d = d->v_link2) { -#ifdef notdef - if (gtype == GRID_SMITH) { - dd = ft_SMITHminmax(d, TRUE); - if( dd[0] < 0.0 ) - dd[0] *= 1.1; - else - dd[0] *= 0.9; - if( dd[1] >= 0.0 ) - dd[1] *= 1.1; - else - dd[1] *= 0.9; - } else -#endif dd = ft_minmax(d, TRUE); if (dd[0] < ylims[0]) ylims[0] = dd[0]; @@ -822,37 +797,12 @@ plotit(wordlist *wl, char *hcopy, char *devname) } if (xlim) { -#ifdef notdef - if (gtype == GRID_SMITH) { - if (ylim) { - SMITH_tfm(xlim[0], ylim[0], &xlims[0], &dummy); - SMITH_tfm(xlim[1], ylim[1], &xlims[1], &dummy); - } else { - SMITH_tfm(xlim[0], 0.0, &xlims[0], &dummy); - SMITH_tfm(xlim[1], 0.0, &xlims[1], &dummy); - } - } else { - } -#endif xlims[0] = xlim[0]; xlims[1] = xlim[1]; } else if (oneval) { xlims[0] = HUGE; xlims[1] = - xlims[0]; for (d = vecs; d; d = d->v_link2) { -#ifdef notdef - if (gtype == GRID_SMITH) { - dd = ft_SMITHminmax(d, FALSE); - if( dd[0] < 0.0 ) - dd[0] *= 1.1; - else - dd[0] *= 0.9; - if( dd[1] >= 0.0 ) - dd[1] *= 1.1; - else - dd[1] *= 0.9; - } else -#endif dd = ft_minmax(d, FALSE); if (dd[0] < xlims[0]) @@ -910,25 +860,6 @@ plotit(wordlist *wl, char *hcopy, char *devname) ylims[1] *= (ylims[1] > 0) ? 1.1 : 0.9; } -#ifdef notdef - /* Now shrink the limits very slightly -- this helps prevent round-off - * error from doing bad things. - */ - if (gtype != GRID_LOGLOG && gtype != GRID_XLOG - && gtype != GRID_POLAR && gtype != GRID_SMITH) - { - tt = xlims[1] - xlims[0]; - xlims[0] += tt * 0.001; - xlims[1] -= tt * 0.001; - } - if (gtype != GRID_LOGLOG && gtype != GRID_YLOG - && gtype != GRID_POLAR && gtype != GRID_SMITH) { - tt = ylims[1] - ylims[0]; - ylims[0] += tt * 0.001; - ylims[1] -= tt * 0.001; - } -#endif - if ((xlims[0] <= 0.0) && ((gtype == GRID_XLOG) || (gtype == GRID_LOGLOG))) { fprintf(cp_err, @@ -958,19 +889,6 @@ plotit(wordlist *wl, char *hcopy, char *devname) } else if ((!xlim || !ylim) && (gtype == GRID_SMITH || gtype == GRID_SMITHGRID)) { -#ifdef notdef - /* Let the user zoom in */ - mx = (fabs(xlims[0]) > fabs(xlims[1])) ? fabs(xlims[0]) : - fabs(xlims[1]); - my = (fabs(ylims[0]) > fabs(ylims[1])) ? fabs(ylims[0]) : - fabs(ylims[1]); - rad = (mx > my) ? mx : my; - /* XXX */ - xlims[0] = - rad; - xlims[1] = rad; - ylims[0] = - rad; - ylims[1] = rad; -#endif xlims[0] = -1.0; xlims[1] = 1.0; ylims[0] = -1.0; diff --git a/src/frontend/dotcards.c b/src/frontend/dotcards.c index 9bc26e27e..d7cb4e987 100644 --- a/src/frontend/dotcards.c +++ b/src/frontend/dotcards.c @@ -485,78 +485,6 @@ setcplot(char *name) return (FALSE); } -#ifdef notdef -static wordlist * -gettoks(s) - char *s; -{ - char *t, *r, buf[64]; - wordlist *wl = NULL, *end = NULL; - bool iflag; - - while (t = gettok(&s)) { - if (*t == '(' /* ) */) { - /* This is a (upper, lower) thing -- ignore. */ - continue; - } else if (!index(t, '(' /*)*/ )) { - if (end) { - end->wl_next = alloc(struct wordlist); - end->wl_next->wl_prev = end; - end = end->wl_next; - } else - wl = end = alloc(struct wordlist); - end->wl_word = copy(t); - } else if (!index(t, ',')) { - iflag = ((*t == 'i') || (*t == 'I')) ? TRUE : FALSE; - while (*t != '(' /*)*/) - t++; - t++; - for (r = t; *r && *r != /*(*/ ')'; r++) - ; - *r = '\0'; - if (end) { - end->wl_next = alloc(struct wordlist); - end->wl_next->wl_prev = end; - end = end->wl_next; - } else - wl = end = alloc(struct wordlist); - if (iflag) { - (void) sprintf(buf, "%s#branch", t); - t = buf; - } - end->wl_word = copy(t); - } else { - /* The painful case */ - while (*t != '(' /*)*/) - t++; - t++; - for (r = t; *r && *r != ','; r++) - ; - *r = '\0'; - if (end) { - end->wl_next = alloc(struct wordlist); - end->wl_next->wl_prev = end; - end = end->wl_next; - } else - wl = end = alloc(struct wordlist); - end->wl_word = copy(t); - t = r + 1; - for (r = t; *r && *r != /*(*/ ')'; r++) - ; - *r = '\0'; - if (end) { - end->wl_next = alloc(struct wordlist); - end->wl_next->wl_prev = end; - end = end->wl_next; - } else - wl = end = alloc(struct wordlist); - end->wl_word = copy(t); - } - } - return (wl); -} -#endif - static wordlist * gettoks(char *s) { diff --git a/src/frontend/fourier.c b/src/frontend/fourier.c index e68f3dde0..bdcc584cc 100644 --- a/src/frontend/fourier.c +++ b/src/frontend/fourier.c @@ -272,112 +272,3 @@ CKTfour(int ndata, int numFreq, double *thd, double *Time, double *Value, double *thd = 100*sqrt(*thd); return(OK); } - -#ifdef notdef - /* What is this code? An old DFT? */ - double initial; /* starting time */ - double final; /* final time */ - double elapsed; /* elapsed time */ - double tmp; - int start=0; - int n; - int m; - int edge; - - *thd = 0; - final = Time[ndata-1]; - initial = Time[0]; - elapsed = final - initial; - if( (elapsed-1/FundFreq)< -.01/FundFreq ){ - /* not enough data for a full period */ - return(E_BADPARM); - } - elapsed = 1/FundFreq; /* set to desired elapsed time */ - initial = final - elapsed; /* set to desired starting time */ - while(Time[start] initial) { - /* interesting case - need to handle previous point */ - /* first, make sure that there is a point on the other side of - * the beginning of time. - */ - if(start-2 < 0) { - /* point doesn't exist, so we have to fudge - * things slightly - by bumping edge up, we re-use the first - * point in the interval for the last point before the - * interval - should be only for very small error in - * interval boundaries, so shouldn't be significant, and is - * better than ignoring the interval - */ - edge = start-1; - } else { - edge = start-2; - } - for(m=0;m1) *thd += nMag[m] * nMag[m]; - } - *thd = 100 * sqrt(*thd); - return(OK); - -#endif diff --git a/src/frontend/gens.c b/src/frontend/gens.c index 7951bebbc..318f62dde 100644 --- a/src/frontend/gens.c +++ b/src/frontend/gens.c @@ -40,27 +40,6 @@ dgen_init(GENcircuit *ckt, wordlist *wl, int nomix, int flag, int model) prevp = &wl; -#ifdef notdef - for (w = wl; w; w = w->wl_next) { - if (!strcmp(w->wl_word, "#")) { - model = 1; - *prevp = w->wl_next; - flag |= DGEN_DEFDEVS; - } else if (index(w->wl_word, '#')) - model = 1; - else - instance = 1; - prevp = &w->wl_next; - } - - if (instance && model) { - fprintf(stderr, - "Error: can't mix instances and models"); - tfree(dg); - return NULL; - } -#endif - if (model) dg->flags = (DGEN_ALL & ~ DGEN_INSTANCE) | DGEN_INIT; else @@ -172,15 +151,7 @@ dgen_next(dgen **dgx) if (need & DGEN_MODEL && !dg->model) continue; -#ifdef notdef - if (dg->instance) - printf("Maybe : %s\n", dg->instance->GENname); - if (dg->model) - printf("Maybe mod : %s\n", dg->model->GENmodName); -#endif - /* Filter */ - if (!dg->dev_list) { if ((dg->flags & DGEN_ALLDEVS) || ((dg->flags & DGEN_DEFDEVS) @@ -263,11 +234,6 @@ dgen_next(dgen **dgx) } /* Now compare */ -#ifdef notdef - printf("Type: %c, subckt: %s, name: %s\n", - type ? type : '0', subckt, device); -#endif - if (dg->instance) dev_name = dg->instance->GENname; else @@ -334,13 +300,6 @@ dgen_next(dgen **dgx) break; } -#ifdef notdef - if (done == 1) - printf("Accepted\n"); - else - printf("Skipped\n"); -#endif - } if (done == 2) diff --git a/src/frontend/graf.c b/src/frontend/graf.c index eaa082a0f..00b98d1d8 100644 --- a/src/frontend/graf.c +++ b/src/frontend/graf.c @@ -381,13 +381,6 @@ gr_start_internal(struct dvec *dv, bool copyvec) dv->v_linestyle = curlst; dv->v_color = curcolor; -/* note: XXX */ -#ifdef notdef - /* This is a minor hack -- reset the color */ - if (dv->v_defcolor) - ReSetColor(curcolor, dv->v_defcolor); -#endif - /* save the data so we can refresh */ link = (struct dveclist *) calloc(1, sizeof(struct dveclist)); link->next = currentgraph->plotdata; diff --git a/src/frontend/grid.c b/src/frontend/grid.c index 7f2fd635f..7eac11015 100644 --- a/src/frontend/grid.c +++ b/src/frontend/grid.c @@ -520,15 +520,6 @@ drawlingrid(GRAPH *graph, char *units, int spacing, int nsp, double dst, double (void) sprintf(buf, "%.*f", digits + 1, m * mag / 100.0); -#ifdef notdef - if (floor(step/10.0) != step/10.0) - (void) sprintf(buf, "%.*lf", mag, m * mag / 100.0); - else if (floor(step/100.0) != step/100.0) - (void) sprintf(buf, "%.1lf", m * mag / 100.0); - else - (void) sprintf(buf, "%lg", j * mag / 100); -#endif - if (axis == x_axis) Text(buf, graph->viewportxoff + i - strlen(buf) / 2 * graph->fontwidth, @@ -818,45 +809,9 @@ polargrid(GRAPH *graph) /* Range is square with upper bound maxrad */ -#ifdef notdef - xx = graph->datawindow.xmin + graph->datawindow.xmax; - yy = graph->datawindow.ymin + graph->datawindow.ymax; - graph->datawindow.xmin = xx - maxrad; - graph->datawindow.xmax = xx + maxrad; - graph->datawindow.ymin = yy - maxrad; - graph->datawindow.ymax = yy + maxrad; -#endif - - -#ifdef notdef - if (ft_grdb) - printf("polar: maxrad = %g, center = (%g, %g)\n", maxrad, xx, yy); - - if ((minrad == 0) && ((hmt - lmt) > 5)) { - if (!((hmt - lmt) % 2)) - step = 2; - else if (!((hmt - lmt) % 3)) - step = 3; - else - step = 1; - } else - step = 1; - - graph->grid.xaxis.circular.lmt = lmt; - graph->grid.yaxis.circular.lmt = step; -#endif - graph->grid.xaxis.circular.hmt = hmt; graph->grid.xaxis.circular.lmt = lmt; graph->grid.xaxis.circular.mag = mag; - -#ifdef notdef - graph->datawindow.xmin = xx - maxrad; - graph->datawindow.xmax = xx + maxrad; - graph->datawindow.ymin = yy - maxrad; - graph->datawindow.ymax = yy + maxrad; -#endif - } @@ -870,12 +825,6 @@ drawpolargrid(GRAPH *graph) double minrad, maxrad, pixperunit; char buf[64]; -#ifdef notdef - step = graph->grid.yaxis.circular.lmt; - mag = floor(mylog10(maxrad)); - tenpowmag = pow(10.0, (double) mag); - pixperunit = graph->grid.xaxis.circular.radius / (maxrad - minrad); -#endif hmt = graph->grid.xaxis.circular.hmt; lmt = graph->grid.xaxis.circular.lmt; mag = graph->grid.xaxis.circular.mag; @@ -1147,15 +1096,6 @@ smithgrid(GRAPH *graph) graph->datawindow.ymin)) centered = TRUE; -#ifdef notdef - /* Figure out the minimum and maximum radii we're dealing with. */ - mx = (graph->datawindow.xmin + graph->datawindow.xmax) / 2; - 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; -#endif - /* Issue a warning if our data range is not normalized */ if (graph->datawindow.ymax > 1.1) { printf("\nwarning: exceeding range for smith chart"); diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 66e626b3c..5841dbb99 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -506,12 +506,6 @@ inp_dodeck(struct line *deck, char *tt, wordlist *end, bool reuse, struct line * */ if (!reuse) { -#ifdef notdef - /* Unused time-waster. */ - for (dd = deck->li_next; dd; dd = dd->li_next) - if_setndnames(dd->li_line); -#endif - /* Be sure that ci_devices and ci_nodes are valid */ ft_curckt->ci_devices = cp_kwswitch(CT_DEVNAMES, (char *) NULL); diff --git a/src/frontend/interp.c b/src/frontend/interp.c index b5957d1d5..834f28ebf 100644 --- a/src/frontend/interp.c +++ b/src/frontend/interp.c @@ -177,23 +177,6 @@ fprintf(cp_err, "n = %d, xdata = ( ", n); mat2[i] = mat2[lindex]; mat2[lindex] = d; } -#ifdef notdef - if (mat1[i * n + i] == 0.0) - for (j = i; j < n; j++) - if (mat1[j * n + i] != 0.0) { - /* Swap rows i and j. */ - for (k = 0; k < n; k++) { - d = mat1[i * n + k]; - mat1[i * n + k] = - mat1[j * n + k]; - mat1[j * n + k] = d; - } - d = mat2[i]; - mat2[i] = mat2[j]; - mat2[j] = d; - break; - } -#endif /* Make sure we have a non-zero pivot. */ if (mat1[i * n + i] == 0.0) { /* this should be rotated. */ @@ -312,36 +295,6 @@ ft_peval(double x, double *coeffs, int degree) return y; } -#ifdef notdef - -XXX The following code is rediculous - -/* This should be a macro or be asm coded if possible. */ - -double -ft_peval(pt, coeffs, degree) - double pt, *coeffs; - register int degree; -{ - register int i, j; - double d = 0.0, f; - - /* fprintf(cp_err, "peval "); - for (i = 0; i <= degree; i++) - fprintf(cp_err, "%G ", coeffs[i]); - fprintf(cp_err, "at %G", pt); - */ - for (i = 0; i <= degree; i++) { - f = 1.0; - for (j = 0; j < i; j++) - f *= pt; - d += f * coeffs[i]; - } - /* fprintf(cp_err, " = %G\n", d);*/ - return (d); -} -#endif - void lincopy(struct dvec *ov, double *newscale, int newlen, struct dvec *oldscale) { diff --git a/src/frontend/nutctab.c b/src/frontend/nutctab.c index e8286291c..cf0df5a8a 100644 --- a/src/frontend/nutctab.c +++ b/src/frontend/nutctab.c @@ -214,20 +214,6 @@ struct comm nutcp_coms[] = { { 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, (int (*)()) NULL, "[rawfile] : Run the simulation as specified in the input file." } , -#ifdef notdef - { "aspice", com_aspice, FALSE, FALSE, FALSE, - { 1, 1, 1, 1 }, E_DEFHMASK, 1, 2, - (int (*)()) NULL, - "file [outfile] : Run a spice job asynchronously." } , - { "jobs", com_jobs, FALSE, FALSE, FALSE, - { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, - (int (*)()) NULL, - ": Report on asynchronous spice jobs." } , - { "rspice", com_rspice, FALSE, FALSE, FALSE, - { 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, - (int (*)()) NULL, - "[input file] : Run a spice job remotely." } , -#endif { "bug", com_bug, FALSE, FALSE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, (int (*)()) NULL, diff --git a/src/frontend/plotcurv.c b/src/frontend/plotcurv.c index d52896561..f34393d8c 100644 --- a/src/frontend/plotcurv.c +++ b/src/frontend/plotcurv.c @@ -339,26 +339,3 @@ plotinterval(struct dvec *v, double lo, double hi, register double *coeffs, int } return; } - -#ifdef notdef - -static void -printmat(name, mat, m, n) - char *name; - double *mat; -{ - int i, j; - - printf("\n\r=== Matrix: %s ===\n\r", name); - for (i = 0; i < m; i++) { - printf(" | "); - for (j = 0; j < n; j++) - printf("%G ", mat[i * n + j]); - printf("|\n\r"); - } - printf("===\n\r"); - return; -} - -#endif - diff --git a/src/frontend/postcoms.c b/src/frontend/postcoms.c index 89b79fb0a..f580c5844 100644 --- a/src/frontend/postcoms.c +++ b/src/frontend/postcoms.c @@ -866,101 +866,16 @@ pvec(struct dvec *d) return; } -#ifdef notdef - -/* Set the current working plot. */ - -void -com_splot(wl) - wordlist *wl; -{ - struct plot *p; - char buf[BSIZE_SP], *s; - - if (wl == NULL) { - fprintf(cp_out, "\tType the name of the desired plot:\n\n"); - fprintf(cp_out, "\tnew\tNew plot\n"); - for (p = plot_list; p; p = p->pl_next) { - if (plot_cur == p) - fprintf(cp_out, "Current"); - fprintf(cp_out, "\t%s\t%s (%s)\n", - p->pl_typename, p->pl_title, p->pl_name); - } - fprintf(cp_out, "? "); - (void) fflush(cp_out); - (void) fgets(buf, BSIZE_SP, cp_in); - clearerr(cp_in); - for (s = buf; *s && !isspace(*s); s++) - ; - *s = '\0'; - } else { - (void) strcpy(buf, wl->wl_word); - } - if (prefix("new", buf)) { - p = plot_alloc("unknown"); - p->pl_title = copy("Anonymous"); - p->pl_name = copy("unknown"); - p->pl_next = plot_list; - plot_list = p; - } else { - for (p = plot_list; p; p = p->pl_next) - if (plot_prefix(buf, p->pl_typename)) - break; - if (!p) { - fprintf(cp_err, "Error: no such plot.\n"); - return; - } - } - plot_cur->pl_ccom = cp_kwswitch(CT_VECTOR, p->pl_ccom); - plot_cur = p; - plot_docoms(plot_cur->pl_commands); - if (wl) - fprintf(cp_out, "%s %s (%s)\n", p->pl_typename, p->pl_title, - p->pl_name); - return; -} - -#endif /* For the sort in display. */ - static int dcomp(struct dvec **v1, struct dvec **v2) { return (strcmp((*v1)->v_name, (*v2)->v_name)); } -#ifdef notdef - -/* Figure out what the name of this vector should be (if it is a number, - * then make it 'V' or 'I')... Note that the data is static. - */ - -static char * -dname(d) - struct dvec *d; -{ - static char buf[128]; - char *s; - - for (s = d->v_name; *s; s++) - if (!isdigit(*s)) - return (d->v_name); - switch (d->v_type) { - case SV_VOLTAGE: - (void) sprintf(buf, "V(%s)", d->v_name); - return (buf); - case SV_CURRENT: - (void) sprintf(buf, "I(%s)", d->v_name); - return (buf); - } - return (d->v_name); -} - -#endif /* Take a set of vectors and form a new vector of the nth elements of each. */ - void com_cross(wordlist *wl) { diff --git a/src/frontend/postsc.c b/src/frontend/postsc.c index a8ee78d18..74ef6db00 100644 --- a/src/frontend/postsc.c +++ b/src/frontend/postsc.c @@ -115,16 +115,6 @@ PS_Init(void) ytadj = YTADJ * scale * fontsize / 10; } -#ifdef notdef - if (fontsize > 11) - gridsize = GRIDSIZES; - else - gridsize = GRIDSIZE; - - dispdev->width = gridsize+16*fontwidth; /* was 612, p.w.h. */ - dispdev->height = gridsize+8*fontheight; /* was 612, p.w.h. */ -#endif - screenflag = 0; dispdev->minx = XOFF / scale; dispdev->miny = YOFF / scale; @@ -149,40 +139,6 @@ PS_NewViewport(GRAPH *graph) /* hardcopying from the screen */ screenflag = 1; - - /* scale to fit on 8 1/2 square */ -#ifdef notdef - /* Face it, this is bogus */ -#ifdef notdef - fprintf(plotfile, "%g %g scale\n", - (double) dispdev->width / graph->absolute.width, - (double) dispdev->height / graph->absolute.height); -#endif - - scalex = (double) graph->absolute.width / dispdev->width; - scaley = (double) graph->absolute.height / dispdev->width; - /* scale left and bottom printer margin */ - scaleps = ((scalex > scaley) ? scalex : scaley) / scale; - xoff = (int) (scaleps * (double) XOFF); - yoff = (int) (scaleps * (double) YOFF); - xtadj = 0; - ytadj = 0; - scalex = (double) dispdev->width / graph->absolute.width; - scaley = (double) dispdev->width / graph->absolute.height; - - if (gtype == GRID_SMITH || gtype == GRID_SMITHGRID - || gtype == GRID_POLAR) - { - scaleps = scale * ((scalex < scaley) ? scalex : scaley); - fprintf(plotfile, "%g %g scale\n", scaleps, scaleps); - } else { - fprintf(plotfile, "%g %g scale\n", scale*scalex, scale*scaley); - } - - /* re-scale linestyles */ - gr_relinestyle(graph); -#endif - } /* reasonable values, used in gr_ for placement */ @@ -202,17 +158,14 @@ PS_NewViewport(GRAPH *graph) fprintf(plotfile, "%%!PS-Adobe-3.0 EPSF-3.0\n"); fprintf(plotfile, "%%%%Creator: nutmeg\n"); fprintf(plotfile, "%%%%BoundingBox: %d %d %d %d\n", - (int) (.75 * 72), (int) (.75 * 72), - (int) (8.5 * 72), (int) (8.5 * 72)); + (int) (.75 * 72), (int) (.75 * 72), + (int) (8.5 * 72), (int) (8.5 * 72)); -#ifdef notdef - if (!screenflag) -#endif - fprintf(plotfile, "%g %g scale\n", 1.0 / scale, 1.0 / scale); + fprintf(plotfile, "%g %g scale\n", 1.0 / scale, 1.0 / scale); /* set up a reasonable font */ fprintf(plotfile, "/%s findfont %d scalefont setfont\n", - psfont, (int) (fontsize * scale)); + psfont, (int) (fontsize * scale)); graph->devdep = tmalloc(sizeof(PSdevdep)); DEVDEP(graph).lastlinestyle = -1; diff --git a/src/frontend/resource.c b/src/frontend/resource.c index 6645c36ea..0bd9d84e8 100644 --- a/src/frontend/resource.c +++ b/src/frontend/resource.c @@ -326,16 +326,6 @@ baseaddr(void) at = (char *) ((((long)low >> LOG2_PAGESIZE) + ((long)high >> LOG2_PAGESIZE)) << (LOG2_PAGESIZE - 1)); -# ifdef notdef - at = (char *) ((((int) low + (int) high) / 2 + 0x7ff) - & ~(long) 0xfff); - /* nearest page */ -# endif -# ifdef notdef - printf( - "high = %#8x low = %#8x at = %#8x\n", - high, low, at); -# endif if (at == low || at == high) { break; @@ -357,9 +347,6 @@ baseaddr(void) } while (1); -# ifdef notdef - printf ("start is at %#x, end is at %#x\n", high, sbrk(0)); -# endif (void) signal(SIGSEGV, (SIGNAL_FUNCTION) orig_signal); return (void *) high; } diff --git a/src/frontend/runcoms.c b/src/frontend/runcoms.c index 4b37c2cba..04547724a 100644 --- a/src/frontend/runcoms.c +++ b/src/frontend/runcoms.c @@ -194,10 +194,6 @@ dosim(char *what, wordlist *wl) ft_setflag = FALSE; return 0; } -#ifdef notdef - if (ft_curckt->ci_runonce) - com_rset((wordlist *) NULL); -#endif /* From now on until the next prompt, an interrupt will just * set a flag and let spice finish up, then control will be @@ -224,10 +220,6 @@ dosim(char *what, wordlist *wl) #endif /* PARALLEL_ARCH */ } else { rawfileFp = NULL; -#ifdef notdef - XXX why? - plot_num++; /* There should be a better way */ -#endif } /* Spice calls wrd_init and wrd_end itself */ diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index af414b488..0a3628822 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -725,44 +725,6 @@ finddev(void *ck, char *name, void **devptr, void **modptr) } -#ifdef notdef -/* XXX Not useful */ -/* Extract the node and device names from the line and add them to the command - * completion structure. This is probably not a good thing to do if it - * takes too much time. - */ - - /* BLOW THIS AWAY */ - -void -if_setndnames(line) - char *line; -{ - char *t; - int i; - - while (isspace(*line)) - line++; - - if (!*line || (*line == '*') || (*line == '.')) - return; - t = gettok(&line); - - if (!(i = inp_numnodes(*t))) - return; - if ((*t == 'q') || (*t == 'Q')) - i = 3; - - cp_addkword(CT_DEVNAMES, t); - while (i-- > 0) { - t = gettok(&line); - if (t) - cp_addkword(CT_NODENAMES, t); - } - return; -} -#endif - /* get an analysis parameter by name instead of id */ int diff --git a/src/frontend/typesdef.c b/src/frontend/typesdef.c index 0c53ab906..d4f7b4986 100644 --- a/src/frontend/typesdef.c +++ b/src/frontend/typesdef.c @@ -42,13 +42,6 @@ struct type types[NUMTYPES] = { { "inoise-integrated", "V or A" } , { "output-noise", NULL } , { "input-noise", NULL } , -#ifdef notdef - { "HD2", NULL } , - { "HD3", NULL } , - { "DIM2", NULL } , - { "SIM2", NULL } , - { "DIM3", NULL } , -#endif { "pole", NULL } , { "zero", NULL } , { "s-param", NULL } , diff --git a/src/frontend/x11.c b/src/frontend/x11.c index 9753dea85..65e899140 100644 --- a/src/frontend/x11.c +++ b/src/frontend/x11.c @@ -449,15 +449,6 @@ X11_Arc(int x0, int y0, int radius, double theta1, double theta2) x0 - radius, currentgraph->absolute.height - radius - y0, 2 * radius, 2 * radius, t1, t2); -# ifdef notdef - printf("at %d, %d, %g %g x %d :: (%d, %d)\n", - x0, y0, theta1, theta2, radius, t1, t2); - printf("skip\n"); - XSync(display, 0); - printf("XDrawArc(%d, %d, %d, %d, %d, %d)\n", x0 - radius, - currentgraph->absolute.height - radius - y0, - 2 * radius, 2 * radius, t1, t2); -# endif } } @@ -502,19 +493,6 @@ X11_SetLinestyle(int linestyleid) if (currentgraph->linestyle != linestyleid) { -# ifdef notdef - switch (linestyleid %3) { - case 0: - values.line_style = LineSolid; - break; - case 1: - values.line_style = LineOnOffDash; - break; - case 2: - values.line_style = LineDoubleDash; - break; - } -# endif if ((linestyleid == 0 || numdispplanes > 1) && linestyleid != 1) { /* solid if linestyle 0 or if has color, allow only one * dashed linestyle */ @@ -584,21 +562,6 @@ handlekeypressed(Widget w, caddr_t clientdata, caddr_t calldata) } -# ifdef notdef -void -keyhandler(clientdata, source, id) -caddr_t clientdata; -int *source; -XtInputId id; -{ - -# ifdef notdef - KEYwaiting = TRUE; -# endif - -} -# endif - void handlebuttonev(Widget w, caddr_t clientdata, caddr_t calldata) { @@ -616,18 +579,6 @@ handlebuttonev(Widget w, caddr_t clientdata, caddr_t calldata) } -# ifdef notdef -handlemotionev(w, clientdata, calldata) -Widget w; -caddr_t clientdata, calldata; -{ - - XMotionEvent *motionev = (XMotionEvent *) calldata; - - switch -} -# endif - void slopelocation(GRAPH *graph, int x0, int y0) @@ -835,15 +786,6 @@ redraw(Widget w, caddr_t client_data, caddr_t call_data) int n = 1; DEVDEP(graph).isopen = 1; -# ifdef notdef - /* if there is a resize, let the resize routine handle the exposures */ - if (XCheckWindowEvent(display, DEVDEP(graph).window, - (long) StructureNotifyMask, &ev)) { - resize(w, client_data, &ev); - return; - } -# endif - rects[0].x = pev->x; rects[0].y = pev->y; rects[0].width = pev->width; @@ -892,38 +834,6 @@ resize(Widget w, caddr_t client_data, caddr_t call_data) } -# ifdef notdef -/* stolen from CP/lexical.c */ - -/* A special 'getc' so that we can deal with ^D properly. There is no way for - * stdio to know if we have typed a ^D after some other characters, so - * don't use buffering at all... - */ -static int inchar(fp) - FILE *fp; -{ - - char c; - int i; - extern int errno; - -# ifdef HAS_TERMREAD - if (cp_interactive && !cp_nocc) { - i = read((int) fileno(fp), &c, 1); - if (i == 0) - return (EOF); - else if (i == -1) { - perror("read"); - return (EOF); - } else - return ((int) c); - } -# endif - c = getc(fp); - return ((int) c); -} -# endif - void X11_Input(REQUEST *request, RESPONSE *response) { diff --git a/src/hlp/readhelp.c b/src/hlp/readhelp.c index 029992bd7..f25ba1adc 100644 --- a/src/hlp/readhelp.c +++ b/src/hlp/readhelp.c @@ -10,26 +10,6 @@ Modified 1999 Emmanuel Rouat #include "ngspice.h" #include "cpstd.h" #include "hlpdefs.h" - -#ifdef notdef - -# ifdef HAVE_SYS_DIR_H -# include -# include -# include -# else -# ifdef HAVE_DIRENT_H -# include -# include -# ifndef direct -# define direct dirent -# endif -# endif -# endif - - -#endif - #include "suffix.h" static char *getsubject(fplace *place); diff --git a/src/hlp/x11disp.c b/src/hlp/x11disp.c index d3a42d1f6..e5393ce02 100644 --- a/src/hlp/x11disp.c +++ b/src/hlp/x11disp.c @@ -104,18 +104,6 @@ hlp_xdisplay(topic *top) top->titlewidget, buttonargs, XtNumber(buttonargs)); XtAddCallback(buttonwidget, XtNcallback, (XtCallbackProc) delete, top); -#ifdef notdef - /* enclose text string w/in a viewport widget for scrolling */ - XtSetArg(vportargs[0], XtNfromVert, top->titlewidget); - XtSetArg(vportargs[1], XtNallowResize, True); - XtSetArg(vportargs[2], XtNallowVert, True); - XtSetArg(vportargs[3], XtNallowHoriz, True); - XtSetArg(vportargs[4], XtNforceBars, True); - top->viewwidget = XtCreateManagedWidget("viewport", - viewportWidgetClass, top->formwidget, - vportargs, 5); -#endif - buf = tmalloc(80 * top->numlines + 100); buf[0] = '\0'; for (wl = top->text; wl; wl = wl->wl_next) { diff --git a/src/include/complex.h b/src/include/complex.h index 5aff8e5c4..56edc681d 100644 --- a/src/include/complex.h +++ b/src/include/complex.h @@ -18,23 +18,6 @@ typedef struct { #define DC_ABS(a,b) (fabs(a) + fabs(b)) -/* Why that ??? */ -#ifdef notdef -#define DC_DIV(a,b,c,d,x,y) { \ - double r,s;\ - if(fabs(c)>fabs(d)) { \ - r=(d)/(c);\ - s=(c)+r*(d);\ - x=((a)+(b)*r)/s;\ - y=((b)-(a)*r)/s;\ - } else { \ - r=(c)/(d);\ - s=(d)+r*(c);\ - x=((a)*r+(b))/s;\ - y=((b)*r-(a))/s;\ - }\ -} -#endif /*notdef */ /* * Division among complex numbers @@ -67,14 +50,6 @@ typedef struct { } -/* Why that ??? */ -#ifdef notdef -#define DC_MINUS(a,b,c,d,x,y) { \ - (x) = (a) - (c) ;\ - (y) = (b) - (d) ;\ -} -#endif /*notdef*/ - /* * Difference among complex numbers a+jb and c+jd * a = a - c amd b = b - d diff --git a/src/include/devdefs.h b/src/include/devdefs.h index 739a7a877..dcf1e7b29 100644 --- a/src/include/devdefs.h +++ b/src/include/devdefs.h @@ -13,7 +13,6 @@ Author: 1985 Thomas L. Quarles #include "noisedef.h" #include "complex.h" -#ifdef __STDC__ double DEVlimvds(double,double); double DEVpnjlim(double,double,double,double,int*); double DEVfetlim(double,double,double); @@ -21,30 +20,11 @@ void DEVcmeyer(double,double,double,double,double,double,double,double,double, double,double,double*,double*,double*,double,double,double,double); void DEVqmeyer(double,double,double,double,double,double*,double*,double*, double,double); -#ifdef notdef -void DEVcap(CKTcircuit*, double, double, double, double, double, double, - double, double, double, double, double, double, double, double, - double*, double*, double*, double*, double*, double*, double*, - double*, double*, double*, double*, double*, double, double, - double, double*, double*, double); -#endif double DEVpred(CKTcircuit*,int); -#else /* stdc */ -double DEVlimvds(); -double DEVpnjlim(); -double DEVfetlim(); -void DEVcmeyer(); -void DEVqmeyer(); -#ifdef notdef -void DEVcap(); -#endif -double DEVpred(); -#endif /* stdc */ typedef struct SPICEdev { IFdevice DEVpublic; -#ifdef __STDC__ int (*DEVparam)(int,IFvalue*,GENinstance*,IFvalue *); /* routine to input a parameter to a device instance */ int (*DEVmodParam)(int,IFvalue*,GENmodel*); @@ -100,49 +80,12 @@ typedef struct SPICEdev { /* procedure to do distortion operations */ int (*DEVnoise)(int, int, GENmodel*,CKTcircuit*, Ndata *, double *); /* noise routine */ - -#else /* stdc */ - - int (*DEVparam)(); /* routine to input a parameter to a device instance */ - int (*DEVmodParam)(); /* routine to input a paramater to a model */ - int (*DEVload)(); /* routine to load the device into the matrix */ - int (*DEVsetup)(); /* setup routine to preprocess devices once before - * soloution begins */ - int (*DEVunsetup)(); /* clean up before running again */ - - int (*DEVpzSetup)(); /* setup routine to process devices specially for - * pz analysis */ - int (*DEVtemperature)(); /* subroutine to do temperature dependent - * setup processing */ - int (*DEVtrunc)(); /* subroutine to perform truncation error calc. */ - int (*DEVfindBranch)(); /* subroutine to search for device branch eq.s */ - int (*DEVacLoad)(); /* ac analysis loading function */ - int (*DEVaccept)(); /* subroutine to call on acceptance of a timepoint */ - void (*DEVdestroy)(); /* subroutine to destroy all models and instances */ - int (*DEVmodDelete)(); /* subroutine to delete a model and all instances */ - int (*DEVdelete)(); /* subroutine to delete an instance */ - int (*DEVsetic)(); /* routine to pick up device init conds from rhs */ - int (*DEVask)(); /* routine to ask about device details*/ - int (*DEVmodAsk)(); /* routine to ask about model details*/ - int (*DEVpzLoad)(); /* routine to load for pole-zero analysis */ - int (*DEVconvTest)(); /* convergence test function */ - - int (*DEVsenSetup)(); /* routine to setup the device sensitivity info */ - int (*DEVsenLoad)(); /* routine to load the device sensitivity info */ - int (*DEVsenUpdate)(); /* routine to update the device sensitivity info */ - int (*DEVsenAcLoad)(); /* routine to load the device ac sensitivity info*/ - void (*DEVsenPrint)(); /* subroutine to print out sensitivity info */ - int (*DEVsenTrunc)(); /* subroutine to print out sensitivity info */ - int (*DEVdisto)(); /* distortion routine */ - int (*DEVnoise)(); /* noise routine */ - -#endif /* stdc */ - int *DEVinstSize; /* size of an instance */ int *DEVmodSize; /* size of a model */ } SPICEdev; /* instance of structure for each possible type of device */ + /* IOP( ) Input/output parameter * IOPP( ) IO parameter which the principle value of a device (used * for naming output variables in sensetivity) diff --git a/src/include/fteconst.h b/src/include/fteconst.h index c36ab9e05..2b5dcc288 100644 --- a/src/include/fteconst.h +++ b/src/include/fteconst.h @@ -21,19 +21,6 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #define SV_ZERO 10 #define SV_SPARAM 11 -#ifdef notdef -#define SV_OUTPUT_NOISE 5 -#define SV_INPUT_NOISE 6 -#define SV_HD2 7 -#define SV_HD3 8 -#define SV_DIM2 9 -#define SV_SIM2 10 -#define SV_DIM3 11 -#define SV_POLE 12 -#define SV_ZERO 13 -#define SV_SPARAM 14 -#endif - /* Dvec flags. */ #define VF_REAL (1 << 0) /* The data is real. */ diff --git a/src/maths/ni/nipzmeth.c b/src/maths/ni/nipzmeth.c index ff2482f99..db6b7421a 100644 --- a/src/maths/ni/nipzmeth.c +++ b/src/maths/ni/nipzmeth.c @@ -26,9 +26,6 @@ int NIpzK_mag; int NIpzSym(PZtrial **set, PZtrial *new) { -#ifndef notdef - return NIpzSym2(set, new); -#else double a, b, c, x0, x1; double dx0, dx1; int a_mag, b_mag, c_mag; @@ -72,9 +69,6 @@ int NIpzComplex(PZtrial **set, PZtrial *new) { return NIpzSym2(set, new); -#ifdef notdef - NIpzMuller(set, new); -#endif } int diff --git a/src/maths/sparse/spalloc.c b/src/maths/sparse/spalloc.c index 733a2b3d1..3f6827096 100644 --- a/src/maths/sparse/spalloc.c +++ b/src/maths/sparse/spalloc.c @@ -47,15 +47,6 @@ * or implied warranty. */ -#ifdef notdef -static char copyright[] = - "Sparse1.3: Copyright (c) 1985,86,87,88,89,90 by Kenneth S. Kundert"; -static char RCSid[] = - "@(#)$Header$"; -#endif - - - /* * IMPORTS * diff --git a/src/maths/sparse/spbuild.c b/src/maths/sparse/spbuild.c index b4d404dc4..3fd64db41 100644 --- a/src/maths/sparse/spbuild.c +++ b/src/maths/sparse/spbuild.c @@ -44,15 +44,6 @@ * or implied warranty. */ -#ifdef notdef -static char copyright[] = - "Sparse1.3: Copyright (c) 1985,86,87,88,89,90 by Kenneth S. Kundert"; -static char RCSid[] = - "@(#)$Header$"; -#endif - - - /* * IMPORTS diff --git a/src/maths/sparse/spcombin.c b/src/maths/sparse/spcombin.c index d262520b1..fe70cec65 100644 --- a/src/maths/sparse/spcombin.c +++ b/src/maths/sparse/spcombin.c @@ -30,15 +30,6 @@ * or implied warranty. */ -#ifdef notdef -static char copyright[] = - "Sparse1.3: Copyright (c) 1985,86,87,88,89,90 by Kenneth S. Kundert"; -static char RCSid[] = - "@(#)$Header$"; -#endif - - - /* * IMPORTS * diff --git a/src/maths/sparse/spextra.c b/src/maths/sparse/spextra.c index 58fbfb780..b2c83c0dd 100644 --- a/src/maths/sparse/spextra.c +++ b/src/maths/sparse/spextra.c @@ -28,20 +28,6 @@ #include "spdefs.h" - - - -/* - * Function declarations - */ - -#ifdef __STDC__ -#if spSEPARATED_COMPLEX_VECTORS -#else -#endif -#else /* __STDC__ */ -#endif /* __STDC__ */ - void spConstMult(matrix, constant) MatrixPtr matrix; @@ -59,154 +45,3 @@ spConstMult(matrix, constant) } } - -#ifdef notdef - -int spccc = 0; -int spccc_hold = -1; -int spccc_h1 = 1; -int spccc_h2 = 1; -int spccc_h3 = 1; -int spccc_h4 = 1; -int spccc_h5 = 1; -int spccc_h11 = 1; -int spccc_h12 = 1; -int spccc_h13 = 1; -int spccc_h15 = 1; -int spccc_h99 = 1; - -spCheck(matrix, key) - MatrixPtr matrix; - int key; -{ - ElementPtr e; - int i, n, k; - int size = matrix->Size; - - spccc += 1; - if (spccc == spccc_hold) - hold_matrix99( ); - - for (i = 1; i <= size; i++) { - k = -1; - if (!(key & 2)) { - for (n = 0, e = matrix->FirstInCol[i]; e && n <= size; - e = e->NextInCol) - { - if (k >= e->Row) - hold_matrix2( ); - if (e->Col != i) - hold_matrix3( ); - if (e->NextInRow && e->Col >= e->NextInRow->Col) - hold_matrix5( ); - - k = e->Row; - n += 1; - } - if (n > size) - hold_matrix1( ); - } - - k = -1; - if (matrix->RowsLinked && !(key & 1)) { - for (n = 0, e = matrix->FirstInRow[i]; e && n <= size; - e = e->NextInRow) - { - if (k >= e->Col) - hold_matrix12( ); - if (e->Row != i) - hold_matrix13( ); - if (e->NextInCol && e->Row >= e->NextInCol->Row) - hold_matrix15( ); - - k = e->Col; - n += 1; - } - if (n > size) - hold_matrix11( ); - } - } - -} - -hold_matrix1( ) -{ - if (spccc_h1) { - printf("BAD MATRIX"); - fflush(stdout); - } -} - -hold_matrix2( ) -{ - if (spccc_h2) { - printf("BAD MATRIX 2"); - fflush(stdout); - } -} - -hold_matrix3( ) -{ - if (spccc_h3) { - printf("BAD MATRIX 3"); - fflush(stdout); - } -} - -hold_matrix4( ) -{ - if (spccc_h4) { - printf("BAD MATRIX 3"); - fflush(stdout); - } -} - -hold_matrix5( ) -{ - if (spccc_h5) { - printf("BAD MATRIX 5"); - fflush(stdout); - } -} - -hold_matrix11( ) -{ - if (spccc_h11) { - printf("BAD MATRIX 11"); - fflush(stdout); - } -} - -hold_matrix12( ) -{ - if (spccc_h12) { - printf("BAD MATRIX 12"); - fflush(stdout); - } -} - -hold_matrix13( ) -{ - if (spccc_h13) { - printf("BAD MATRIX 13"); - fflush(stdout); - } -} - -hold_matrix15( ) -{ - if (spccc_h15) { - printf("BAD MATRIX 15"); - fflush(stdout); - } -} - -hold_matrix99( ) -{ - if (spccc_h99) { - printf("BAD MATRIX 99"); - fflush(stdout); - } -} - -#endif diff --git a/src/maths/sparse/spfactor.c b/src/maths/sparse/spfactor.c index 41406691f..e12b1526e 100644 --- a/src/maths/sparse/spfactor.c +++ b/src/maths/sparse/spfactor.c @@ -44,15 +44,6 @@ * or implied warranty. */ -#ifdef notdef -static char copyright[] = - "Sparse1.3: Copyright (c) 1985,86,87,88,89,90 by Kenneth S. Kundert"; -static char RCSid[] = - "@(#)$Header$"; -#endif - - - /* * IMPORTS * diff --git a/src/maths/sparse/spoutput.c b/src/maths/sparse/spoutput.c index 35cb3fd98..b42b58104 100644 --- a/src/maths/sparse/spoutput.c +++ b/src/maths/sparse/spoutput.c @@ -34,14 +34,6 @@ * or implied warranty. */ -#ifdef notdef -static char copyright[] = - "Sparse1.3: Copyright (c) 1985,86,87,88,89,90 by Kenneth S. Kundert"; -static char RCSid[] = - "$Header$"; -#endif - - /* * IMPORTS * diff --git a/src/maths/sparse/spsmp.c b/src/maths/sparse/spsmp.c index 39af150e5..972a752a4 100644 --- a/src/maths/sparse/spsmp.c +++ b/src/maths/sparse/spsmp.c @@ -90,16 +90,6 @@ * any purpose. It is provided `as is', without express or implied warranty. */ -#ifdef notdef -static char copyright[] = - "Sparse1.3: Copyright (c) 1985,86,87,88,89,90 by Kenneth S. Kundert"; -static char RCSid[] = - "@(#)$Header$"; -#endif - - - - /* * IMPORTS * diff --git a/src/maths/sparse/spsolve.c b/src/maths/sparse/spsolve.c index 2b65a0ed8..9fa83605f 100644 --- a/src/maths/sparse/spsolve.c +++ b/src/maths/sparse/spsolve.c @@ -34,15 +34,6 @@ * or implied warranty. */ -#ifdef notdef -static char copyright[] = - "Sparse1.3: Copyright (c) 1985,86,87,88,89,90 by Kenneth S. Kundert"; -static char RCSid[] = - "@(#)$Header$"; -#endif - - - /* * IMPORTS * diff --git a/src/maths/sparse/sputils.c b/src/maths/sparse/sputils.c index 491d1a85c..1821d9ebf 100644 --- a/src/maths/sparse/sputils.c +++ b/src/maths/sparse/sputils.c @@ -47,15 +47,6 @@ * or implied warranty. */ -#ifdef notdef -static char copyright[] = - "Sparse1.3: Copyright (c) 1985,86,87,88,89,90 by Kenneth S. Kundert"; -static char RCSid[] = - "@(#)$Header$"; -#endif - - - /* * IMPORTS * @@ -271,13 +262,8 @@ ElementPtr pTwin1, pTwin2; if ((pTwin2 != NULL) AND (ABS(pTwin2->Real) == 1.0)) { /* Found symmetric twins. */ if (++Twins >= 2) return Twins; -#ifdef notdef - (*ppTwin1 = pTwin1)/*->Col = Col XXX */; - (*ppTwin2 = pTwin2)/*->Col = Row XXX */; -#else (*ppTwin1 = pTwin1)->Col = Col; (*ppTwin2 = pTwin2)->Col = Row; -#endif } } pTwin1 = pTwin1->NextInCol; @@ -305,15 +291,6 @@ int Col1 = pTwin1->Col, Col2 = pTwin2->Col; /* Begin `SwapCols'. */ -#ifdef notdef -ElementPtr e; /*XXX*/ - /* XXX Update column numbers */ - for (e = Matrix->FirstInCol[Col1]; e != NULL; e = e->NextInCol) - e->Col = Col2; - for (e = Matrix->FirstInCol[Col2]; e != NULL; e = e->NextInCol) - e->Col = Col1; -#endif - SWAP (ElementPtr, Matrix->FirstInCol[Col1], Matrix->FirstInCol[Col2]); SWAP (int, Matrix->IntToExtColMap[Col1], Matrix->IntToExtColMap[Col2]); #if TRANSLATE diff --git a/src/multidec.c b/src/multidec.c index 6ec9e60a1..037736243 100644 --- a/src/multidec.c +++ b/src/multidec.c @@ -241,14 +241,6 @@ int fprintf(stderr,"Singular matrix: problem in row %d and col %d\n", singular_row, singular_col); fflush(stderr); exit(1); -#ifdef notdef - /* For the original "sparse" interface; doesn't work with the spice3 interface - to sparse */ - case spSMALL_PIVOT: - fprintf(stderr,"* Warning: matrix is illconditioned.\n"); - fflush(stderr); - break; -#endif default: break; } diff --git a/src/parser/lexical.c b/src/parser/lexical.c index 5c0d8e8b0..3a0689375 100644 --- a/src/parser/lexical.c +++ b/src/parser/lexical.c @@ -298,15 +298,6 @@ prompt(void) s = cp_promptstring; if (cp_altprompt) s = cp_altprompt; -#ifdef notdef - /* XXXX VMS */ - /* this is for VMS/RMS which otherwise won't output the LF - * part of the newline on the previous line if this line - * doesn't also end in newline, and most prompts don't, so... - * we force an extra line here. - */ - fprintf(cp_out,"\n"); -#endif while (*s) { switch (strip(*s)) { case '!': diff --git a/src/parser/unixcom.c b/src/parser/unixcom.c index 270d9bb5b..83de8b3d3 100644 --- a/src/parser/unixcom.c +++ b/src/parser/unixcom.c @@ -234,56 +234,6 @@ cp_hstat(void) return; } -#ifdef notdef -/*** The person who wrote this should be strung up ***/ -/* Some strange stuff... Don't ever free the dir buffer, because we keep - * pointers into it in the command hash table. - */ - -static bool -myopendir(char *path) -{ - struct stat stbuf; - int i; - - if (!path) - return (0); - if (stat(path, &stbuf)) - return (FALSE); - if ((i = open(path, O_RDONLY)) == -1) - return (0); - dirbuffer = tmalloc(stbuf.st_size); - if (read(i, dirbuffer, stbuf.st_size) != stbuf.st_size) { - fprintf(cp_err, "Error: bad read on directory %s\n", path); - return (0); - } - dirlength = stbuf.st_size; - dirpos = 0; - return (1); -} - -static char * -myreaddir(void) -{ - struct direct *dp; - - /* Advance us to the next valid directory entry. */ - for (;;) { - dp = (struct direct *) &dirbuffer[dirpos]; - if (dirpos >= dirlength) - return (NULL); - while (dp->d_ino == 0) { - dirpos += dp->d_reclen; - goto x; /* Ack... */ - } - break; -x: ; - } - dirpos += dp->d_reclen; - return (dp->d_name); -} -# endif - #else void @@ -303,4 +253,3 @@ cp_unixcom(wordlist *wl) } #endif - diff --git a/src/spicelib/devices/asrc/asrcacld.c b/src/spicelib/devices/asrc/asrcacld.c index 9321518cc..eb941a2c2 100644 --- a/src/spicelib/devices/asrc/asrcacld.c +++ b/src/spicelib/devices/asrc/asrcacld.c @@ -16,9 +16,7 @@ Author: 1988 Kanwar Jit Singh /*ARGSUSED*/ int -ASRCacLoad(inModel,ckt) -GENmodel *inModel; -CKTcircuit *ckt; +ASRCacLoad(GENmodel *inModel, CKTcircuit *ckt) { /* @@ -38,71 +36,62 @@ CKTcircuit *ckt; /* loop through all the instances of the model */ for (here = model->ASRCinstances; here != NULL ; - here = here->ASRCnextInstance) { - if (here->ASRCowner != ARCHme) continue; + here = here->ASRCnextInstance) { + if (here->ASRCowner != ARCHme) continue; - /* - * Get the function and its derivatives from the - * field in the instance structure. The field is - * an array of doubles holding the rhs, and the - * entries of the jacobian. - */ + /* + * Get the function and its derivatives from the + * field in the instance structure. The field is + * an array of doubles holding the rhs, and the + * entries of the jacobian. + */ - v_first = 1; - j=0; - derivs = here->ASRCacValues; - rhs = (here->ASRCacValues)[here->ASRCtree->numVars]; + v_first = 1; + j=0; + derivs = here->ASRCacValues; + rhs = (here->ASRCacValues)[here->ASRCtree->numVars]; - for(i=0; i < here->ASRCtree->numVars; i++){ - switch(here->ASRCtree->varTypes[i]){ - case IF_INSTANCE: - if( here->ASRCtype == ASRC_VOLTAGE){ - /* CCVS */ - if(v_first){ - *(here->ASRCposptr[j++]) += 1.0; - *(here->ASRCposptr[j++]) -= 1.0; - *(here->ASRCposptr[j++]) -= 1.0; - *(here->ASRCposptr[j++]) += 1.0; - v_first = 0; - } - *(here->ASRCposptr[j++]) -= derivs[i]; - } else{ - /* CCCS */ - *(here->ASRCposptr[j++]) += derivs[i]; - *(here->ASRCposptr[j++]) -= derivs[i]; - } - break; - case IF_NODE: - if(here->ASRCtype == ASRC_VOLTAGE){ - /* VCVS */ - if( v_first){ - *(here->ASRCposptr[j++]) += 1.0; - *(here->ASRCposptr[j++]) -= 1.0; - *(here->ASRCposptr[j++]) -= 1.0; - *(here->ASRCposptr[j++]) += 1.0; - v_first = 0; - } - *(here->ASRCposptr[j++]) -= derivs[i]; - } else { - /*VCCS*/ - *(here->ASRCposptr[j++]) += derivs[i]; - *(here->ASRCposptr[j++]) -= derivs[i]; - } - break; - default: - return(E_BADPARM); - } - } -#ifdef notdef - /* Insert the RHS */ - if( here->ASRCtype == ASRC_VOLTAGE){ - *(ckt->CKTrhs+(here->ASRCbranch)) += rhs; - } else { - *(ckt->CKTrhs+(here->ASRCposNode)) -= rhs; - *(ckt->CKTrhs+(here->ASRCnegNode)) += rhs; - } -#endif - } + for(i=0; i < here->ASRCtree->numVars; i++){ + switch(here->ASRCtree->varTypes[i]){ + case IF_INSTANCE: + if( here->ASRCtype == ASRC_VOLTAGE){ + /* CCVS */ + if(v_first){ + *(here->ASRCposptr[j++]) += 1.0; + *(here->ASRCposptr[j++]) -= 1.0; + *(here->ASRCposptr[j++]) -= 1.0; + *(here->ASRCposptr[j++]) += 1.0; + v_first = 0; + } + *(here->ASRCposptr[j++]) -= derivs[i]; + } else{ + /* CCCS */ + *(here->ASRCposptr[j++]) += derivs[i]; + *(here->ASRCposptr[j++]) -= derivs[i]; + } + break; + case IF_NODE: + if(here->ASRCtype == ASRC_VOLTAGE){ + /* VCVS */ + if( v_first){ + *(here->ASRCposptr[j++]) += 1.0; + *(here->ASRCposptr[j++]) -= 1.0; + *(here->ASRCposptr[j++]) -= 1.0; + *(here->ASRCposptr[j++]) += 1.0; + v_first = 0; + } + *(here->ASRCposptr[j++]) -= derivs[i]; + } else { + /*VCCS*/ + *(here->ASRCposptr[j++]) += derivs[i]; + *(here->ASRCposptr[j++]) -= derivs[i]; + } + break; + default: + return(E_BADPARM); + } + } + } } return(OK); } diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index b63324157..60ee5aef2 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -1,12 +1,38 @@ -/* Configuration file for ng-spice */ +/* NG-SPICE -- An electrical circuit simulator + * + * Copyright (c) 1990 University of California + * Copyright (c) 2000 Arno W. Peters + * + * Permission to use, copy, modify, and distribute this software and + * its documentation without fee, and without a written agreement is + * hereby granted, provided that the above copyright notice, this + * paragraph and the following three paragraphs appear in all copies. + * + * This software program and documentation are copyrighted by their + * authors. The software program and documentation are supplied "as + * is", without any accompanying services from the authors. The + * authors do not warrant that the operation of the program will be + * uninterrupted or error-free. The end-user understands that the + * program was developed for research purposes and is advised not to + * rely exclusively on the program for any reason. + * + * IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, + * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING + * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS + * DOCUMENTATION, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. THE AUTHORS SPECIFICALLY DISCLAIMS ANY + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE + * SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE AUTHORS + * HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, + * ENHANCEMENTS, OR MODIFICATIONS. */ + #include #include "dev.h" #include "devdefs.h" -/* - * Devices - */ +/* Enable the following devices */ #define DEV_asrc #define DEV_bjt #define DEV_bsim1 @@ -73,7 +99,6 @@ SPICEdev *DEVices[] = { - /* URC must appear before the resistor, capacitor, and diode */ &URCinfo, &ASRCinfo, @@ -116,7 +141,7 @@ int DEVmaxnum = sizeof(DEVices)/sizeof(SPICEdev *); int num_devices(void) { - return sizeof(DEVices)/sizeof(SPICEdev *); + return DEVmaxnum; } IFdevice ** diff --git a/src/spicelib/devices/devsup/devsup.c b/src/spicelib/devices/devsup/devsup.c index f01dab3ab..294c02d0a 100644 --- a/src/spicelib/devices/devsup/devsup.c +++ b/src/spicelib/devices/devsup/devsup.c @@ -3,22 +3,17 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ - /* support routines for device models */ +/* support routines for device models */ #include "ngspice.h" #include "devdefs.h" #include "cktdefs.h" #include "suffix.h" - /* DEVlimvds(vnew,vold) - * limit the per-iteration change of VDS - */ - +/* limit the per-iteration change of VDS */ double -DEVlimvds(vnew,vold) - double vnew; - double vold; - +DEVlimvds(double vnew, + double vold) { if(vold >= 3.5) { @@ -40,20 +35,13 @@ DEVlimvds(vnew,vold) } - /* DEVpnjlim(vnew,vold,vt,vcrit,icheck) - * limit the per-iteration change of PN junction voltages - */ - - +/* limit the per-iteration change of PN junction voltages */ double -DEVpnjlim(vnew,vold,vt,vcrit,icheck) - - double vnew; - double vold; - double vt; - double vcrit; - int *icheck; - +DEVpnjlim(double vnew, + double vold, + double vt, + double vcrit, + int *icheck) { double arg; @@ -75,18 +63,11 @@ DEVpnjlim(vnew,vold,vt,vcrit,icheck) return(vnew); } - /* - * DEVfetlim(vnew,vold.vto) - * - * limit the per-iteration change of FET voltages - */ - +/* limit the per-iteration change of FET voltages */ double -DEVfetlim(vnew,vold,vto) - double vnew; - double vold; - double vto; - +DEVfetlim(double vnew, + double vold, + double vto) { double vtsthi; double vtstlo; @@ -147,40 +128,27 @@ DEVfetlim(vnew,vold,vto) } - /* - * DEVcmeyer(vgs0,vgd0,vgb0,von0,vdsat0, - * vgs1,vgd1,vgb1,covlgs,covlgd,covlgb, - * cgs0,cgd0,cgb0, - * von,vdsat) - * - * Compute the MOS overlap capacitances as functions of the - * device terminal voltages - */ - +/* Compute the MOS overlap capacitances as functions of the device + * terminal voltages */ void -DEVcmeyer(vgs0,vgd0,vgb0,von0,vdsat0, - vgs1,vgd1,vgb1,covlgs,covlgd,covlgb, - cgs,cgd,cgb, - phi,cox,von,vdsat) -double vgs0; /* initial voltage gate-source */ -double vgd0; /* initial voltage gate-drain */ -double vgb0; /* initial voltage gate-bulk */ -double von0; -double vdsat0; -double vgs1; /* final voltage gate-source */ -double vgd1; /* final voltage gate-drain */ -double vgb1; /* final voltage gate-bulk */ -double covlgs; /* overlap capacitance gate-source */ -double covlgd; /* overlap capacitance gate-drain */ -double covlgb; /* overlap capacitance gate-bulk */ -register double *cgs; -register double *cgd; -register double *cgb; -double phi; -double cox; -double von; -double vdsat; - +DEVcmeyer(double vgs0, /* initial voltage gate-source */ + double vgd0, /* initial voltage gate-drain */ + double vgb0, /* initial voltage gate-bulk */ + double von0, + double vdsat0, + double vgs1, /* final voltage gate-source */ + double vgd1, /* final voltage gate-drain */ + double vgb1, /* final voltage gate-bulk */ + double covlgs, /* overlap capacitance gate-source */ + double covlgd, /* overlap capacitance gate-drain */ + double covlgb, /* overlap capacitance gate-bulk */ + double *cgs, + double *cgd, + double *cgb, + double phi, + double cox, + double von, + double vdsat) { @@ -245,39 +213,29 @@ double vdsat; } - /* - * DEVqmeyer(vgs,vgd,vgb,von,vdsat,capgs,capgd,capgb,phi,cox) - * - * - * - * Compute the MOS overlap capacitances as functions of the - * device terminal voltages - */ - -/* ARGSUSED */ /* because vgb is no longer used */ +/* Compute the MOS overlap capacitances as functions of the device + * terminal voltages */ void -DEVqmeyer(vgs,vgd,vgb,von,vdsat,capgs,capgd,capgb,phi,cox) -double vgs; /* initial voltage gate-source */ -double vgd; /* initial voltage gate-drain */ -double vgb; /* initial voltage gate-bulk */ -double von; -double vdsat; -double *capgs; /* non-constant portion of g-s overlap capacitance */ -double *capgd; /* non-constant portion of g-d overlap capacitance */ -double *capgb; /* non-constant portion of g-b overlap capacitance */ -double phi; -double cox; /* oxide capactiance */ - +DEVqmeyer(double vgs, /* initial voltage gate-source */ + double vgd, /* initial voltage gate-drain */ + double vgb, /* initial voltage gate-bulk */ + double von, + double vdsat, + double *capgs, /* non-constant portion of g-s overlap + capacitance */ + double *capgd, /* non-constant portion of g-d overlap + capacitance */ + double *capgb, /* non-constant portion of g-b overlap + capacitance */ + double phi, + double cox) /* oxide capactiance */ { - - double vds; double vddif; double vddif1; double vddif2; double vgst; - vgst = vgs-von; if (vgst <= -phi) { *capgb = cox/2; @@ -309,119 +267,17 @@ double cox; /* oxide capactiance */ } -#ifdef notdef -/* XXX This is no longer used, apparently */ -void -DEVcap(ckt,vgd,vgs,vgb,covlgd,covlgs,covlgb, - capbd,capbs,cggb,cgdb,cgsb,cbgb,cbdb,cbsb, - gcggb,gcgdb,gcgsb,gcbgb,gcbdb,gcbsb, - gcdgb,gcddb,gcdsb,gcsgb,gcsdb,gcssb, - qgate,qchan,qbulk,qdrn,qsrc,xqc) -register CKTcircuit *ckt; - double vgd; - double vgs; - double vgb; - double covlgd; - double covlgs; - double covlgb; - double capbd; - double capbs; - double cggb; - double cgdb; - double cgsb; - double cbgb; - double cbdb; - double cbsb; - double *gcggb; - double *gcgdb; - double *gcgsb; - double *gcbgb; - double *gcbdb; - double *gcbsb; - double *gcdgb; - double *gcddb; - double *gcdsb; - double *gcsgb; - double *gcsdb; - double *gcssb; - double qgate; - double qchan; - double qbulk; - double *qdrn; - double *qsrc; - double xqc; - - /* - * compute equivalent conductances - * divide up the channel charge (1-xqc)/xqc to source and drain - */ +/* Predict a value for the capacitor at loct by extrapolating from + * previous values */ +double +DEVpred(CKTcircuit *ckt, int loct) { - - double gcd; - double gcdxd; - double gcdxs; - double gcg; - double gcgxd; - double gcgxs; - double gcs; - double gcsxd; - double gcsxs; - double qgb; - double qgd; - double qgs; - - gcg = (cggb+cbgb)*ckt->CKTag[1]; - gcd = (cgdb+cbdb)*ckt->CKTag[1]; - gcs = (cgsb+cbsb)*ckt->CKTag[1]; - gcgxd = -xqc*gcg; - gcgxs = -(1-xqc)*gcg; - gcdxd = -xqc*gcd; - gcdxs = -(1-xqc)*gcd; - gcsxd = -xqc*gcs; - gcsxs = -(1-xqc)*gcs; - *gcdgb = gcgxd-covlgd*ckt->CKTag[1]; - *gcddb = gcdxd+(capbd+covlgd)*ckt->CKTag[1]; - *gcdsb = gcsxd; - *gcsgb = gcgxs-covlgs*ckt->CKTag[1]; - *gcsdb = gcdxs; - *gcssb = gcsxs+(capbs+covlgs)*ckt->CKTag[1]; - *gcggb = (cggb+covlgd+covlgs+covlgb)*ckt->CKTag[1]; - *gcgdb = (cgdb-covlgd)*ckt->CKTag[1]; - *gcgsb = (cgsb-covlgs)*ckt->CKTag[1]; - *gcbgb = (cbgb-covlgb)*ckt->CKTag[1]; - *gcbdb = (cbdb-capbd)*ckt->CKTag[1]; - *gcbsb = (cbsb-capbs)*ckt->CKTag[1]; - /* - * compute total terminal charges - */ - qgd = covlgd*vgd; - qgs = covlgs*vgs; - qgb = covlgb*vgb; - qgate = qgate+qgd+qgs+qgb; - qbulk = qbulk-qgb; - *qdrn = xqc*qchan-qgd; - *qsrc = (1-xqc)*qchan-qgs; - /* - * finished - */ -} -#endif - -double DEVpred(ckt,loct) - CKTcircuit *ckt; - int loct; -{ - - /* predict a value for the capacitor at loct by - * extrapolating from previous values - */ - #ifndef NEWTRUNC double xfact; + xfact = ckt->CKTdelta/ckt->CKTdeltaOld[1]; return( ( (1+xfact) * *(ckt->CKTstate1+loct) ) - ( xfact * *(ckt->CKTstate2+loct) ) ); -#endif /*NEWTRUNC*/ - +#endif /* NEWTRUNC */ } diff --git a/src/spicelib/devices/jfet/jfetload.c b/src/spicelib/devices/jfet/jfetload.c index 3baeab8b8..60d6a4e62 100644 --- a/src/spicelib/devices/jfet/jfetload.c +++ b/src/spicelib/devices/jfet/jfetload.c @@ -312,76 +312,6 @@ JFETload(inModel,ckt) } } } -#ifdef notdef - /* The original section is now commented out */ - /* end Sydney University mod */ - /* - * compute drain current and derivitives for normal mode - */ - if (vds >= 0) { - vgst=vgs-model->JFETthreshold; - /* - * normal mode, cutoff region - */ - if (vgst <= 0) { - cdrain=0; - gm=0; - gds=0; - } else { - betap=beta*(1+model->JFETlModulation*vds); - twob=betap+betap; - if (vgst <= vds) { - /* - * normal mode, saturation region - */ - cdrain=betap*vgst*vgst; - gm=twob*vgst; - gds=model->JFETlModulation*beta*vgst*vgst; - } else { - /* - * normal mode, linear region - */ - cdrain=betap*vds*(vgst+vgst-vds); - gm=twob*vds; - gds=twob*(vgst-vds)+model->JFETlModulation*beta* - vds*(vgst+vgst-vds); - } - } - } else { - /* - * compute drain current and derivitives for inverse mode - */ - vgdt=vgd-model->JFETthreshold; - if (vgdt <= 0) { - /* - * inverse mode, cutoff region - */ - cdrain=0; - gm=0; - gds=0; - } else { - /* - * inverse mode, saturation region - */ - betap=beta*(1-model->JFETlModulation*vds); - twob=betap+betap; - if (vgdt <= -vds) { - cdrain = -betap*vgdt*vgdt; - gm = -twob*vgdt; - gds = model->JFETlModulation*beta*vgdt*vgdt-gm; - } else { - /* - * inverse mode, linear region - */ - cdrain=betap*vds*(vgdt+vgdt+vds); - gm=twob*vds; - gds=twob*vgdt-model->JFETlModulation*beta*vds* - (vgdt+vgdt+vds); - } - } - } - /* end of original section, now deleted (replaced w/SU mod */ -#endif /* * compute equivalent drain current source */ diff --git a/src/spicelib/devices/ltra/ltra.c b/src/spicelib/devices/ltra/ltra.c index 817a988e1..121048242 100644 --- a/src/spicelib/devices/ltra/ltra.c +++ b/src/spicelib/devices/ltra/ltra.c @@ -55,20 +55,6 @@ IFparm LTRAmPTable[] = { /* model parameters */ "special reltol for straight line checking"), IOPAU("compactabs", LTRA_MOD_STLINEABS, IF_REAL, "special abstol for straight line checking") -#ifdef notdef - IOP("f", LTRA_MOD_FREQ, IF_REAL, "Frequency"), - IOP("nl", LTRA_MOD_NL, IF_REAL, "Normalized length at frequency given"), - IOP("fullcontrol", LTRA_MOD_FULLCONTROL, IF_FLAG, "rigorous timestep control"), - IOP("halfcontrol", LTRA_MOD_HALFCONTROL, IF_FLAG, - "only the current step is considered for timestep control"), - IOP("print", LTRA_MOD_PRINT, IF_FLAG, "printing of debugging info on"), - IOP("noprint", LTRA_MOD_NOPRINT, IF_FLAG, "printing of debugging info off"), - IOP("ronly", LTRA_MOD_RONLY, IF_FLAG, "use special load routines for G=0"), - IOP("choprel", LTRA_MOD_CHOPREL, IF_REAL, - "special reltol for truncation of impulse responses"), - IOP("chopabs", LTRA_MOD_CHOPABS, IF_REAL, - "special abstol for truncation of impulse responses "), -#endif }; char *LTRAnames[] = { diff --git a/src/spicelib/devices/ltra/ltraset.c b/src/spicelib/devices/ltra/ltraset.c index 2a7cdedb4..6d653a20b 100644 --- a/src/spicelib/devices/ltra/ltraset.c +++ b/src/spicelib/devices/ltra/ltraset.c @@ -75,10 +75,6 @@ LTRAsetup(matrix, inModel, ckt, state) } if ((model->LTRAstepLimit != LTRA_MOD_NOSTEPLIMIT)) model->LTRAstepLimit = LTRA_MOD_STEPLIMIT; -#ifdef notdef - if ((model->LTRAprintFlag != LTRA_MOD_PRINT)) - model->LTRAprintFlag = LTRA_MOD_NOPRINT; -#endif if ((model->LTRAlteConType != LTRA_MOD_FULLCONTROL) && (model->LTRAlteConType != LTRA_MOD_HALFCONTROL)) model->LTRAlteConType = LTRA_MOD_NOCONTROL; diff --git a/src/spicelib/devices/mos6/mos6ext.h b/src/spicelib/devices/mos6/mos6ext.h index e37ba67f3..4f55b4dc5 100644 --- a/src/spicelib/devices/mos6/mos6ext.h +++ b/src/spicelib/devices/mos6/mos6ext.h @@ -15,13 +15,6 @@ extern int MOS6mDelete(GENmodel**,IFuid,GENmodel*); extern int MOS6mParam(int,IFvalue*,GENmodel*); extern int MOS6param(int,IFvalue*,GENinstance*,IFvalue*); extern int MOS6pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); -#ifdef notdef -extern int MOS6sAcLoad(GENmodel*,CKTcircuit*); -extern int MOS6sLoad(GENmodel*,CKTcircuit*); -extern void MOS6sPrint(GENmodel*,CKTcircuit*); -extern int MOS6sSetup(SENstruct*,GENmodel*); -extern int MOS6sUpdate(GENmodel*,CKTcircuit*); -#endif extern int MOS6setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); extern int MOS6unsetup(GENmodel*,CKTcircuit*); extern int MOS6temp(GENmodel*,CKTcircuit*);