From 25560ed141b47b6a80a25134b44b6b174aa2f84d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 20 Feb 2022 19:57:04 +0000 Subject: Eliminate dead code and fix a comment --- generic/tclBasic.c | 11 ----------- generic/tclProc.c | 2 +- win/tclWinInit.c | 14 -------------- 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index a21f633..2d86e9c 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -1220,17 +1220,6 @@ Tcl_CreateInterp(void) Tcl_SetVar2(interp, "tcl_version", NULL, TCL_VERSION, TCL_GLOBAL_ONLY); TclpSetVariables(interp); -#if TCL_THREADS && !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 - /* - * The existence of the "threaded" element of the tcl_platform array - * indicates that this particular Tcl shell has been compiled with threads - * turned on. Using "info exists tcl_platform(threaded)" a Tcl script can - * introspect on the interpreter level of thread safety. - */ - - Tcl_SetVar2(interp, "tcl_platform", "threaded", "1", TCL_GLOBAL_ONLY); -#endif - /* * Register Tcl's version number. * TIP #268: Full patchlevel instead of just major.minor diff --git a/generic/tclProc.c b/generic/tclProc.c index 9b5d163..adc015f 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -84,7 +84,7 @@ const Tcl_ObjType tclProcBodyType = { } while (0) /* - * The [upvar]/[uplevel] level reference type. Uses the longValue field + * The [upvar]/[uplevel] level reference type. Uses the wideValue field * to remember the integer value of a parsed # format. * * Uses the default behaviour throughout, and never disposes of the string diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 64b3b5a..1ddd518 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -493,20 +493,6 @@ TclpSetVariables( TCL_GLOBAL_ONLY); } -#if !defined(NDEBUG) && !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 - - /* - * The existence of the "debug" element of the tcl_platform array - * indicates that this particular Tcl shell has been compiled with debug - * information. Using "info exists tcl_platform(debug)" a Tcl script can - * direct the interpreter to load debug versions of DLLs with the load - * command. - */ - - Tcl_SetVar2(interp, "tcl_platform", "debug", "1", - TCL_GLOBAL_ONLY); -#endif - /* * Set up the HOME environment variable from the HOMEDRIVE & HOMEPATH * environment variables, if necessary. -- cgit v0.12 From c736c693049e659603b5cc2efb22092d921cc250 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 21 Feb 2022 16:18:10 +0000 Subject: Fix [fb4a0a6675]: signed integer overflow in TclpGetClicks() --- unix/tclUnixTime.c | 4 ++-- win/tclWinTime.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index 0fc87ea..3694ba2 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -136,7 +136,7 @@ TclpGetClicks(void) Tcl_Time time; tclGetTimeProcPtr(&time, tclTimeClientData); - now = time.sec*1000000 + time.usec; + now = ((unsigned long)(time.sec)*1000000UL) + (unsigned long)(time.usec); } else { /* * A semi-NativeGetTime, specialized to clicks. @@ -149,7 +149,7 @@ TclpGetClicks(void) Tcl_Time time; tclGetTimeProcPtr(&time, tclTimeClientData); - now = time.sec*1000000 + time.usec; + now = ((unsigned long)(time.sec)*1000000UL) + (unsigned long)(time.usec); #endif return now; diff --git a/win/tclWinTime.c b/win/tclWinTime.c index f75567e..ed58824 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -225,7 +225,7 @@ TclpGetClicks(void) Tcl_Time now; /* Current Tcl time */ tclGetTimeProcPtr(&now, tclTimeClientData); /* Tcl_GetTime inlined */ - return (unsigned long)(now.sec * 1000000) + now.usec; + return ((unsigned long)(now.sec)*1000000UL) + (unsigned long)(now.usec); } } -- cgit v0.12