From 37b1a2a07d7eca0d71ca2beab57a03c7ec406e80 Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Mon, 2 Feb 2026 20:53:13 -0500 Subject: [PATCH] Cleaned up some errors (most minor, some not so minor) in the code that were surfaced by Stefan Thiede running clang on Mac OS. Function prototype warnings have not been fixed yet, as that is a more involved fix, although it needs to be done. --- VERSION | 2 +- base/actel.c | 4 ++-- base/netfile.c | 2 ++ base/objlist.c | 6 +++++- base/query.c | 5 +++-- base/spice.c | 9 +++++---- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 6a7b4fe..0f1b371 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.315 +1.5.316 diff --git a/base/actel.c b/base/actel.c index c7a7101..6010436 100644 --- a/base/actel.c +++ b/base/actel.c @@ -91,7 +91,7 @@ char *ActelName(char *Name) /* strip physical-pin information, if it exists */ if ((nm = strrchr(name,PHYSICALPIN[0])) != NULL) *nm = '\0'; if (strlen(name) > 13) { - ActelIndex = (++ActelIndex) % ACTELNAMESIZE; + ActelIndex = (ActelIndex + 1) % ACTELNAMESIZE; /* format the value of the hashed value of the string */ sprintf(ActelNames[ActelIndex], "$%lX", ActelNameHash(name)); if (Debug) @@ -102,7 +102,7 @@ Printf("ActelNameHash returns %s on name %s\n",ActelNames[ActelIndex], name); NeedsQuoting = 0; if (NULL != strpbrk(name, ".,:; \t\"'\n\r")) NeedsQuoting = 1; - ActelIndex = (++ActelIndex) % ACTELNAMESIZE; + ActelIndex = (ActelIndex + 1) % ACTELNAMESIZE; if (!NeedsQuoting) { strcpy(ActelNames[ActelIndex], name); return(ActelNames[ActelIndex]); diff --git a/base/netfile.c b/base/netfile.c index 539c372..0c2b746 100644 --- a/base/netfile.c +++ b/base/netfile.c @@ -685,6 +685,7 @@ void SpiceSkipNewLine(void) ungetc(contline, infile); } +#if 0 /* Commented with "#if 0" due to comment characters in the comment */ /*----------------------------------------------------------------------*/ /* Function similar to strtok() for token parsing. The difference is */ /* that it takes two sets of delimiters. The first is whitespace */ @@ -705,6 +706,7 @@ void SpiceSkipNewLine(void) /* the first character of the delimiter string in addition to marking */ /* the boundary between two-character and one-character delimiters. */ /*----------------------------------------------------------------------*/ +#endif char *strdtok0(char *pstring, char *delim1, char *delim2, char isverilog) { diff --git a/base/objlist.c b/base/objlist.c index de5e658..1849168 100644 --- a/base/objlist.c +++ b/base/objlist.c @@ -449,6 +449,7 @@ int removeshorted(struct hashlist *p, int file) ob = nob; } } + return 1; } /* Remove shorted instances of class "class" from the database */ @@ -539,6 +540,7 @@ int deleteclass(struct hashlist *p, int file) } } FREE(checknodes); + return 1; } /* Remove all instances of class "class" from the database */ @@ -576,6 +578,7 @@ int renameinstances(struct hashlist *p, int file) } } } + return 1; } void InstanceRename(char *from, char *to, int file) @@ -598,9 +601,10 @@ int freeprop(struct hashlist *p) struct property *prop; prop = (struct property *)(p->ptr); - if (prop->type == PROP_STRING) + if (prop->type == PROP_STRING) { if (prop->pdefault.string != NULL) FREE(prop->pdefault.string); + } else if (prop->type == PROP_EXPRESSION) { struct tokstack *stackptr, *nptr; stackptr = prop->pdefault.stack; diff --git a/base/query.c b/base/query.c index 6a23e0f..feb091c 100644 --- a/base/query.c +++ b/base/query.c @@ -319,7 +319,7 @@ void Fanout(char *cell, char *node, int filter) while (ob != NULL) { char *obname = ob->name; if (*obname == '/') obname++; - if (ob->node == nodenum) + if (ob->node == nodenum) { if (filter == ALLOBJECTS) { Printf(" %s (", obname); PrintObjectType(ob->type); @@ -331,6 +331,7 @@ void Fanout(char *cell, char *node, int filter) else if (ob->type == filter) { Printf(" %s\n", obname); } + } ob = ob->next; } } @@ -933,7 +934,7 @@ static int PrintLeavesInCellHash(struct hashlist *p) struct nlist *ptr; ptr = (struct nlist *)(p->ptr); - if ((ptr->class == CLASS_SUBCKT)) PrintLeavesInCell(ptr->name, ptr->file); + if (ptr->class == CLASS_SUBCKT) PrintLeavesInCell(ptr->name, ptr->file); return(0); } diff --git a/base/spice.c b/base/spice.c index dc0b66b..4515aae 100644 --- a/base/spice.c +++ b/base/spice.c @@ -196,7 +196,7 @@ void SpiceSubCell(struct nlist *tp, int IsSubCell) if (ob->type == PROPERTY) { struct valuelist *vl; int i; - for (i == 0;; i++) { + for (i = 0;; i++) { vl = &(ob->instance.props[i]); if (vl->type == PROP_ENDLIST) break; else if (vl->type == PROP_VALUE) { @@ -216,7 +216,7 @@ void SpiceSubCell(struct nlist *tp, int IsSubCell) if (ob->type == PROPERTY) { struct valuelist *vl; int i; - for (i == 0;; i++) { + for (i = 0;; i++) { vl = &(ob->instance.props[i]); if (vl->type == PROP_ENDLIST) break; else if (vl->type == PROP_VALUE) { @@ -236,7 +236,7 @@ void SpiceSubCell(struct nlist *tp, int IsSubCell) if (ob->type == PROPERTY) { struct valuelist *vl; int i; - for (i == 0;; i++) { + for (i = 0;; i++) { vl = &(ob->instance.props[i]); if (vl->type == PROP_ENDLIST) break; else if (vl->type == PROP_VALUE) { @@ -399,7 +399,7 @@ int renamepins(struct hashlist *p, int file) ptr = (struct nlist *)(p->ptr); if (ptr->file != file) - return 1; + return 0; for (ob = ptr->cell; ob != NULL; ob = ob->next) { if (ob->type == FIRSTPIN) { @@ -426,6 +426,7 @@ int renamepins(struct hashlist *p, int file) } } } + return 1; } /* If any pins are marked unconnected, see if there are */