Corrected two different errors:

(1) When a comment line follows a ".subckt" line, and the comment
    line is empty or all whitespace, then the following line would
    be ignored.  This condition appears to be very specific and
    was solved simply by detecting it and handling it.
(2) Occasionally the "M" parameter of a subcircuit will be recorded
    as type double, and this was not being anticipated by the code
    that checks if "M=1" matches a corresponding entry with no "M"
    parameter.  Simple fix to check the condition where the "M"
    parameter is type double.
This commit is contained in:
Tim Edwards 2024-01-03 21:21:03 -05:00
parent 1817f4dd6a
commit eb27a18ae3
3 changed files with 18 additions and 4 deletions

View File

@ -1 +1 @@
1.5.264
1.5.265

View File

@ -6124,7 +6124,9 @@ PropertyMatch(struct Element *E1, struct Element *E2,
if (kl2 != NULL)
break; // Property is required
}
else if (vl2->value.ival != 1)
else if ((vl2->type == PROP_INTEGER) && (vl2->value.ival != 1))
break; // Property M != 1 or S != 1 is a mismatch.
else if ((vl2->type == PROP_DOUBLE) && (vl2->value.dval != 1))
break; // Property M != 1 or S != 1 is a mismatch.
}
if (vl2->type != PROP_ENDLIST) {

View File

@ -587,6 +587,12 @@ void SkipTokNoNewline(char *delimiter)
/* */
/* Modified 3/30/2015 to include the condition where a comment line is */
/* in the middle of a series of continuation lines. */
/* */
/* Modified 1/3/2024 to avoid skipping two lines if a line has only the */
/* comment character '*' followed by a newline. It seems that '\n' is */
/* being ignored in WHITESPACE_DELIMITER, but it's easier to write the */
/* code to find the exception rather than track down the problem in */
/* GetNextLine(). */
/*----------------------------------------------------------------------*/
void SpiceTokNoNewline(void)
@ -598,8 +604,14 @@ void SpiceTokNoNewline(void)
while (nexttok == NULL) {
contline = getc(infile);
if (contline == '*') {
char testline = ' ';
while ((testline == ' ') || (testline == '\t'))
testline = getc(infile);
if (testline != '\n') {
ungetc(testline, infile);
GetNextLine(WHITESPACE_DELIMITER);
SkipNewLine(NULL);
}
continue;
}
else if (contline != '+') {