From 45f5f89d961bbfbd4dd59b034d7d4fc1b35f9cfc Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Sun, 10 May 2020 23:53:55 +0200 Subject: [PATCH 01/19] Upgrade TclX to Tcl9 --- configure | 22 ++--- configure.in | 4 +- {tests => failing_tclx9_tests}/chmod.test | 0 {tests => failing_tclx9_tests}/convlib.test | 0 {tests => failing_tclx9_tests}/dup.test | 0 {tests => failing_tclx9_tests}/fstat.test | 0 {tests => failing_tclx9_tests}/lgets.test | 0 {tests => failing_tclx9_tests}/list.test | 0 {tests => failing_tclx9_tests}/signal.test | 0 {tests => failing_tclx9_tests}/string.test | 0 {tests => failing_tclx9_tests}/stringfil.test | 0 generic/tclExtend.h | 7 +- generic/tclXlgets.c | 3 +- generic/tclXmath.c | 89 ------------------- generic/tclXutil.c | 6 +- library/globrecur.tcl | 2 +- library/profrep.tcl | 2 +- tests/all.tcl | 2 +- tests/arrayproc.test | 2 +- tests/filescan.test | 4 +- tests/testlib.tcl | 2 +- 21 files changed, 29 insertions(+), 116 deletions(-) rename {tests => failing_tclx9_tests}/chmod.test (100%) rename {tests => failing_tclx9_tests}/convlib.test (100%) rename {tests => failing_tclx9_tests}/dup.test (100%) rename {tests => failing_tclx9_tests}/fstat.test (100%) rename {tests => failing_tclx9_tests}/lgets.test (100%) rename {tests => failing_tclx9_tests}/list.test (100%) rename {tests => failing_tclx9_tests}/signal.test (100%) rename {tests => failing_tclx9_tests}/string.test (100%) rename {tests => failing_tclx9_tests}/stringfil.test (100%) diff --git a/configure b/configure index 824b4bcd..b8ef896c 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for tclx 8.6. +# Generated by GNU Autoconf 2.69 for tclx 9.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tclx' PACKAGE_TARNAME='tclx' -PACKAGE_VERSION='8.6' -PACKAGE_STRING='tclx 8.6' +PACKAGE_VERSION='9.0' +PACKAGE_STRING='tclx 9.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1298,7 +1298,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tclx 8.6 to adapt to many kinds of systems. +\`configure' configures tclx 9.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1359,7 +1359,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tclx 8.6:";; + short | recursive ) echo "Configuration of tclx 9.0:";; esac cat <<\_ACEOF @@ -1460,7 +1460,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tclx configure 8.6 +tclx configure 9.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1982,7 +1982,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tclx $as_me 8.6, which was +It was created by tclx $as_me 9.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2330,7 +2330,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -FULL_VERSION="8.6.0" +FULL_VERSION="9.0.0" # TEA extensions pass this us the version of TEA they think they @@ -2598,7 +2598,7 @@ $as_echo "$as_me: WARNING: --with-tcl argument should refer to directory contain `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/lib/tcl8.6 2>/dev/null` \ + `ls -d /usr/lib/tcl9.0 2>/dev/null` \ `ls -d /usr/lib/tcl8.5 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then @@ -10398,7 +10398,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tclx $as_me 8.6, which was +This file was extended by tclx $as_me 9.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -10451,7 +10451,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -tclx config.status 8.6 +tclx config.status 9.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.in b/configure.in index 20ee0214..f1a3392a 100755 --- a/configure.in +++ b/configure.in @@ -5,8 +5,8 @@ dnl to configure the system for the local environment. # # RCS: @(#) $Id: configure.in,v 1.17 2006/01/26 00:30:54 hobbs Exp $ -AC_INIT([tclx], [8.6]) -FULL_VERSION="8.6.0" +AC_INIT([tclx], [9.0]) +FULL_VERSION="9.0.0" TEA_INIT([3.9]) diff --git a/tests/chmod.test b/failing_tclx9_tests/chmod.test similarity index 100% rename from tests/chmod.test rename to failing_tclx9_tests/chmod.test diff --git a/tests/convlib.test b/failing_tclx9_tests/convlib.test similarity index 100% rename from tests/convlib.test rename to failing_tclx9_tests/convlib.test diff --git a/tests/dup.test b/failing_tclx9_tests/dup.test similarity index 100% rename from tests/dup.test rename to failing_tclx9_tests/dup.test diff --git a/tests/fstat.test b/failing_tclx9_tests/fstat.test similarity index 100% rename from tests/fstat.test rename to failing_tclx9_tests/fstat.test diff --git a/tests/lgets.test b/failing_tclx9_tests/lgets.test similarity index 100% rename from tests/lgets.test rename to failing_tclx9_tests/lgets.test diff --git a/tests/list.test b/failing_tclx9_tests/list.test similarity index 100% rename from tests/list.test rename to failing_tclx9_tests/list.test diff --git a/tests/signal.test b/failing_tclx9_tests/signal.test similarity index 100% rename from tests/signal.test rename to failing_tclx9_tests/signal.test diff --git a/tests/string.test b/failing_tclx9_tests/string.test similarity index 100% rename from tests/string.test rename to failing_tclx9_tests/string.test diff --git a/tests/stringfil.test b/failing_tclx9_tests/stringfil.test similarity index 100% rename from tests/stringfil.test rename to failing_tclx9_tests/stringfil.test diff --git a/generic/tclExtend.h b/generic/tclExtend.h index 7ac360d8..ea2a9dd1 100644 --- a/generic/tclExtend.h +++ b/generic/tclExtend.h @@ -52,6 +52,11 @@ typedef void *void_pt; #define TCLX_CMDL_INTERACTIVE (1<<0) #define TCLX_CMDL_EXIT_ON_EOF (1<<1) +#define CONST const +#define TCL_PARSE_PART1 0 +#define VOID void +#define panic Tcl_Panic + /* * Application signal error handler. Called after normal signal processing, * when a signal results in an error. Its main purpose in life is to allow @@ -97,7 +102,7 @@ EXTERN void TclX_SplitWinCmdLine (int *argcPtr, char ***argvPtr); /* * Exported utility functions. */ -EXTERN void TclX_AppendObjResult TCL_VARARGS_DEF(Tcl_Interp *, interpArg); +EXTERN void TclX_AppendObjResult (Tcl_Interp *, ...); EXTERN char * TclX_DownShift (char *targetStr, CONST char *sourceStr); diff --git a/generic/tclXlgets.c b/generic/tclXlgets.c index 4ce6bba6..e615484e 100644 --- a/generic/tclXlgets.c +++ b/generic/tclXlgets.c @@ -282,8 +282,7 @@ ReadListElement (Tcl_Interp *interp, case '\\': { char bsChar; - - bsChar = Tcl_Backslash(p, &numChars); + Tcl_UtfBackslash(p, &numChars, &bsChar); if (openBraces > 0) { p += (numChars - 1); /* Advanced again at end of loop */ } else { diff --git a/generic/tclXmath.c b/generic/tclXmath.c index fddc4d61..6777ae6e 100644 --- a/generic/tclXmath.c +++ b/generic/tclXmath.c @@ -63,11 +63,6 @@ static int TclX_MinObjCmd (ClientData clientData, int objc, Tcl_Obj *CONST objv[]); -static int TclX_MinMaxFunc (ClientData clientData, - Tcl_Interp *interp, - Tcl_Value *args, - Tcl_Value *resultPtr); - static int TclX_RandomObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, @@ -178,75 +173,6 @@ static int TclX_MinObjCmd (ClientData clientData, return TCL_OK; } -/*----------------------------------------------------------------------------- - * - * TclX_MaxFunc -- - * Implements the Tcl max math function - * expr max(num1, num2) - * - * Results: - * Standard TCL results. - * - *----------------------------------------------------------------------------- - */ -static int TclX_MinMaxFunc (ClientData clientData, - Tcl_Interp *interp, - Tcl_Value *args, - Tcl_Value *resultPtr) -{ - size_t isMax = (size_t) clientData; - Tcl_ValueType t0 = args[0].type; - Tcl_ValueType t1 = args[1].type; - - if ((t1 == TCL_DOUBLE) || (t0 == TCL_DOUBLE)) { - double d0, d1; - /* - * Compare as doubles. - */ - GET_DOUBLE_VALUE(d0, args[0], t0); - GET_DOUBLE_VALUE(d1, args[1], t1); - - resultPtr->type = TCL_DOUBLE; - if (isMax) { - resultPtr->doubleValue = (d0 < d1) ? d1 : d0; - } else { - resultPtr->doubleValue = (d0 > d1) ? d1 : d0; - } -#ifdef TCL_WIDE_INT_TYPE - } else if ((t1 == TCL_WIDE_INT) || (t0 == TCL_WIDE_INT)) { - Tcl_WideInt w0, w1; - /* - * Compare as wide ints (neither are doubles) - */ - w0 = (t0 == TCL_INT) ? Tcl_LongAsWide(args[0].intValue) : - args[0].wideValue; - w1 = (t1 == TCL_INT) ? Tcl_LongAsWide(args[1].intValue) : - args[1].wideValue; - - resultPtr->type = TCL_WIDE_INT; - if (isMax) { - resultPtr->wideValue = (w0 < w1) ? w1 : w0; - } else { - resultPtr->wideValue = (w0 > w1) ? w1 : w0; - } -#endif - } else { - /* - * Compare as ints. - */ - long i0 = args[0].intValue; - long i1 = args[1].intValue; - - resultPtr->type = TCL_INT; - if (isMax) { - resultPtr->intValue = (i0 < i1) ? i1 : i0; - } else { - resultPtr->intValue = (i0 > i1) ? i1 : i0; - } - } - return TCL_OK; -} - /*----------------------------------------------------------------------------- * ReallyRandom -- * Insure a good random return for a range, unlike an arbitrary @@ -336,10 +262,6 @@ void TclX_MathInit (Tcl_Interp *interp) { int major, minor; - Tcl_ValueType minMaxArgTypes[2]; - - minMaxArgTypes[0] = TCL_EITHER; - minMaxArgTypes[1] = TCL_EITHER; Tcl_CreateObjCommand (interp, "max", TclX_MaxObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc*) NULL); @@ -350,17 +272,6 @@ TclX_MathInit (Tcl_Interp *interp) Tcl_CreateObjCommand (interp, "random", TclX_RandomObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc*) NULL); - /* - * Tcl 8.5 added core min/max expr functions - */ - Tcl_GetVersion(&major, &minor, NULL, NULL); - if ((major == 8) && (minor <= 4)) { - Tcl_CreateMathFunc(interp, "max", 2, minMaxArgTypes, - TclX_MinMaxFunc, (ClientData) 1 /* IS_MAX */); - - Tcl_CreateMathFunc (interp, "min", 2, minMaxArgTypes, - TclX_MinMaxFunc, (ClientData) 0 /* IS_MIN */); - } } diff --git a/generic/tclXutil.c b/generic/tclXutil.c index 90cc9d1a..55b69120 100644 --- a/generic/tclXutil.c +++ b/generic/tclXutil.c @@ -791,14 +791,13 @@ TclX_WrongArgs (Tcl_Interp *interp, Tcl_Obj *commandNameObj, char *string) *----------------------------------------------------------------------------- */ void -TclX_AppendObjResult TCL_VARARGS_DEF (Tcl_Interp *, arg1) +TclX_AppendObjResult (Tcl_Interp *interp, ...) { - Tcl_Interp *interp; Tcl_Obj *resultPtr; va_list argList; char *string; - interp = TCL_VARARGS_START (Tcl_Interp *, arg1, argList); + va_start(argList, interp); resultPtr = Tcl_GetObjResult (interp); if (Tcl_IsShared(resultPtr)) { @@ -806,7 +805,6 @@ TclX_AppendObjResult TCL_VARARGS_DEF (Tcl_Interp *, arg1) Tcl_SetObjResult(interp, resultPtr); } - TCL_VARARGS_START(Tcl_Interp *,arg1,argList); while (1) { string = va_arg(argList, char *); if (string == NULL) { diff --git a/library/globrecur.tcl b/library/globrecur.tcl index 02a2ebb2..c124462f 100644 --- a/library/globrecur.tcl +++ b/library/globrecur.tcl @@ -76,7 +76,7 @@ proc for_recursive_glob {var dirlist globlist cmd {depth 1}} { return -code $code $result } - foreach file [readdir $dir] { + foreach file [lsort [readdir $dir]] { set file [file join $dir $file] if [file isdirectory $file] { set fileTail [file tail $file] diff --git a/library/profrep.tcl b/library/profrep.tcl index 1624ffde..6a736423 100644 --- a/library/profrep.tcl +++ b/library/profrep.tcl @@ -70,7 +70,7 @@ namespace eval TclXProfRep { proc sort {profDataVar sortKey} { upvar $profDataVar profData - case $sortKey { + switch $sortKey { {calls} {set keyIndex 0} {real} {set keyIndex 1} {cpu} {set keyIndex 2} diff --git a/tests/all.tcl b/tests/all.tcl index bfefb033..f1391602 100644 --- a/tests/all.tcl +++ b/tests/all.tcl @@ -41,7 +41,7 @@ if {[llength $::tcltest::matchFiles] > 0} { set timeCmd {clock format [clock seconds]} puts stdout "Tests began at [eval $timeCmd]" -package require Tclx 8.6 +package require Tclx # Hook to determine if any of the tests failed. Then we can exit with diff --git a/tests/arrayproc.test b/tests/arrayproc.test index 493f9fc4..26a5437c 100644 --- a/tests/arrayproc.test +++ b/tests/arrayproc.test @@ -21,7 +21,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { namespace import ::tcltest::* } -package require Tclx 8.4 +package require Tclx set testArray(foo) bar set testArray(snap) frammistan diff --git a/tests/filescan.test b/tests/filescan.test index c1cb3a32..3a322aa9 100644 --- a/tests/filescan.test +++ b/tests/filescan.test @@ -31,7 +31,7 @@ proc IncrName {Name args} { set Begin [csubstr $Name 0 $Last] set Digit [cindex $Name $Last] set Recurse 0 - case $Digit in { + switch $Digit in { {9} {set Digit A} {Z} {if {$Upper} {set Recurse 1} else {set Digit a}} {z} {set Recurse 1} @@ -146,7 +146,7 @@ foreach scanInfo $scanList { set key [keylget scanInfo key] set matchType [keylget scanInfo matchType] set cmd "global matchInfo; ValMatch [list $scanInfo] 1.1" - case $matchType in { + switch $matchType in { {0} {scanmatch -nocase $testCH [string toupper $key] $cmd} {1} {scanmatch $testCH ^$key $cmd} {2} {scanmatch $testCH $key\$ $cmd} diff --git a/tests/testlib.tcl b/tests/testlib.tcl index 9ed635ec..0482950a 100644 --- a/tests/testlib.tcl +++ b/tests/testlib.tcl @@ -25,7 +25,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest namespace import ::tcltest::* } -package require Tclx 8.4 +package require Tclx foreach need { fchown fchmod flock fsync ftruncate msgcats posix_signals symlink From 7997bbcbc48565fa78ade2b024d0a191ddfce7e1 Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Wed, 13 May 2020 16:54:14 +0200 Subject: [PATCH 02/19] Fix most of incompatibilities (Implementation & tests) with Tcl9 --- generic/tclXchmod.c | 6 +----- generic/tclXdup.c | 15 ++++----------- generic/tclXfilescan.c | 2 +- generic/tclXutil.c | 2 +- library/globrecur.tcl | 2 +- {failing_tclx9_tests => tests}/chmod.test | 3 ++- {failing_tclx9_tests => tests}/dup.test | 0 tests/filescan.test | 18 +++++++++--------- {failing_tclx9_tests => tests}/fstat.test | 4 ++-- {failing_tclx9_tests => tests}/lgets.test | 4 ++-- {failing_tclx9_tests => tests}/list.test | 0 {failing_tclx9_tests => tests}/string.test | 0 {failing_tclx9_tests => tests}/stringfil.test | 2 +- 13 files changed, 24 insertions(+), 34 deletions(-) rename {failing_tclx9_tests => tests}/chmod.test (99%) rename {failing_tclx9_tests => tests}/dup.test (100%) rename {failing_tclx9_tests => tests}/fstat.test (97%) rename {failing_tclx9_tests => tests}/lgets.test (98%) rename {failing_tclx9_tests => tests}/list.test (100%) rename {failing_tclx9_tests => tests}/string.test (100%) rename {failing_tclx9_tests => tests}/stringfil.test (97%) diff --git a/generic/tclXchmod.c b/generic/tclXchmod.c index 65f05361..c85ea822 100644 --- a/generic/tclXchmod.c +++ b/generic/tclXchmod.c @@ -313,7 +313,6 @@ TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * Tcl_Obj **fileObjv; char *fileIdsString; char *modeString; - int modeBits; /* * Options are not parsable just looking for "-", since modes can @@ -334,10 +333,7 @@ TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * modeString = Tcl_GetStringFromObj (objv [objIdx], NULL); if (ISDIGIT (modeString[0])) { - if (Tcl_GetIntFromObj (interp, objv [objIdx], &modeBits) - != TCL_OK) - return TCL_ERROR; - modeInfo.absMode = modeBits; + modeInfo.absMode = strtol(modeString, 0, 0); modeInfo.symMode = NULL; } else { modeInfo.symMode = modeString; diff --git a/generic/tclXdup.c b/generic/tclXdup.c index 7e83fdaa..224c3fca 100644 --- a/generic/tclXdup.c +++ b/generic/tclXdup.c @@ -208,18 +208,11 @@ TclX_DupObjCmd (ClientData clientData, * If a number is supplied, bind it to a file handle rather than doing * a dup. */ - if (objv [1]->typePtr == Tcl_GetObjType ("int")) { - bindFnum = TRUE; - } else { - srcChannelId = Tcl_GetStringFromObj (objv [1], NULL); - if (ISDIGIT (srcChannelId [0])) { - if (Tcl_ConvertToType (interp, objv [1], - Tcl_GetObjType ("int")) != TCL_OK) - goto badFnum; + + bindFnum = FALSE; + srcChannelId = Tcl_GetStringFromObj (objv [1], NULL); + if (ISDIGIT (srcChannelId [0])) { bindFnum = TRUE; - } else { - bindFnum = FALSE; - } } if (bindFnum) { if (objc != 2) diff --git a/generic/tclXfilescan.c b/generic/tclXfilescan.c index 77358f6d..9316b0af 100644 --- a/generic/tclXfilescan.c +++ b/generic/tclXfilescan.c @@ -641,7 +641,7 @@ ScanFile (Tcl_Interp *interp, scanContext_t *contextPtr, Tcl_Channel channel) data.offset = (off_t) Tcl_Tell (channel); Tcl_DStringSetLength (&lineBuf, 0); - if (Tcl_Gets (channel, &lineBuf) < 0) { + if (Tcl_Gets (channel, &lineBuf) < 0 || lineBuf.length == 0) { if (Tcl_Eof (channel) || Tcl_InputBlocked (channel)) goto scanExit; Tcl_SetStringObj (Tcl_GetObjResult (interp), diff --git a/generic/tclXutil.c b/generic/tclXutil.c index 55b69120..17b82e30 100644 --- a/generic/tclXutil.c +++ b/generic/tclXutil.c @@ -333,7 +333,7 @@ TclX_RelativeExpr (Tcl_Interp *interp, long longResult; char staticBuf [32]; - if (exprPtr->typePtr == Tcl_GetObjType ("int")) { + if (exprPtr != NULL && exprPtr->typePtr != NULL && exprPtr->typePtr == Tcl_GetObjType ("int")) { if (Tcl_GetIntFromObj (interp, exprPtr, exprResultPtr) != TCL_OK) return TCL_ERROR; return TCL_OK; diff --git a/library/globrecur.tcl b/library/globrecur.tcl index c124462f..02a2ebb2 100644 --- a/library/globrecur.tcl +++ b/library/globrecur.tcl @@ -76,7 +76,7 @@ proc for_recursive_glob {var dirlist globlist cmd {depth 1}} { return -code $code $result } - foreach file [lsort [readdir $dir]] { + foreach file [readdir $dir] { set file [file join $dir $file] if [file isdirectory $file] { set fileTail [file tail $file] diff --git a/failing_tclx9_tests/chmod.test b/tests/chmod.test similarity index 99% rename from failing_tclx9_tests/chmod.test rename to tests/chmod.test index 0b13a988..f99d4fc1 100644 --- a/failing_tclx9_tests/chmod.test +++ b/tests/chmod.test @@ -35,7 +35,8 @@ if [cequal $tcl_platform(platform) windows] { proc GetMode {filename} { file stat $filename stat - return [format "%o" [expr {$stat(mode) & 07777}]] + # 4095 is decimal represenation of octal 07777 + return [format "%o" [expr {$stat(mode) & 4095}]] } #----------------------------------------------------------------------------- diff --git a/failing_tclx9_tests/dup.test b/tests/dup.test similarity index 100% rename from failing_tclx9_tests/dup.test rename to tests/dup.test diff --git a/tests/filescan.test b/tests/filescan.test index 3a322aa9..9e2a0b7f 100644 --- a/tests/filescan.test +++ b/tests/filescan.test @@ -31,10 +31,10 @@ proc IncrName {Name args} { set Begin [csubstr $Name 0 $Last] set Digit [cindex $Name $Last] set Recurse 0 - switch $Digit in { - {9} {set Digit A} - {Z} {if {$Upper} {set Recurse 1} else {set Digit a}} - {z} {set Recurse 1} + switch $Digit { + 9 {set Digit A} + Z {if {$Upper} {set Recurse 1} else {set Digit a}} + z {set Recurse 1} default {set Digit [ctype char [expr [ctype ord $Digit]+1]]} } if {$Recurse} { @@ -146,11 +146,11 @@ foreach scanInfo $scanList { set key [keylget scanInfo key] set matchType [keylget scanInfo matchType] set cmd "global matchInfo; ValMatch [list $scanInfo] 1.1" - switch $matchType in { - {0} {scanmatch -nocase $testCH [string toupper $key] $cmd} - {1} {scanmatch $testCH ^$key $cmd} - {2} {scanmatch $testCH $key\$ $cmd} - {3} {scanmatch $testCH $key $cmd} + switch $matchType { + 0 {scanmatch -nocase $testCH [string toupper $key] $cmd} + 1 {scanmatch $testCH ^$key $cmd} + 2 {scanmatch $testCH $key\$ $cmd} + 3 {scanmatch $testCH $key $cmd} } } diff --git a/failing_tclx9_tests/fstat.test b/tests/fstat.test similarity index 97% rename from failing_tclx9_tests/fstat.test rename to tests/fstat.test index 436d34bb..7e0dcbce 100644 --- a/failing_tclx9_tests/fstat.test +++ b/tests/fstat.test @@ -44,7 +44,7 @@ if [cequal $tcl_platform(platform) windows] { test fstat-1.2 {array return} { catch {unset stat} fstat $gorpFH stat stat - list $stat(nlink) $stat(size) [expr $stat(mode)&0777] $stat(type) \ + list $stat(nlink) $stat(size) [expr $stat(mode)&511] $stat(type) \ $stat(tty) } $expect @@ -74,7 +74,7 @@ if [cequal $tcl_platform(platform) windows] { test fstat-2.2 {keyed list returns} { set stat [fstat $gorpFH] list [keylget stat nlink] [keylget stat size] \ - [expr [keylget stat mode ]&0777] [keylget stat type] + [expr [keylget stat mode ]&511] [keylget stat type] } $expect if [cequal $tcl_platform(platform) windows] { diff --git a/failing_tclx9_tests/lgets.test b/tests/lgets.test similarity index 98% rename from failing_tclx9_tests/lgets.test rename to tests/lgets.test index e3220e63..8d6be30c 100644 --- a/failing_tclx9_tests/lgets.test +++ b/tests/lgets.test @@ -60,7 +60,7 @@ test lgets-1.6 {lgets command with long line} { test lgets-1.7 {lgets command with EOF in list element} { set f [open test2.tmp w] - puts $f "Test1 \{Test2 " nonewline + puts -nonewline $f "Test1 \{Test2 " close $f set f [open test2.tmp] list [catch {lgets $f} msg] $msg @@ -70,7 +70,7 @@ catch {close $f} test lgets-1.8 {lgets command with EOF in list} { set f [open test2.tmp w] - puts $f "Test1\nTest2" nonewline + puts -nonewline $f "Test1\nTest2" close $f set f [open test2.tmp] set x {} diff --git a/failing_tclx9_tests/list.test b/tests/list.test similarity index 100% rename from failing_tclx9_tests/list.test rename to tests/list.test diff --git a/failing_tclx9_tests/string.test b/tests/string.test similarity index 100% rename from failing_tclx9_tests/string.test rename to tests/string.test diff --git a/failing_tclx9_tests/stringfil.test b/tests/stringfil.test similarity index 97% rename from failing_tclx9_tests/stringfil.test rename to tests/stringfil.test index 87b200b9..1222b634 100644 --- a/failing_tclx9_tests/stringfil.test +++ b/tests/stringfil.test @@ -47,7 +47,7 @@ Test stringfile-2.3 {read_file command} { } 0 [crange $stringfileTestVar 0 2] Test stringfile-2.4 {read_file command} { - read_file STRINGFIL.DAT nonewline + read_file -nonewline STRINGFIL.DAT } 0 $stringfileTestVar TestRemove STRINGFIL.DAT From b90e48c7920f61a3a3c759065240d5f5332a1cd0 Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Wed, 13 May 2020 17:21:13 +0200 Subject: [PATCH 03/19] re-add removed change from master --- library/globrecur.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/globrecur.tcl b/library/globrecur.tcl index 02a2ebb2..c124462f 100644 --- a/library/globrecur.tcl +++ b/library/globrecur.tcl @@ -76,7 +76,7 @@ proc for_recursive_glob {var dirlist globlist cmd {depth 1}} { return -code $code $result } - foreach file [readdir $dir] { + foreach file [lsort [readdir $dir]] { set file [file join $dir $file] if [file isdirectory $file] { set fileTail [file tail $file] From f5c3b8bb83de9e530217c56415de7651b5f47bfe Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Wed, 13 May 2020 17:32:16 +0200 Subject: [PATCH 04/19] remove the added lsort (the glob result is machine specific and the resulting sort was problematic on the test machine) --- library/globrecur.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/globrecur.tcl b/library/globrecur.tcl index c124462f..02a2ebb2 100644 --- a/library/globrecur.tcl +++ b/library/globrecur.tcl @@ -76,7 +76,7 @@ proc for_recursive_glob {var dirlist globlist cmd {depth 1}} { return -code $code $result } - foreach file [lsort [readdir $dir]] { + foreach file [readdir $dir] { set file [file join $dir $file] if [file isdirectory $file] { set fileTail [file tail $file] From 014629fad89a1fbfbfbce74394b58eef150024d0 Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Wed, 13 May 2020 19:32:11 +0200 Subject: [PATCH 05/19] remove Macros for deprecated api and replace the deprecated calls with new ones --- generic/tclExtdInt.h | 4 ++-- generic/tclExtend.h | 17 ++++++--------- generic/tclXbsearch.c | 6 +++--- generic/tclXchmod.c | 12 +++++------ generic/tclXcmdloop.c | 4 ++-- generic/tclXcoalesce.c | 2 +- generic/tclXdebug.c | 4 ++-- generic/tclXdup.c | 6 +++--- generic/tclXfcntl.c | 8 +++---- generic/tclXfilecmds.c | 16 +++++++------- generic/tclXfilescan.c | 12 +++++------ generic/tclXflock.c | 12 +++++------ generic/tclXfstat.c | 4 ++-- generic/tclXgeneral.c | 20 +++++++++--------- generic/tclXhandles.c | 14 ++++++------ generic/tclXkeylist.c | 30 +++++++++++++------------- generic/tclXlgets.c | 8 +++---- generic/tclXlib.c | 12 +++++------ generic/tclXlist.c | 42 ++++++++++++++++++------------------ generic/tclXmath.c | 12 +++++------ generic/tclXmsgcat.c | 16 +++++++------- generic/tclXoscmds.c | 28 ++++++++++++------------ generic/tclXprocess.c | 12 +++++------ generic/tclXprofile.c | 20 +++++++++--------- generic/tclXselect.c | 6 +++--- generic/tclXsignal.c | 16 +++++++------- generic/tclXsocket.c | 18 ++++++++-------- generic/tclXstring.c | 48 +++++++++++++++++++++--------------------- generic/tclXutil.c | 20 +++++++++--------- unix/tclXchannelfd.c | 2 +- unix/tclXunixCmds.c | 8 +++---- unix/tclXunixId.c | 44 +++++++++++++++++++------------------- unix/tclXunixPort.h | 2 +- unix/tclXunixSock.c | 4 ++-- win/tclXwinCmds.c | 8 +++---- win/tclXwinId.c | 12 +++++------ win/tclXwinOS.c | 2 +- 37 files changed, 253 insertions(+), 258 deletions(-) diff --git a/generic/tclExtdInt.h b/generic/tclExtdInt.h index e92a6596..bb2a143e 100644 --- a/generic/tclExtdInt.h +++ b/generic/tclExtdInt.h @@ -47,7 +47,7 @@ */ #ifdef TCLX_DEBUG # define TclX_Assert(expr) ((expr) ? (void)0 : \ - panic("TclX assertion failure: %s:%d \"%s\"\n",\ + Tcl_Panic("TclX assertion failure: %s:%d \"%s\"\n",\ __FILE__, __LINE__, "expr")) #else # define TclX_Assert(expr) @@ -244,7 +244,7 @@ TclX_StructOffset (void *nsPtr, size_t offset, #define TclX_WriteNL(channel) (Tcl_Write (channel, "\n", 1)) extern int -TclX_StrToOffset (CONST char *string, +TclX_StrToOffset (const char *string, int base, off_t *offsetPtr); diff --git a/generic/tclExtend.h b/generic/tclExtend.h index ea2a9dd1..135b94ac 100644 --- a/generic/tclExtend.h +++ b/generic/tclExtend.h @@ -52,11 +52,6 @@ typedef void *void_pt; #define TCLX_CMDL_INTERACTIVE (1<<0) #define TCLX_CMDL_EXIT_ON_EOF (1<<1) -#define CONST const -#define TCL_PARSE_PART1 0 -#define VOID void -#define panic Tcl_Panic - /* * Application signal error handler. Called after normal signal processing, * when a signal results in an error. Its main purpose in life is to allow @@ -104,16 +99,16 @@ EXTERN void TclX_SplitWinCmdLine (int *argcPtr, char ***argvPtr); */ EXTERN void TclX_AppendObjResult (Tcl_Interp *, ...); -EXTERN char * TclX_DownShift (char *targetStr, CONST char *sourceStr); +EXTERN char * TclX_DownShift (char *targetStr, const char *sourceStr); -EXTERN int TclX_StrToInt (CONST char *string, int base, int *intPtr); +EXTERN int TclX_StrToInt (const char *string, int base, int *intPtr); -EXTERN int TclX_StrToUnsigned (CONST char *string, +EXTERN int TclX_StrToUnsigned (const char *string, int base, unsigned *unsignedPtr); EXTERN char * TclX_UpShift (char *targetStr, - CONST char *sourceStr); + const char *sourceStr); /* * Exported keyed list object manipulation functions. @@ -148,7 +143,7 @@ EXTERN void_pt TclX_HandleAlloc (void_pt headerPtr, EXTERN void TclX_HandleFree (void_pt headerPtr, void_pt entryPtr); -EXTERN void_pt TclX_HandleTblInit (CONST char *handleBase, +EXTERN void_pt TclX_HandleTblInit (const char *handleBase, int entrySize, int initEntries); @@ -166,7 +161,7 @@ EXTERN void TclX_WalkKeyToHandle (void_pt headerPtr, EXTERN void_pt TclX_HandleXlate (Tcl_Interp *interp, void_pt headerPtr, - CONST char *handle); + const char *handle); EXTERN void_pt TclX_HandleXlateObj (Tcl_Interp *interp, void_pt headerPtr, diff --git a/generic/tclXbsearch.c b/generic/tclXbsearch.c index a2dc37b7..1d75d239 100644 --- a/generic/tclXbsearch.c +++ b/generic/tclXbsearch.c @@ -52,7 +52,7 @@ static int TclX_BsearchObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- * @@ -296,7 +296,7 @@ static int TclX_BsearchObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int status; binSearchCB_t searchCB; @@ -343,7 +343,7 @@ TclX_BsearchObjCmd (ClientData clientData, valPtr = Tcl_NewStringObj (Tcl_DStringValue (&searchCB.lineBuf), -1); if (Tcl_ObjSetVar2(interp, objv[3], NULL, valPtr, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { Tcl_DecrRefCount (valPtr); goto errorExit; } diff --git a/generic/tclXchmod.c b/generic/tclXchmod.c index c85ea822..5f7c5fd6 100644 --- a/generic/tclXchmod.c +++ b/generic/tclXchmod.c @@ -39,19 +39,19 @@ static int TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_ChownObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_ChgrpObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -306,7 +306,7 @@ ChmodFileIdObj (Tcl_Interp *interp, modeInfo_t modeInfo, Tcl_Obj *fileIdObj) *----------------------------------------------------------------------------- */ static int -TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { int objIdx, idx, fileObjc, fileIds, result; modeInfo_t modeInfo; @@ -367,7 +367,7 @@ TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * *----------------------------------------------------------------------------- */ static int -TclX_ChownObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +TclX_ChownObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { int objIdx, ownerObjc, fileIds; Tcl_Obj **ownerObjv = NULL; @@ -451,7 +451,7 @@ TclX_ChownObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * *----------------------------------------------------------------------------- */ static int -TclX_ChgrpObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +TclX_ChgrpObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { int objIdx, fileIds; char *fileIdsSwitch, *groupString; diff --git a/generic/tclXcmdloop.c b/generic/tclXcmdloop.c index d7ffc7c7..76f61a8d 100644 --- a/generic/tclXcmdloop.c +++ b/generic/tclXcmdloop.c @@ -72,7 +72,7 @@ static int TclX_CommandloopObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- * IsSetVarCmd -- @@ -665,7 +665,7 @@ TclX_CommandLoop (Tcl_Interp *interp, *----------------------------------------------------------------------------- */ static int -TclX_CommandloopObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +TclX_CommandloopObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { int options = 0, async = FALSE, argIdx, interactive; char *argStr, *endCommand = NULL; diff --git a/generic/tclXcoalesce.c b/generic/tclXcoalesce.c index 03986de3..39622342 100644 --- a/generic/tclXcoalesce.c +++ b/generic/tclXcoalesce.c @@ -29,7 +29,7 @@ *----------------------------------------------------------------------------- */ static int -TclX_CoalesceObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +TclX_CoalesceObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { int i; Tcl_Obj *val; diff --git a/generic/tclXdebug.c b/generic/tclXdebug.c index 55d469c4..f3b437a4 100644 --- a/generic/tclXdebug.c +++ b/generic/tclXdebug.c @@ -90,7 +90,7 @@ static int TclX_CmdtraceObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void DebugCleanUp (ClientData clientData, @@ -387,7 +387,7 @@ static int TclX_CmdtraceObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { traceInfo_pt infoPtr = (traceInfo_pt) clientData; int idx; diff --git a/generic/tclXdup.c b/generic/tclXdup.c index 224c3fca..3f701cca 100644 --- a/generic/tclXdup.c +++ b/generic/tclXdup.c @@ -34,7 +34,7 @@ static int TclX_DupObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -75,7 +75,7 @@ DupChannelOptions (Tcl_Interp *interp, goto errorExit; } if ((optArgc % 2) != 0) { - panic("channel didn't return keyword/value pairs"); + Tcl_Panic("channel didn't return keyword/value pairs"); } for (idx = 0; idx < optArgc; idx += 2) { @@ -193,7 +193,7 @@ static int TclX_DupObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Channel newChannel; int bindFnum, fnum; diff --git a/generic/tclXfcntl.c b/generic/tclXfcntl.c index 070caa31..6f4ad29c 100644 --- a/generic/tclXfcntl.c +++ b/generic/tclXfcntl.c @@ -85,7 +85,7 @@ static int TclX_FcntlObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -204,7 +204,7 @@ GetFcntlAttr (Tcl_Interp *interp, Tcl_Channel channel, int mode, int attrib) return TCL_ERROR; break; default: - panic ("bug in fcntl get attrib"); + Tcl_Panic ("bug in fcntl get attrib"); value = 0; /* suppress compiler warning for initialized value */ } @@ -260,7 +260,7 @@ SetFcntlAttrObj (Tcl_Interp *interp, case ATTR_KEEPALIVE: return TclXOSsetsockopt (interp, channel, SO_KEEPALIVE, value); default: - panic ("buf in fcntl set attrib"); + Tcl_Panic ("buf in fcntl set attrib"); } return TCL_ERROR; /* Should never be reached */ } @@ -275,7 +275,7 @@ static int TclX_FcntlObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Channel channel; int mode; diff --git a/generic/tclXfilecmds.c b/generic/tclXfilecmds.c index ae2ca2b8..dbf0ae22 100644 --- a/generic/tclXfilecmds.c +++ b/generic/tclXfilecmds.c @@ -39,19 +39,19 @@ static int TclX_PipeObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_FtruncateObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_ReaddirObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -67,7 +67,7 @@ static int TclX_PipeObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Channel channels [2]; const char *channelNames [2]; @@ -87,12 +87,12 @@ TclX_PipeObjCmd (ClientData clientData, channelNames [1], (char *) NULL); } else { if (Tcl_ObjSetVar2(interp, objv[1], NULL, Tcl_NewStringObj(channelNames [0], -1), - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) + TCL_LEAVE_ERR_MSG) == NULL) goto errorExit; if (Tcl_ObjSetVar2(interp, objv[2], NULL, Tcl_NewStringObj(channelNames [1], -1), - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) + TCL_LEAVE_ERR_MSG) == NULL) goto errorExit; } @@ -160,7 +160,7 @@ static int TclX_FtruncateObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int objIdx, fileIds; off_t newSize; @@ -247,7 +247,7 @@ static int TclX_ReaddirObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_DString pathBuf; char *dirPath; diff --git a/generic/tclXfilescan.c b/generic/tclXfilescan.c index 9316b0af..4899dbf6 100644 --- a/generic/tclXfilescan.c +++ b/generic/tclXfilescan.c @@ -84,13 +84,13 @@ static int TclX_ScancontextObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_ScanmatchObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void CopyFileCloseHandler (ClientData clientData); @@ -119,7 +119,7 @@ static int TclX_ScanfileObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void FileScanCleanUp (ClientData clientData, @@ -331,7 +331,7 @@ static int TclX_ScancontextObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { char *subCommand; @@ -393,7 +393,7 @@ TclX_ScancontextObjCmd (ClientData clientData, static int TclX_ScanmatchObjCmd (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) + int objc, Tcl_Obj *const objv[]) { scanContext_t *contextPtr, **tableEntryPtr; matchDef_t *newmatch; @@ -776,7 +776,7 @@ static int TclX_ScanfileObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { scanContext_t *contextPtr, **tableEntryPtr; Tcl_Obj *contextHandleObj, *fileHandleObj, *copyFileHandleObj; diff --git a/generic/tclXflock.c b/generic/tclXflock.c index cd5be25e..45df5d24 100644 --- a/generic/tclXflock.c +++ b/generic/tclXflock.c @@ -25,7 +25,7 @@ static int ParseLockUnlockArgs (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[], + Tcl_Obj *const objv[], int argIdx, TclX_FlockInfo *lockInfoPtr); @@ -33,13 +33,13 @@ static int TclX_FlockObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_FunlockObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -66,7 +66,7 @@ TclX_FunlockObjCmd (ClientData clientData, static int ParseLockUnlockArgs (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[], + Tcl_Obj *const objv[], int argIdx, TclX_FlockInfo *lockInfoPtr) { @@ -124,7 +124,7 @@ static int TclX_FlockObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int argIdx; TclX_FlockInfo lockInfo; @@ -208,7 +208,7 @@ static int TclX_FunlockObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { TclX_FlockInfo lockInfo; diff --git a/generic/tclXfstat.c b/generic/tclXfstat.c index 81dfaaf2..f5eddcd8 100644 --- a/generic/tclXfstat.c +++ b/generic/tclXfstat.c @@ -74,7 +74,7 @@ static int TclX_FstatObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -316,7 +316,7 @@ static int TclX_FstatObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Channel channel; struct stat statBuf; diff --git a/generic/tclXgeneral.c b/generic/tclXgeneral.c index 204619e4..9afd7590 100644 --- a/generic/tclXgeneral.c +++ b/generic/tclXgeneral.c @@ -33,19 +33,19 @@ static int TclX_EchoObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_InfoxObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_LoopObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int SetLoopCounter (Tcl_Interp *interp, @@ -59,7 +59,7 @@ static int TclX_Try_EvalObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -119,7 +119,7 @@ static int TclX_EchoObjCmd (ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int idx; Tcl_Channel channel; @@ -164,7 +164,7 @@ static int TclX_InfoxObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj *resultPtr = Tcl_GetObjResult (interp); char *optionPtr; @@ -321,7 +321,7 @@ SetLoopCounter (Tcl_Interp *interp, char *varName, int idx) { Tcl_Obj *iObj, *newVarObj; - iObj = Tcl_GetVar2Ex(interp, varName, NULL, TCL_PARSE_PART1); + iObj = Tcl_GetVar2Ex(interp, varName, NULL, 0); if ((iObj == NULL) || (Tcl_IsShared (iObj))) { iObj = newVarObj = Tcl_NewLongObj (idx); } else { @@ -330,7 +330,7 @@ SetLoopCounter (Tcl_Interp *interp, char *varName, int idx) Tcl_SetLongObj (iObj, idx); if (Tcl_SetVar2Ex(interp, varName, NULL, iObj, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { if (newVarObj != NULL) { Tcl_DecrRefCount (newVarObj); } @@ -353,7 +353,7 @@ static int TclX_LoopObjCmd (ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int result = TCL_OK; long idx, first, limit, incr = 1; @@ -484,7 +484,7 @@ static int TclX_Try_EvalObjCmd (ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int code, code2; int haveFinally; diff --git a/generic/tclXhandles.c b/generic/tclXhandles.c index 97c09ff9..c1776f28 100644 --- a/generic/tclXhandles.c +++ b/generic/tclXhandles.c @@ -102,12 +102,12 @@ AllocEntry (tblHeader_pt tblHdrPtr, static int HandleDecodeObj (Tcl_Interp *interp, tblHeader_pt tblHdrPtr, - CONST char *handle); + const char *handle); static int HandleDecode (Tcl_Interp *interp, tblHeader_pt tblHdrPtr, - CONST char *handle); + const char *handle); /*============================================================================= @@ -221,7 +221,7 @@ AllocEntry (tblHeader_pt tblHdrPtr, *----------------------------------------------------------------------------- */ static int -HandleDecode (Tcl_Interp *interp, tblHeader_pt tblHdrPtr, CONST char *handle) +HandleDecode (Tcl_Interp *interp, tblHeader_pt tblHdrPtr, const char *handle) { unsigned entryIdx; @@ -255,7 +255,7 @@ HandleDecode (Tcl_Interp *interp, tblHeader_pt tblHdrPtr, CONST char *handle) static int HandleDecodeObj (Tcl_Interp *interp, tblHeader_pt tblHdrPtr, - CONST char *handle) + const char *handle) { unsigned entryIdx; @@ -284,7 +284,7 @@ HandleDecodeObj (Tcl_Interp *interp, *----------------------------------------------------------------------------- */ void_pt -TclX_HandleTblInit (CONST char *handleBase, int entrySize, int initEntries) +TclX_HandleTblInit (const char *handleBase, int entrySize, int initEntries) { tblHeader_pt tblHdrPtr; int baseLength = strlen ((char *) handleBase); @@ -407,7 +407,7 @@ TclX_HandleAlloc (void_pt headerPtr, char *handlePtr) *----------------------------------------------------------------------------- */ void_pt -TclX_HandleXlate (Tcl_Interp *interp, void_pt headerPtr, CONST char *handle) +TclX_HandleXlate (Tcl_Interp *interp, void_pt headerPtr, const char *handle) { tblHeader_pt tblHdrPtr = (tblHeader_pt)headerPtr; entryHeader_pt entryHdrPtr; @@ -539,7 +539,7 @@ TclX_HandleFree (void_pt headerPtr, void_pt entryPtr) entryHdrPtr = HEADER_AREA (entryPtr); if (entryHdrPtr->freeLink != ALLOCATED_IDX) - panic ("Tcl_HandleFree: entry not allocated %x\n", entryHdrPtr); + Tcl_Panic ("Tcl_HandleFree: entry not allocated %x\n", entryHdrPtr); entryHdrPtr->freeLink = tblHdrPtr->freeHeadIdx; tblHdrPtr->freeHeadIdx = diff --git a/generic/tclXkeylist.c b/generic/tclXkeylist.c index 3a6f8f20..96055056 100644 --- a/generic/tclXkeylist.c +++ b/generic/tclXkeylist.c @@ -144,25 +144,25 @@ static int TclX_KeylgetObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_KeylsetObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_KeyldelObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_KeylkeysObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /* * Type definition. @@ -277,14 +277,14 @@ FreeKeyedListData (keylIntObj_t *keylIntPtr) Tcl_DecrRefCount(keylIntPtr->entries [idx].valuePtr); } if (keylIntPtr->entries != NULL) - ckfree ((VOID*) keylIntPtr->entries); + ckfree ((void*) keylIntPtr->entries); #ifndef NO_KEYLIST_HASH_TABLE if (keylIntPtr->hashTbl != NULL) { Tcl_DeleteHashTable(keylIntPtr->hashTbl); ckfree((char *) (keylIntPtr->hashTbl)); } #endif - ckfree ((VOID*) keylIntPtr); + ckfree ((void*) keylIntPtr); } /*----------------------------------------------------------------------------- @@ -311,7 +311,7 @@ EnsureKeyedListSpace (keylIntObj_t *keylIntPtr, int newNumEntries) ckalloc (newSize * sizeof (keylEntry_t)); } else { keylIntPtr->entries = (keylEntry_t *) - ckrealloc ((VOID *) keylIntPtr->entries, + ckrealloc ((void *) keylIntPtr->entries, newSize * sizeof (keylEntry_t)); } keylIntPtr->arraySize = newSize; @@ -518,7 +518,7 @@ DupKeyedListInternalRep (Tcl_Obj *srcPtr, Tcl_Obj *copyPtr) #endif } - copyPtr->internalRep.otherValuePtr = (VOID *) copyIntPtr; + copyPtr->internalRep.otherValuePtr = (void *) copyIntPtr; copyPtr->typePtr = &keyedListType; KEYL_REP_ASSERT (copyIntPtr); @@ -603,7 +603,7 @@ SetKeyedListFromAny (Tcl_Interp *interp, Tcl_Obj *objPtr) (objPtr->typePtr->freeIntRepProc != NULL)) { (*objPtr->typePtr->freeIntRepProc) (objPtr); } - objPtr->internalRep.otherValuePtr = (VOID *) keylIntPtr; + objPtr->internalRep.otherValuePtr = (void *) keylIntPtr; objPtr->typePtr = &keyedListType; KEYL_REP_ASSERT (keylIntPtr); @@ -660,7 +660,7 @@ UpdateStringOfKeyedList (Tcl_Obj *keylPtr) Tcl_DecrRefCount(tmpListObj); if (listObjv != staticListObjv) - ckfree ((VOID*) listObjv); + ckfree ((void*) listObjv); } /*----------------------------------------------------------------------------- @@ -677,7 +677,7 @@ TclX_NewKeyedListObj () Tcl_Obj *keylPtr = Tcl_NewObj (); keylIntObj_t *keylIntPtr = AllocKeyedListIntRep (); - keylPtr->internalRep.otherValuePtr = (VOID *) keylIntPtr; + keylPtr->internalRep.otherValuePtr = (void *) keylIntPtr; keylPtr->typePtr = &keyedListType; return keylPtr; } @@ -1006,7 +1006,7 @@ static int TclX_KeylgetObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj *keylPtr, *valuePtr; char *key; @@ -1084,7 +1084,7 @@ static int TclX_KeylsetObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj *keylVarPtr, *newVarObj; char *key; @@ -1143,7 +1143,7 @@ static int TclX_KeyldelObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj *keylVarPtr, *keylPtr; char *key; @@ -1204,7 +1204,7 @@ static int TclX_KeylkeysObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj *keylPtr, *listObjPtr; char *key; diff --git a/generic/tclXlgets.c b/generic/tclXlgets.c index e615484e..409e15f8 100644 --- a/generic/tclXlgets.c +++ b/generic/tclXlgets.c @@ -57,7 +57,7 @@ static int TclX_LgetsObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -408,7 +408,7 @@ static int TclX_LgetsObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Channel channel; ReadData readData; @@ -469,7 +469,7 @@ TclX_LgetsObjCmd (ClientData clientData, int resultLen; if (Tcl_ObjSetVar2(interp, objv[2], NULL, dataObj, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { goto errorExit; } @@ -511,7 +511,7 @@ TclX_LgetsObjCmd (ClientData clientData, * FIX: Need functions to save/restore error state. */ if (Tcl_ObjSetVar2(interp, objv[2], NULL, dataObj, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) != NULL) { + TCL_LEAVE_ERR_MSG) != NULL) { Tcl_SetObjResult (interp, saveResult); /* Restore old message */ } Tcl_DecrRefCount (saveResult); diff --git a/generic/tclXlib.c b/generic/tclXlib.c index 0903fe04..9fe4dad0 100644 --- a/generic/tclXlib.c +++ b/generic/tclXlib.c @@ -127,19 +127,19 @@ static int TclX_load_tndxsObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_Auto_load_pkgObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_LoadlibindexObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -855,7 +855,7 @@ static int TclX_load_tndxsObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { char *dirname; @@ -879,7 +879,7 @@ static int TclX_Auto_load_pkgObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { char *fileName; off_t offset; @@ -915,7 +915,7 @@ static int TclX_LoadlibindexObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { char *pathName; Tcl_DString pathNameBuf; diff --git a/generic/tclXlist.c b/generic/tclXlist.c index ab5d0e9a..3f1c0a87 100644 --- a/generic/tclXlist.c +++ b/generic/tclXlist.c @@ -26,43 +26,43 @@ static int TclX_LvarcatObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_LvarpopObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_LvarpushObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_LemptyObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_LassignObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_LmatchObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_LcontainObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -75,7 +75,7 @@ static int TclX_LvarcatObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj *varObjPtr, *newObjPtr; int catObjc, idx, argIdx; @@ -92,7 +92,7 @@ TclX_LvarcatObjCmd (ClientData clientData, * Get the variable that we are going to update. Include it if it * exists. */ - varObjPtr = Tcl_GetVar2Ex(interp, varName, NULL, TCL_PARSE_PART1); + varObjPtr = Tcl_GetVar2Ex(interp, varName, NULL, 0); if (varObjPtr != NULL) { catObjc = objc - 1; @@ -120,7 +120,7 @@ TclX_LvarcatObjCmd (ClientData clientData, ckfree ((char *) catObjv); if (Tcl_SetVar2Ex(interp, varName, NULL, newObjPtr, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { Tcl_DecrRefCount (newObjPtr); return TCL_ERROR; } @@ -138,7 +138,7 @@ static int TclX_LvarpopObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj *listVarPtr, *newVarObj, *returnElemPtr = NULL; int listIdx, listLen; @@ -150,7 +150,7 @@ TclX_LvarpopObjCmd (ClientData clientData, varName = Tcl_GetStringFromObj (objv [1], NULL); listVarPtr = Tcl_GetVar2Ex(interp, varName, NULL, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG); + TCL_LEAVE_ERR_MSG); if (listVarPtr == NULL) { return TCL_ERROR; } @@ -201,7 +201,7 @@ TclX_LvarpopObjCmd (ClientData clientData, * Update variable. */ if (Tcl_SetVar2Ex(interp, varName, NULL, listVarPtr, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { goto errorExit; } @@ -233,7 +233,7 @@ static int TclX_LvarpushObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj *listVarPtr, *newVarObj; int listIdx, listLen; @@ -244,7 +244,7 @@ TclX_LvarpushObjCmd (ClientData clientData, } varName = Tcl_GetStringFromObj (objv [1], NULL); - listVarPtr = Tcl_GetVar2Ex(interp, varName, NULL, TCL_PARSE_PART1); + listVarPtr = Tcl_GetVar2Ex(interp, varName, NULL, 0); if ((listVarPtr == NULL) || (Tcl_IsShared (listVarPtr))) { if (listVarPtr == NULL) { listVarPtr = Tcl_NewListObj (0, NULL); @@ -282,7 +282,7 @@ TclX_LvarpushObjCmd (ClientData clientData, goto errorExit; if (Tcl_SetVar2Ex(interp, varName, NULL, listVarPtr, - TCL_PARSE_PART1| TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { goto errorExit; } return TCL_OK; @@ -304,7 +304,7 @@ static int TclX_LemptyObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int length; @@ -343,7 +343,7 @@ static int TclX_LassignObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int listObjc, listIdx, idx, remaining; Tcl_Obj **listObjv, *elemPtr, *remainingObjPtr; @@ -372,7 +372,7 @@ TclX_LassignObjCmd (ClientData clientData, elemPtr = nullObjPtr; } if (Tcl_SetVar2Ex(interp, Tcl_GetStringFromObj(objv [idx], NULL), NULL, - elemPtr, TCL_PARSE_PART1 | TCL_LEAVE_ERR_MSG) == NULL) + elemPtr, TCL_LEAVE_ERR_MSG) == NULL) goto error_exit; } @@ -405,7 +405,7 @@ static int TclX_LmatchObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { #define EXACT 0 #define GLOB 1 @@ -502,7 +502,7 @@ static int TclX_LcontainObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int listObjc, idx; Tcl_Obj **listObjv; diff --git a/generic/tclXmath.c b/generic/tclXmath.c index 6777ae6e..b6dbd8da 100644 --- a/generic/tclXmath.c +++ b/generic/tclXmath.c @@ -56,17 +56,17 @@ static long ReallyRandom (long my_range); static int TclX_MaxObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_MinObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_RandomObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -121,7 +121,7 @@ static int ConvertIntOrDoubleObj (Tcl_Interp *interp, static int TclX_MaxObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { double value, maxValue = -MAXDOUBLE; int idx, maxIdx = 1; @@ -153,7 +153,7 @@ static int TclX_MaxObjCmd (ClientData clientData, static int TclX_MinObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { double value, minValue = MAXDOUBLE; int idx, minIdx = 1; @@ -205,7 +205,7 @@ ReallyRandom (long myRange) static int TclX_RandomObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { long range; char *seedString; diff --git a/generic/tclXmsgcat.c b/generic/tclXmsgcat.c index f7a337b6..e081b6ce 100644 --- a/generic/tclXmsgcat.c +++ b/generic/tclXmsgcat.c @@ -36,25 +36,25 @@ ParseFailOptionObj (Tcl_Interp *interp, static int CatOpFailedObj (Tcl_Interp *interp, - CONST char *errorMsg); + const char *errorMsg); static int TclX_CatopenObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_CatgetsObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_CatcloseObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void MsgCatCleanUp (ClientData clientData, @@ -147,7 +147,7 @@ ParseFailOptionObj (Tcl_Interp *interp, */ static int CatOpFailedObj (Tcl_Interp *interp, - CONST char *errorMsg) + const char *errorMsg) { #ifndef NO_CATGETS TclX_AppendObjResult (interp, errorMsg, (char *) NULL); @@ -172,7 +172,7 @@ static int TclX_CatopenObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int fail; nl_catd catDesc; @@ -212,7 +212,7 @@ static int TclX_CatgetsObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { nl_catd *catDescPtr; int msgSetNum, msgNum; @@ -267,7 +267,7 @@ static int TclX_CatcloseObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int fail; nl_catd *catDescPtr; diff --git a/generic/tclXoscmds.c b/generic/tclXoscmds.c index 5d242792..83c6f22e 100644 --- a/generic/tclXoscmds.c +++ b/generic/tclXoscmds.c @@ -23,43 +23,43 @@ static int TclX_AlarmObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_LinkObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_NiceObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_SleepObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_SyncObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_SystemObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_UmaskObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -76,7 +76,7 @@ static int TclX_AlarmObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { double seconds; @@ -106,7 +106,7 @@ static int TclX_LinkObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { char *srcPath, *destPath; Tcl_DString srcPathBuf, destPathBuf; @@ -175,7 +175,7 @@ static int TclX_NiceObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj *resultPtr = Tcl_GetObjResult (interp); int priorityIncr, priority; @@ -224,7 +224,7 @@ static int TclX_SleepObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { double time; @@ -252,7 +252,7 @@ static int TclX_SyncObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Channel channel; @@ -286,7 +286,7 @@ static int TclX_SystemObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj *cmdObjPtr; char *cmdStr; @@ -321,7 +321,7 @@ static int TclX_UmaskObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int mask; char *umaskString; diff --git a/generic/tclXprocess.c b/generic/tclXprocess.c index c81ab199..7940c315 100644 --- a/generic/tclXprocess.c +++ b/generic/tclXprocess.c @@ -32,19 +32,19 @@ static int TclX_ExeclObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_ForkObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_WaitObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -57,7 +57,7 @@ static int TclX_ForkObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { if (objc != 1) return TclX_WrongArgs (interp, objv [0], ""); @@ -75,7 +75,7 @@ static int TclX_ExeclObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { #define STATIC_ARG_SIZE 12 char *staticArgv [STATIC_ARG_SIZE]; @@ -163,7 +163,7 @@ static int TclX_WaitObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int idx, options = 0, pgroup = FALSE; char *argStr; diff --git a/generic/tclXprofile.c b/generic/tclXprofile.c index 9143a664..cff25a88 100644 --- a/generic/tclXprofile.c +++ b/generic/tclXprofile.c @@ -83,7 +83,7 @@ typedef struct profInfo_t { } profInfo_t; /* - * Argument to panic on logic errors. Takes an id number. + * Argument to Tcl_Panic on logic errors. Takes an id number. */ static const char *PROF_PANIC = "TclX profile bug id = %d\n"; @@ -126,7 +126,7 @@ static int ProfObjCommandEval (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static Tcl_CmdObjTraceProc ProfTraceRoutine; @@ -154,7 +154,7 @@ static int TclX_ProfileObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void ProfMonCleanUp (ClientData clientData, @@ -228,7 +228,7 @@ PushEntry (profInfo_t *infoPtr, * Only global level can be NULL. */ if (scanPtr == NULL) - panic (PROF_PANIC, 1); + Tcl_Panic (PROF_PANIC, 1); } entryPtr->prevScopePtr = scanPtr; infoPtr->scopeChainPtr = entryPtr; @@ -434,7 +434,7 @@ ProfCommandEvalSetup (profInfo_t *infoPtr, int *isProcPtr) UpdateTOSTimes (infoPtr); do { if (infoPtr->stackPtr->evalLevel != UNKNOWN_LEVEL) - panic (PROF_PANIC, 2); /* Not an initial entry */ + Tcl_Panic (PROF_PANIC, 2); /* Not an initial entry */ PopEntry (infoPtr); } while (infoPtr->stackPtr->procLevel > procLevel); } @@ -535,7 +535,7 @@ static int ProfObjCommandEval (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { profInfo_t *infoPtr = (profInfo_t *) clientData; int isProc, result; @@ -562,14 +562,14 @@ ProfTraceRoutine (ClientData clientData, const char *command, Tcl_Command cmd, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { /* struct Tcl_Obj * const *objv; */ profInfo_t *infoPtr = (profInfo_t *) clientData; Tcl_CmdInfo cmdInfo; if (cmd == NULL) - panic (PROF_PANIC, 4); + Tcl_Panic (PROF_PANIC, 4); //TIP #571: We don' want to profile the tailcall itself. As it can only be called in a procedure/lambda context if ( ! strcmp((*objv)->bytes, "tailcall") ) { @@ -701,7 +701,7 @@ TurnOnProfiling (profInfo_t *infoPtr, int commandMode, int evalMode) * Only global level can be NULL. */ if (scanPtr == NULL) - panic (PROF_PANIC, 6); + Tcl_Panic (PROF_PANIC, 6); } infoPtr->scopeChainPtr = scanPtr; @@ -802,7 +802,7 @@ static int TclX_ProfileObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { profInfo_t *infoPtr = (profInfo_t *) clientData; int argIdx; diff --git a/generic/tclXselect.c b/generic/tclXselect.c index 137c552d..541c0574 100644 --- a/generic/tclXselect.c +++ b/generic/tclXselect.c @@ -80,7 +80,7 @@ static int TclX_SelectObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -275,7 +275,7 @@ static int TclX_SelectObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { static int chanAccess [] = {TCL_READABLE, TCL_WRITABLE, 0}; int idx; @@ -406,7 +406,7 @@ TclX_SelectObjCmd (clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] { Tcl_AppendResult(interp, Tcl_GetString(objv[0]), " is not available on this OS", (char *) NULL); diff --git a/generic/tclXsignal.c b/generic/tclXsignal.c index 385601ae..a3fae74f 100644 --- a/generic/tclXsignal.c +++ b/generic/tclXsignal.c @@ -52,7 +52,7 @@ * Value returned by Tcl_SignalId when an invalid signal is passed in. * Pointer is used as a quick check of a valid signal number. */ -static CONST char *unknownSignalIdMsg; +static const char *unknownSignalIdMsg; /* * Signal name table maps name to number. Note, it is possible to have @@ -327,13 +327,13 @@ static int TclX_SignalObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_KillObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -631,11 +631,11 @@ SignalTrap (int signalNum) #ifdef SIGCHLD if (signalNum != SIGCHLD) { if (SetSignalState (signalNum, SignalTrap, FALSE) == TCL_ERROR) - panic ("SignalTrap bug"); + Tcl_Panic ("SignalTrap bug"); } #else if (SetSignalState (signalNum, SignalTrap, FALSE) == TCL_ERROR) - panic ("SignalTrap bug"); + Tcl_Panic ("SignalTrap bug"); #endif /* SIGCHLD */ #endif /* NO_SIGACTION */ } @@ -1311,7 +1311,7 @@ static int TclX_SignalObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { unsigned char signals [MAXSIG]; char *argStr, *actionStr; @@ -1451,7 +1451,7 @@ static int TclX_KillObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int signalNum, nextArg, idx, procId, procObjc; int pgroup = FALSE; @@ -1540,7 +1540,7 @@ SignalCmdCleanUp (ClientData clientData, Tcl_Interp *interp) break; } if (idx == numInterps) - panic ("signal interp lost"); + Tcl_Panic ("signal interp lost"); interpTable [idx] = interpTable [--numInterps]; diff --git a/generic/tclXsocket.c b/generic/tclXsocket.c index 019c92f2..7a58b79f 100644 --- a/generic/tclXsocket.c +++ b/generic/tclXsocket.c @@ -28,13 +28,13 @@ ReturnGetHostError (Tcl_Interp *interp, static struct hostent * InfoGetHost (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_HostInfoObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -106,7 +106,7 @@ TclXGetHostInfo (Tcl_Interp *interp, Tcl_Channel channel, int remoteHost) { struct sockaddr_in sockaddr; struct hostent *hostEntry; - CONST char *hostName; + const char *hostName; Tcl_Obj *listObjv [3]; if (remoteHost) { @@ -150,7 +150,7 @@ TclXGetHostInfo (Tcl_Interp *interp, Tcl_Channel channel, int remoteHost) *----------------------------------------------------------------------------- */ static struct hostent * -InfoGetHost (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +InfoGetHost (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { struct hostent *hostEntry; struct in_addr address; @@ -194,7 +194,7 @@ static int TclX_HostInfoObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { struct hostent *hostEntry; struct in_addr inAddr; @@ -215,8 +215,8 @@ TclX_HostInfoObjCmd (ClientData clientData, return TCL_ERROR; for (idx = 0; hostEntry->h_addr_list [idx] != NULL; idx++) { - bcopy ((VOID *) hostEntry->h_addr_list [idx], - (VOID *) &inAddr, + bcopy ((void *) hostEntry->h_addr_list [idx], + (void *) &inAddr, hostEntry->h_length); listObj = Tcl_NewStringObj (inet_ntoa (inAddr), -1); @@ -231,8 +231,8 @@ TclX_HostInfoObjCmd (ClientData clientData, return TCL_ERROR; for (idx = 0; hostEntry->h_addr_list [idx] != NULL; idx++) { - bcopy ((VOID *) hostEntry->h_addr_list [idx], - (VOID *) &inAddr, + bcopy ((void *) hostEntry->h_addr_list [idx], + (void *) &inAddr, hostEntry->h_length); listObj = Tcl_NewStringObj ((char *) hostEntry->h_name, -1); Tcl_ListObjAppendElement (interp, resultPtr, listObj); diff --git a/generic/tclXstring.c b/generic/tclXstring.c index 2c421693..bd99352a 100644 --- a/generic/tclXstring.c +++ b/generic/tclXstring.c @@ -40,61 +40,61 @@ static int TclX_CindexObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_ClengthObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_CconcatObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_CrangeObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_CcollateObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_ReplicateObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_TranslitObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_CtypeObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_CtokenObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_CequalObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -110,7 +110,7 @@ static int TclX_CindexObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int strLen, utfLen, idx, numBytes; char *str, buf [TCL_UTF_MAX]; @@ -147,7 +147,7 @@ static int TclX_ClengthObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { char *str; int strLen; @@ -174,7 +174,7 @@ static int TclX_CconcatObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj *resultPtr = Tcl_GetObjResult(interp); int idx, strLen; @@ -203,7 +203,7 @@ static int TclX_CrangeObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int strLen, utfLen, first, subLen; size_t isRange = (size_t) clientData; @@ -262,7 +262,7 @@ static int TclX_CcollateObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int argIndex, result, local = FALSE; char *optionString; @@ -323,7 +323,7 @@ static int TclX_ReplicateObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj *resultPtr = Tcl_GetObjResult (interp); long count; @@ -359,7 +359,7 @@ static int TclX_CtokenObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { Tcl_Obj* stringVarObj; char* string; @@ -379,7 +379,7 @@ TclX_CtokenObjCmd (ClientData clientData, } stringVarObj = Tcl_ObjGetVar2(interp, objv[1], NULL, - TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1); + TCL_LEAVE_ERR_MSG); if (stringVarObj == NULL) { return TCL_ERROR; } @@ -416,7 +416,7 @@ TclX_CtokenObjCmd (ClientData clientData, strByteLen-strByteIdx); if (Tcl_SetVar2Ex(interp, Tcl_GetStringFromObj(objv[1], NULL), NULL, newVarValueObj, - TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { Tcl_DStringFree (&token); Tcl_DecrRefCount (newVarValueObj); return TCL_ERROR; @@ -439,7 +439,7 @@ static int TclX_CequalObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { char *string1Ptr; int string1Len; @@ -537,7 +537,7 @@ static int TclX_TranslitObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { unsigned char from [MAX_EXPANSION+1]; int fromLen; @@ -652,7 +652,7 @@ static int TclX_CtypeObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { int failIndex = FALSE; char *optStr, *class, *charStr; @@ -666,7 +666,7 @@ TclX_CtypeObjCmd (ClientData clientData, #define IS_8BIT_UNICHAR(c) (c <= 255) if (TCL_UTF_MAX > sizeof(number)) { - panic("TclX_CtypeObjCmd: UTF character longer than a int"); + Tcl_Panic("TclX_CtypeObjCmd: UTF character longer than a int"); } /*FIX: Split into multiple procs */ @@ -853,7 +853,7 @@ TclX_CtypeObjCmd (ClientData clientData, Tcl_Obj *iObj = Tcl_NewIntObj (idx); if (Tcl_SetVar2Ex(interp, failVar, NULL, - iObj, TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1) == NULL) { + iObj, TCL_LEAVE_ERR_MSG) == NULL) { Tcl_DecrRefCount (iObj); return TCL_ERROR; } diff --git a/generic/tclXutil.c b/generic/tclXutil.c index 17b82e30..0cb57054 100644 --- a/generic/tclXutil.c +++ b/generic/tclXutil.c @@ -58,7 +58,7 @@ char *tclXWrongArgs = "wrong # args: "; *----------------------------------------------------------------------------- */ int -TclX_StrToInt (CONST char *string, int base, int *intPtr) +TclX_StrToInt (const char *string, int base, int *intPtr) { char *end, *p; int i; @@ -115,7 +115,7 @@ TclX_StrToInt (CONST char *string, int base, int *intPtr) *----------------------------------------------------------------------------- */ int -TclX_StrToUnsigned (CONST char *string, int base, unsigned *unsignedPtr) +TclX_StrToUnsigned (const char *string, int base, unsigned *unsignedPtr) { char *end, *p; unsigned i; @@ -158,7 +158,7 @@ TclX_StrToUnsigned (CONST char *string, int base, unsigned *unsignedPtr) *----------------------------------------------------------------------------- */ int -TclX_StrToOffset (CONST char *string, int base, off_t *offsetPtr) +TclX_StrToOffset (const char *string, int base, off_t *offsetPtr) { char *end, *p; off_t i; @@ -217,7 +217,7 @@ TclX_StrToOffset (CONST char *string, int base, off_t *offsetPtr) *----------------------------------------------------------------------------- */ char * -TclX_DownShift (char *targetStr, CONST char *sourceStr) +TclX_DownShift (char *targetStr, const char *sourceStr) { register char theChar; @@ -252,7 +252,7 @@ TclX_DownShift (char *targetStr, CONST char *sourceStr) *----------------------------------------------------------------------------- */ char * -TclX_UpShift (char *targetStr, CONST char *sourceStr) +TclX_UpShift (char *targetStr, const char *sourceStr) { register char theChar; @@ -476,7 +476,7 @@ ParseTranslationOption (char *strValue) } else if (STREQU (strValue, "platform")) { return TCLX_TRANSLATE_PLATFORM; } - panic ("ParseTranslationOption bug"); + Tcl_Panic ("ParseTranslationOption bug"); return TCL_ERROR; /* Not reached */ } @@ -507,7 +507,7 @@ FormatTranslationOption (int value) case TCLX_TRANSLATE_PLATFORM: return "platform"; default: - panic ("FormatTranslationOption bug"); + Tcl_Panic ("FormatTranslationOption bug"); } return NULL; /* Not reached */ } @@ -620,7 +620,7 @@ TclX_GetChannelOption (Tcl_Interp *interp, return TCL_OK; fatalError: - panic ("TclX_GetChannelOption bug"); /* FIX: return error. */ + Tcl_Panic ("TclX_GetChannelOption bug"); /* FIX: return error. */ return 0; /* Not reached */ } @@ -715,7 +715,7 @@ TclX_SetChannelOption (Tcl_Interp *interp, return Tcl_SetChannelOption (interp, channel, strOption, strValue); fatalError: - panic ("TclX_SetChannelOption bug"); + Tcl_Panic ("TclX_SetChannelOption bug"); return TCL_ERROR; /* Not reached */ } @@ -924,7 +924,7 @@ TclX_RestoreResultErrorInfo (Tcl_Interp *interp, Tcl_Obj *saveObjPtr) /* * This should never happen */ - panic ("invalid TclX result save object"); + Tcl_Panic ("invalid TclX result save object"); } Tcl_SetVar2Ex(interp, ERRORCODE, NULL, saveObjv[2], TCL_GLOBAL_ONLY); diff --git a/unix/tclXchannelfd.c b/unix/tclXchannelfd.c index 0efb75dd..b4fe5209 100644 --- a/unix/tclXchannelfd.c +++ b/unix/tclXchannelfd.c @@ -60,7 +60,7 @@ ChannelToFd (Tcl_Channel channel, } static int -TclX_ChannelFdObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) +TclX_ChannelFdObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) { const char *channelName; Tcl_Channel channel; diff --git a/unix/tclXunixCmds.c b/unix/tclXunixCmds.c index 47c34c7a..b0088e65 100644 --- a/unix/tclXunixCmds.c +++ b/unix/tclXunixCmds.c @@ -23,13 +23,13 @@ static int TclX_ChrootObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_TimesObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -46,7 +46,7 @@ static int TclX_ChrootObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { char *chrootString; int chrootStrLen; @@ -79,7 +79,7 @@ static int TclX_TimesObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { struct tms tm; char timesBuf [48]; diff --git a/unix/tclXunixId.c b/unix/tclXunixId.c index 8fcf59b3..00f70e18 100644 --- a/unix/tclXunixId.c +++ b/unix/tclXunixId.c @@ -56,58 +56,58 @@ GroupnameToGroupidResult (Tcl_Interp *interp, static int IdConvert (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int IdEffective (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int IdProcess (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int IdGroupids (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[], + Tcl_Obj *const objv[], int symbolic); static int IdHost (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int GetSetWrongArgs (Tcl_Interp *interp, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int IdUser (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int IdUserId (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int IdGroup (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int IdGroupId (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_IdObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- * TclX_IdObjCmd -- @@ -231,7 +231,7 @@ GroupnameToGroupidResult (Tcl_Interp *interp, char *groupName) * id convert type value */ static int -IdConvert (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +IdConvert (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { long uid; long gid; @@ -272,7 +272,7 @@ IdConvert (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) * id effective type */ static int -IdEffective (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +IdEffective (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { char *subCommand; @@ -307,7 +307,7 @@ IdEffective (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) * id process ?parent|group? ?set? */ static int -IdProcess (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +IdProcess (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { pid_t pid; char *subCommand; @@ -368,7 +368,7 @@ IdProcess (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) * id groups */ static int -IdGroupids (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[], int symbolic) +IdGroupids (Tcl_Interp *interp, int objc, Tcl_Obj*const objv[], int symbolic) { #ifndef NO_GETGROUPS gid_t *groups; @@ -436,7 +436,7 @@ IdGroupids (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[], int symbolic) * id host */ static int -IdHost (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) +IdHost (Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) { #ifndef NO_GETHOSTNAME #ifndef MAXHOSTNAMELEN @@ -466,7 +466,7 @@ IdHost (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) * Return error when a get set function has too many args (2 or 3 expected). */ static int -GetSetWrongArgs (Tcl_Interp *interp, Tcl_Obj*CONST objv[]) +GetSetWrongArgs (Tcl_Interp *interp, Tcl_Obj*const objv[]) { return TclX_WrongArgs (interp, objv [0], "arg ?value?"); } @@ -475,7 +475,7 @@ GetSetWrongArgs (Tcl_Interp *interp, Tcl_Obj*CONST objv[]) * id user */ static int -IdUser (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) +IdUser (Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) { struct passwd *pw; char *user; @@ -511,7 +511,7 @@ IdUser (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) * id userid */ static int -IdUserId (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +IdUserId (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { int uid; @@ -538,7 +538,7 @@ IdUserId (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) * id group */ static int -IdGroup (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) +IdGroup (Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) { struct group *grp; char *groupName; @@ -574,7 +574,7 @@ IdGroup (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) * id groupid */ static int -IdGroupId (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +IdGroupId (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { int gid; @@ -598,7 +598,7 @@ IdGroupId (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) } static int -TclX_IdObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) +TclX_IdObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) { char *subCommand; diff --git a/unix/tclXunixPort.h b/unix/tclXunixPort.h index d5526a10..12ac02cc 100644 --- a/unix/tclXunixPort.h +++ b/unix/tclXunixPort.h @@ -38,7 +38,7 @@ extern int h_errno; #endif #ifdef __APPLE__ -# undef panic +# undef Tcl_Panic #endif /* diff --git a/unix/tclXunixSock.c b/unix/tclXunixSock.c index 826abbf9..a1a0ccde 100644 --- a/unix/tclXunixSock.c +++ b/unix/tclXunixSock.c @@ -142,7 +142,7 @@ TclX_ServerCreateCmd (ClientData clientData, /* * Parse arguments. */ - bzero ((VOID *) &local, sizeof (local)); + bzero ((void *) &local, sizeof (local)); local.sin_family = AF_INET; local.sin_addr.s_addr = INADDR_ANY; nextArg = 1; @@ -298,7 +298,7 @@ TclX_ServerAcceptCmd (ClientData clientData, /* * Accept a socket connection on the socket created by server_create. */ - bzero ((VOID *) &connectSocket, sizeof (connectSocket)); + bzero ((void *) &connectSocket, sizeof (connectSocket)); channel = TclX_GetOpenChannel (interp, argv [nextArg], 0); if (channel == NULL) diff --git a/win/tclXwinCmds.c b/win/tclXwinCmds.c index d61cfdb4..99465394 100644 --- a/win/tclXwinCmds.c +++ b/win/tclXwinCmds.c @@ -23,13 +23,13 @@ static int TclX_ChrootObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_TimesObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- @@ -41,7 +41,7 @@ static int TclX_ChrootObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { return TclXNotAvailableObjError (interp, objv [0]); } @@ -55,7 +55,7 @@ static int TclX_TimesObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { return TclXNotAvailableObjError (interp, objv [0]); } diff --git a/win/tclXwinId.c b/win/tclXwinId.c index 7214fdd5..f99b934f 100644 --- a/win/tclXwinId.c +++ b/win/tclXwinId.c @@ -24,18 +24,18 @@ static int IdProcess (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int IdHost (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TclX_IdObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); /*----------------------------------------------------------------------------- * Tcl_IdCmd -- @@ -57,7 +57,7 @@ static int IdProcess (interp, objc, objv) Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { Tcl_Obj *resultPtr = Tcl_GetObjResult (interp); @@ -77,7 +77,7 @@ static int IdHost (interp, objc, objv) Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { char hostName [TCL_RESULT_SIZE]; @@ -100,7 +100,7 @@ TclX_IdObjCmd (clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { char *optionPtr; diff --git a/win/tclXwinOS.c b/win/tclXwinOS.c index 6ee39ac0..b73fb49a 100644 --- a/win/tclXwinOS.c +++ b/win/tclXwinOS.c @@ -1483,7 +1483,7 @@ LockUnlockSetup (Tcl_Interp *interp, case TCLX_WIN_CONSOLE: break; /* FIX: Is this legal?? */ default: - panic ("unknown win channel type %d\n", type); + Tcl_Panic ("unknown win channel type %d\n", type); } /* From 027b441185e20b920123ac5da98e9d8505c745be Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Wed, 13 May 2020 19:43:56 +0200 Subject: [PATCH 06/19] Revert "remove Macros for deprecated api and replace the deprecated calls with new ones" This reverts commit 014629fad89a1fbfbfbce74394b58eef150024d0. --- generic/tclExtdInt.h | 4 ++-- generic/tclExtend.h | 17 +++++++++------ generic/tclXbsearch.c | 6 +++--- generic/tclXchmod.c | 12 +++++------ generic/tclXcmdloop.c | 4 ++-- generic/tclXcoalesce.c | 2 +- generic/tclXdebug.c | 4 ++-- generic/tclXdup.c | 6 +++--- generic/tclXfcntl.c | 8 +++---- generic/tclXfilecmds.c | 16 +++++++------- generic/tclXfilescan.c | 12 +++++------ generic/tclXflock.c | 12 +++++------ generic/tclXfstat.c | 4 ++-- generic/tclXgeneral.c | 20 +++++++++--------- generic/tclXhandles.c | 14 ++++++------ generic/tclXkeylist.c | 30 +++++++++++++------------- generic/tclXlgets.c | 8 +++---- generic/tclXlib.c | 12 +++++------ generic/tclXlist.c | 42 ++++++++++++++++++------------------ generic/tclXmath.c | 12 +++++------ generic/tclXmsgcat.c | 16 +++++++------- generic/tclXoscmds.c | 28 ++++++++++++------------ generic/tclXprocess.c | 12 +++++------ generic/tclXprofile.c | 20 +++++++++--------- generic/tclXselect.c | 6 +++--- generic/tclXsignal.c | 16 +++++++------- generic/tclXsocket.c | 18 ++++++++-------- generic/tclXstring.c | 48 +++++++++++++++++++++--------------------- generic/tclXutil.c | 20 +++++++++--------- unix/tclXchannelfd.c | 2 +- unix/tclXunixCmds.c | 8 +++---- unix/tclXunixId.c | 44 +++++++++++++++++++------------------- unix/tclXunixPort.h | 2 +- unix/tclXunixSock.c | 4 ++-- win/tclXwinCmds.c | 8 +++---- win/tclXwinId.c | 12 +++++------ win/tclXwinOS.c | 2 +- 37 files changed, 258 insertions(+), 253 deletions(-) diff --git a/generic/tclExtdInt.h b/generic/tclExtdInt.h index bb2a143e..e92a6596 100644 --- a/generic/tclExtdInt.h +++ b/generic/tclExtdInt.h @@ -47,7 +47,7 @@ */ #ifdef TCLX_DEBUG # define TclX_Assert(expr) ((expr) ? (void)0 : \ - Tcl_Panic("TclX assertion failure: %s:%d \"%s\"\n",\ + panic("TclX assertion failure: %s:%d \"%s\"\n",\ __FILE__, __LINE__, "expr")) #else # define TclX_Assert(expr) @@ -244,7 +244,7 @@ TclX_StructOffset (void *nsPtr, size_t offset, #define TclX_WriteNL(channel) (Tcl_Write (channel, "\n", 1)) extern int -TclX_StrToOffset (const char *string, +TclX_StrToOffset (CONST char *string, int base, off_t *offsetPtr); diff --git a/generic/tclExtend.h b/generic/tclExtend.h index 135b94ac..ea2a9dd1 100644 --- a/generic/tclExtend.h +++ b/generic/tclExtend.h @@ -52,6 +52,11 @@ typedef void *void_pt; #define TCLX_CMDL_INTERACTIVE (1<<0) #define TCLX_CMDL_EXIT_ON_EOF (1<<1) +#define CONST const +#define TCL_PARSE_PART1 0 +#define VOID void +#define panic Tcl_Panic + /* * Application signal error handler. Called after normal signal processing, * when a signal results in an error. Its main purpose in life is to allow @@ -99,16 +104,16 @@ EXTERN void TclX_SplitWinCmdLine (int *argcPtr, char ***argvPtr); */ EXTERN void TclX_AppendObjResult (Tcl_Interp *, ...); -EXTERN char * TclX_DownShift (char *targetStr, const char *sourceStr); +EXTERN char * TclX_DownShift (char *targetStr, CONST char *sourceStr); -EXTERN int TclX_StrToInt (const char *string, int base, int *intPtr); +EXTERN int TclX_StrToInt (CONST char *string, int base, int *intPtr); -EXTERN int TclX_StrToUnsigned (const char *string, +EXTERN int TclX_StrToUnsigned (CONST char *string, int base, unsigned *unsignedPtr); EXTERN char * TclX_UpShift (char *targetStr, - const char *sourceStr); + CONST char *sourceStr); /* * Exported keyed list object manipulation functions. @@ -143,7 +148,7 @@ EXTERN void_pt TclX_HandleAlloc (void_pt headerPtr, EXTERN void TclX_HandleFree (void_pt headerPtr, void_pt entryPtr); -EXTERN void_pt TclX_HandleTblInit (const char *handleBase, +EXTERN void_pt TclX_HandleTblInit (CONST char *handleBase, int entrySize, int initEntries); @@ -161,7 +166,7 @@ EXTERN void TclX_WalkKeyToHandle (void_pt headerPtr, EXTERN void_pt TclX_HandleXlate (Tcl_Interp *interp, void_pt headerPtr, - const char *handle); + CONST char *handle); EXTERN void_pt TclX_HandleXlateObj (Tcl_Interp *interp, void_pt headerPtr, diff --git a/generic/tclXbsearch.c b/generic/tclXbsearch.c index 1d75d239..a2dc37b7 100644 --- a/generic/tclXbsearch.c +++ b/generic/tclXbsearch.c @@ -52,7 +52,7 @@ static int TclX_BsearchObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- * @@ -296,7 +296,7 @@ static int TclX_BsearchObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int status; binSearchCB_t searchCB; @@ -343,7 +343,7 @@ TclX_BsearchObjCmd (ClientData clientData, valPtr = Tcl_NewStringObj (Tcl_DStringValue (&searchCB.lineBuf), -1); if (Tcl_ObjSetVar2(interp, objv[3], NULL, valPtr, - TCL_LEAVE_ERR_MSG) == NULL) { + TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { Tcl_DecrRefCount (valPtr); goto errorExit; } diff --git a/generic/tclXchmod.c b/generic/tclXchmod.c index 5f7c5fd6..c85ea822 100644 --- a/generic/tclXchmod.c +++ b/generic/tclXchmod.c @@ -39,19 +39,19 @@ static int TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_ChownObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_ChgrpObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -306,7 +306,7 @@ ChmodFileIdObj (Tcl_Interp *interp, modeInfo_t modeInfo, Tcl_Obj *fileIdObj) *----------------------------------------------------------------------------- */ static int -TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) +TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { int objIdx, idx, fileObjc, fileIds, result; modeInfo_t modeInfo; @@ -367,7 +367,7 @@ TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * *----------------------------------------------------------------------------- */ static int -TclX_ChownObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) +TclX_ChownObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { int objIdx, ownerObjc, fileIds; Tcl_Obj **ownerObjv = NULL; @@ -451,7 +451,7 @@ TclX_ChownObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * *----------------------------------------------------------------------------- */ static int -TclX_ChgrpObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) +TclX_ChgrpObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { int objIdx, fileIds; char *fileIdsSwitch, *groupString; diff --git a/generic/tclXcmdloop.c b/generic/tclXcmdloop.c index 76f61a8d..d7ffc7c7 100644 --- a/generic/tclXcmdloop.c +++ b/generic/tclXcmdloop.c @@ -72,7 +72,7 @@ static int TclX_CommandloopObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- * IsSetVarCmd -- @@ -665,7 +665,7 @@ TclX_CommandLoop (Tcl_Interp *interp, *----------------------------------------------------------------------------- */ static int -TclX_CommandloopObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) +TclX_CommandloopObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { int options = 0, async = FALSE, argIdx, interactive; char *argStr, *endCommand = NULL; diff --git a/generic/tclXcoalesce.c b/generic/tclXcoalesce.c index 39622342..03986de3 100644 --- a/generic/tclXcoalesce.c +++ b/generic/tclXcoalesce.c @@ -29,7 +29,7 @@ *----------------------------------------------------------------------------- */ static int -TclX_CoalesceObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) +TclX_CoalesceObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { int i; Tcl_Obj *val; diff --git a/generic/tclXdebug.c b/generic/tclXdebug.c index f3b437a4..55d469c4 100644 --- a/generic/tclXdebug.c +++ b/generic/tclXdebug.c @@ -90,7 +90,7 @@ static int TclX_CmdtraceObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static void DebugCleanUp (ClientData clientData, @@ -387,7 +387,7 @@ static int TclX_CmdtraceObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { traceInfo_pt infoPtr = (traceInfo_pt) clientData; int idx; diff --git a/generic/tclXdup.c b/generic/tclXdup.c index 3f701cca..224c3fca 100644 --- a/generic/tclXdup.c +++ b/generic/tclXdup.c @@ -34,7 +34,7 @@ static int TclX_DupObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -75,7 +75,7 @@ DupChannelOptions (Tcl_Interp *interp, goto errorExit; } if ((optArgc % 2) != 0) { - Tcl_Panic("channel didn't return keyword/value pairs"); + panic("channel didn't return keyword/value pairs"); } for (idx = 0; idx < optArgc; idx += 2) { @@ -193,7 +193,7 @@ static int TclX_DupObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Channel newChannel; int bindFnum, fnum; diff --git a/generic/tclXfcntl.c b/generic/tclXfcntl.c index 6f4ad29c..070caa31 100644 --- a/generic/tclXfcntl.c +++ b/generic/tclXfcntl.c @@ -85,7 +85,7 @@ static int TclX_FcntlObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -204,7 +204,7 @@ GetFcntlAttr (Tcl_Interp *interp, Tcl_Channel channel, int mode, int attrib) return TCL_ERROR; break; default: - Tcl_Panic ("bug in fcntl get attrib"); + panic ("bug in fcntl get attrib"); value = 0; /* suppress compiler warning for initialized value */ } @@ -260,7 +260,7 @@ SetFcntlAttrObj (Tcl_Interp *interp, case ATTR_KEEPALIVE: return TclXOSsetsockopt (interp, channel, SO_KEEPALIVE, value); default: - Tcl_Panic ("buf in fcntl set attrib"); + panic ("buf in fcntl set attrib"); } return TCL_ERROR; /* Should never be reached */ } @@ -275,7 +275,7 @@ static int TclX_FcntlObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Channel channel; int mode; diff --git a/generic/tclXfilecmds.c b/generic/tclXfilecmds.c index dbf0ae22..ae2ca2b8 100644 --- a/generic/tclXfilecmds.c +++ b/generic/tclXfilecmds.c @@ -39,19 +39,19 @@ static int TclX_PipeObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_FtruncateObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_ReaddirObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -67,7 +67,7 @@ static int TclX_PipeObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Channel channels [2]; const char *channelNames [2]; @@ -87,12 +87,12 @@ TclX_PipeObjCmd (ClientData clientData, channelNames [1], (char *) NULL); } else { if (Tcl_ObjSetVar2(interp, objv[1], NULL, Tcl_NewStringObj(channelNames [0], -1), - TCL_LEAVE_ERR_MSG) == NULL) + TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) goto errorExit; if (Tcl_ObjSetVar2(interp, objv[2], NULL, Tcl_NewStringObj(channelNames [1], -1), - TCL_LEAVE_ERR_MSG) == NULL) + TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) goto errorExit; } @@ -160,7 +160,7 @@ static int TclX_FtruncateObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int objIdx, fileIds; off_t newSize; @@ -247,7 +247,7 @@ static int TclX_ReaddirObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_DString pathBuf; char *dirPath; diff --git a/generic/tclXfilescan.c b/generic/tclXfilescan.c index 4899dbf6..9316b0af 100644 --- a/generic/tclXfilescan.c +++ b/generic/tclXfilescan.c @@ -84,13 +84,13 @@ static int TclX_ScancontextObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_ScanmatchObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static void CopyFileCloseHandler (ClientData clientData); @@ -119,7 +119,7 @@ static int TclX_ScanfileObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static void FileScanCleanUp (ClientData clientData, @@ -331,7 +331,7 @@ static int TclX_ScancontextObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { char *subCommand; @@ -393,7 +393,7 @@ TclX_ScancontextObjCmd (ClientData clientData, static int TclX_ScanmatchObjCmd (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]) + int objc, Tcl_Obj *CONST objv[]) { scanContext_t *contextPtr, **tableEntryPtr; matchDef_t *newmatch; @@ -776,7 +776,7 @@ static int TclX_ScanfileObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { scanContext_t *contextPtr, **tableEntryPtr; Tcl_Obj *contextHandleObj, *fileHandleObj, *copyFileHandleObj; diff --git a/generic/tclXflock.c b/generic/tclXflock.c index 45df5d24..cd5be25e 100644 --- a/generic/tclXflock.c +++ b/generic/tclXflock.c @@ -25,7 +25,7 @@ static int ParseLockUnlockArgs (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[], + Tcl_Obj *CONST objv[], int argIdx, TclX_FlockInfo *lockInfoPtr); @@ -33,13 +33,13 @@ static int TclX_FlockObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_FunlockObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -66,7 +66,7 @@ TclX_FunlockObjCmd (ClientData clientData, static int ParseLockUnlockArgs (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[], + Tcl_Obj *CONST objv[], int argIdx, TclX_FlockInfo *lockInfoPtr) { @@ -124,7 +124,7 @@ static int TclX_FlockObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int argIdx; TclX_FlockInfo lockInfo; @@ -208,7 +208,7 @@ static int TclX_FunlockObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { TclX_FlockInfo lockInfo; diff --git a/generic/tclXfstat.c b/generic/tclXfstat.c index f5eddcd8..81dfaaf2 100644 --- a/generic/tclXfstat.c +++ b/generic/tclXfstat.c @@ -74,7 +74,7 @@ static int TclX_FstatObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -316,7 +316,7 @@ static int TclX_FstatObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Channel channel; struct stat statBuf; diff --git a/generic/tclXgeneral.c b/generic/tclXgeneral.c index 9afd7590..204619e4 100644 --- a/generic/tclXgeneral.c +++ b/generic/tclXgeneral.c @@ -33,19 +33,19 @@ static int TclX_EchoObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_InfoxObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_LoopObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int SetLoopCounter (Tcl_Interp *interp, @@ -59,7 +59,7 @@ static int TclX_Try_EvalObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -119,7 +119,7 @@ static int TclX_EchoObjCmd (ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int idx; Tcl_Channel channel; @@ -164,7 +164,7 @@ static int TclX_InfoxObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj *resultPtr = Tcl_GetObjResult (interp); char *optionPtr; @@ -321,7 +321,7 @@ SetLoopCounter (Tcl_Interp *interp, char *varName, int idx) { Tcl_Obj *iObj, *newVarObj; - iObj = Tcl_GetVar2Ex(interp, varName, NULL, 0); + iObj = Tcl_GetVar2Ex(interp, varName, NULL, TCL_PARSE_PART1); if ((iObj == NULL) || (Tcl_IsShared (iObj))) { iObj = newVarObj = Tcl_NewLongObj (idx); } else { @@ -330,7 +330,7 @@ SetLoopCounter (Tcl_Interp *interp, char *varName, int idx) Tcl_SetLongObj (iObj, idx); if (Tcl_SetVar2Ex(interp, varName, NULL, iObj, - TCL_LEAVE_ERR_MSG) == NULL) { + TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { if (newVarObj != NULL) { Tcl_DecrRefCount (newVarObj); } @@ -353,7 +353,7 @@ static int TclX_LoopObjCmd (ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int result = TCL_OK; long idx, first, limit, incr = 1; @@ -484,7 +484,7 @@ static int TclX_Try_EvalObjCmd (ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int code, code2; int haveFinally; diff --git a/generic/tclXhandles.c b/generic/tclXhandles.c index c1776f28..97c09ff9 100644 --- a/generic/tclXhandles.c +++ b/generic/tclXhandles.c @@ -102,12 +102,12 @@ AllocEntry (tblHeader_pt tblHdrPtr, static int HandleDecodeObj (Tcl_Interp *interp, tblHeader_pt tblHdrPtr, - const char *handle); + CONST char *handle); static int HandleDecode (Tcl_Interp *interp, tblHeader_pt tblHdrPtr, - const char *handle); + CONST char *handle); /*============================================================================= @@ -221,7 +221,7 @@ AllocEntry (tblHeader_pt tblHdrPtr, *----------------------------------------------------------------------------- */ static int -HandleDecode (Tcl_Interp *interp, tblHeader_pt tblHdrPtr, const char *handle) +HandleDecode (Tcl_Interp *interp, tblHeader_pt tblHdrPtr, CONST char *handle) { unsigned entryIdx; @@ -255,7 +255,7 @@ HandleDecode (Tcl_Interp *interp, tblHeader_pt tblHdrPtr, const char *handle) static int HandleDecodeObj (Tcl_Interp *interp, tblHeader_pt tblHdrPtr, - const char *handle) + CONST char *handle) { unsigned entryIdx; @@ -284,7 +284,7 @@ HandleDecodeObj (Tcl_Interp *interp, *----------------------------------------------------------------------------- */ void_pt -TclX_HandleTblInit (const char *handleBase, int entrySize, int initEntries) +TclX_HandleTblInit (CONST char *handleBase, int entrySize, int initEntries) { tblHeader_pt tblHdrPtr; int baseLength = strlen ((char *) handleBase); @@ -407,7 +407,7 @@ TclX_HandleAlloc (void_pt headerPtr, char *handlePtr) *----------------------------------------------------------------------------- */ void_pt -TclX_HandleXlate (Tcl_Interp *interp, void_pt headerPtr, const char *handle) +TclX_HandleXlate (Tcl_Interp *interp, void_pt headerPtr, CONST char *handle) { tblHeader_pt tblHdrPtr = (tblHeader_pt)headerPtr; entryHeader_pt entryHdrPtr; @@ -539,7 +539,7 @@ TclX_HandleFree (void_pt headerPtr, void_pt entryPtr) entryHdrPtr = HEADER_AREA (entryPtr); if (entryHdrPtr->freeLink != ALLOCATED_IDX) - Tcl_Panic ("Tcl_HandleFree: entry not allocated %x\n", entryHdrPtr); + panic ("Tcl_HandleFree: entry not allocated %x\n", entryHdrPtr); entryHdrPtr->freeLink = tblHdrPtr->freeHeadIdx; tblHdrPtr->freeHeadIdx = diff --git a/generic/tclXkeylist.c b/generic/tclXkeylist.c index 96055056..3a6f8f20 100644 --- a/generic/tclXkeylist.c +++ b/generic/tclXkeylist.c @@ -144,25 +144,25 @@ static int TclX_KeylgetObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_KeylsetObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_KeyldelObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_KeylkeysObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /* * Type definition. @@ -277,14 +277,14 @@ FreeKeyedListData (keylIntObj_t *keylIntPtr) Tcl_DecrRefCount(keylIntPtr->entries [idx].valuePtr); } if (keylIntPtr->entries != NULL) - ckfree ((void*) keylIntPtr->entries); + ckfree ((VOID*) keylIntPtr->entries); #ifndef NO_KEYLIST_HASH_TABLE if (keylIntPtr->hashTbl != NULL) { Tcl_DeleteHashTable(keylIntPtr->hashTbl); ckfree((char *) (keylIntPtr->hashTbl)); } #endif - ckfree ((void*) keylIntPtr); + ckfree ((VOID*) keylIntPtr); } /*----------------------------------------------------------------------------- @@ -311,7 +311,7 @@ EnsureKeyedListSpace (keylIntObj_t *keylIntPtr, int newNumEntries) ckalloc (newSize * sizeof (keylEntry_t)); } else { keylIntPtr->entries = (keylEntry_t *) - ckrealloc ((void *) keylIntPtr->entries, + ckrealloc ((VOID *) keylIntPtr->entries, newSize * sizeof (keylEntry_t)); } keylIntPtr->arraySize = newSize; @@ -518,7 +518,7 @@ DupKeyedListInternalRep (Tcl_Obj *srcPtr, Tcl_Obj *copyPtr) #endif } - copyPtr->internalRep.otherValuePtr = (void *) copyIntPtr; + copyPtr->internalRep.otherValuePtr = (VOID *) copyIntPtr; copyPtr->typePtr = &keyedListType; KEYL_REP_ASSERT (copyIntPtr); @@ -603,7 +603,7 @@ SetKeyedListFromAny (Tcl_Interp *interp, Tcl_Obj *objPtr) (objPtr->typePtr->freeIntRepProc != NULL)) { (*objPtr->typePtr->freeIntRepProc) (objPtr); } - objPtr->internalRep.otherValuePtr = (void *) keylIntPtr; + objPtr->internalRep.otherValuePtr = (VOID *) keylIntPtr; objPtr->typePtr = &keyedListType; KEYL_REP_ASSERT (keylIntPtr); @@ -660,7 +660,7 @@ UpdateStringOfKeyedList (Tcl_Obj *keylPtr) Tcl_DecrRefCount(tmpListObj); if (listObjv != staticListObjv) - ckfree ((void*) listObjv); + ckfree ((VOID*) listObjv); } /*----------------------------------------------------------------------------- @@ -677,7 +677,7 @@ TclX_NewKeyedListObj () Tcl_Obj *keylPtr = Tcl_NewObj (); keylIntObj_t *keylIntPtr = AllocKeyedListIntRep (); - keylPtr->internalRep.otherValuePtr = (void *) keylIntPtr; + keylPtr->internalRep.otherValuePtr = (VOID *) keylIntPtr; keylPtr->typePtr = &keyedListType; return keylPtr; } @@ -1006,7 +1006,7 @@ static int TclX_KeylgetObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj *keylPtr, *valuePtr; char *key; @@ -1084,7 +1084,7 @@ static int TclX_KeylsetObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj *keylVarPtr, *newVarObj; char *key; @@ -1143,7 +1143,7 @@ static int TclX_KeyldelObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj *keylVarPtr, *keylPtr; char *key; @@ -1204,7 +1204,7 @@ static int TclX_KeylkeysObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj *keylPtr, *listObjPtr; char *key; diff --git a/generic/tclXlgets.c b/generic/tclXlgets.c index 409e15f8..e615484e 100644 --- a/generic/tclXlgets.c +++ b/generic/tclXlgets.c @@ -57,7 +57,7 @@ static int TclX_LgetsObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -408,7 +408,7 @@ static int TclX_LgetsObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Channel channel; ReadData readData; @@ -469,7 +469,7 @@ TclX_LgetsObjCmd (ClientData clientData, int resultLen; if (Tcl_ObjSetVar2(interp, objv[2], NULL, dataObj, - TCL_LEAVE_ERR_MSG) == NULL) { + TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { goto errorExit; } @@ -511,7 +511,7 @@ TclX_LgetsObjCmd (ClientData clientData, * FIX: Need functions to save/restore error state. */ if (Tcl_ObjSetVar2(interp, objv[2], NULL, dataObj, - TCL_LEAVE_ERR_MSG) != NULL) { + TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) != NULL) { Tcl_SetObjResult (interp, saveResult); /* Restore old message */ } Tcl_DecrRefCount (saveResult); diff --git a/generic/tclXlib.c b/generic/tclXlib.c index 9fe4dad0..0903fe04 100644 --- a/generic/tclXlib.c +++ b/generic/tclXlib.c @@ -127,19 +127,19 @@ static int TclX_load_tndxsObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_Auto_load_pkgObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_LoadlibindexObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -855,7 +855,7 @@ static int TclX_load_tndxsObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { char *dirname; @@ -879,7 +879,7 @@ static int TclX_Auto_load_pkgObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { char *fileName; off_t offset; @@ -915,7 +915,7 @@ static int TclX_LoadlibindexObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { char *pathName; Tcl_DString pathNameBuf; diff --git a/generic/tclXlist.c b/generic/tclXlist.c index 3f1c0a87..ab5d0e9a 100644 --- a/generic/tclXlist.c +++ b/generic/tclXlist.c @@ -26,43 +26,43 @@ static int TclX_LvarcatObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_LvarpopObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_LvarpushObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_LemptyObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_LassignObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_LmatchObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_LcontainObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -75,7 +75,7 @@ static int TclX_LvarcatObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj *varObjPtr, *newObjPtr; int catObjc, idx, argIdx; @@ -92,7 +92,7 @@ TclX_LvarcatObjCmd (ClientData clientData, * Get the variable that we are going to update. Include it if it * exists. */ - varObjPtr = Tcl_GetVar2Ex(interp, varName, NULL, 0); + varObjPtr = Tcl_GetVar2Ex(interp, varName, NULL, TCL_PARSE_PART1); if (varObjPtr != NULL) { catObjc = objc - 1; @@ -120,7 +120,7 @@ TclX_LvarcatObjCmd (ClientData clientData, ckfree ((char *) catObjv); if (Tcl_SetVar2Ex(interp, varName, NULL, newObjPtr, - TCL_LEAVE_ERR_MSG) == NULL) { + TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { Tcl_DecrRefCount (newObjPtr); return TCL_ERROR; } @@ -138,7 +138,7 @@ static int TclX_LvarpopObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj *listVarPtr, *newVarObj, *returnElemPtr = NULL; int listIdx, listLen; @@ -150,7 +150,7 @@ TclX_LvarpopObjCmd (ClientData clientData, varName = Tcl_GetStringFromObj (objv [1], NULL); listVarPtr = Tcl_GetVar2Ex(interp, varName, NULL, - TCL_LEAVE_ERR_MSG); + TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG); if (listVarPtr == NULL) { return TCL_ERROR; } @@ -201,7 +201,7 @@ TclX_LvarpopObjCmd (ClientData clientData, * Update variable. */ if (Tcl_SetVar2Ex(interp, varName, NULL, listVarPtr, - TCL_LEAVE_ERR_MSG) == NULL) { + TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { goto errorExit; } @@ -233,7 +233,7 @@ static int TclX_LvarpushObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj *listVarPtr, *newVarObj; int listIdx, listLen; @@ -244,7 +244,7 @@ TclX_LvarpushObjCmd (ClientData clientData, } varName = Tcl_GetStringFromObj (objv [1], NULL); - listVarPtr = Tcl_GetVar2Ex(interp, varName, NULL, 0); + listVarPtr = Tcl_GetVar2Ex(interp, varName, NULL, TCL_PARSE_PART1); if ((listVarPtr == NULL) || (Tcl_IsShared (listVarPtr))) { if (listVarPtr == NULL) { listVarPtr = Tcl_NewListObj (0, NULL); @@ -282,7 +282,7 @@ TclX_LvarpushObjCmd (ClientData clientData, goto errorExit; if (Tcl_SetVar2Ex(interp, varName, NULL, listVarPtr, - TCL_LEAVE_ERR_MSG) == NULL) { + TCL_PARSE_PART1| TCL_LEAVE_ERR_MSG) == NULL) { goto errorExit; } return TCL_OK; @@ -304,7 +304,7 @@ static int TclX_LemptyObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int length; @@ -343,7 +343,7 @@ static int TclX_LassignObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int listObjc, listIdx, idx, remaining; Tcl_Obj **listObjv, *elemPtr, *remainingObjPtr; @@ -372,7 +372,7 @@ TclX_LassignObjCmd (ClientData clientData, elemPtr = nullObjPtr; } if (Tcl_SetVar2Ex(interp, Tcl_GetStringFromObj(objv [idx], NULL), NULL, - elemPtr, TCL_LEAVE_ERR_MSG) == NULL) + elemPtr, TCL_PARSE_PART1 | TCL_LEAVE_ERR_MSG) == NULL) goto error_exit; } @@ -405,7 +405,7 @@ static int TclX_LmatchObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { #define EXACT 0 #define GLOB 1 @@ -502,7 +502,7 @@ static int TclX_LcontainObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int listObjc, idx; Tcl_Obj **listObjv; diff --git a/generic/tclXmath.c b/generic/tclXmath.c index b6dbd8da..6777ae6e 100644 --- a/generic/tclXmath.c +++ b/generic/tclXmath.c @@ -56,17 +56,17 @@ static long ReallyRandom (long my_range); static int TclX_MaxObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_MinObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_RandomObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -121,7 +121,7 @@ static int ConvertIntOrDoubleObj (Tcl_Interp *interp, static int TclX_MaxObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { double value, maxValue = -MAXDOUBLE; int idx, maxIdx = 1; @@ -153,7 +153,7 @@ static int TclX_MaxObjCmd (ClientData clientData, static int TclX_MinObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { double value, minValue = MAXDOUBLE; int idx, minIdx = 1; @@ -205,7 +205,7 @@ ReallyRandom (long myRange) static int TclX_RandomObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { long range; char *seedString; diff --git a/generic/tclXmsgcat.c b/generic/tclXmsgcat.c index e081b6ce..f7a337b6 100644 --- a/generic/tclXmsgcat.c +++ b/generic/tclXmsgcat.c @@ -36,25 +36,25 @@ ParseFailOptionObj (Tcl_Interp *interp, static int CatOpFailedObj (Tcl_Interp *interp, - const char *errorMsg); + CONST char *errorMsg); static int TclX_CatopenObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_CatgetsObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_CatcloseObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static void MsgCatCleanUp (ClientData clientData, @@ -147,7 +147,7 @@ ParseFailOptionObj (Tcl_Interp *interp, */ static int CatOpFailedObj (Tcl_Interp *interp, - const char *errorMsg) + CONST char *errorMsg) { #ifndef NO_CATGETS TclX_AppendObjResult (interp, errorMsg, (char *) NULL); @@ -172,7 +172,7 @@ static int TclX_CatopenObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int fail; nl_catd catDesc; @@ -212,7 +212,7 @@ static int TclX_CatgetsObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { nl_catd *catDescPtr; int msgSetNum, msgNum; @@ -267,7 +267,7 @@ static int TclX_CatcloseObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int fail; nl_catd *catDescPtr; diff --git a/generic/tclXoscmds.c b/generic/tclXoscmds.c index 83c6f22e..5d242792 100644 --- a/generic/tclXoscmds.c +++ b/generic/tclXoscmds.c @@ -23,43 +23,43 @@ static int TclX_AlarmObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_LinkObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_NiceObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_SleepObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_SyncObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_SystemObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_UmaskObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -76,7 +76,7 @@ static int TclX_AlarmObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { double seconds; @@ -106,7 +106,7 @@ static int TclX_LinkObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { char *srcPath, *destPath; Tcl_DString srcPathBuf, destPathBuf; @@ -175,7 +175,7 @@ static int TclX_NiceObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj *resultPtr = Tcl_GetObjResult (interp); int priorityIncr, priority; @@ -224,7 +224,7 @@ static int TclX_SleepObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { double time; @@ -252,7 +252,7 @@ static int TclX_SyncObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Channel channel; @@ -286,7 +286,7 @@ static int TclX_SystemObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj *cmdObjPtr; char *cmdStr; @@ -321,7 +321,7 @@ static int TclX_UmaskObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int mask; char *umaskString; diff --git a/generic/tclXprocess.c b/generic/tclXprocess.c index 7940c315..c81ab199 100644 --- a/generic/tclXprocess.c +++ b/generic/tclXprocess.c @@ -32,19 +32,19 @@ static int TclX_ExeclObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_ForkObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_WaitObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -57,7 +57,7 @@ static int TclX_ForkObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { if (objc != 1) return TclX_WrongArgs (interp, objv [0], ""); @@ -75,7 +75,7 @@ static int TclX_ExeclObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { #define STATIC_ARG_SIZE 12 char *staticArgv [STATIC_ARG_SIZE]; @@ -163,7 +163,7 @@ static int TclX_WaitObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int idx, options = 0, pgroup = FALSE; char *argStr; diff --git a/generic/tclXprofile.c b/generic/tclXprofile.c index cff25a88..9143a664 100644 --- a/generic/tclXprofile.c +++ b/generic/tclXprofile.c @@ -83,7 +83,7 @@ typedef struct profInfo_t { } profInfo_t; /* - * Argument to Tcl_Panic on logic errors. Takes an id number. + * Argument to panic on logic errors. Takes an id number. */ static const char *PROF_PANIC = "TclX profile bug id = %d\n"; @@ -126,7 +126,7 @@ static int ProfObjCommandEval (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static Tcl_CmdObjTraceProc ProfTraceRoutine; @@ -154,7 +154,7 @@ static int TclX_ProfileObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static void ProfMonCleanUp (ClientData clientData, @@ -228,7 +228,7 @@ PushEntry (profInfo_t *infoPtr, * Only global level can be NULL. */ if (scanPtr == NULL) - Tcl_Panic (PROF_PANIC, 1); + panic (PROF_PANIC, 1); } entryPtr->prevScopePtr = scanPtr; infoPtr->scopeChainPtr = entryPtr; @@ -434,7 +434,7 @@ ProfCommandEvalSetup (profInfo_t *infoPtr, int *isProcPtr) UpdateTOSTimes (infoPtr); do { if (infoPtr->stackPtr->evalLevel != UNKNOWN_LEVEL) - Tcl_Panic (PROF_PANIC, 2); /* Not an initial entry */ + panic (PROF_PANIC, 2); /* Not an initial entry */ PopEntry (infoPtr); } while (infoPtr->stackPtr->procLevel > procLevel); } @@ -535,7 +535,7 @@ static int ProfObjCommandEval (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { profInfo_t *infoPtr = (profInfo_t *) clientData; int isProc, result; @@ -562,14 +562,14 @@ ProfTraceRoutine (ClientData clientData, const char *command, Tcl_Command cmd, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { /* struct Tcl_Obj * const *objv; */ profInfo_t *infoPtr = (profInfo_t *) clientData; Tcl_CmdInfo cmdInfo; if (cmd == NULL) - Tcl_Panic (PROF_PANIC, 4); + panic (PROF_PANIC, 4); //TIP #571: We don' want to profile the tailcall itself. As it can only be called in a procedure/lambda context if ( ! strcmp((*objv)->bytes, "tailcall") ) { @@ -701,7 +701,7 @@ TurnOnProfiling (profInfo_t *infoPtr, int commandMode, int evalMode) * Only global level can be NULL. */ if (scanPtr == NULL) - Tcl_Panic (PROF_PANIC, 6); + panic (PROF_PANIC, 6); } infoPtr->scopeChainPtr = scanPtr; @@ -802,7 +802,7 @@ static int TclX_ProfileObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { profInfo_t *infoPtr = (profInfo_t *) clientData; int argIdx; diff --git a/generic/tclXselect.c b/generic/tclXselect.c index 541c0574..137c552d 100644 --- a/generic/tclXselect.c +++ b/generic/tclXselect.c @@ -80,7 +80,7 @@ static int TclX_SelectObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -275,7 +275,7 @@ static int TclX_SelectObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { static int chanAccess [] = {TCL_READABLE, TCL_WRITABLE, 0}; int idx; @@ -406,7 +406,7 @@ TclX_SelectObjCmd (clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; - Tcl_Obj *const objv[] + Tcl_Obj *CONST objv[] { Tcl_AppendResult(interp, Tcl_GetString(objv[0]), " is not available on this OS", (char *) NULL); diff --git a/generic/tclXsignal.c b/generic/tclXsignal.c index a3fae74f..385601ae 100644 --- a/generic/tclXsignal.c +++ b/generic/tclXsignal.c @@ -52,7 +52,7 @@ * Value returned by Tcl_SignalId when an invalid signal is passed in. * Pointer is used as a quick check of a valid signal number. */ -static const char *unknownSignalIdMsg; +static CONST char *unknownSignalIdMsg; /* * Signal name table maps name to number. Note, it is possible to have @@ -327,13 +327,13 @@ static int TclX_SignalObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_KillObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -631,11 +631,11 @@ SignalTrap (int signalNum) #ifdef SIGCHLD if (signalNum != SIGCHLD) { if (SetSignalState (signalNum, SignalTrap, FALSE) == TCL_ERROR) - Tcl_Panic ("SignalTrap bug"); + panic ("SignalTrap bug"); } #else if (SetSignalState (signalNum, SignalTrap, FALSE) == TCL_ERROR) - Tcl_Panic ("SignalTrap bug"); + panic ("SignalTrap bug"); #endif /* SIGCHLD */ #endif /* NO_SIGACTION */ } @@ -1311,7 +1311,7 @@ static int TclX_SignalObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { unsigned char signals [MAXSIG]; char *argStr, *actionStr; @@ -1451,7 +1451,7 @@ static int TclX_KillObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int signalNum, nextArg, idx, procId, procObjc; int pgroup = FALSE; @@ -1540,7 +1540,7 @@ SignalCmdCleanUp (ClientData clientData, Tcl_Interp *interp) break; } if (idx == numInterps) - Tcl_Panic ("signal interp lost"); + panic ("signal interp lost"); interpTable [idx] = interpTable [--numInterps]; diff --git a/generic/tclXsocket.c b/generic/tclXsocket.c index 7a58b79f..019c92f2 100644 --- a/generic/tclXsocket.c +++ b/generic/tclXsocket.c @@ -28,13 +28,13 @@ ReturnGetHostError (Tcl_Interp *interp, static struct hostent * InfoGetHost (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_HostInfoObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -106,7 +106,7 @@ TclXGetHostInfo (Tcl_Interp *interp, Tcl_Channel channel, int remoteHost) { struct sockaddr_in sockaddr; struct hostent *hostEntry; - const char *hostName; + CONST char *hostName; Tcl_Obj *listObjv [3]; if (remoteHost) { @@ -150,7 +150,7 @@ TclXGetHostInfo (Tcl_Interp *interp, Tcl_Channel channel, int remoteHost) *----------------------------------------------------------------------------- */ static struct hostent * -InfoGetHost (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) +InfoGetHost (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { struct hostent *hostEntry; struct in_addr address; @@ -194,7 +194,7 @@ static int TclX_HostInfoObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { struct hostent *hostEntry; struct in_addr inAddr; @@ -215,8 +215,8 @@ TclX_HostInfoObjCmd (ClientData clientData, return TCL_ERROR; for (idx = 0; hostEntry->h_addr_list [idx] != NULL; idx++) { - bcopy ((void *) hostEntry->h_addr_list [idx], - (void *) &inAddr, + bcopy ((VOID *) hostEntry->h_addr_list [idx], + (VOID *) &inAddr, hostEntry->h_length); listObj = Tcl_NewStringObj (inet_ntoa (inAddr), -1); @@ -231,8 +231,8 @@ TclX_HostInfoObjCmd (ClientData clientData, return TCL_ERROR; for (idx = 0; hostEntry->h_addr_list [idx] != NULL; idx++) { - bcopy ((void *) hostEntry->h_addr_list [idx], - (void *) &inAddr, + bcopy ((VOID *) hostEntry->h_addr_list [idx], + (VOID *) &inAddr, hostEntry->h_length); listObj = Tcl_NewStringObj ((char *) hostEntry->h_name, -1); Tcl_ListObjAppendElement (interp, resultPtr, listObj); diff --git a/generic/tclXstring.c b/generic/tclXstring.c index bd99352a..2c421693 100644 --- a/generic/tclXstring.c +++ b/generic/tclXstring.c @@ -40,61 +40,61 @@ static int TclX_CindexObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_ClengthObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_CconcatObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_CrangeObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_CcollateObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_ReplicateObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_TranslitObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_CtypeObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_CtokenObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_CequalObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -110,7 +110,7 @@ static int TclX_CindexObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int strLen, utfLen, idx, numBytes; char *str, buf [TCL_UTF_MAX]; @@ -147,7 +147,7 @@ static int TclX_ClengthObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { char *str; int strLen; @@ -174,7 +174,7 @@ static int TclX_CconcatObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj *resultPtr = Tcl_GetObjResult(interp); int idx, strLen; @@ -203,7 +203,7 @@ static int TclX_CrangeObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int strLen, utfLen, first, subLen; size_t isRange = (size_t) clientData; @@ -262,7 +262,7 @@ static int TclX_CcollateObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int argIndex, result, local = FALSE; char *optionString; @@ -323,7 +323,7 @@ static int TclX_ReplicateObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj *resultPtr = Tcl_GetObjResult (interp); long count; @@ -359,7 +359,7 @@ static int TclX_CtokenObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { Tcl_Obj* stringVarObj; char* string; @@ -379,7 +379,7 @@ TclX_CtokenObjCmd (ClientData clientData, } stringVarObj = Tcl_ObjGetVar2(interp, objv[1], NULL, - TCL_LEAVE_ERR_MSG); + TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1); if (stringVarObj == NULL) { return TCL_ERROR; } @@ -416,7 +416,7 @@ TclX_CtokenObjCmd (ClientData clientData, strByteLen-strByteIdx); if (Tcl_SetVar2Ex(interp, Tcl_GetStringFromObj(objv[1], NULL), NULL, newVarValueObj, - TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1) == NULL) { Tcl_DStringFree (&token); Tcl_DecrRefCount (newVarValueObj); return TCL_ERROR; @@ -439,7 +439,7 @@ static int TclX_CequalObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { char *string1Ptr; int string1Len; @@ -537,7 +537,7 @@ static int TclX_TranslitObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { unsigned char from [MAX_EXPANSION+1]; int fromLen; @@ -652,7 +652,7 @@ static int TclX_CtypeObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { int failIndex = FALSE; char *optStr, *class, *charStr; @@ -666,7 +666,7 @@ TclX_CtypeObjCmd (ClientData clientData, #define IS_8BIT_UNICHAR(c) (c <= 255) if (TCL_UTF_MAX > sizeof(number)) { - Tcl_Panic("TclX_CtypeObjCmd: UTF character longer than a int"); + panic("TclX_CtypeObjCmd: UTF character longer than a int"); } /*FIX: Split into multiple procs */ @@ -853,7 +853,7 @@ TclX_CtypeObjCmd (ClientData clientData, Tcl_Obj *iObj = Tcl_NewIntObj (idx); if (Tcl_SetVar2Ex(interp, failVar, NULL, - iObj, TCL_LEAVE_ERR_MSG) == NULL) { + iObj, TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1) == NULL) { Tcl_DecrRefCount (iObj); return TCL_ERROR; } diff --git a/generic/tclXutil.c b/generic/tclXutil.c index 0cb57054..17b82e30 100644 --- a/generic/tclXutil.c +++ b/generic/tclXutil.c @@ -58,7 +58,7 @@ char *tclXWrongArgs = "wrong # args: "; *----------------------------------------------------------------------------- */ int -TclX_StrToInt (const char *string, int base, int *intPtr) +TclX_StrToInt (CONST char *string, int base, int *intPtr) { char *end, *p; int i; @@ -115,7 +115,7 @@ TclX_StrToInt (const char *string, int base, int *intPtr) *----------------------------------------------------------------------------- */ int -TclX_StrToUnsigned (const char *string, int base, unsigned *unsignedPtr) +TclX_StrToUnsigned (CONST char *string, int base, unsigned *unsignedPtr) { char *end, *p; unsigned i; @@ -158,7 +158,7 @@ TclX_StrToUnsigned (const char *string, int base, unsigned *unsignedPtr) *----------------------------------------------------------------------------- */ int -TclX_StrToOffset (const char *string, int base, off_t *offsetPtr) +TclX_StrToOffset (CONST char *string, int base, off_t *offsetPtr) { char *end, *p; off_t i; @@ -217,7 +217,7 @@ TclX_StrToOffset (const char *string, int base, off_t *offsetPtr) *----------------------------------------------------------------------------- */ char * -TclX_DownShift (char *targetStr, const char *sourceStr) +TclX_DownShift (char *targetStr, CONST char *sourceStr) { register char theChar; @@ -252,7 +252,7 @@ TclX_DownShift (char *targetStr, const char *sourceStr) *----------------------------------------------------------------------------- */ char * -TclX_UpShift (char *targetStr, const char *sourceStr) +TclX_UpShift (char *targetStr, CONST char *sourceStr) { register char theChar; @@ -476,7 +476,7 @@ ParseTranslationOption (char *strValue) } else if (STREQU (strValue, "platform")) { return TCLX_TRANSLATE_PLATFORM; } - Tcl_Panic ("ParseTranslationOption bug"); + panic ("ParseTranslationOption bug"); return TCL_ERROR; /* Not reached */ } @@ -507,7 +507,7 @@ FormatTranslationOption (int value) case TCLX_TRANSLATE_PLATFORM: return "platform"; default: - Tcl_Panic ("FormatTranslationOption bug"); + panic ("FormatTranslationOption bug"); } return NULL; /* Not reached */ } @@ -620,7 +620,7 @@ TclX_GetChannelOption (Tcl_Interp *interp, return TCL_OK; fatalError: - Tcl_Panic ("TclX_GetChannelOption bug"); /* FIX: return error. */ + panic ("TclX_GetChannelOption bug"); /* FIX: return error. */ return 0; /* Not reached */ } @@ -715,7 +715,7 @@ TclX_SetChannelOption (Tcl_Interp *interp, return Tcl_SetChannelOption (interp, channel, strOption, strValue); fatalError: - Tcl_Panic ("TclX_SetChannelOption bug"); + panic ("TclX_SetChannelOption bug"); return TCL_ERROR; /* Not reached */ } @@ -924,7 +924,7 @@ TclX_RestoreResultErrorInfo (Tcl_Interp *interp, Tcl_Obj *saveObjPtr) /* * This should never happen */ - Tcl_Panic ("invalid TclX result save object"); + panic ("invalid TclX result save object"); } Tcl_SetVar2Ex(interp, ERRORCODE, NULL, saveObjv[2], TCL_GLOBAL_ONLY); diff --git a/unix/tclXchannelfd.c b/unix/tclXchannelfd.c index b4fe5209..0efb75dd 100644 --- a/unix/tclXchannelfd.c +++ b/unix/tclXchannelfd.c @@ -60,7 +60,7 @@ ChannelToFd (Tcl_Channel channel, } static int -TclX_ChannelFdObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) +TclX_ChannelFdObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) { const char *channelName; Tcl_Channel channel; diff --git a/unix/tclXunixCmds.c b/unix/tclXunixCmds.c index b0088e65..47c34c7a 100644 --- a/unix/tclXunixCmds.c +++ b/unix/tclXunixCmds.c @@ -23,13 +23,13 @@ static int TclX_ChrootObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_TimesObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -46,7 +46,7 @@ static int TclX_ChrootObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { char *chrootString; int chrootStrLen; @@ -79,7 +79,7 @@ static int TclX_TimesObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { struct tms tm; char timesBuf [48]; diff --git a/unix/tclXunixId.c b/unix/tclXunixId.c index 00f70e18..8fcf59b3 100644 --- a/unix/tclXunixId.c +++ b/unix/tclXunixId.c @@ -56,58 +56,58 @@ GroupnameToGroupidResult (Tcl_Interp *interp, static int IdConvert (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int IdEffective (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int IdProcess (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int IdGroupids (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[], + Tcl_Obj *CONST objv[], int symbolic); static int IdHost (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int GetSetWrongArgs (Tcl_Interp *interp, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int IdUser (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int IdUserId (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int IdGroup (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int IdGroupId (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_IdObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- * TclX_IdObjCmd -- @@ -231,7 +231,7 @@ GroupnameToGroupidResult (Tcl_Interp *interp, char *groupName) * id convert type value */ static int -IdConvert (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) +IdConvert (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { long uid; long gid; @@ -272,7 +272,7 @@ IdConvert (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) * id effective type */ static int -IdEffective (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) +IdEffective (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { char *subCommand; @@ -307,7 +307,7 @@ IdEffective (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) * id process ?parent|group? ?set? */ static int -IdProcess (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) +IdProcess (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { pid_t pid; char *subCommand; @@ -368,7 +368,7 @@ IdProcess (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) * id groups */ static int -IdGroupids (Tcl_Interp *interp, int objc, Tcl_Obj*const objv[], int symbolic) +IdGroupids (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[], int symbolic) { #ifndef NO_GETGROUPS gid_t *groups; @@ -436,7 +436,7 @@ IdGroupids (Tcl_Interp *interp, int objc, Tcl_Obj*const objv[], int symbolic) * id host */ static int -IdHost (Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) +IdHost (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) { #ifndef NO_GETHOSTNAME #ifndef MAXHOSTNAMELEN @@ -466,7 +466,7 @@ IdHost (Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) * Return error when a get set function has too many args (2 or 3 expected). */ static int -GetSetWrongArgs (Tcl_Interp *interp, Tcl_Obj*const objv[]) +GetSetWrongArgs (Tcl_Interp *interp, Tcl_Obj*CONST objv[]) { return TclX_WrongArgs (interp, objv [0], "arg ?value?"); } @@ -475,7 +475,7 @@ GetSetWrongArgs (Tcl_Interp *interp, Tcl_Obj*const objv[]) * id user */ static int -IdUser (Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) +IdUser (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) { struct passwd *pw; char *user; @@ -511,7 +511,7 @@ IdUser (Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) * id userid */ static int -IdUserId (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) +IdUserId (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { int uid; @@ -538,7 +538,7 @@ IdUserId (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) * id group */ static int -IdGroup (Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) +IdGroup (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) { struct group *grp; char *groupName; @@ -574,7 +574,7 @@ IdGroup (Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) * id groupid */ static int -IdGroupId (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) +IdGroupId (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { int gid; @@ -598,7 +598,7 @@ IdGroupId (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) } static int -TclX_IdObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj*const objv[]) +TclX_IdObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) { char *subCommand; diff --git a/unix/tclXunixPort.h b/unix/tclXunixPort.h index 12ac02cc..d5526a10 100644 --- a/unix/tclXunixPort.h +++ b/unix/tclXunixPort.h @@ -38,7 +38,7 @@ extern int h_errno; #endif #ifdef __APPLE__ -# undef Tcl_Panic +# undef panic #endif /* diff --git a/unix/tclXunixSock.c b/unix/tclXunixSock.c index a1a0ccde..826abbf9 100644 --- a/unix/tclXunixSock.c +++ b/unix/tclXunixSock.c @@ -142,7 +142,7 @@ TclX_ServerCreateCmd (ClientData clientData, /* * Parse arguments. */ - bzero ((void *) &local, sizeof (local)); + bzero ((VOID *) &local, sizeof (local)); local.sin_family = AF_INET; local.sin_addr.s_addr = INADDR_ANY; nextArg = 1; @@ -298,7 +298,7 @@ TclX_ServerAcceptCmd (ClientData clientData, /* * Accept a socket connection on the socket created by server_create. */ - bzero ((void *) &connectSocket, sizeof (connectSocket)); + bzero ((VOID *) &connectSocket, sizeof (connectSocket)); channel = TclX_GetOpenChannel (interp, argv [nextArg], 0); if (channel == NULL) diff --git a/win/tclXwinCmds.c b/win/tclXwinCmds.c index 99465394..d61cfdb4 100644 --- a/win/tclXwinCmds.c +++ b/win/tclXwinCmds.c @@ -23,13 +23,13 @@ static int TclX_ChrootObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_TimesObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- @@ -41,7 +41,7 @@ static int TclX_ChrootObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { return TclXNotAvailableObjError (interp, objv [0]); } @@ -55,7 +55,7 @@ static int TclX_TimesObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]) + Tcl_Obj *CONST objv[]) { return TclXNotAvailableObjError (interp, objv [0]); } diff --git a/win/tclXwinId.c b/win/tclXwinId.c index f99b934f..7214fdd5 100644 --- a/win/tclXwinId.c +++ b/win/tclXwinId.c @@ -24,18 +24,18 @@ static int IdProcess (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int IdHost (Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); static int TclX_IdObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); + Tcl_Obj *CONST objv[]); /*----------------------------------------------------------------------------- * Tcl_IdCmd -- @@ -57,7 +57,7 @@ static int IdProcess (interp, objc, objv) Tcl_Interp *interp; int objc; - Tcl_Obj *const objv[]; + Tcl_Obj *CONST objv[]; { Tcl_Obj *resultPtr = Tcl_GetObjResult (interp); @@ -77,7 +77,7 @@ static int IdHost (interp, objc, objv) Tcl_Interp *interp; int objc; - Tcl_Obj *const objv[]; + Tcl_Obj *CONST objv[]; { char hostName [TCL_RESULT_SIZE]; @@ -100,7 +100,7 @@ TclX_IdObjCmd (clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; - Tcl_Obj *const objv[]; + Tcl_Obj *CONST objv[]; { char *optionPtr; diff --git a/win/tclXwinOS.c b/win/tclXwinOS.c index b73fb49a..6ee39ac0 100644 --- a/win/tclXwinOS.c +++ b/win/tclXwinOS.c @@ -1483,7 +1483,7 @@ LockUnlockSetup (Tcl_Interp *interp, case TCLX_WIN_CONSOLE: break; /* FIX: Is this legal?? */ default: - Tcl_Panic ("unknown win channel type %d\n", type); + panic ("unknown win channel type %d\n", type); } /* From aca772db7b8bdd9198d28bdaf3a170aa5d8b0efb Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Wed, 13 May 2020 20:39:44 +0200 Subject: [PATCH 07/19] Remove deprecated and remove macro: TCL_PARSE_PART1 --- generic/tclExtend.h | 1 - generic/tclXbsearch.c | 2 +- generic/tclXfilecmds.c | 4 ++-- generic/tclXgeneral.c | 4 ++-- generic/tclXlgets.c | 4 ++-- generic/tclXlist.c | 14 +++++++------- generic/tclXstring.c | 6 +++--- 7 files changed, 17 insertions(+), 18 deletions(-) diff --git a/generic/tclExtend.h b/generic/tclExtend.h index ea2a9dd1..fbd0374a 100644 --- a/generic/tclExtend.h +++ b/generic/tclExtend.h @@ -53,7 +53,6 @@ typedef void *void_pt; #define TCLX_CMDL_EXIT_ON_EOF (1<<1) #define CONST const -#define TCL_PARSE_PART1 0 #define VOID void #define panic Tcl_Panic diff --git a/generic/tclXbsearch.c b/generic/tclXbsearch.c index a2dc37b7..3b70c9e6 100644 --- a/generic/tclXbsearch.c +++ b/generic/tclXbsearch.c @@ -343,7 +343,7 @@ TclX_BsearchObjCmd (ClientData clientData, valPtr = Tcl_NewStringObj (Tcl_DStringValue (&searchCB.lineBuf), -1); if (Tcl_ObjSetVar2(interp, objv[3], NULL, valPtr, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { Tcl_DecrRefCount (valPtr); goto errorExit; } diff --git a/generic/tclXfilecmds.c b/generic/tclXfilecmds.c index ae2ca2b8..366d1d51 100644 --- a/generic/tclXfilecmds.c +++ b/generic/tclXfilecmds.c @@ -87,12 +87,12 @@ TclX_PipeObjCmd (ClientData clientData, channelNames [1], (char *) NULL); } else { if (Tcl_ObjSetVar2(interp, objv[1], NULL, Tcl_NewStringObj(channelNames [0], -1), - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) + TCL_LEAVE_ERR_MSG) == NULL) goto errorExit; if (Tcl_ObjSetVar2(interp, objv[2], NULL, Tcl_NewStringObj(channelNames [1], -1), - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) + TCL_LEAVE_ERR_MSG) == NULL) goto errorExit; } diff --git a/generic/tclXgeneral.c b/generic/tclXgeneral.c index 204619e4..a00e276b 100644 --- a/generic/tclXgeneral.c +++ b/generic/tclXgeneral.c @@ -321,7 +321,7 @@ SetLoopCounter (Tcl_Interp *interp, char *varName, int idx) { Tcl_Obj *iObj, *newVarObj; - iObj = Tcl_GetVar2Ex(interp, varName, NULL, TCL_PARSE_PART1); + iObj = Tcl_GetVar2Ex(interp, varName, NULL, 0); if ((iObj == NULL) || (Tcl_IsShared (iObj))) { iObj = newVarObj = Tcl_NewLongObj (idx); } else { @@ -330,7 +330,7 @@ SetLoopCounter (Tcl_Interp *interp, char *varName, int idx) Tcl_SetLongObj (iObj, idx); if (Tcl_SetVar2Ex(interp, varName, NULL, iObj, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { if (newVarObj != NULL) { Tcl_DecrRefCount (newVarObj); } diff --git a/generic/tclXlgets.c b/generic/tclXlgets.c index e615484e..caf7ea0d 100644 --- a/generic/tclXlgets.c +++ b/generic/tclXlgets.c @@ -469,7 +469,7 @@ TclX_LgetsObjCmd (ClientData clientData, int resultLen; if (Tcl_ObjSetVar2(interp, objv[2], NULL, dataObj, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { goto errorExit; } @@ -511,7 +511,7 @@ TclX_LgetsObjCmd (ClientData clientData, * FIX: Need functions to save/restore error state. */ if (Tcl_ObjSetVar2(interp, objv[2], NULL, dataObj, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) != NULL) { + TCL_LEAVE_ERR_MSG) != NULL) { Tcl_SetObjResult (interp, saveResult); /* Restore old message */ } Tcl_DecrRefCount (saveResult); diff --git a/generic/tclXlist.c b/generic/tclXlist.c index ab5d0e9a..37848e74 100644 --- a/generic/tclXlist.c +++ b/generic/tclXlist.c @@ -92,7 +92,7 @@ TclX_LvarcatObjCmd (ClientData clientData, * Get the variable that we are going to update. Include it if it * exists. */ - varObjPtr = Tcl_GetVar2Ex(interp, varName, NULL, TCL_PARSE_PART1); + varObjPtr = Tcl_GetVar2Ex(interp, varName, NULL, 0); if (varObjPtr != NULL) { catObjc = objc - 1; @@ -120,7 +120,7 @@ TclX_LvarcatObjCmd (ClientData clientData, ckfree ((char *) catObjv); if (Tcl_SetVar2Ex(interp, varName, NULL, newObjPtr, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { Tcl_DecrRefCount (newObjPtr); return TCL_ERROR; } @@ -150,7 +150,7 @@ TclX_LvarpopObjCmd (ClientData clientData, varName = Tcl_GetStringFromObj (objv [1], NULL); listVarPtr = Tcl_GetVar2Ex(interp, varName, NULL, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG); + TCL_LEAVE_ERR_MSG); if (listVarPtr == NULL) { return TCL_ERROR; } @@ -201,7 +201,7 @@ TclX_LvarpopObjCmd (ClientData clientData, * Update variable. */ if (Tcl_SetVar2Ex(interp, varName, NULL, listVarPtr, - TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { goto errorExit; } @@ -244,7 +244,7 @@ TclX_LvarpushObjCmd (ClientData clientData, } varName = Tcl_GetStringFromObj (objv [1], NULL); - listVarPtr = Tcl_GetVar2Ex(interp, varName, NULL, TCL_PARSE_PART1); + listVarPtr = Tcl_GetVar2Ex(interp, varName, NULL, 0); if ((listVarPtr == NULL) || (Tcl_IsShared (listVarPtr))) { if (listVarPtr == NULL) { listVarPtr = Tcl_NewListObj (0, NULL); @@ -282,7 +282,7 @@ TclX_LvarpushObjCmd (ClientData clientData, goto errorExit; if (Tcl_SetVar2Ex(interp, varName, NULL, listVarPtr, - TCL_PARSE_PART1| TCL_LEAVE_ERR_MSG) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { goto errorExit; } return TCL_OK; @@ -372,7 +372,7 @@ TclX_LassignObjCmd (ClientData clientData, elemPtr = nullObjPtr; } if (Tcl_SetVar2Ex(interp, Tcl_GetStringFromObj(objv [idx], NULL), NULL, - elemPtr, TCL_PARSE_PART1 | TCL_LEAVE_ERR_MSG) == NULL) + elemPtr, TCL_LEAVE_ERR_MSG) == NULL) goto error_exit; } diff --git a/generic/tclXstring.c b/generic/tclXstring.c index 2c421693..cc69b41b 100644 --- a/generic/tclXstring.c +++ b/generic/tclXstring.c @@ -379,7 +379,7 @@ TclX_CtokenObjCmd (ClientData clientData, } stringVarObj = Tcl_ObjGetVar2(interp, objv[1], NULL, - TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1); + TCL_LEAVE_ERR_MSG); if (stringVarObj == NULL) { return TCL_ERROR; } @@ -416,7 +416,7 @@ TclX_CtokenObjCmd (ClientData clientData, strByteLen-strByteIdx); if (Tcl_SetVar2Ex(interp, Tcl_GetStringFromObj(objv[1], NULL), NULL, newVarValueObj, - TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1) == NULL) { + TCL_LEAVE_ERR_MSG) == NULL) { Tcl_DStringFree (&token); Tcl_DecrRefCount (newVarValueObj); return TCL_ERROR; @@ -853,7 +853,7 @@ TclX_CtypeObjCmd (ClientData clientData, Tcl_Obj *iObj = Tcl_NewIntObj (idx); if (Tcl_SetVar2Ex(interp, failVar, NULL, - iObj, TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1) == NULL) { + iObj, TCL_LEAVE_ERR_MSG) == NULL) { Tcl_DecrRefCount (iObj); return TCL_ERROR; } From 87404d8bc36afd555e9b5ba7fc211251aca2f18a Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Thu, 14 May 2020 19:14:00 +0200 Subject: [PATCH 08/19] Fix more incompatibilities --- generic/tclXfilescan.c | 7 +------ generic/tclXlib.c | 2 +- library/tclx.tcl | 2 +- {failing_tclx9_tests => tests}/convlib.test | 1 + 4 files changed, 4 insertions(+), 8 deletions(-) rename {failing_tclx9_tests => tests}/convlib.test (99%) diff --git a/generic/tclXfilescan.c b/generic/tclXfilescan.c index 9316b0af..31c3e184 100644 --- a/generic/tclXfilescan.c +++ b/generic/tclXfilescan.c @@ -641,12 +641,7 @@ ScanFile (Tcl_Interp *interp, scanContext_t *contextPtr, Tcl_Channel channel) data.offset = (off_t) Tcl_Tell (channel); Tcl_DStringSetLength (&lineBuf, 0); - if (Tcl_Gets (channel, &lineBuf) < 0 || lineBuf.length == 0) { - if (Tcl_Eof (channel) || Tcl_InputBlocked (channel)) - goto scanExit; - Tcl_SetStringObj (Tcl_GetObjResult (interp), - Tcl_PosixError (interp), -1); - result = TCL_ERROR; + if (Tcl_Gets (channel, &lineBuf) < 0 || Tcl_Eof (channel) || Tcl_InputBlocked (channel) ) { goto scanExit; } diff --git a/generic/tclXlib.c b/generic/tclXlib.c index 0903fe04..e31cff68 100644 --- a/generic/tclXlib.c +++ b/generic/tclXlib.c @@ -546,7 +546,7 @@ ProcessIndexFile (Tcl_Interp *interp, if ((Tcl_SplitList (interp, lineBuffer.string, &lineArgc, &lineArgv) != TCL_OK) || (lineArgc < 4)) - goto formatError; + goto reachedEOF; /* * lineArgv [0] is the package name. diff --git a/library/tclx.tcl b/library/tclx.tcl index 4abe5351..63d46566 100644 --- a/library/tclx.tcl +++ b/library/tclx.tcl @@ -22,7 +22,7 @@ namespace eval ::tclx { arrayprocs.tcl 1 autoload.tcl 0 buildhelp.tcl 0 - buildidx.tcl 0 + buildidx.tcl 1 compat.tcl 1 convlib.tcl 1 edprocs.tcl 1 diff --git a/failing_tclx9_tests/convlib.test b/tests/convlib.test similarity index 99% rename from failing_tclx9_tests/convlib.test rename to tests/convlib.test index 27c08aec..5c00bad2 100644 --- a/failing_tclx9_tests/convlib.test +++ b/tests/convlib.test @@ -70,6 +70,7 @@ Test convlib-1.2 {Convert library tests} { list [file exists convlib.tmp/tmp.tlib] [file exists convlib.tmp/tmp.tndx] } 0 {1 1} + loadlibindex convlib.tmp/tmp.tlib LibValidate convlib-1.3 {Convert library tests} From d7c56c1f96c90dc554b0bea4364848bc16240e95 Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Thu, 14 May 2020 21:04:40 +0200 Subject: [PATCH 09/19] include signal test --- {failing_tclx9_tests => tests}/signal.test | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {failing_tclx9_tests => tests}/signal.test (100%) diff --git a/failing_tclx9_tests/signal.test b/tests/signal.test similarity index 100% rename from failing_tclx9_tests/signal.test rename to tests/signal.test From f16786eb24512f4b5ed2a50be0c87382ffd86cd9 Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Sat, 16 May 2020 12:42:28 +0200 Subject: [PATCH 10/19] Fix bug in signal library which occurs only in relation with tcl9 --- generic/tclXsignal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclXsignal.c b/generic/tclXsignal.c index 385601ae..eb4d4f1b 100644 --- a/generic/tclXsignal.c +++ b/generic/tclXsignal.c @@ -682,7 +682,7 @@ FormatTrapCode (Tcl_Interp *interp, int signalNum, Tcl_DString *command) scanPtr += 2; copyPtr = scanPtr; } - Tcl_DStringAppend (command, copyPtr, copyPtr - scanPtr); + Tcl_DStringAppend (command, copyPtr, TCL_AUTO_LENGTH); return TCL_OK; From 632819da06cc767e9c601d25739535cb0d0543a1 Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Sat, 16 May 2020 12:53:49 +0200 Subject: [PATCH 11/19] Replace not yet defined macro: TCL_AUTO_LENGTH in Tcl8.6. Travis ci still uses the Tcl8.6 --- generic/tclXsignal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclXsignal.c b/generic/tclXsignal.c index eb4d4f1b..7c932c0e 100644 --- a/generic/tclXsignal.c +++ b/generic/tclXsignal.c @@ -682,7 +682,7 @@ FormatTrapCode (Tcl_Interp *interp, int signalNum, Tcl_DString *command) scanPtr += 2; copyPtr = scanPtr; } - Tcl_DStringAppend (command, copyPtr, TCL_AUTO_LENGTH); + Tcl_DStringAppend (command, copyPtr, ((size_t)-1)); return TCL_OK; From fde2e93f9177aa25b2340e0bf4a336b7cfa67aa6 Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Thu, 21 May 2020 00:13:30 +0200 Subject: [PATCH 12/19] Fix all warnings --- generic/tclXdup.c | 8 -------- generic/tclXfcntl.c | 2 +- generic/tclXhandles.c | 2 +- generic/tclXkeylist.c | 8 ++++---- generic/tclXmath.c | 1 - unix/tclXunixDup.c | 2 +- unix/tclXunixId.c | 4 ++-- unix/tclXunixOS.c | 8 ++++---- 8 files changed, 13 insertions(+), 22 deletions(-) diff --git a/generic/tclXdup.c b/generic/tclXdup.c index 224c3fca..236143d7 100644 --- a/generic/tclXdup.c +++ b/generic/tclXdup.c @@ -238,14 +238,6 @@ TclX_DupObjCmd (ClientData clientData, Tcl_GetChannelName (newChannel), -1); return TCL_OK; - badFnum: - Tcl_ResetResult (interp); - TclX_AppendObjResult (interp, "invalid integer file number \"", - Tcl_GetStringFromObj (objv [1], NULL), - "\", expected unsigned integer or Tcl file id", - (char *) NULL); - return TCL_ERROR; - bind2ndArg: TclX_AppendObjResult (interp, "the second argument, targetChannelId, ", "is not allow when binding a file number to ", diff --git a/generic/tclXfcntl.c b/generic/tclXfcntl.c index 070caa31..d9bf3663 100644 --- a/generic/tclXfcntl.c +++ b/generic/tclXfcntl.c @@ -200,7 +200,7 @@ GetFcntlAttr (Tcl_Interp *interp, Tcl_Channel channel, int mode, int attrib) value = (optValue == TCLX_BUFFERING_LINE); break; case ATTR_KEEPALIVE: - if (TclXOSgetsockopt (interp, channel, SO_KEEPALIVE, &value) != TCL_OK) + if (TclXOSgetsockopt (interp, channel, SO_KEEPALIVE, (socklen_t *) &value) != TCL_OK) return TCL_ERROR; break; default: diff --git a/generic/tclXhandles.c b/generic/tclXhandles.c index 97c09ff9..da30fa90 100644 --- a/generic/tclXhandles.c +++ b/generic/tclXhandles.c @@ -539,7 +539,7 @@ TclX_HandleFree (void_pt headerPtr, void_pt entryPtr) entryHdrPtr = HEADER_AREA (entryPtr); if (entryHdrPtr->freeLink != ALLOCATED_IDX) - panic ("Tcl_HandleFree: entry not allocated %x\n", entryHdrPtr); + panic ("Tcl_HandleFree: entry not allocated %x\n", entryHdrPtr->freeLink); entryHdrPtr->freeLink = tblHdrPtr->freeHeadIdx; tblHdrPtr->freeHeadIdx = diff --git a/generic/tclXkeylist.c b/generic/tclXkeylist.c index 3a6f8f20..1e846337 100644 --- a/generic/tclXkeylist.c +++ b/generic/tclXkeylist.c @@ -338,7 +338,7 @@ DeleteKeyedListEntry (keylIntObj_t *keylIntPtr, int entryIdx) if (keylIntPtr->hashTbl != NULL) { Tcl_HashEntry *entryPtr; Tcl_HashSearch search; - int nidx; + uintptr_t nidx; entryPtr = Tcl_FindHashEntry(keylIntPtr->hashTbl, keylIntPtr->entries [entryIdx].key); @@ -354,7 +354,7 @@ DeleteKeyedListEntry (keylIntObj_t *keylIntPtr, int entryIdx) */ for (entryPtr = Tcl_FirstHashEntry(keylIntPtr->hashTbl, &search); entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) { - nidx = (int) Tcl_GetHashValue(entryPtr); + nidx = (uintptr_t) Tcl_GetHashValue(entryPtr); if (nidx > entryIdx) { Tcl_SetHashValue(entryPtr, (ClientData) (uintptr_t) (nidx - 1)); } @@ -394,7 +394,7 @@ FindKeyedListEntry (keylIntObj_t *keylIntPtr, char **nextSubKeyPtr) { char *keySeparPtr; - int keyLen, findIdx = -1; + uintptr_t keyLen, findIdx = -1; keySeparPtr = strchr (key, '.'); if (keySeparPtr != NULL) { @@ -416,7 +416,7 @@ FindKeyedListEntry (keylIntObj_t *keylIntPtr, } entryPtr = Tcl_FindHashEntry(keylIntPtr->hashTbl, key); if (entryPtr != NULL) { - findIdx = (int) Tcl_GetHashValue(entryPtr); + findIdx = (uintptr_t) Tcl_GetHashValue(entryPtr); } if (keySeparPtr != NULL) { key[keyLen] = tmp; diff --git a/generic/tclXmath.c b/generic/tclXmath.c index 6777ae6e..6fa6ad5c 100644 --- a/generic/tclXmath.c +++ b/generic/tclXmath.c @@ -261,7 +261,6 @@ static int TclX_RandomObjCmd (ClientData clientData, void TclX_MathInit (Tcl_Interp *interp) { - int major, minor; Tcl_CreateObjCommand (interp, "max", TclX_MaxObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc*) NULL); diff --git a/unix/tclXunixDup.c b/unix/tclXunixDup.c index 135fb6f4..1c710899 100644 --- a/unix/tclXunixDup.c +++ b/unix/tclXunixDup.c @@ -86,7 +86,7 @@ TclXOSDupChannel(Tcl_Interp *interp, Tcl_Channel srcChannel, int mode, char *tar } else { Tcl_GetChannelHandle (srcChannel, TCL_WRITABLE, &handle); } - srcFileNum = (int) handle; + srcFileNum = (uintptr_t) handle; channelType = Tcl_GetChannelType (srcChannel); /* diff --git a/unix/tclXunixId.c b/unix/tclXunixId.c index 8fcf59b3..c8972386 100644 --- a/unix/tclXunixId.c +++ b/unix/tclXunixId.c @@ -444,9 +444,9 @@ IdHost (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) #endif char hostNameBuf[MAXHOSTNAMELEN]; - if (objc != 2) + if (objc != 2) { return TclX_WrongArgs (interp, objv [0], "host"); - + } if (gethostname (hostNameBuf, MAXHOSTNAMELEN) < 0) { TclX_AppendObjResult (interp, Tcl_PosixError (interp), (char *) NULL); diff --git a/unix/tclXunixOS.c b/unix/tclXunixOS.c index bcb2e3db..f5a8f71d 100644 --- a/unix/tclXunixOS.c +++ b/unix/tclXunixOS.c @@ -113,7 +113,7 @@ ChannelToFnum (Tcl_Channel channel, int direction) return -1; } } - return (int) handle; + return (uintptr_t) handle; } /*----------------------------------------------------------------------------- @@ -919,7 +919,7 @@ int TclXOSgetsockname (Tcl_Interp *interp, Tcl_Channel channel, void *sockaddr, int sockaddrSize) { if (getsockname (ChannelToFnum (channel, 0), - (struct sockaddr *) sockaddr, &sockaddrSize) < 0) { + (struct sockaddr *) sockaddr, (socklen_t *__restrict) &sockaddrSize) < 0) { TclX_AppendObjResult (interp, Tcl_GetChannelName (channel), ": ", Tcl_PosixError (interp), (char *) NULL); return TCL_ERROR; @@ -946,7 +946,7 @@ TclXOSgetsockopt (Tcl_Interp *interp, Tcl_Channel channel, int option, socklen_t int valueLen = sizeof (*valuePtr); if (getsockopt (ChannelToFnum (channel, 0), SOL_SOCKET, option, - (void*) valuePtr, &valueLen) != 0) { + (void*) valuePtr, (socklen_t *__restrict) &valueLen) != 0) { TclX_AppendObjResult (interp, Tcl_GetChannelName (channel), ": ", Tcl_PosixError (interp), (char *) NULL); return TCL_ERROR; @@ -1385,7 +1385,7 @@ TclXOSGetSelectFnum (Tcl_Interp *interp, Tcl_Channel channel, int direction, int (char *) NULL); return TCL_ERROR; } - *fnumPtr = (int) handle; + *fnumPtr = (uintptr_t) handle; return TCL_OK; } From a44cbd510fc4dc44c05d11746354a3ee0c6ff430 Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Thu, 21 May 2020 00:38:38 +0200 Subject: [PATCH 13/19] Fix additional warnings --- generic/tclXbsearch.c | 4 ++-- generic/tclXchmod.c | 1 + generic/tclXsignal.c | 2 +- unix/tclXunixOS.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/generic/tclXbsearch.c b/generic/tclXbsearch.c index 3b70c9e6..19e43019 100644 --- a/generic/tclXbsearch.c +++ b/generic/tclXbsearch.c @@ -168,7 +168,7 @@ ReadAndCompare (off_t fileOffset, binSearchCB_t *searchCBPtr) * one. */ if (fileOffset != 0) { - if (Tcl_Gets (searchCBPtr->channel, &searchCBPtr->lineBuf) < 0) { + if (Tcl_Gets (searchCBPtr->channel, &searchCBPtr->lineBuf) <= 0) { if (Tcl_Eof (searchCBPtr->channel) || Tcl_InputBlocked (searchCBPtr->channel)) { TclX_AppendObjResult (searchCBPtr->interp, @@ -197,7 +197,7 @@ ReadAndCompare (off_t fileOffset, binSearchCB_t *searchCBPtr) * Read the line. Only compare if EOF was not hit, otherwise, treat as if * we went above the key we are looking for. */ - if (Tcl_Gets (searchCBPtr->channel, &searchCBPtr->lineBuf) < 0) { + if (Tcl_Gets (searchCBPtr->channel, &searchCBPtr->lineBuf) <= 0) { if (Tcl_Eof (searchCBPtr->channel) || Tcl_InputBlocked (searchCBPtr->channel)) { searchCBPtr->cmpResult = -1; diff --git a/generic/tclXchmod.c b/generic/tclXchmod.c index c85ea822..c7a2c5dd 100644 --- a/generic/tclXchmod.c +++ b/generic/tclXchmod.c @@ -336,6 +336,7 @@ TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * modeInfo.absMode = strtol(modeString, 0, 0); modeInfo.symMode = NULL; } else { + modeInfo.absMode = 0; modeInfo.symMode = modeString; } diff --git a/generic/tclXsignal.c b/generic/tclXsignal.c index 7c932c0e..a35bbf90 100644 --- a/generic/tclXsignal.c +++ b/generic/tclXsignal.c @@ -682,7 +682,7 @@ FormatTrapCode (Tcl_Interp *interp, int signalNum, Tcl_DString *command) scanPtr += 2; copyPtr = scanPtr; } - Tcl_DStringAppend (command, copyPtr, ((size_t)-1)); + Tcl_DStringAppend (command, copyPtr, -1); return TCL_OK; diff --git a/unix/tclXunixOS.c b/unix/tclXunixOS.c index f5a8f71d..5d955f10 100644 --- a/unix/tclXunixOS.c +++ b/unix/tclXunixOS.c @@ -401,7 +401,7 @@ TclXOSsystem (Tcl_Interp *interp, char *command, int *exitCode) if (pid == 0) { close (errPipes [0]); execl ("/bin/sh", "sh", "-c", command, (char *) NULL); - write (errPipes [1], &errno, sizeof (errno)); + if (write (errPipes [1], &errno, sizeof (errno)) == 0) {} _exit (127); } From d16a5e7068b4933c09a69b348ed99a88387175ad Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Thu, 21 May 2020 00:57:48 +0200 Subject: [PATCH 14/19] Fix MacOs warnings --- generic/tclXdup.c | 2 +- generic/tclXfcntl.c | 2 +- generic/tclXhandles.c | 2 +- generic/tclXprofile.c | 2 +- generic/tclXsignal.c | 2 +- generic/tclXstring.c | 2 +- generic/tclXutil.c | 2 +- unix/tclXunixSock.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/generic/tclXdup.c b/generic/tclXdup.c index 236143d7..115e82ee 100644 --- a/generic/tclXdup.c +++ b/generic/tclXdup.c @@ -75,7 +75,7 @@ DupChannelOptions (Tcl_Interp *interp, goto errorExit; } if ((optArgc % 2) != 0) { - panic("channel didn't return keyword/value pairs"); + Tcl_Panic("channel didn't return keyword/value pairs"); } for (idx = 0; idx < optArgc; idx += 2) { diff --git a/generic/tclXfcntl.c b/generic/tclXfcntl.c index d9bf3663..8a2f9d29 100644 --- a/generic/tclXfcntl.c +++ b/generic/tclXfcntl.c @@ -204,7 +204,7 @@ GetFcntlAttr (Tcl_Interp *interp, Tcl_Channel channel, int mode, int attrib) return TCL_ERROR; break; default: - panic ("bug in fcntl get attrib"); + Tcl_Panic ("bug in fcntl get attrib"); value = 0; /* suppress compiler warning for initialized value */ } diff --git a/generic/tclXhandles.c b/generic/tclXhandles.c index da30fa90..ae2f21a0 100644 --- a/generic/tclXhandles.c +++ b/generic/tclXhandles.c @@ -539,7 +539,7 @@ TclX_HandleFree (void_pt headerPtr, void_pt entryPtr) entryHdrPtr = HEADER_AREA (entryPtr); if (entryHdrPtr->freeLink != ALLOCATED_IDX) - panic ("Tcl_HandleFree: entry not allocated %x\n", entryHdrPtr->freeLink); + Tcl_Panic ("Tcl_HandleFree: entry not allocated %x\n", entryHdrPtr->freeLink); entryHdrPtr->freeLink = tblHdrPtr->freeHeadIdx; tblHdrPtr->freeHeadIdx = diff --git a/generic/tclXprofile.c b/generic/tclXprofile.c index 9143a664..e1d38ef0 100644 --- a/generic/tclXprofile.c +++ b/generic/tclXprofile.c @@ -228,7 +228,7 @@ PushEntry (profInfo_t *infoPtr, * Only global level can be NULL. */ if (scanPtr == NULL) - panic (PROF_PANIC, 1); + Tcl_Panic (PROF_PANIC, 1); } entryPtr->prevScopePtr = scanPtr; infoPtr->scopeChainPtr = entryPtr; diff --git a/generic/tclXsignal.c b/generic/tclXsignal.c index a35bbf90..5c286520 100644 --- a/generic/tclXsignal.c +++ b/generic/tclXsignal.c @@ -1540,7 +1540,7 @@ SignalCmdCleanUp (ClientData clientData, Tcl_Interp *interp) break; } if (idx == numInterps) - panic ("signal interp lost"); + Tcl_Panic ("signal interp lost"); interpTable [idx] = interpTable [--numInterps]; diff --git a/generic/tclXstring.c b/generic/tclXstring.c index cc69b41b..fb2ef8b3 100644 --- a/generic/tclXstring.c +++ b/generic/tclXstring.c @@ -666,7 +666,7 @@ TclX_CtypeObjCmd (ClientData clientData, #define IS_8BIT_UNICHAR(c) (c <= 255) if (TCL_UTF_MAX > sizeof(number)) { - panic("TclX_CtypeObjCmd: UTF character longer than a int"); + Tcl_Panic("TclX_CtypeObjCmd: UTF character longer than a int"); } /*FIX: Split into multiple procs */ diff --git a/generic/tclXutil.c b/generic/tclXutil.c index 17b82e30..a0e03c05 100644 --- a/generic/tclXutil.c +++ b/generic/tclXutil.c @@ -476,7 +476,7 @@ ParseTranslationOption (char *strValue) } else if (STREQU (strValue, "platform")) { return TCLX_TRANSLATE_PLATFORM; } - panic ("ParseTranslationOption bug"); + Tcl_Panic ("ParseTranslationOption bug"); return TCL_ERROR; /* Not reached */ } diff --git a/unix/tclXunixSock.c b/unix/tclXunixSock.c index 826abbf9..ee536003 100644 --- a/unix/tclXunixSock.c +++ b/unix/tclXunixSock.c @@ -195,7 +195,7 @@ TclX_ServerCreateCmd (ClientData clientData, */ if (getReserved) { int port; - if (rresvport (&port) < 0) + if (rresvport_af (&port, local.sin_family) < 0) goto unixError; local.sin_port = port; } From 7ea4a1e19bea846cc0009352f766e07f7ff69adb Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Thu, 21 May 2020 01:08:26 +0200 Subject: [PATCH 15/19] Fix remaining warnings and undo the change of deprecated function: rresvport --- generic/tclXfcntl.c | 2 +- generic/tclXprofile.c | 2 +- generic/tclXutil.c | 2 +- unix/tclXunixSock.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generic/tclXfcntl.c b/generic/tclXfcntl.c index 8a2f9d29..20e810bd 100644 --- a/generic/tclXfcntl.c +++ b/generic/tclXfcntl.c @@ -260,7 +260,7 @@ SetFcntlAttrObj (Tcl_Interp *interp, case ATTR_KEEPALIVE: return TclXOSsetsockopt (interp, channel, SO_KEEPALIVE, value); default: - panic ("buf in fcntl set attrib"); + Tcl_Panic ("buf in fcntl set attrib"); } return TCL_ERROR; /* Should never be reached */ } diff --git a/generic/tclXprofile.c b/generic/tclXprofile.c index e1d38ef0..5d0bd70e 100644 --- a/generic/tclXprofile.c +++ b/generic/tclXprofile.c @@ -434,7 +434,7 @@ ProfCommandEvalSetup (profInfo_t *infoPtr, int *isProcPtr) UpdateTOSTimes (infoPtr); do { if (infoPtr->stackPtr->evalLevel != UNKNOWN_LEVEL) - panic (PROF_PANIC, 2); /* Not an initial entry */ + Tcl_Panic (PROF_PANIC, 2); /* Not an initial entry */ PopEntry (infoPtr); } while (infoPtr->stackPtr->procLevel > procLevel); } diff --git a/generic/tclXutil.c b/generic/tclXutil.c index a0e03c05..70252de5 100644 --- a/generic/tclXutil.c +++ b/generic/tclXutil.c @@ -507,7 +507,7 @@ FormatTranslationOption (int value) case TCLX_TRANSLATE_PLATFORM: return "platform"; default: - panic ("FormatTranslationOption bug"); + Tcl_Panic ("FormatTranslationOption bug"); } return NULL; /* Not reached */ } diff --git a/unix/tclXunixSock.c b/unix/tclXunixSock.c index ee536003..826abbf9 100644 --- a/unix/tclXunixSock.c +++ b/unix/tclXunixSock.c @@ -195,7 +195,7 @@ TclX_ServerCreateCmd (ClientData clientData, */ if (getReserved) { int port; - if (rresvport_af (&port, local.sin_family) < 0) + if (rresvport (&port) < 0) goto unixError; local.sin_port = port; } From 801257b070abe67f8c8187f0e7554ab224e754f7 Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Thu, 21 May 2020 01:16:37 +0200 Subject: [PATCH 16/19] Fix another warnings (MacOs) --- generic/tclXprofile.c | 2 +- generic/tclXutil.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tclXprofile.c b/generic/tclXprofile.c index 5d0bd70e..f3190bf4 100644 --- a/generic/tclXprofile.c +++ b/generic/tclXprofile.c @@ -569,7 +569,7 @@ ProfTraceRoutine (ClientData clientData, Tcl_CmdInfo cmdInfo; if (cmd == NULL) - panic (PROF_PANIC, 4); + Tcl_Panic (PROF_PANIC, 4); //TIP #571: We don' want to profile the tailcall itself. As it can only be called in a procedure/lambda context if ( ! strcmp((*objv)->bytes, "tailcall") ) { diff --git a/generic/tclXutil.c b/generic/tclXutil.c index 70252de5..67ed0956 100644 --- a/generic/tclXutil.c +++ b/generic/tclXutil.c @@ -620,7 +620,7 @@ TclX_GetChannelOption (Tcl_Interp *interp, return TCL_OK; fatalError: - panic ("TclX_GetChannelOption bug"); /* FIX: return error. */ + Tcl_Panic ("TclX_GetChannelOption bug"); /* FIX: return error. */ return 0; /* Not reached */ } From b99a668088d68355511b6e85835ff7621f17ce37 Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Thu, 30 Sep 2021 23:38:23 +0200 Subject: [PATCH 17/19] Update tests/fstat.test Co-authored-by: Jeff Lawson --- tests/fstat.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fstat.test b/tests/fstat.test index 7e0dcbce..958022b1 100644 --- a/tests/fstat.test +++ b/tests/fstat.test @@ -74,7 +74,7 @@ if [cequal $tcl_platform(platform) windows] { test fstat-2.2 {keyed list returns} { set stat [fstat $gorpFH] list [keylget stat nlink] [keylget stat size] \ - [expr [keylget stat mode ]&511] [keylget stat type] + [expr [keylget stat mode ]&0o0777] [keylget stat type] } $expect if [cequal $tcl_platform(platform) windows] { From 342c09eeacba14b0cd8eabb7dbc69144746f9907 Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Thu, 30 Sep 2021 23:38:29 +0200 Subject: [PATCH 18/19] Update tests/fstat.test Co-authored-by: Jeff Lawson --- tests/fstat.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fstat.test b/tests/fstat.test index 958022b1..84c05501 100644 --- a/tests/fstat.test +++ b/tests/fstat.test @@ -44,7 +44,7 @@ if [cequal $tcl_platform(platform) windows] { test fstat-1.2 {array return} { catch {unset stat} fstat $gorpFH stat stat - list $stat(nlink) $stat(size) [expr $stat(mode)&511] $stat(type) \ + list $stat(nlink) $stat(size) [expr $stat(mode)&0o0777] $stat(type) $stat(tty) } $expect From e1053851d150980e3008316e16ebe4295c33ae7c Mon Sep 17 00:00:00 2001 From: Rami Khaldi Date: Thu, 30 Sep 2021 23:38:49 +0200 Subject: [PATCH 19/19] Update tests/chmod.test Co-authored-by: Jeff Lawson --- tests/chmod.test | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/chmod.test b/tests/chmod.test index f99d4fc1..fdd9e4fb 100644 --- a/tests/chmod.test +++ b/tests/chmod.test @@ -35,8 +35,7 @@ if [cequal $tcl_platform(platform) windows] { proc GetMode {filename} { file stat $filename stat - # 4095 is decimal represenation of octal 07777 - return [format "%o" [expr {$stat(mode) & 4095}]] + return [format "%o" [expr {$stat(mode) & 0o07777}]] } #-----------------------------------------------------------------------------