diff --git a/src/frontend/shyu.c b/src/frontend/shyu.c index 69ad909ea..ef2f65a9f 100644 --- a/src/frontend/shyu.c +++ b/src/frontend/shyu.c @@ -334,25 +334,21 @@ next: continue; } - /* found it, analysis which, parameter i */ - if (if_parm->dataType & IF_FLAG) { - /* one of the keywords! */ - ptemp.iValue = 1; - error = ft_sim->setAnalysisParm - (ckt, senseJob, - if_parm->id, &ptemp, NULL); - if (error) - current->error = INPerrCat(current->error, INPerror(error)); - } else { - parm = INPgetValue - (ckt, &line, - if_parm->dataType, tab); - error = ft_sim->setAnalysisParm - (ckt, senseJob, - if_parm->id, parm, NULL); - if (error) - current->error = INPerrCat(current->error, INPerror(error)); - } + /* found it, analysis which, parameter i */ + if (if_parm->dataType & IF_FLAG) { + /* one of the keywords! */ + ptemp.iValue = 1; + error = ft_sim->setAnalysisParm (ckt, senseJob, + if_parm->id, &ptemp, NULL); + if (error) + current->error = INPerrCat(current->error, INPerror(error)); + } else { + parm = INPgetValue (ckt, &line, if_parm->dataType, tab); + error = ft_sim->setAnalysisParm (ckt, senseJob, + if_parm->id, parm, NULL); + if (error) + current->error = INPerrCat(current->error, INPerror(error)); + } } if ((err = ft_sim->doAnalyses (ckt, 1, ft_curckt->ci_curTask)) != OK) { diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index 0b720cd68..335bf596e 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -1210,13 +1210,12 @@ finddev(CKTcircuit *ckt, char *name, GENinstance **devptr, GENmodel **modptr) int if_analQbyName(CKTcircuit *ckt, int which, JOB *anal, char *name, IFvalue *parm) { - IFparm *if_parm; - if_parm = ft_find_analysis_parm(which, name); + IFparm *if_parm = ft_find_analysis_parm(which, name); + if (!if_parm) return (E_BADPARM); - return (ft_sim->askAnalysisQuest - (ckt, anal, if_parm->id, parm, NULL)); + return (ft_sim->askAnalysisQuest (ckt, anal, if_parm->id, parm, NULL)); } @@ -1283,7 +1282,7 @@ if_getstat(CKTcircuit *ckt, char *name) IFvalue parm; IFparm *if_parm; - options_idx = ft_find_analysis("options"); + options_idx = ft_find_analysis("options"); if (options_idx == -1) { fprintf(cp_err, "Warning: statistics unsupported\n"); diff --git a/src/spicelib/parser/inp2dot.c b/src/spicelib/parser/inp2dot.c index fcf0a2885..e0d1b1a41 100644 --- a/src/spicelib/parser/inp2dot.c +++ b/src/spicelib/parser/inp2dot.c @@ -511,45 +511,48 @@ dot_sens2(char *line, CKTcircuit *ckt, INPtables *tab, card *current, LITERR("Sensitivity-2 analysis unsupported\n"); return (0); } + IFC(newAnalysis, (ckt, which, "Sensitivity-2 Analysis", &foo, task)); + while (*line) { - IFparm *if_parm; - /* read the entire line */ - INPgetTok(&line, &token, 1); - if_parm = ft_find_analysis_parm(which, token); - if (!if_parm) { - /* didn't find it! */ - LITERR(" Error: unknown parameter on .sens-ignored \n"); - continue; - } - /* found it, analysis which, parameter i */ - if (if_parm->dataType & IF_FLAG) { - /* one of the keywords! */ - ptemp.iValue = 1; - error = - ft_sim->setAnalysisParm (ckt, foo, - if_parm->id, - &ptemp, - NULL); - if (error) - current->error = - INPerrCat(current->error, INPerror(error)); - } else { - parm = - INPgetValue(ckt, &line, - if_parm->dataType, tab); - error = - ft_sim->setAnalysisParm (ckt, foo, - if_parm->id, - parm, - NULL); - if (error) - current->error = - INPerrCat(current->error, INPerror(error)); - - } + IFparm *if_parm; + + /* read the entire line */ + INPgetTok(&line, &token, 1); + + if_parm = ft_find_analysis_parm(which, token); + + if (!if_parm) { + /* didn't find it! */ + LITERR(" Error: unknown parameter on .sens-ignored \n"); + continue; + } + + /* found it, analysis which, parameter i */ + if (if_parm->dataType & IF_FLAG) { + + /* one of the keywords! */ + ptemp.iValue = 1; + error = ft_sim->setAnalysisParm (ckt, foo, + if_parm->id, + &ptemp, + NULL); + if (error) + current->error = INPerrCat(current->error, INPerror(error)); + + } else { + + parm = INPgetValue(ckt, &line, if_parm->dataType, tab); + error = ft_sim->setAnalysisParm (ckt, foo, + if_parm->id, + parm, + NULL); + if (error) + current->error = INPerrCat(current->error, INPerror(error)); + } } + return (0); } #endif diff --git a/src/spicelib/parser/inpdoopt.c b/src/spicelib/parser/inpdoopt.c index 977282630..6dd048146 100644 --- a/src/spicelib/parser/inpdoopt.c +++ b/src/spicelib/parser/inpdoopt.c @@ -32,42 +32,47 @@ INPdoOpts( int which; which = ft_find_analysis("options"); + if(which == -1) { optCard->error = INPerrCat(optCard->error,INPmkTemp( - "error: analysis options table not found\n")); + "error: analysis options table not found\n")); return; } + line = optCard->line; + INPgetTok(&line,&token,1); /* throw away '.option' */ + while (*line) { + IFparm *if_parm; + INPgetTok(&line,&token,1); + if_parm = ft_find_analysis_parm(which, token); + if(if_parm && !(if_parm->dataType & IF_UNIMP_MASK)) { - errmsg = TMALLOC(char, 45 + strlen(token)); - (void) sprintf(errmsg, - " Warning: %s not yet implemented - ignored \n",token); - optCard->error = INPerrCat(optCard->error,errmsg); - val = INPgetValue(ckt,&line, - if_parm->dataType, tab); - continue; + errmsg = TMALLOC(char, 45 + strlen(token)); + (void) sprintf(errmsg, " Warning: %s not yet implemented - ignored \n",token); + optCard->error = INPerrCat(optCard->error,errmsg); + val = INPgetValue(ckt,&line, if_parm->dataType, tab); + continue; } + if(if_parm && (if_parm->dataType & IF_SET)) { - val = INPgetValue(ckt,&line, - if_parm->dataType&IF_VARTYPES, tab); - error = ft_sim->setAnalysisParm (ckt, anal, - if_parm->id, val, NULL); - if(error) { - errmsg = TMALLOC(char, 35 + strlen(token)); - (void) sprintf(errmsg, - "Warning: can't set option %s\n", token); - optCard->error = INPerrCat(optCard->error, errmsg); - } - continue; + val = INPgetValue(ckt,&line, if_parm->dataType&IF_VARTYPES, tab); + error = ft_sim->setAnalysisParm (ckt, anal, if_parm->id, val, NULL); + if(error) { + errmsg = TMALLOC(char, 35 + strlen(token)); + (void) sprintf(errmsg, "Warning: can't set option %s\n", token); + optCard->error = INPerrCat(optCard->error, errmsg); + } + continue; } - errmsg = TMALLOC(char, 100); - (void) strcpy(errmsg," Error: unknown option - ignored\n"); - optCard->error = INPerrCat(optCard->error,errmsg); - fprintf(stderr, "%s\n", optCard->error); + + errmsg = TMALLOC(char, 100); + (void) strcpy(errmsg," Error: unknown option - ignored\n"); + optCard->error = INPerrCat(optCard->error,errmsg); + fprintf(stderr, "%s\n", optCard->error); } }