Applied patches from Charles Williams. The patched code makes error reporting

more verbose. In inperror.c makes use of errMsg.
This commit is contained in:
pnenzi 2001-11-27 10:26:25 +00:00
parent 633f489e4c
commit e2e71a7e4d
4 changed files with 25 additions and 5 deletions

View File

@ -21,7 +21,7 @@ ACsetParm(CKTcircuit *ckt, void *anal, int which, IFvalue *value)
case AC_START:
if (value->rValue <= 0.0) {
errMsg = copy("Frequency of 0 is invalid");
errMsg = copy("Frequency of 0 is invalid for AC start");
((ACAN*)anal)->ACstartFreq = 1.0;
return(E_PARMVAL);
}
@ -31,7 +31,7 @@ ACsetParm(CKTcircuit *ckt, void *anal, int which, IFvalue *value)
case AC_STOP:
if (value->rValue <= 0.0) {
errMsg = copy("Frequency of 0 is invalid");
errMsg = copy("Frequency of 0 is invalid for AC stop");
((ACAN*)anal)->ACstartFreq = 1.0;
return(E_PARMVAL);
}

View File

@ -34,7 +34,7 @@ NOISEan (CKTcircuit *ckt, int restart)
int code;
int step;
IFuid freqUid;
void *inst; /* PN fixes incompatible pointer type warning */
char *inst;
double freqTol; /* tolerence parameter for finding final frequency; hack */
NOISEAN *job = (NOISEAN*) (ckt->CKTcurJob);
@ -47,7 +47,7 @@ NOISEan (CKTcircuit *ckt, int restart)
inst = NULL;
code = CKTtypelook("Vsource");
if (code != -1) {
error = CKTfndDev((void *)ckt,&code,&inst,
error = CKTfndDev((void *)ckt,&code,(void **)&inst,
job->input, (void *)NULL, (IFuid)NULL);
if (!error && !((VSRCinstance *)inst)->VSRCacGiven) {
errMsg = MALLOC(strlen(noacinput)+1);
@ -58,7 +58,7 @@ NOISEan (CKTcircuit *ckt, int restart)
code = CKTtypelook("Isource");
if (code != -1 && inst==NULL) {
error = CKTfndDev((void *)ckt,&code,&inst,
error = CKTfndDev((void *)ckt,&code, (void **)&inst,
job->input, (void *)NULL,(IFuid)NULL);
if (error) {
/* XXX ??? */

View File

@ -19,12 +19,27 @@ TRANsetParm(CKTcircuit *ckt, void *anal, int which, IFvalue *value)
switch(which) {
case TRAN_TSTOP:
if (value->rValue <= 0.0) {
errMsg = copy("TST0P is invalid, must be greater than zero.");
((TRANan *)anal)->TRANfinalTime = 1.0;
return(E_PARMVAL);
}
((TRANan *)anal)->TRANfinalTime = value->rValue;
break;
case TRAN_TSTEP:
if (value->rValue <= 0.0) {
errMsg = copy( "TSTEP is invalid, must be greater than zero." );
((TRANan *)anal)->TRANstep = 1.0;
return(E_PARMVAL);
}
((TRANan *)anal)->TRANstep = value->rValue;
break;
case TRAN_TSTART:
if (value->rValue >= ((TRANan *)anal)->TRANfinalTime ) {
errMsg = copy("TSTART is invalid, must be less than TSTOP.");
((TRANan *)anal)->TRANinitTime = 0.0;
return(E_PARMVAL);
}
((TRANan *)anal)->TRANinitTime = value->rValue;
break;
case TRAN_TMAX:

View File

@ -23,6 +23,11 @@ char *INPerror(int type)
char *val;
char *ebuf;
/*CDHW Lots of things set errMsg but it is never used so let's hack it in CDHW*/
if ( errMsg ) {
val = errMsg; errMsg=NULL; }
else
/*CDHW end of hack CDHW*/
val = SPerror(type);
if (!val)