From 73344329f843065065368a9cc0804c2b16ff683d Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Wed, 12 Nov 2025 09:17:46 -0500 Subject: [PATCH 1/3] Made some updates for Tcl 9 compatibility; also changed the Makefile to pass EXTRA_CFLAGS for testing with "-std=c99" and "-std=gnu99". Made some additional corrections to ensure a clean compile using -std=gnu99. --- base/netcmp.c | 1 + base/netgen.c | 2 ++ base/spice.c | 3 +++ tcltk/tclnetgen.c | 29 +++++++++++++++++++---------- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/base/netcmp.c b/base/netcmp.c index 8f0d859..d19dc2e 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -24,6 +24,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include +#include /* for strncasecmp() */ #include /* for time() as a seed for random number generator */ #include #include /* for fabs() */ diff --git a/base/netgen.c b/base/netgen.c index 844da03..cbbeff5 100644 --- a/base/netgen.c +++ b/base/netgen.c @@ -25,6 +25,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include /* for strtof() */ #include +#include +#include #include /* toupper() */ #ifdef IBMPC #include diff --git a/base/spice.c b/base/spice.c index 28414e2..dc0b66b 100644 --- a/base/spice.c +++ b/base/spice.c @@ -21,6 +21,9 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include +#include +#include +#include #if 0 #include /* what about varargs, like in pdutils.c ??? */ #endif diff --git a/tcltk/tclnetgen.c b/tcltk/tclnetgen.c index e5b2695..2c6c70f 100644 --- a/tcltk/tclnetgen.c +++ b/tcltk/tclnetgen.c @@ -21,6 +21,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include /* for getenv */ #include +#include +#include /* for va_list */ #include @@ -43,6 +45,10 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define FALSE 0 #endif +#if TCL_MAJOR_VERSION < 9 +typedef int Tcl_Size; +#endif + /*-----------------------*/ /* Tcl 8.4 compatibility */ /*-----------------------*/ @@ -283,7 +289,7 @@ GetTopCell(int fnum) int CommonGetFilenameOrFile(Tcl_Interp *interp, Tcl_Obj *fobj, int *fnumptr) { - int result, llen; + int result; int fnum, ftest; char *filename; struct nlist *tp; @@ -366,7 +372,8 @@ CommonParseCell(Tcl_Interp *interp, Tcl_Obj *objv, struct nlist **tpr, int *fnumptr) { Tcl_Obj *tobj, *fobj; - int result, llen; + int result; + Tcl_Size llen; int fnum, ftest, index; char *filename, *cellname; struct nlist *tp, *tp2; @@ -1016,7 +1023,7 @@ _netgen_flatten(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { char *repstr, *file; - int result, llen, filenum; + int result, filenum; struct nlist *tp, *tp2, *tptop; if ((objc < 2) || (objc > 4)) { @@ -2114,7 +2121,7 @@ _netcmp_compare(ClientData clientData, int fnum1, fnum2, dolist = 0; int dohierarchy = FALSE; int assignonly = FALSE; - int argstart = 1, qresult, llen, result; + int argstart = 1, qresult, result; int hascontents1, hascontents2; struct Correspond *nextcomp; struct nlist *tp1 = NULL, *tp2 = NULL; @@ -2828,7 +2835,7 @@ _netcmp_global(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { char *filename, *cellname, *pattern; - int numchanged = 0, p, fnum, llen, result; + int numchanged = 0, p, fnum, result; struct nlist *tp; if (objc < 2) { @@ -2925,7 +2932,8 @@ _netcmp_equate(ClientData clientData, struct ElementClass *saveEclass = NULL; struct NodeClass *saveNclass = NULL; int file1, file2; - int i, l1, l2, ltest, lent, dolist = 0, doforce = 0, dounique = 0; + int i, dolist = 0, doforce = 0, dounique = 0; + Tcl_Size l1, l2, lent, ltest; Tcl_Obj *tobj1, *tobj2, *tobj3; while (objc > 1) { @@ -3426,10 +3434,11 @@ int _netcmp_property(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - int fnum, i, llen; + int fnum, i; struct nlist *tp; struct property *kl, *kllast, *klnext; Tcl_Obj *tobj1, *tobj2, *tobj3; + Tcl_Size llen; double dval; int ival, argstart; @@ -4485,14 +4494,14 @@ void tcl_vprintf(FILE *f, const char *fmt, va_list args_in) void tcl_stdflush(FILE *f) { - Tcl_SavedResult state; + Tcl_InterpState state; static char stdstr[] = "::flush stdxxx"; char *stdptr = stdstr + 11; - Tcl_SaveResult(netgeninterp, &state); + state = Tcl_SaveInterpState(netgeninterp, TCL_OK); strcpy(stdptr, (f == stderr) ? "err" : "out"); Tcl_Eval(netgeninterp, stdstr); - Tcl_RestoreResult(netgeninterp, &state); + Tcl_RestoreInterpState(netgeninterp, state); } /*------------------------------------------------------*/ From 601277e53938b14bb5eb713224eb489bbc5648f9 Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Wed, 12 Nov 2025 09:19:52 -0500 Subject: [PATCH 2/3] Updated the revision number for the last set of changes. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8c354cd..8c4fe4a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.307 +1.5.308 From f7d35f9ccab021091bea17aa627ec525968f816c Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Wed, 12 Nov 2025 09:55:29 -0500 Subject: [PATCH 3/3] Accidentally changed a file in the last commit which gets overwritten by "configure". Moved the modification to the source file that doesn't get overwritten. --- scripts/defs.mak.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/defs.mak.in b/scripts/defs.mak.in index 5eedefe..b20390a 100644 --- a/scripts/defs.mak.in +++ b/scripts/defs.mak.in @@ -68,6 +68,7 @@ LIB_SPECS = @LIB_SPECS@ LIB_SPECS_NOSTUB = @LIB_SPECS_NOSTUB@ WISH_EXE = @WISH_EXE@ TCL_LIB_DIR = @TCL_LIB_DIR@ +EXTRA_CFLAGS = CC = @CC@ CPP = @CPP@ @@ -76,7 +77,7 @@ CXX = @CXX@ CPPFLAGS = -I. -I${NETGENDIR} @CPPFLAGS@ DFLAGS = @extra_defs@ @stub_defs@ @DEFS@ -DSHDLIB_EXT=\"@SHDLIB_EXT@\" -DNDEBUG DFLAGS_NOSTUB = @extra_defs@ @DEFS@ -DSHDLIB_EXT=\"@SHDLIB_EXT@\" -DNDEBUG -CFLAGS = @CFLAGS@ @SHLIB_CFLAGS@ @INC_SPECS@ +CFLAGS = @CFLAGS@ @SHLIB_CFLAGS@ @INC_SPECS@ ${EXTRA_CFLAGS} DEPEND_FILE = Depend DEPEND_FLAG = @DEPEND_FLAG@