From 80ab8d3a63055ed70c57f2eb8743d2b15d46b511 Mon Sep 17 00:00:00 2001 From: Camm Maguire Date: Fri, 7 Mar 2025 11:04:42 -0500 Subject: [PATCH] TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. gcl (2.6.14-14) unstable; urgency=medium * Version_2_6_15pre13 Gbp-Pq: Name Version_2_6_15pre13 --- gcl-tk/tkMain.c | 30 +++++++++++++++++++++--------- git.tag | 2 +- h/pool.h | 2 +- lsp/gcl_sharp.lsp | 2 +- makefile | 4 ++-- o/gmp_big.c | 27 --------------------------- o/makefile | 2 +- o/print.d | 10 ++++++++++ 8 files changed, 37 insertions(+), 42 deletions(-) diff --git a/gcl-tk/tkMain.c b/gcl-tk/tkMain.c index 40811617..b3fbeda3 100755 --- a/gcl-tk/tkMain.c +++ b/gcl-tk/tkMain.c @@ -36,7 +36,9 @@ #include #include #include - +#if TCL_MAJOR_VERSION >= 9 +#include +#endif #if (TK_MINOR_VERSION==0 && TK_MAJOR_VERSION==4) @@ -67,12 +69,12 @@ struct connection_state *dsfd; * file out of the Tk source directory to make their own modified versions). */ -/* extern void exit _ANSI_ARGS_((int status)); */ +/* extern void exit _ANSI_ARGS_((int status)); extern int isatty _ANSI_ARGS_((int fd)); -/* extern int read _ANSI_ARGS_((int fd, char *buf, size_t size)); -*/ extern char * strrchr _ANSI_ARGS_((CONST char *string, int c)); +*/ +extern int Tcl_AppInit(Tcl_Interp *interp); /* * Global variables used by the main program: @@ -331,11 +333,17 @@ TkX_Wish (argc, argv) */ if (tcl_RcFileName != NULL) { - Tcl_DString buffer; char *fullName; FILE *f; +#if TCL_MAJOR_VERSION >= 9 + wordexp_t exp_result; + wordexp(tcl_RcFileName, &exp_result, WRDE_NOCMD); + fullName = exp_result.we_wordv[0]; +#else + Tcl_DString buffer; fullName = Tcl_TildeSubst(interp, tcl_RcFileName, &buffer); +#endif if (fullName == NULL) { fprintf(stderr, "%s\n", INTERP_RESULT(interp)); } else { @@ -348,12 +356,16 @@ TkX_Wish (argc, argv) fclose(f); } } +#if TCL_MAJOR_VERSION >= 9 + wordfree(&exp_result); +#else Tcl_DStringFree(&buffer); +#endif } dfprintf(stderr, "guis : Creating file handler for %d\n", dsfd->fd); #ifndef __MINGW32__ - Tk_CreateFileHandler(dsfd->fd, TK_READABLE, StdinProc, (ClientData) 0); + Tcl_CreateFileHandler(dsfd->fd, TCL_READABLE, StdinProc, (ClientData) 0); #endif } fflush(stdout); @@ -466,7 +478,7 @@ StdinProc(clientData, mask) */ dfprintf(stderr, "\nguis : Disabling file handler for %d\n", dsfd->fd); -/* Tk_CreateFileHandler(dsfd->fd, 0, StdinProc, (ClientData) 0); */ +/* Tcl_CreateFileHandler(dsfd->fd, 0, StdinProc, (ClientData) 0); */ do { @@ -478,7 +490,7 @@ StdinProc(clientData, mask) /*dfprintf(stderr, "Yoo !!! Empty command\n"); */ if (debug)perror("zero message"); #ifndef __MINGW32__ - Tk_CreateFileHandler(dsfd->fd, TK_READABLE, StdinProc, (ClientData) 0); + Tcl_CreateFileHandler(dsfd->fd, TCL_READABLE, StdinProc, (ClientData) 0); #endif return; } @@ -580,7 +592,7 @@ StdinProc(clientData, mask) } while (fNotDone > 0); - /* Tk_CreateFileHandler(dsfd->fd, TK_READABLE, StdinProc, (ClientData) 0); */ + /* Tcl_CreateFileHandler(dsfd->fd, TCL_READABLE, StdinProc, (ClientData) 0); */ if ((void *)msg != (void *) buf) free ((void *) msg); } diff --git a/git.tag b/git.tag index c6520047..b00b2504 100644 --- a/git.tag +++ b/git.tag @@ -1 +1 @@ -"Version_2_6_15pre10" +"Version_2_6_15pre13" diff --git a/h/pool.h b/h/pool.h index 4e650aa8..3469551e 100644 --- a/h/pool.h +++ b/h/pool.h @@ -112,7 +112,7 @@ close_pool(void) { if (pool!=-1) { f.l_type=F_WRLCK; if (!fcntl(pool,F_SETLK,&f)) - massert(!unlink(gcl_pool)); + massert(!unlink(gcl_pool) || errno=ENOENT); register_pool(-1); massert(!close(pool)); massert(!munmap(Pool,sizeof(struct pool))); diff --git a/lsp/gcl_sharp.lsp b/lsp/gcl_sharp.lsp index a6a2115f..1df4742d 100644 --- a/lsp/gcl_sharp.lsp +++ b/lsp/gcl_sharp.lsp @@ -51,7 +51,7 @@ (aset1 x i (patch-sharp (row-major-aref x i))))) (structure (let ((d (structure-def x))) - (dotimes (i (structure-length x) x) + (dotimes (i (structure-length d) x) (declare (fixnum i)) (structure-set x d i (patch-sharp (structure-ref x d i)))))) (spice (let* ((y (gethash1 x (context-spice *sharp-eq-context*))) diff --git a/makefile b/makefile index 77ddbf0e..02afd0b6 100644 --- a/makefile +++ b/makefile @@ -269,12 +269,12 @@ $(HDIR)new_decl.h: $(HDIR)mcompdefs.h: $(HDIR)compdefs.h $(HDIR)new_decl.h cat $< |\ $(AWK) 'BEGIN {print "#include \"include.h\"";print "#include \"cmponly.h\"";print "---"} {a=$$1;gsub("\\.\\.\\.","",a);print "\"#define " $$1 "\" " a}' |\ - $(CC) -E -P -I./$(HDIR) - |\ + $(CC) $(CFLAGS) -E -P -I./$(HDIR) - |\ $(AWK) '/^\-\-\-$$/ {i=1;next} {if (!i) next} {gsub("\"","");print}' >$@ $(HDIR)cmpinclude.h: $(HDIR)mcompdefs.h $(CMPINCLUDE_FILES) $(HDIR)config.h cp $< $(@F) - cat $(CMPINCLUDE_FILES) | $(CC) -E -I./$(HDIR) - | $(AWK) '/^# |^$$|^#pragma/ {next}{print}' >> $(@F) + cat $(CMPINCLUDE_FILES) | $(CC) $(CFLAGS) -E -I./$(HDIR) - | $(AWK) '/^# |^$$|^#pragma/ {next}{print}' >> $(@F) ./xbin/move-if-changed mv $(@F) $@ ./xbin/move-if-changed cp $@ o/$(@F) diff --git a/o/gmp_big.c b/o/gmp_big.c index ff2ee55c..d3b0c2eb 100755 --- a/o/gmp_big.c +++ b/o/gmp_big.c @@ -292,33 +292,6 @@ big_minus(object x) #endif -/* static int */ -/* double_exponent(double d) { */ - -/* union {double d;int i[2];} u; */ - -/* if (d == 0.0) */ -/* return(0); */ - -/* u.d=d; */ -/* return (((u.i[HIND] & 0x7ff00000) >> 20) - 1022); */ - -/* } */ - -/* static double */ -/* set_exponent(double d, int e) { */ - -/* union {double d;int i[2];} u; */ - -/* if (d == 0.0) */ -/* return(0.0); */ - -/* u.d=d; */ -/* u.i[HIND]= (u.i[HIND] & 0x800fffff) | (((e + 1022) << 20) & 0x7ff00000); */ -/* return(u.d); */ - -/* } */ - double big_to_double(object x) { diff --git a/o/makefile b/o/makefile index 22ec15fa..4c6fe008 100644 --- a/o/makefile +++ b/o/makefile @@ -71,7 +71,7 @@ boot.h: boot.ini rm $*.c $(DPP): ../bin/dpp.c - ${CC} ${DEFS} -o $@ $< + ${CC} $(CFLAGS) $(LDFLAGS) ${DEFS} -o $@ $< new_init.c: ${INI_FILES} echo '#include "make-init.h"' > $@ diff --git a/o/print.d b/o/print.d index ac3fa1fa..f49938bd 100755 --- a/o/print.d +++ b/o/print.d @@ -484,6 +484,8 @@ bool shortp; write_decimal(exp); } +static object circle_table=Cnil; + static void call_structure_print_function(x, level) object x; @@ -569,12 +571,15 @@ ONCE_MORE: goto L; } + if (PRINTcircle) circle_table=PRINTvs_top[0]; + ifuncall3(S_DATA(x->str.str_def)->print_function, x, PRINTstream, vs_head); vs_popp; eflag = FALSE; L: + circle_table=Cnil; frs_pop(); bds_unwind(old_bds_top); @@ -1525,6 +1530,11 @@ setupPRINTcircle(object x,int dogensyms) { object *vp=vs_top,*v=vp,h; fixnum j; + if (circle_table!=Cnil) { + vs_push(circle_table); + return; + } + travel(x,dogensyms,PRINTarray); h=vs_top>vp ? gcl_make_hash_table(sLeq) : Cnil; -- 2.30.2