Fix a bug when reading a list of type ( 2 4 6 ): If ')' was not
the last token, an error message was generated.
This commit is contained in:
parent
64e5e13c4e
commit
110a853ce5
|
|
@ -34,8 +34,9 @@ INPgetValue(CKTcircuit *ckt, char **line, int type, INPtables *tab)
|
||||||
temp.rValue = INPevaluate(line, &error, 1);
|
temp.rValue = INPevaluate(line, &error, 1);
|
||||||
/* printf(" returning real value %e\n",temp.rValue); */
|
/* printf(" returning real value %e\n",temp.rValue); */
|
||||||
} else if (type == IF_REALVEC) {
|
} else if (type == IF_REALVEC) {
|
||||||
/* read until error occurs. If first token is already
|
/* read until error occurs. If error, and first
|
||||||
in error, return NULL */
|
character of remaining line is ')', everything is o.k.
|
||||||
|
If first token is already in error, return NULL.*/
|
||||||
temp.v.numValue = 0;
|
temp.v.numValue = 0;
|
||||||
list = TMALLOC(double, 1);
|
list = TMALLOC(double, 1);
|
||||||
tmp = INPevaluate(line, &error, 1);
|
tmp = INPevaluate(line, &error, 1);
|
||||||
|
|
@ -50,13 +51,15 @@ INPgetValue(CKTcircuit *ckt, char **line, int type, INPtables *tab)
|
||||||
list[temp.v.numValue - 1] = tmp;
|
list[temp.v.numValue - 1] = tmp;
|
||||||
tmp = INPevaluate(line, &error, 1);
|
tmp = INPevaluate(line, &error, 1);
|
||||||
}
|
}
|
||||||
if (error && ft_ngdebug && !eq(*line, "") && !eq(*line, ")"))
|
if (error && !eq(*line, "") && !prefix(")", *line)) {
|
||||||
/* in rare cases false warnings may occur */
|
fprintf(stderr, "\nWarning: Could not read parameter from \n%s\nat\n", compline);
|
||||||
fprintf(stderr, "Warning: Could not read parameter from %s at %s\n", compline, *line);
|
fprintf(stderr, "%*s%s\n", *line - compline," ", *line);
|
||||||
|
}
|
||||||
temp.v.vec.rVec = list;
|
temp.v.vec.rVec = list;
|
||||||
} else if (type == IF_INTVEC) {
|
} else if (type == IF_INTVEC) {
|
||||||
/* read until error occurs. If first token is already
|
/* read until error occurs. If error, and first
|
||||||
in error, return NULL */
|
character of remaining line is ')', everything is o.k.
|
||||||
|
If first token is already in error, return NULL.*/
|
||||||
temp.v.numValue = 0;
|
temp.v.numValue = 0;
|
||||||
ilist = TMALLOC(int, 1);
|
ilist = TMALLOC(int, 1);
|
||||||
tmp = INPevaluate(line, &error, 1);
|
tmp = INPevaluate(line, &error, 1);
|
||||||
|
|
@ -71,8 +74,10 @@ INPgetValue(CKTcircuit *ckt, char **line, int type, INPtables *tab)
|
||||||
ilist[temp.v.numValue - 1] = (int) floor(0.5 + tmp);
|
ilist[temp.v.numValue - 1] = (int) floor(0.5 + tmp);
|
||||||
tmp = INPevaluate(line, &error, 1);
|
tmp = INPevaluate(line, &error, 1);
|
||||||
}
|
}
|
||||||
if (error && ft_ngdebug && !eq(*line, "") && !eq(*line, ")"))
|
if (error && !eq(*line, "") && !prefix(")", *line)) {
|
||||||
fprintf(stderr, "Warning: Could not read parameter from %s at %s\n", compline, *line);
|
fprintf(stderr, "\nWarning: Could not read parameter from \n%s\nat\n", compline);
|
||||||
|
fprintf(stderr, "%*s%s\n", *line - compline, " ", *line);
|
||||||
|
}
|
||||||
temp.v.vec.iVec = ilist;
|
temp.v.vec.iVec = ilist;
|
||||||
} else if (type == IF_FLAG) {
|
} else if (type == IF_FLAG) {
|
||||||
temp.iValue = 1;
|
temp.iValue = 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue