fix use of possibly uninitialized variables, return on error

This commit is contained in:
rlar 2011-08-06 19:10:16 +00:00
parent 87dc06f1b2
commit 17ca4ce1f1
2 changed files with 52 additions and 54 deletions

View File

@ -1,3 +1,7 @@
2011-08-06 Robert Larice
* src/frontend/shyu.c :
fix use of possibly uninitialized variables, return on error
2011-08-06 Robert Larice
* src/spicelib/devices/adms/admst/ngspice.xml :
reposition NG_IGNOREABLE for non C99 compiler compatibility

View File

@ -77,19 +77,18 @@ if_sens_run(CKTcircuit *ckt, wordlist *args, INPtables *tab)
break;
}
}
if(which != -1) {
err = ft_sim->newAnalysis (ft_curckt->ci_ckt, which, "options",
&(ft_curckt->ci_specOpt), ft_curckt->ci_specTask);
if(err) {
ft_sperror(err,"createOptions");
return(0);/* temporary */
}
ft_curckt->ci_curOpt = ft_curckt->ci_specOpt;
}
else {
if(which == -1) {
/* in DEEP trouble */
;
ft_sperror(err,"in DEEP trouble");
return(0);/* temporary */
}
err = ft_sim->newAnalysis (ft_curckt->ci_ckt, which, "options",
&(ft_curckt->ci_specOpt), ft_curckt->ci_specTask);
if(err) {
ft_sperror(err,"createOptions");
return(0);/* temporary */
}
ft_curckt->ci_curOpt = ft_curckt->ci_specOpt;
ft_curckt->ci_curTask = ft_curckt->ci_specTask;
which = -1;
for(j=0;j<ft_sim->numAnalyses;j++) {
@ -98,19 +97,17 @@ if_sens_run(CKTcircuit *ckt, wordlist *args, INPtables *tab)
break;
}
}
if(which != -1) {
err = ft_sim->newAnalysis (ft_curckt->ci_ckt, which, "sense",
&(senseJob),ft_curckt->ci_specTask);
if(err) {
ft_sperror(err,"createSense");
return(0);/* temporary */
}
}
else{
if(which == -1) {
current->error = INPerrCat(current->error,INPmkTemp(
"sensetivity analysis unsupported\n"));
return(0);
}
err = ft_sim->newAnalysis (ft_curckt->ci_ckt, which, "sense",
& senseJob, ft_curckt->ci_specTask);
if(err) {
ft_sperror(err,"createSense");
return(0);/* temporary */
}
save = which;
INPgetTok(&line,&token,1);
if(strcmp(token ,"ac")==0){
@ -122,17 +119,16 @@ if_sens_run(CKTcircuit *ckt, wordlist *args, INPtables *tab)
break;
}
}
if(which != -1) {
err = ft_sim->newAnalysis (ft_curckt->ci_ckt, which, "acan",
&(acJob),ft_curckt->ci_specTask);
if(err) {
ft_sperror(err,"createAC"); /* or similar error message */
return(0);
}
}
else{
if(which == -1) {
current->error = INPerrCat(current->error,INPmkTemp(
"ac analysis unsupported\n"));
return(0);/* temporary */
}
err = ft_sim->newAnalysis (ft_curckt->ci_ckt, which, "acan",
& acJob, ft_curckt->ci_specTask);
if(err) {
ft_sperror(err,"createAC"); /* or similar error message */
return(0);/* temporary */
}
INPgetTok(&line,&steptype,1); /* get DEC, OCT, or LIN */
@ -165,14 +161,13 @@ if_sens_run(CKTcircuit *ckt, wordlist *args, INPtables *tab)
if(which == -1) {
current->error = INPerrCat(current->error,INPmkTemp(
"DC operating point analysis unsupported\n"));
return(0);/* temporary */
}
else {
err = ft_sim->newAnalysis (ft_curckt->ci_ckt, which, "dcop",
&(opJob),ft_curckt->ci_specTask);
if(err) {
ft_sperror(err,"createOP"); /* or similar error message */
return(0);
}
err = ft_sim->newAnalysis (ft_curckt->ci_ckt, which, "dcop",
& opJob, ft_curckt->ci_specTask);
if(err) {
ft_sperror(err,"createOP"); /* or similar error message */
return(0);
}
}
if(strcmp(token ,"dc")==0){
@ -189,6 +184,7 @@ if_sens_run(CKTcircuit *ckt, wordlist *args, INPtables *tab)
if(which==-1) {
current->error = INPerrCat(current->error,INPmkTemp(
"DC transfer curve analysis unsupported\n"));
return(0);/* temporary */
}
err = ft_sim->newAnalysis (ft_curckt->ci_ckt, which, "DCtransfer",
&(dcJob),ft_curckt->ci_specTask);
@ -237,17 +233,16 @@ if_sens_run(CKTcircuit *ckt, wordlist *args, INPtables *tab)
break;
}
}
if(which != -1) {
err = ft_sim->newAnalysis (ft_curckt->ci_ckt, which, "tranan",
&(tranJob),ft_curckt->ci_specTask);
if(err) {
ft_sperror(err,"createTRAN");
return(0);
}
}
else{
if(which == -1) {
current->error = INPerrCat(current->error,INPmkTemp(
"transient analysis unsupported\n"));
return(0);/* temporary */
}
err = ft_sim->newAnalysis (ft_curckt->ci_ckt, which, "tranan",
& tranJob, ft_curckt->ci_specTask);
if(err) {
ft_sperror(err,"createTRAN");
return(0);
}
parm=INPgetValue(ckt,&line,IF_REAL,tab);/* Tstep */
@ -297,17 +292,16 @@ uic:
break;
}
}
if(which != -1) {
err = (*(ft_sim->newAnalysis))(ft_curckt->ci_ckt,which,"pssan",
&(pssJob),ft_curckt->ci_specTask);
if(err) {
ft_sperror(err,"createPSS");
return(0);
}
}
else{
if(which == -1) {
current->error = INPerrCat(current->error,INPmkTemp(
"periodic steady state analysis unsupported\n"));
return(0);/* temporary */
}
err = ft_sim->newAnalysis (ft_curckt->ci_ckt,which, "pssan",
& pssJob, ft_curckt->ci_specTask);
if(err) {
ft_sperror(err,"createPSS");
return(0);
}
parm=INPgetValue(ckt,&line,IF_REAL,tab);/* Guessed Frequency */