From 12d9ffaef1380be43b85025f096d839edf97ce48 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Mar 2024 10:04:57 +0000 Subject: Remove dead code --- unix/configure | 14 +++++--------- unix/tcl.m4 | 11 +++++------ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/unix/configure b/unix/configure index fe3be30..c8e5bdc 100755 --- a/unix/configure +++ b/unix/configure @@ -6402,16 +6402,12 @@ fi case $system in DragonFly-*|FreeBSD-*) - if test "${TCL_THREADS}" = "1" -then : - - # The -pthread needs to go in the LDFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LDFLAGS="$LDFLAGS $PTHREAD_LIBS" -fi + # The -pthread needs to go in the LDFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LDFLAGS="$LDFLAGS $PTHREAD_LIBS" ;; - esac + esac if test $doRpath = yes then : diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 4a9fe40..7b84923 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1276,13 +1276,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ case $system in DragonFly-*|FreeBSD-*) - AS_IF([test "${TCL_THREADS}" = "1"], [ - # The -pthread needs to go in the LDFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LDFLAGS="$LDFLAGS $PTHREAD_LIBS"]) + # The -pthread needs to go in the LDFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LDFLAGS="$LDFLAGS $PTHREAD_LIBS" ;; - esac + esac AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) -- cgit v0.12 From d3ed53e89b8c0cb708d5d21ce0045144e7d081e3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Mar 2024 11:31:50 +0000 Subject: typo's --- win/tclWinThrd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index da9133f..e468d7a 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -38,7 +38,7 @@ static CRITICAL_SECTION initLock; /* * allocLock is used by Tcl's version of malloc for synchronization. For - * obvious reasons, cannot use any dyamically allocated storage. + * obvious reasons, cannot use any dynamically allocated storage. */ #if TCL_THREADS @@ -458,7 +458,7 @@ TclpGlobalUnlock(void) * Tcl_GetAllocMutex * * This procedure returns a pointer to a statically initialized mutex for - * use by the memory allocator. The alloctor must use this lock, because + * use by the memory allocator. The allocator must use this lock, because * all other locks are allocated... * * Results: -- cgit v0.12 From 49f6fe769712854083c260db59905a5ba7a3152d Mon Sep 17 00:00:00 2001 From: sebres Date: Fri, 8 Mar 2024 13:30:18 +0000 Subject: TclGetNamespaceForQualName: TCL_FIND_IF_NOT_SIMPLE considers alternate search path too --- generic/tclNamesp.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 099e29f..f7d1a7d 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -2189,7 +2189,7 @@ TclGetNamespaceForQualName( * TCL_FIND_ONLY_NS was specified. */ { Interp *iPtr = (Interp *) interp; - Namespace *nsPtr = cxtNsPtr; + Namespace *nsPtr = cxtNsPtr, *lastNsPtr = NULL, *lastAltNsPtr = NULL; Namespace *altNsPtr; Namespace *globalNsPtr = iPtr->globalNsPtr; const char *start, *end; @@ -2330,17 +2330,12 @@ TclGetNamespaceForQualName( if (nsPtr == NULL) { Tcl_Panic("Could not create namespace '%s'", nsName); } - } else { /* Namespace not found and was not - * created. */ - if (flags & TCL_FIND_IF_NOT_SIMPLE) { - /* - * return last found NS and not simple name relative it, - * e. g. ::A::B::C::D -> ::A::B and C::D, if - * namespace C cannot be found in ::A::B - */ - *simpleNamePtr = start; - goto done; - } + } else { + /* + * Namespace not found and was not created. + * Remember last found namespace for TCL_FIND_IF_NOT_SIMPLE. + */ + lastNsPtr = nsPtr; nsPtr = NULL; } } @@ -2362,6 +2357,8 @@ TclGetNamespaceForQualName( if (entryPtr != NULL) { altNsPtr = (Namespace *)Tcl_GetHashValue(entryPtr); } else { + /* Remember last found in alternate path */ + lastAltNsPtr = altNsPtr; altNsPtr = NULL; } } @@ -2371,6 +2368,17 @@ TclGetNamespaceForQualName( */ if ((nsPtr == NULL) && (altNsPtr == NULL)) { + if (flags & TCL_FIND_IF_NOT_SIMPLE) { + /* + * return last found NS, regardless simple name or not, + * e. g. ::A::B::C::D -> ::A::B and C::D, if namespace C + * cannot be found in ::A::B + */ + nsPtr = lastNsPtr; + altNsPtr = lastAltNsPtr; + *simpleNamePtr = start; + goto done; + } *simpleNamePtr = NULL; goto done; } -- cgit v0.12