diff --git a/ChangeLog b/ChangeLog index 152b3067b..0659e3cdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ -2009-04-26 Holger Vogt +2009-05-01 Holger Vogt + * cktdojob.c, cktsopt.c: moved to cktsopt.c: + maxord set to min 2 or max 6 + +2009-04-28 Holger Vogt * winmain.c, inp.c, cktop.c: SetAnalyse() modified/added cktdojob.c: maxord set to minimum 2 (prevent crash in dctran.c:774) diff --git a/src/spicelib/analysis/cktdojob.c b/src/spicelib/analysis/cktdojob.c index 5c651b7d6..a853ace1a 100644 --- a/src/spicelib/analysis/cktdojob.c +++ b/src/spicelib/analysis/cktdojob.c @@ -52,11 +52,6 @@ CKTdoJob(void *inCkt, int reset, void *inTask) ckt->CKTtemp = task->TSKtemp; ckt->CKTnomTemp = task->TSKnomTemp; - /* Check options method and maxorder for consistency */ - if (task->TSKmaxOrder < 2) { - task->TSKmaxOrder = 2; - fprintf(stderr,"\nWarning -- Option maxord < 2 not allowed in this build\nSet to 2\n\n"); - } ckt->CKTmaxOrder = task->TSKmaxOrder; ckt->CKTintegrateMethod = task->TSKintegrateMethod; ckt->CKTbypass = task->TSKbypass; diff --git a/src/spicelib/analysis/cktsopt.c b/src/spicelib/analysis/cktsopt.c index c7a3ea769..d66fda3f9 100644 --- a/src/spicelib/analysis/cktsopt.c +++ b/src/spicelib/analysis/cktsopt.c @@ -112,6 +112,15 @@ CKTsetOpt(CKTcircuit *ckt, void *anal, int opt, IFvalue *val) break; case OPT_MAXORD: task->TSKmaxOrder = val->iValue; + /* Check options method and maxorder for consistency */ + if (task->TSKmaxOrder < 2) { + task->TSKmaxOrder = 2; + fprintf(stderr,"\nWarning -- Option maxord < 2 not allowed in ngspice\nSet to 2\n\n"); + } + else if (task->TSKmaxOrder > 6) { + task->TSKmaxOrder = 6; + fprintf(stderr,"\nWarning -- Option maxord > 6 not allowed in ngspice\nSet to 6\n\n"); + } break; case OPT_OLDLIMIT: task->TSKfixLimit = val->iValue;