diff options
97 files changed, 2132 insertions, 2245 deletions
diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index a7ce43b..3b55c41 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -23,7 +23,6 @@ jobs: cfgopt: - "" - "OPTS=utf16" - - "CHECKS=nodep" - "OPTS=static" - "OPTS=symbols" - "OPTS=symbols STATS=compdbg,memdbg" @@ -62,7 +61,6 @@ jobs: cfgopt: - "" - "CFLAGS=-DTCL_UTF_MAX=3" - - "CFLAGS=-DTCL_NO_DEPRECATED=1" - "--disable-shared" - "--enable-symbols" - "--enable-symbols=mem" @@ -1,6 +1,6 @@ # README: Tcl -This is the **Tcl 9.0a4** source distribution. +This is the **Tcl 9.0a0** source distribution. You can get any source release of Tcl from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). @@ -19,6 +19,11 @@ site](https://sourceforge.net/projects/tcl/files/Tcl/). [![Build Status](https://github.com/tcltk/tcl/workflows/Linux/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux%22+branch%3Amain) [![Build Status](https://github.com/tcltk/tcl/workflows/Windows/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows%22+branch%3Amain) [![Build Status](https://github.com/tcltk/tcl/workflows/macOS/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22macOS%22+branch%3Amain) +<br> +9.1 (unofficial, with TIP #626)) +[![Build Status](https://github.com/tcltk/tcl/workflows/Linux/badge.svg?branch=tip-626)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux%22+branch%3Atip-626) +[![Build Status](https://github.com/tcltk/tcl/workflows/Windows/badge.svg?branch=tip-626)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows%22+branch%3Atip-626) +[![Build Status](https://github.com/tcltk/tcl/workflows/macOS/badge.svg?branch=tip-626)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22macOS%22+branch%3Atip-626) ## Contents 1. [Introduction](#intro) diff --git a/generic/tcl.decls b/generic/tcl.decls index d52b710..eade459 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -1137,7 +1137,7 @@ declare 303 { } declare 304 { int Tcl_GetIndexFromObjStruct(Tcl_Interp *interp, Tcl_Obj *objPtr, - const void *tablePtr, Tcl_Size offset, const char *msg, int flags, + const void *tablePtr, size_t offset, const char *msg, int flags, void *indexPtr) } declare 305 { diff --git a/generic/tcl.h b/generic/tcl.h index 1e33ba1..2fab849 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -51,12 +51,12 @@ extern "C" { # define TCL_MAJOR_VERSION 9 #endif #if TCL_MAJOR_VERSION == 9 -# define TCL_MINOR_VERSION 0 +# define TCL_MINOR_VERSION 1 # define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE -# define TCL_RELEASE_SERIAL 4 +# define TCL_RELEASE_SERIAL 0 -# define TCL_VERSION "9.0" -# define TCL_PATCH_LEVEL "9.0a4" +# define TCL_VERSION "9.1" +# define TCL_PATCH_LEVEL "9.1a0" #endif /* TCL_MAJOR_VERSION */ #if defined(RC_INVOKED) @@ -557,9 +557,11 @@ typedef int (Tcl_CmdProc) (void *clientData, Tcl_Interp *interp, typedef void (Tcl_CmdTraceProc) (void *clientData, Tcl_Interp *interp, int level, char *command, Tcl_CmdProc *proc, void *cmdClientData, int argc, const char *argv[]); +#ifndef TCL_NO_DEPRECATED typedef int (Tcl_CmdObjTraceProc) (void *clientData, Tcl_Interp *interp, int level, const char *command, Tcl_Command commandInfo, int objc, struct Tcl_Obj *const *objv); +#endif /* TCL_NO_DEPRECATED */ typedef int (Tcl_CmdObjTraceProc2) (void *clientData, Tcl_Interp *interp, Tcl_Size level, const char *command, Tcl_Command commandInfo, Tcl_Size objc, struct Tcl_Obj *const *objv); @@ -583,8 +585,10 @@ typedef void (Tcl_IdleProc) (void *clientData); typedef void (Tcl_InterpDeleteProc) (void *clientData, Tcl_Interp *interp); typedef void (Tcl_NamespaceDeleteProc) (void *clientData); +#ifndef TCL_NO_DEPRECATED typedef int (Tcl_ObjCmdProc) (void *clientData, Tcl_Interp *interp, int objc, struct Tcl_Obj *const *objv); +#endif /* TCL_NO_DEPRECATED */ typedef int (Tcl_ObjCmdProc2) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, struct Tcl_Obj *const *objv); typedef int (Tcl_LibraryInitProc) (Tcl_Interp *interp); @@ -780,8 +784,13 @@ typedef struct { * Tcl_CreateObjCommand; 2 if objProc was registered by * a call to Tcl_CreateObjCommand2; 0 otherwise. * Tcl_SetCmdInfo does not modify this field. */ +#ifdef TCL_NO_DEPRECATED + void *objProcNotUsed; /* Command's object-based function. */ + void *objClientDataNotUsed; /* ClientData for object proc. */ +#else Tcl_ObjCmdProc *objProc; /* Command's object-based function. */ void *objClientData; /* ClientData for object proc. */ +#endif Tcl_CmdProc *proc; /* Command's string-based function. */ void *clientData; /* ClientData for string proc. */ Tcl_CmdDeleteProc *deleteProc; @@ -2258,17 +2267,10 @@ void * TclStubCall(void *arg); #ifdef USE_TCL_STUBS #if TCL_MAJOR_VERSION < 9 -# if TCL_UTF_MAX < 4 # define Tcl_InitStubs(interp, version, exact) \ (Tcl_InitStubs)(interp, version, \ (exact)|(TCL_MAJOR_VERSION<<8)|(0xFF<<16), \ TCL_STUB_MAGIC) -# else -# define Tcl_InitStubs(interp, version, exact) \ - (Tcl_InitStubs)(interp, "8.7.0", \ - (exact)|(TCL_MAJOR_VERSION<<8)|(0xFF<<16), \ - TCL_STUB_MAGIC) -# endif #elif TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE # define Tcl_InitStubs(interp, version, exact) \ (Tcl_InitStubs)(interp, version, \ diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 910532e..ef25e74 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -773,7 +773,7 @@ int Tcl_AssembleObjCmd( void *clientData, /* clientData */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { /* @@ -781,14 +781,14 @@ Tcl_AssembleObjCmd( * because there needs to be one in place to execute bytecode. */ - return Tcl_NRCallObjProc(interp, TclNRAssembleObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRAssembleObjCmd, clientData, objc, objv); } int TclNRAssembleObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { ByteCode *codePtr; /* Pointer to the bytecode to execute */ diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 02940e7..b4fa133 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -133,7 +133,7 @@ TCL_DECLARE_MUTEX(commandTypeLock); * Static functions in this file: */ -static Tcl_ObjCmdProc BadEnsembleSubcommand; +static Tcl_ObjCmdProc2 BadEnsembleSubcommand; static char * CallCommandTraces(Interp *iPtr, Command *cmdPtr, const char *oldName, const char *newName, int flags); @@ -144,52 +144,55 @@ static void DeleteCoroutine(void *clientData); static void DeleteInterpProc(Tcl_Interp *interp); static void DeleteOpCmdClientData(void *clientData); #ifdef USE_DTRACE -static Tcl_ObjCmdProc DTraceObjCmd; +static Tcl_ObjCmdProc2 DTraceObjCmd; static Tcl_NRPostProc DTraceCmdReturn; #else # define DTraceCmdReturn NULL #endif /* USE_DTRACE */ -static Tcl_ObjCmdProc ExprAbsFunc; -static Tcl_ObjCmdProc ExprBinaryFunc; -static Tcl_ObjCmdProc ExprBoolFunc; -static Tcl_ObjCmdProc ExprCeilFunc; -static Tcl_ObjCmdProc ExprDoubleFunc; -static Tcl_ObjCmdProc ExprFloorFunc; -static Tcl_ObjCmdProc ExprIntFunc; -static Tcl_ObjCmdProc ExprIsqrtFunc; -static Tcl_ObjCmdProc ExprIsFiniteFunc; -static Tcl_ObjCmdProc ExprIsInfinityFunc; -static Tcl_ObjCmdProc ExprIsNaNFunc; -static Tcl_ObjCmdProc ExprIsNormalFunc; -static Tcl_ObjCmdProc ExprIsSubnormalFunc; -static Tcl_ObjCmdProc ExprIsUnorderedFunc; -static Tcl_ObjCmdProc ExprMaxFunc; -static Tcl_ObjCmdProc ExprMinFunc; -static Tcl_ObjCmdProc ExprRandFunc; -static Tcl_ObjCmdProc ExprRoundFunc; -static Tcl_ObjCmdProc ExprSqrtFunc; -static Tcl_ObjCmdProc ExprSrandFunc; -static Tcl_ObjCmdProc ExprUnaryFunc; -static Tcl_ObjCmdProc ExprWideFunc; -static Tcl_ObjCmdProc FloatClassifyObjCmd; +static Tcl_ObjCmdProc2 InvokeStringCommand; +static Tcl_ObjCmdProc2 ExprAbsFunc; +static Tcl_ObjCmdProc2 ExprBinaryFunc; +static Tcl_ObjCmdProc2 ExprBoolFunc; +static Tcl_ObjCmdProc2 ExprCeilFunc; +static Tcl_ObjCmdProc2 ExprDoubleFunc; +static Tcl_ObjCmdProc2 ExprFloorFunc; +static Tcl_ObjCmdProc2 ExprIntFunc; +static Tcl_ObjCmdProc2 ExprIsqrtFunc; +static Tcl_ObjCmdProc2 ExprIsFiniteFunc; +static Tcl_ObjCmdProc2 ExprIsInfinityFunc; +static Tcl_ObjCmdProc2 ExprIsNaNFunc; +static Tcl_ObjCmdProc2 ExprIsNormalFunc; +static Tcl_ObjCmdProc2 ExprIsSubnormalFunc; +static Tcl_ObjCmdProc2 ExprIsUnorderedFunc; +static Tcl_ObjCmdProc2 ExprMaxFunc; +static Tcl_ObjCmdProc2 ExprMinFunc; +static Tcl_ObjCmdProc2 ExprRandFunc; +static Tcl_ObjCmdProc2 ExprRoundFunc; +static Tcl_ObjCmdProc2 ExprSqrtFunc; +static Tcl_ObjCmdProc2 ExprSrandFunc; +static Tcl_ObjCmdProc2 ExprUnaryFunc; +static Tcl_ObjCmdProc2 ExprWideFunc; +static Tcl_ObjCmdProc2 FloatClassifyObjCmd; static void MathFuncWrongNumArgs(Tcl_Interp *interp, int expected, int actual, Tcl_Obj *const *objv); static Tcl_NRPostProc NRCoroutineCallerCallback; static Tcl_NRPostProc NRCoroutineExitCallback; static Tcl_NRPostProc NRCommand; +static Tcl_CmdProc InvokeObjectCommand; + static void ProcessUnexpectedResult(Tcl_Interp *interp, int returnCode); static int RewindCoroutine(CoroutineData *corPtr, int result); static void TEOV_SwitchVarFrame(Tcl_Interp *interp); static void TEOV_PushExceptionHandlers(Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[], int flags); + Tcl_Size objc, Tcl_Obj *const objv[], int flags); static inline Command * TEOV_LookupCmdFromObj(Tcl_Interp *interp, Tcl_Obj *namePtr, Namespace *lookupNsPtr); -static int TEOV_NotFound(Tcl_Interp *interp, int objc, +static int TEOV_NotFound(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], Namespace *lookupNsPtr); static int TEOV_RunEnterTraces(Tcl_Interp *interp, - Command **cmdPtrPtr, Tcl_Obj *commandPtr, int objc, + Command **cmdPtrPtr, Tcl_Obj *commandPtr, Tcl_Size objc, Tcl_Obj *const objv[]); static Tcl_NRPostProc RewindCoroutineCallback; static Tcl_NRPostProc TEOEx_ByteCodeCallback; @@ -202,11 +205,11 @@ static Tcl_NRPostProc TEOV_RunLeaveTraces; static Tcl_NRPostProc EvalObjvCore; static Tcl_NRPostProc Dispatch; -static Tcl_ObjCmdProc NRInjectObjCmd; +static Tcl_ObjCmdProc2 NRInjectObjCmd; static Tcl_NRPostProc NRPostInvoke; -static Tcl_ObjCmdProc CoroTypeObjCmd; -static Tcl_ObjCmdProc TclNRCoroInjectObjCmd; -static Tcl_ObjCmdProc TclNRCoroProbeObjCmd; +static Tcl_ObjCmdProc2 CoroTypeObjCmd; +static Tcl_ObjCmdProc2 TclNRCoroInjectObjCmd; +static Tcl_ObjCmdProc2 TclNRCoroProbeObjCmd; static Tcl_NRPostProc InjectHandler; static Tcl_NRPostProc InjectHandlerPostCall; @@ -220,8 +223,8 @@ MODULE_SCOPE const TclStubs tclStubs; #define CORO_ACTIVATE_YIELD NULL #define CORO_ACTIVATE_YIELDM INT2PTR(1) -#define COROUTINE_ARGUMENTS_SINGLE_OPTIONAL (-1) -#define COROUTINE_ARGUMENTS_ARBITRARY (-2) +#define COROUTINE_ARGUMENTS_SINGLE_OPTIONAL ((Tcl_Size)-1) +#define COROUTINE_ARGUMENTS_ARBITRARY ((Tcl_Size)-2) /* * The following structure define the commands in the Tcl core. @@ -229,9 +232,9 @@ MODULE_SCOPE const TclStubs tclStubs; typedef struct { const char *name; /* Name of object-based command. */ - Tcl_ObjCmdProc *objProc; /* Object-based function for command. */ + Tcl_ObjCmdProc2 *objProc; /* Object-based function for command. */ CompileProc *compileProc; /* Function called to compile command. */ - Tcl_ObjCmdProc *nreProc; /* NR-based function for command */ + Tcl_ObjCmdProc2 *nreProc; /* NR-based function for command */ int flags; /* Various flag bits, as defined below. */ } CmdInfo; @@ -264,12 +267,6 @@ typedef struct { * The built-in commands, and the functions that implement them: */ -int procObjCmd(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]) { - return Tcl_ProcObjCmd(clientData, interp, objc, objv); -} - - static const CmdInfo builtInCmds[] = { /* * Commands in the generic core. @@ -314,7 +311,7 @@ static const CmdInfo builtInCmds[] = { {"lset", Tcl_LsetObjCmd, TclCompileLsetCmd, NULL, CMD_IS_SAFE}, {"lsort", Tcl_LsortObjCmd, NULL, NULL, CMD_IS_SAFE}, {"package", Tcl_PackageObjCmd, NULL, TclNRPackageObjCmd, CMD_IS_SAFE}, - {"proc", procObjCmd, NULL, NULL, CMD_IS_SAFE}, + {"proc", Tcl_ProcObjCmd, NULL, NULL, CMD_IS_SAFE}, {"regexp", Tcl_RegexpObjCmd, TclCompileRegexpCmd, NULL, CMD_IS_SAFE}, {"regsub", Tcl_RegsubObjCmd, TclCompileRegsubCmd, NULL, CMD_IS_SAFE}, {"rename", Tcl_RenameObjCmd, NULL, NULL, CMD_IS_SAFE}, @@ -441,7 +438,7 @@ static const UnsafeEnsembleInfo unsafeEnsembleCommands[] = { typedef struct { const char *name; /* Name of the function. The full name is * "::tcl::mathfunc::<name>". */ - Tcl_ObjCmdProc *objCmdProc; /* Function that evaluates the function */ + Tcl_ObjCmdProc2 *objCmdProc; /* Function that evaluates the function */ double (*fn)(double x); /* Real function pointer */ } BuiltinFuncDef; static const BuiltinFuncDef BuiltinFuncTable[] = { @@ -491,7 +488,7 @@ static const BuiltinFuncDef BuiltinFuncTable[] = { typedef struct { const char *name; /* Name of object-based command. */ - Tcl_ObjCmdProc *objProc; /* Object-based function for command. */ + Tcl_ObjCmdProc2 *objProc; /* Object-based function for command. */ CompileProc *compileProc; /* Function called to compile command. */ union { int numArgs; @@ -695,6 +692,7 @@ buildInfoObjCmd2( return TCL_OK; } +#ifndef TCL_NO_DEPRECATED static int buildInfoObjCmd( void *clientData, @@ -702,8 +700,9 @@ buildInfoObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return buildInfoObjCmd2(clientData, interp, objc, objv); + return buildInfoObjCmd2(clientData, interp, (size_t)objc, objv); } +#endif /* *---------------------------------------------------------------------- @@ -776,9 +775,8 @@ Tcl_CreateInterp(void) Tcl_MutexUnlock(&cancelLock); } -#undef TclObjInterpProc if (commandTypeInit == 0) { - TclRegisterCommandTypeName(TclObjInterpProc, "proc"); + TclRegisterCommandTypeName(TclObjInterpProc2, "proc"); TclRegisterCommandTypeName(TclEnsembleImplementationCmd, "ensemble"); TclRegisterCommandTypeName(TclAliasObjCmd, "alias"); TclRegisterCommandTypeName(TclLocalAliasObjCmd, "alias"); @@ -1032,11 +1030,11 @@ Tcl_CreateInterp(void) * Create the core commands. Do it here, rather than calling * Tcl_CreateCommand, because it's faster (there's no need to check for a * preexisting command by the same name). If a command has a Tcl_CmdProc - * but no Tcl_ObjCmdProc, set the Tcl_ObjCmdProc to - * TclInvokeStringCommand. This is an object-based wrapper function that + * but no Tcl_ObjCmdProc2, set the Tcl_ObjCmdProc2 to + * InvokeStringCommand. This is an object-based wrapper function that * extracts strings, calls the string function, and creates an object for - * the result. Similarly, if a command has a Tcl_ObjCmdProc but no - * Tcl_CmdProc, set the Tcl_CmdProc to TclInvokeObjectCommand. + * the result. Similarly, if a command has a Tcl_ObjCmdProc2 but no + * Tcl_CmdProc, set the Tcl_CmdProc to InvokeObjectCommand. */ for (cmdInfoPtr = builtInCmds; cmdInfoPtr->name != NULL; cmdInfoPtr++) { @@ -1055,10 +1053,10 @@ Tcl_CreateInterp(void) cmdPtr->refCount = 1; cmdPtr->cmdEpoch = 0; cmdPtr->compileProc = cmdInfoPtr->compileProc; - cmdPtr->proc = TclInvokeObjectCommand; + cmdPtr->proc = InvokeObjectCommand; cmdPtr->clientData = cmdPtr; - cmdPtr->objProc = cmdInfoPtr->objProc; - cmdPtr->objClientData = NULL; + cmdPtr->objProc2 = cmdInfoPtr->objProc; + cmdPtr->objClientData2 = NULL; cmdPtr->deleteProc = NULL; cmdPtr->deleteData = NULL; cmdPtr->flags = 0; @@ -1067,7 +1065,7 @@ Tcl_CreateInterp(void) } cmdPtr->importRefPtr = NULL; cmdPtr->tracePtr = NULL; - cmdPtr->nreProc = cmdInfoPtr->nreProc; + cmdPtr->nreProc2 = cmdInfoPtr->nreProc; Tcl_SetHashValue(hPtr, cmdPtr); } } @@ -1108,30 +1106,30 @@ Tcl_CreateInterp(void) * Register the default [interp bgerror] handler. */ - Tcl_CreateObjCommand(interp, "::tcl::Bgerror", + Tcl_CreateObjCommand2(interp, "::tcl::Bgerror", TclDefaultBgErrorHandlerObjCmd, NULL, NULL); /* * Create unsupported commands for debugging bytecode and objects. */ - Tcl_CreateObjCommand(interp, "::tcl::unsupported::disassemble", + Tcl_CreateObjCommand2(interp, "::tcl::unsupported::disassemble", Tcl_DisassembleObjCmd, INT2PTR(0), NULL); - Tcl_CreateObjCommand(interp, "::tcl::unsupported::getbytecode", + Tcl_CreateObjCommand2(interp, "::tcl::unsupported::getbytecode", Tcl_DisassembleObjCmd, INT2PTR(1), NULL); - Tcl_CreateObjCommand(interp, "::tcl::unsupported::representation", + Tcl_CreateObjCommand2(interp, "::tcl::unsupported::representation", Tcl_RepresentationCmd, NULL, NULL); /* Adding the bytecode assembler command */ - cmdPtr = (Command *) Tcl_NRCreateCommand(interp, + cmdPtr = (Command *) Tcl_NRCreateCommand2(interp, "::tcl::unsupported::assemble", Tcl_AssembleObjCmd, TclNRAssembleObjCmd, NULL, NULL); cmdPtr->compileProc = &TclCompileAssembleCmd; /* Coroutine monkeybusiness */ - Tcl_NRCreateCommand(interp, "::tcl::unsupported::inject", NULL, + Tcl_NRCreateCommand2(interp, "::tcl::unsupported::inject", NULL, NRInjectObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "::tcl::unsupported::corotype", + Tcl_CreateObjCommand2(interp, "::tcl::unsupported::corotype", CoroTypeObjCmd, NULL, NULL); /* Export unsupported commands */ @@ -1146,7 +1144,7 @@ Tcl_CreateInterp(void) * Register the tcl::dtrace command. */ - Tcl_CreateObjCommand(interp, "::tcl::dtrace", DTraceObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "::tcl::dtrace", DTraceObjCmd, NULL, NULL); #endif /* USE_DTRACE */ /* @@ -1162,7 +1160,7 @@ Tcl_CreateInterp(void) for (builtinFuncPtr = BuiltinFuncTable; builtinFuncPtr->name != NULL; builtinFuncPtr++) { strcpy(mathFuncName+MATH_FUNC_PREFIX_LEN, builtinFuncPtr->name); - Tcl_CreateObjCommand(interp, mathFuncName, + Tcl_CreateObjCommand2(interp, mathFuncName, builtinFuncPtr->objCmdProc, (void *)builtinFuncPtr->fn, NULL); Tcl_Export(interp, nsPtr, builtinFuncPtr->name, 0); } @@ -1185,7 +1183,7 @@ Tcl_CreateInterp(void) occdPtr->i.numArgs = opcmdInfoPtr->i.numArgs; occdPtr->expected = opcmdInfoPtr->expected; strcpy(mathFuncName + MATH_OP_PREFIX_LEN, opcmdInfoPtr->name); - cmdPtr = (Command *) Tcl_CreateObjCommand(interp, mathFuncName, + cmdPtr = (Command *) Tcl_CreateObjCommand2(interp, mathFuncName, opcmdInfoPtr->objProc, occdPtr, DeleteOpCmdClientData); if (cmdPtr == NULL) { Tcl_Panic("failed to create math operator %s", @@ -1247,6 +1245,10 @@ Tcl_CreateInterp(void) Tcl_PkgProvideEx(interp, "Tcl", TCL_PATCH_LEVEL, &tclStubs); Tcl_PkgProvideEx(interp, "tcl", TCL_PATCH_LEVEL, &tclStubs); +#ifdef TCL_NO_DEPRECATED + Tcl_CreateObjCommand2(interp, "::tcl::build-info", + buildInfoObjCmd2, (void *)version, NULL); +#else Tcl_CmdInfo info2; Tcl_Command buildInfoCmd = Tcl_CreateObjCommand(interp, "::tcl::build-info", buildInfoObjCmd, (void *)version, NULL); @@ -1254,6 +1256,7 @@ Tcl_CreateInterp(void) info2.objProc2 = buildInfoObjCmd2; info2.objClientData2 = (void *)version; Tcl_SetCommandInfoFromToken(buildInfoCmd, &info2); +#endif if (TclTommath_Init(interp) != TCL_OK) { Tcl_Panic("%s", Tcl_GetStringResult(interp)); @@ -1296,7 +1299,7 @@ DeleteOpCmdClientData( * TclRegisterCommandTypeName, TclGetCommandTypeName -- * * Command type registration and lookup mechanism. Everything is keyed by - * the Tcl_ObjCmdProc for the command, and that is used as the *key* into + * the Tcl_ObjCmdProc2 for the command, and that is used as the *key* into * the hash table that maps to constant strings that are names. (It is * recommended that those names be ASCII.) * @@ -1305,7 +1308,7 @@ DeleteOpCmdClientData( void TclRegisterCommandTypeName( - Tcl_ObjCmdProc *implementationProc, + Tcl_ObjCmdProc2 *implementationProc, const char *nameStr) { Tcl_HashEntry *hPtr; @@ -1336,11 +1339,11 @@ TclGetCommandTypeName( Tcl_Command command) { Command *cmdPtr = (Command *) command; - Tcl_ObjCmdProc *procPtr = cmdPtr->objProc; + Tcl_ObjCmdProc2 *procPtr = cmdPtr->objProc2; const char *name = "native"; if (procPtr == NULL) { - procPtr = cmdPtr->nreProc; + procPtr = cmdPtr->nreProc2; } Tcl_MutexLock(&commandTypeLock); if (commandTypeInit) { @@ -1407,7 +1410,7 @@ TclHideUnsafeCommands( unsafePtr->ensembleNsName, unsafePtr->commandName, Tcl_GetStringResult(interp)); } - Tcl_CreateObjCommand(interp, TclGetString(cmdName), + Tcl_CreateObjCommand2(interp, TclGetString(cmdName), BadEnsembleSubcommand, (void *)unsafePtr, NULL); TclDecrRefCount(cmdName); TclDecrRefCount(hideName); @@ -1450,7 +1453,7 @@ static int BadEnsembleSubcommand( void *clientData, Tcl_Interp *interp, - TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(Tcl_Size) /*objc*/, TCL_UNUSED(Tcl_Obj *const *) /* objv */) { const UnsafeEnsembleInfo *infoPtr = (const UnsafeEnsembleInfo *)clientData; @@ -2152,7 +2155,7 @@ Tcl_HideCommand( if (strstr(hiddenCmdToken, "::") != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "cannot use namespace qualifiers in hidden command" - " token (rename)", -1)); + " token (rename)", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "HIDDENTOKEN", NULL); return TCL_ERROR; } @@ -2443,8 +2446,8 @@ Tcl_ExposeCommand( * If a command named cmdName already exists for interp, it is deleted. * In the future, when cmdName is seen as the name of a command by * Tcl_Eval, proc will be called. To support the bytecode interpreter, - * the command is created with a wrapper Tcl_ObjCmdProc - * (TclInvokeStringCommand) that eventually calls proc. When the command + * the command is created with a wrapper Tcl_ObjCmdProc2 + * (InvokeStringCommand) that eventually calls proc. When the command * is deleted from the table, deleteProc will be called. See the manual * entry for details on the calling sequence. * @@ -2586,8 +2589,8 @@ Tcl_CreateCommand( cmdPtr->refCount = 1; cmdPtr->cmdEpoch = 0; cmdPtr->compileProc = NULL; - cmdPtr->objProc = TclInvokeStringCommand; - cmdPtr->objClientData = cmdPtr; + cmdPtr->objProc2 = InvokeStringCommand; + cmdPtr->objClientData2 = cmdPtr; cmdPtr->proc = proc; cmdPtr->clientData = clientData; cmdPtr->deleteProc = deleteProc; @@ -2595,7 +2598,7 @@ Tcl_CreateCommand( cmdPtr->flags = 0; cmdPtr->importRefPtr = NULL; cmdPtr->tracePtr = NULL; - cmdPtr->nreProc = NULL; + cmdPtr->nreProc2 = NULL; /* * Plug in any existing import references found above. Be sure to update @@ -2606,7 +2609,7 @@ Tcl_CreateCommand( cmdPtr->importRefPtr = oldRefPtr; while (oldRefPtr != NULL) { Command *refCmdPtr = oldRefPtr->importedCmdPtr; - dataPtr = (ImportedCmdData *)refCmdPtr->objClientData; + dataPtr = (ImportedCmdData *)refCmdPtr->objClientData2; dataPtr->realCmdPtr = cmdPtr; oldRefPtr = oldRefPtr->nextPtr; } @@ -2640,32 +2643,34 @@ Tcl_CreateCommand( * * In the future, during bytecode evaluation when "cmdName" is seen as * the name of a command by Tcl_EvalObj or Tcl_Eval, the object-based - * Tcl_ObjCmdProc proc will be called. When the command is deleted from + * Tcl_ObjCmdProc2 proc will be called. When the command is deleted from * the table, deleteProc will be called. See the manual entry for details * on the calling sequence. * *---------------------------------------------------------------------- */ +#ifndef TCL_NO_DEPRECATED typedef struct { - Tcl_ObjCmdProc2 *proc; + Tcl_ObjCmdProc *proc; void *clientData; /* Arbitrary value to pass to proc function. */ Tcl_CmdDeleteProc *deleteProc; void *deleteData; /* Arbitrary value to pass to deleteProc function. */ - Tcl_ObjCmdProc2 *nreProc; + Tcl_ObjCmdProc *nreProc; } CmdWrapperInfo; static int cmdWrapperProc(void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj * const *objv) { CmdWrapperInfo *info = (CmdWrapperInfo *)clientData; - if (objc < 0) { - objc = -1; + if (objc > INT_MAX) { + Tcl_WrongNumArgs(interp, 1, objv, "?args?"); + return TCL_ERROR; } - return info->proc(info->clientData, interp, objc, objv); + return info->proc(info->clientData, interp, (int)objc, objv); } static void cmdWrapperDeleteProc(void *clientData) { @@ -2680,14 +2685,14 @@ static void cmdWrapperDeleteProc(void *clientData) { } Tcl_Command -Tcl_CreateObjCommand2( +Tcl_CreateObjCommand( Tcl_Interp *interp, /* Token for command interpreter (returned by * previous call to Tcl_CreateInterp). */ const char *cmdName, /* Name of command. If it contains namespace * qualifiers, the new command is put in the * specified namespace; otherwise it is put in * the global namespace. */ - Tcl_ObjCmdProc2 *proc, /* Object-based function to associate with + Tcl_ObjCmdProc *proc, /* Object-based function to associate with * name. */ void *clientData, /* Arbitrary value to pass to object * function. */ @@ -2702,20 +2707,21 @@ Tcl_CreateObjCommand2( info->deleteProc = deleteProc; info->deleteData = clientData; - return Tcl_CreateObjCommand(interp, cmdName, + return Tcl_CreateObjCommand2(interp, cmdName, (proc ? cmdWrapperProc : NULL), info, cmdWrapperDeleteProc); } +#endif /* TCL_NO_DEPRECATED */ Tcl_Command -Tcl_CreateObjCommand( +Tcl_CreateObjCommand2( Tcl_Interp *interp, /* Token for command interpreter (returned by * previous call to Tcl_CreateInterp). */ const char *cmdName, /* Name of command. If it contains namespace * qualifiers, the new command is put in the * specified namespace; otherwise it is put in * the global namespace. */ - Tcl_ObjCmdProc *proc, /* Object-based function to associate with + Tcl_ObjCmdProc2 *proc, /* Object-based function to associate with * name. */ void *clientData, /* Arbitrary value to pass to object * function. */ @@ -2765,7 +2771,7 @@ TclCreateObjCommandInNs( const char *cmdName, /* Name of command, without any namespace * components. */ Tcl_Namespace *namesp, /* The namespace to create the command in */ - Tcl_ObjCmdProc *proc, /* Object-based function to associate with + Tcl_ObjCmdProc2 *proc, /* Object-based function to associate with * name. */ void *clientData, /* Arbitrary value to pass to object * function. */ @@ -2873,16 +2879,16 @@ TclCreateObjCommandInNs( cmdPtr->refCount = 1; cmdPtr->cmdEpoch = 0; cmdPtr->compileProc = NULL; - cmdPtr->objProc = proc; - cmdPtr->objClientData = clientData; - cmdPtr->proc = TclInvokeObjectCommand; + cmdPtr->objProc2 = proc; + cmdPtr->objClientData2 = clientData; + cmdPtr->proc = InvokeObjectCommand; cmdPtr->clientData = cmdPtr; cmdPtr->deleteProc = deleteProc; cmdPtr->deleteData = clientData; cmdPtr->flags = 0; cmdPtr->importRefPtr = NULL; cmdPtr->tracePtr = NULL; - cmdPtr->nreProc = NULL; + cmdPtr->nreProc2 = NULL; /* * Plug in any existing import references found above. Be sure to update @@ -2894,7 +2900,7 @@ TclCreateObjCommandInNs( while (oldRefPtr != NULL) { Command *refCmdPtr = oldRefPtr->importedCmdPtr; - dataPtr = (ImportedCmdData*)refCmdPtr->objClientData; + dataPtr = (ImportedCmdData*)refCmdPtr->objClientData2; cmdPtr->refCount++; TclCleanupCommandMacro(dataPtr->realCmdPtr); dataPtr->realCmdPtr = cmdPtr; @@ -2916,11 +2922,11 @@ TclCreateObjCommandInNs( /* *---------------------------------------------------------------------- * - * TclInvokeStringCommand -- + * InvokeStringCommand -- * - * "Wrapper" Tcl_ObjCmdProc used to call an existing string-based + * "Wrapper" Tcl_ObjCmdProc2 used to call an existing string-based * Tcl_CmdProc if no object-based function exists for a command. A - * pointer to this function is stored as the Tcl_ObjCmdProc in a Command + * pointer to this function is stored as the Tcl_ObjCmdProc2 in a Command * structure. It simply turns around and calls the string Tcl_CmdProc in * the Command structure. * @@ -2929,21 +2935,27 @@ TclCreateObjCommandInNs( * * Side effects: * Besides those side effects of the called Tcl_CmdProc, - * TclInvokeStringCommand allocates and frees storage. + * InvokeStringCommand allocates and frees storage. * *---------------------------------------------------------------------- */ int -TclInvokeStringCommand( +InvokeStringCommand( void *clientData, /* Points to command's Command structure. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Command *cmdPtr = (Command *)clientData; int i, result; - const char **argv = (const char **) + const char **argv; + + if (objc > INT_MAX) { + Tcl_WrongNumArgs(interp, 1, objv, "?args?"); + return TCL_ERROR; + } + argv = (const char **) TclStackAlloc(interp, (objc + 1) * sizeof(char *)); for (i = 0; i < objc; i++) { @@ -2964,26 +2976,26 @@ TclInvokeStringCommand( /* *---------------------------------------------------------------------- * - * TclInvokeObjectCommand -- + * InvokeObjectCommand -- * * "Wrapper" Tcl_CmdProc used to call an existing object-based - * Tcl_ObjCmdProc if no string-based function exists for a command. A + * Tcl_ObjCmdProc2 if no string-based function exists for a command. A * pointer to this function is stored as the Tcl_CmdProc in a Command - * structure. It simply turns around and calls the object Tcl_ObjCmdProc + * structure. It simply turns around and calls the object Tcl_ObjCmdProc2 * in the Command structure. * * Results: * A standard Tcl result value. * * Side effects: - * Besides those side effects of the called Tcl_ObjCmdProc, - * TclInvokeObjectCommand allocates and frees storage. + * Besides those side effects of the called Tcl_ObjCmdProc2, + * InvokeObjectCommand allocates and frees storage. * *---------------------------------------------------------------------- */ int -TclInvokeObjectCommand( +InvokeObjectCommand( void *clientData, /* Points to command's Command structure. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ @@ -2992,9 +3004,14 @@ TclInvokeObjectCommand( Command *cmdPtr = ( Command *) clientData; Tcl_Obj *objPtr; int i, length, result; - Tcl_Obj **objv = (Tcl_Obj **) - TclStackAlloc(interp, (argc * sizeof(Tcl_Obj *))); + Tcl_Obj **objv; + if (argc < 0) { + argc = TCL_INDEX_NONE; /* Make sure any invalid argc is handled as TCL_INDEX_NONE */ + objv = NULL; + } else { + objv = (Tcl_Obj **) TclStackAlloc(interp, (argc * sizeof(Tcl_Obj *))); + } for (i = 0; i < argc; i++) { length = strlen(argv[i]); TclNewStringObj(objPtr, argv[i], length); @@ -3003,14 +3020,14 @@ TclInvokeObjectCommand( } /* - * Invoke the command's object-based Tcl_ObjCmdProc. + * Invoke the command's object-based Tcl_ObjCmdProc2. */ - if (cmdPtr->objProc != NULL) { - result = cmdPtr->objProc(cmdPtr->objClientData, interp, argc, objv); + if (cmdPtr->objProc2 != NULL) { + result = cmdPtr->objProc2(cmdPtr->objClientData2, interp, argc, objv); } else { - result = Tcl_NRCallObjProc(interp, cmdPtr->nreProc, - cmdPtr->objClientData, argc, objv); + result = Tcl_NRCallObjProc2(interp, cmdPtr->nreProc2, + cmdPtr->objClientData2, argc, objv); } /* @@ -3022,7 +3039,9 @@ TclInvokeObjectCommand( objPtr = objv[i]; Tcl_DecrRefCount(objPtr); } - TclStackFree(interp, objv); + if (objv != NULL) { + TclStackFree(interp, objv); + } return result; } @@ -3188,11 +3207,11 @@ TclRenameCommand( */ Tcl_DStringInit(&newFullName); - Tcl_DStringAppend(&newFullName, newNsPtr->fullName, -1); + Tcl_DStringAppend(&newFullName, newNsPtr->fullName, TCL_INDEX_NONE); if (newNsPtr != iPtr->globalNsPtr) { TclDStringAppendLiteral(&newFullName, "::"); } - Tcl_DStringAppend(&newFullName, newTail, -1); + Tcl_DStringAppend(&newFullName, newTail, TCL_INDEX_NONE); cmdPtr->refCount++; CallCommandTraces(iPtr, cmdPtr, TclGetString(oldFullName), Tcl_DStringValue(&newFullName), TCL_TRACE_RENAME); @@ -3287,39 +3306,41 @@ Tcl_SetCommandInfo( *---------------------------------------------------------------------- */ +#ifndef TCL_NO_DEPRECATED static int invokeObj2Command( void *clientData, /* Points to command's Command structure. */ Tcl_Interp *interp, /* Current interpreter. */ - Tcl_Size objc, /* Number of arguments. */ + int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int result; Command *cmdPtr = (Command *) clientData; - if (objc > INT_MAX) { - return TclCommandWordLimitError(interp, objc); + if (objc < 0) { + objc = TCL_INDEX_NONE; } - if (cmdPtr->objProc != NULL) { - result = cmdPtr->objProc(cmdPtr->objClientData, interp, objc, objv); + if (cmdPtr->objProc2 != NULL) { + result = cmdPtr->objProc2(cmdPtr->objClientData2, interp, (size_t)objc, objv); } else { - result = Tcl_NRCallObjProc(interp, cmdPtr->nreProc, - cmdPtr->objClientData, objc, objv); + result = Tcl_NRCallObjProc2(interp, cmdPtr->nreProc2, + cmdPtr->objClientData2, (size_t)objc, objv); } return result; } static int cmdWrapper2Proc(void *clientData, Tcl_Interp *interp, - Tcl_Size objc, + int objc, Tcl_Obj *const objv[]) { Command *cmdPtr = (Command *)clientData; - if (objc > INT_MAX) { - return TclCommandWordLimitError(interp, objc); + if (objc < 0) { + objc = -1; } - return cmdPtr->objProc(cmdPtr->objClientData, interp, objc, objv); + return cmdPtr->objProc2(cmdPtr->objClientData2, interp, (size_t)objc, objv); } +#endif int Tcl_SetCommandInfoFromToken( @@ -3339,43 +3360,49 @@ Tcl_SetCommandInfoFromToken( cmdPtr = (Command *) cmd; cmdPtr->proc = infoPtr->proc; cmdPtr->clientData = infoPtr->clientData; - if (infoPtr->objProc == NULL) { - cmdPtr->objProc = TclInvokeStringCommand; - cmdPtr->objClientData = cmdPtr; - cmdPtr->nreProc = NULL; + if (infoPtr->objProc2 == NULL) { + cmdPtr->objProc2 = InvokeStringCommand; + cmdPtr->objClientData2 = cmdPtr; + cmdPtr->nreProc2 = NULL; } else { - if (infoPtr->objProc != cmdPtr->objProc) { - cmdPtr->nreProc = NULL; - cmdPtr->objProc = infoPtr->objProc; + if (infoPtr->objProc2 != cmdPtr->objProc2) { + cmdPtr->nreProc2 = NULL; + cmdPtr->objProc2 = infoPtr->objProc2; } - cmdPtr->objClientData = infoPtr->objClientData; + cmdPtr->objClientData2 = infoPtr->objClientData2; } +#ifndef TCL_NO_DEPRECATED if (cmdPtr->deleteProc == cmdWrapperDeleteProc) { CmdWrapperInfo *info = (CmdWrapperInfo *)cmdPtr->deleteData; - if (infoPtr->objProc2 == NULL) { + if (infoPtr->objProc == NULL) { info->proc = invokeObj2Command; info->clientData = cmdPtr; - info->nreProc = NULL; + info->nreProc = NULL; } else { - if (infoPtr->objProc2 != info->proc) { - info->nreProc = NULL; - info->proc = infoPtr->objProc2; + if (infoPtr->objProc != info->proc) { + info->nreProc = NULL; + info->proc = infoPtr->objProc; } - info->clientData = infoPtr->objClientData2; + info->clientData = infoPtr->objClientData; } info->deleteProc = infoPtr->deleteProc; info->deleteData = infoPtr->deleteData; - } else { - if ((infoPtr->objProc2 != NULL) && (infoPtr->objProc2 != cmdWrapper2Proc)) { + } else +#endif + { +#ifndef TCL_NO_DEPRECATED + if ((infoPtr->objProc != NULL) && (infoPtr->objProc != cmdWrapper2Proc)) { CmdWrapperInfo *info = (CmdWrapperInfo *)Tcl_Alloc(sizeof(CmdWrapperInfo)); - info->proc = infoPtr->objProc2; - info->clientData = infoPtr->objClientData2; + info->proc = infoPtr->objProc; + info->clientData = infoPtr->objClientData; info->nreProc = NULL; info->deleteProc = infoPtr->deleteProc; info->deleteData = infoPtr->deleteData; cmdPtr->deleteProc = cmdWrapperDeleteProc; cmdPtr->deleteData = info; - } else { + } else +#endif + { cmdPtr->deleteProc = infoPtr->deleteProc; cmdPtr->deleteData = infoPtr->deleteData; } @@ -3452,25 +3479,30 @@ Tcl_GetCommandInfoFromToken( cmdPtr = (Command *) cmd; infoPtr->isNativeObjectProc = - (cmdPtr->objProc != TclInvokeStringCommand); - infoPtr->objProc = cmdPtr->objProc; - infoPtr->objClientData = cmdPtr->objClientData; + (cmdPtr->objProc2 != InvokeStringCommand) ? 2 : 0; + infoPtr->objProc2 = cmdPtr->objProc2; + infoPtr->objClientData2 = cmdPtr->objClientData2; infoPtr->proc = cmdPtr->proc; infoPtr->clientData = cmdPtr->clientData; +#ifndef TCL_NO_DEPRECATED if (cmdPtr->deleteProc == cmdWrapperDeleteProc) { CmdWrapperInfo *info = (CmdWrapperInfo *)cmdPtr->deleteData; infoPtr->deleteProc = info->deleteProc; - infoPtr->deleteData = info->deleteData; - infoPtr->objProc2 = info->proc; - infoPtr->objClientData2 = info->clientData; - if (cmdPtr->objProc == cmdWrapperProc) { - infoPtr->isNativeObjectProc = 2; + infoPtr->deleteData = info->deleteData; + infoPtr->objProc = info->proc; + infoPtr->objClientData = info->clientData; + if (cmdPtr->objProc2 == cmdWrapperProc) { + infoPtr->isNativeObjectProc = 1; } - } else { + } else +#endif + { infoPtr->deleteProc = cmdPtr->deleteProc; infoPtr->deleteData = cmdPtr->deleteData; - infoPtr->objProc2 = cmdWrapper2Proc; - infoPtr->objClientData2 = cmdPtr; +#ifndef TCL_NO_DEPRECATED + infoPtr->objProc = cmdWrapper2Proc; + infoPtr->objClientData = cmdPtr; +#endif } infoPtr->namespacePtr = (Tcl_Namespace *) cmdPtr->nsPtr; return 1; @@ -3556,14 +3588,14 @@ Tcl_GetCommandFullName( if ((cmdPtr != NULL) && TclRoutineHasName(cmdPtr)) { if (cmdPtr->nsPtr != NULL) { - Tcl_AppendToObj(objPtr, cmdPtr->nsPtr->fullName, -1); + Tcl_AppendToObj(objPtr, cmdPtr->nsPtr->fullName, TCL_INDEX_NONE); if (cmdPtr->nsPtr != iPtr->globalNsPtr) { Tcl_AppendToObj(objPtr, "::", 2); } } if (cmdPtr->hPtr != NULL) { name = (char *)Tcl_GetHashKey(cmdPtr->hPtr->tablePtr, cmdPtr->hPtr); - Tcl_AppendToObj(objPtr, name, -1); + Tcl_AppendToObj(objPtr, name, TCL_INDEX_NONE); } } } @@ -3786,7 +3818,7 @@ Tcl_DeleteCommandFromToken( * commands. */ - cmdPtr->objProc = NULL; + cmdPtr->objProc2 = NULL; /* * Now free the Command structure, unless there is another reference to it @@ -4064,7 +4096,7 @@ TclInterpReady( if (iPtr->flags & DELETED) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "attempt to call eval in deleted interpreter", -1)); + "attempt to call eval in deleted interpreter", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "IDELETE", "attempt to call eval in deleted interpreter", NULL); return TCL_ERROR; @@ -4093,7 +4125,7 @@ TclInterpReady( } Tcl_SetObjResult(interp, Tcl_NewStringObj( - "too many nested evaluations (infinite loop?)", -1)); + "too many nested evaluations (infinite loop?)", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "LIMIT", "STACK", NULL); return TCL_ERROR; } @@ -4227,7 +4259,7 @@ Tcl_Canceled( } } - Tcl_SetObjResult(interp, Tcl_NewStringObj(message, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(message, TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "CANCEL", id, message, NULL); } @@ -4432,7 +4464,7 @@ EvalObjvCore( { Command *cmdPtr = NULL, *preCmdPtr = (Command *)data[0]; int flags = PTR2INT(data[1]); - int objc = PTR2INT(data[2]); + Tcl_Size objc = PTR2INT(data[2]); Tcl_Obj **objv = (Tcl_Obj **)data[3]; Interp *iPtr = (Interp *) interp; Namespace *lookupNsPtr = NULL; @@ -4579,8 +4611,8 @@ EvalObjvCore( } TclNRAddCallback(interp, Dispatch, - cmdPtr->nreProc ? cmdPtr->nreProc : cmdPtr->objProc, - cmdPtr->objClientData, INT2PTR(objc), objv); + cmdPtr->nreProc2 ? cmdPtr->nreProc2 : cmdPtr->objProc2, + cmdPtr->objClientData2, INT2PTR(objc), objv); return TCL_OK; } @@ -4590,16 +4622,16 @@ Dispatch( Tcl_Interp *interp, TCL_UNUSED(int) /*result*/) { - Tcl_ObjCmdProc *objProc = (Tcl_ObjCmdProc *)data[0]; + Tcl_ObjCmdProc2 *objProc = (Tcl_ObjCmdProc2 *)data[0]; void *clientData = data[1]; - int objc = PTR2INT(data[2]); + Tcl_Size objc = PTR2INT(data[2]); Tcl_Obj **objv = (Tcl_Obj **)data[3]; Interp *iPtr = (Interp *) interp; #ifdef USE_DTRACE if (TCL_DTRACE_CMD_ARGS_ENABLED()) { const char *a[10]; - int i = 0; + Tcl_Size i = 0; while (i < 10) { a[i] = i < objc ? TclGetString(objv[i]) : NULL; i++; @@ -4705,7 +4737,7 @@ NRCommand( static void TEOV_PushExceptionHandlers( Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[], int flags) { @@ -4801,7 +4833,7 @@ TEOV_Error( Tcl_Obj *listPtr; const char *cmdString; Tcl_Size cmdLen; - int objc = PTR2INT(data[0]); + Tcl_Size objc = PTR2INT(data[0]); Tcl_Obj **objv = (Tcl_Obj **)data[1]; if ((result == TCL_ERROR) && !(iPtr->flags & ERR_ALREADY_LOGGED)) { @@ -4823,7 +4855,7 @@ TEOV_Error( static int TEOV_NotFound( Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[], Namespace *lookupNsPtr) { @@ -4924,11 +4956,11 @@ TEOV_NotFoundCallback( int result) { Interp *iPtr = (Interp *) interp; - int objc = PTR2INT(data[0]); + Tcl_Size objc = PTR2INT(data[0]); Tcl_Obj **objv = (Tcl_Obj **)data[1]; Namespace *savedNsPtr = (Namespace *)data[2]; - int i; + Tcl_Size i; if (savedNsPtr) { iPtr->varFramePtr->nsPtr = savedNsPtr; @@ -4951,7 +4983,7 @@ TEOV_RunEnterTraces( Tcl_Interp *interp, Command **cmdPtrPtr, Tcl_Obj *commandPtr, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *) interp; @@ -5005,7 +5037,7 @@ TEOV_RunLeaveTraces( { Interp *iPtr = (Interp *) interp; int traceCode = TCL_OK; - int objc = PTR2INT(data[0]); + Tcl_Size objc = PTR2INT(data[0]); Tcl_Obj *commandPtr = (Tcl_Obj *)data[1]; Command *cmdPtr = (Command *)data[2]; Tcl_Obj **objv = (Tcl_Obj **)data[3]; @@ -5167,17 +5199,17 @@ TclEvalEx( { Interp *iPtr = (Interp *) interp; const char *p, *next; - const int minObjs = 20; + const unsigned int minObjs = 20; Tcl_Obj **objv, **objvSpace; int *expand, *lines, *lineSpace; Tcl_Token *tokenPtr; - int expandRequested, code = TCL_OK; - Tcl_Size bytesLeft, commandLength; + int bytesLeft, expandRequested, code = TCL_OK; + Tcl_Size commandLength; CallFrame *savedVarFramePtr;/* Saves old copy of iPtr->varFramePtr in case * TCL_EVAL_GLOBAL was set. */ int allowExceptions = (iPtr->evalFlags & TCL_ALLOW_EXCEPTIONS); int gotParse = 0; - Tcl_Size i, objectsUsed = 0; + TCL_HASH_TYPE i, objectsUsed = 0; /* These variables keep track of how much * state has been allocated while evaluating * the script, so that it can be freed @@ -5315,8 +5347,8 @@ TclEvalEx( Tcl_Size wordLine = line; const char *wordStart = parsePtr->commandStart; int *wordCLNext = clNext; - Tcl_Size objectsNeeded = 0; - Tcl_Size numWords = parsePtr->numWords; + unsigned int objectsNeeded = 0; + unsigned int numWords = parsePtr->numWords; /* * Generate an array of objects for the words of the command. @@ -5335,8 +5367,6 @@ TclEvalEx( for (objectsUsed = 0, tokenPtr = parsePtr->tokenPtr; objectsUsed < numWords; objectsUsed++, tokenPtr += tokenPtr->numComponents+1) { - Tcl_Size additionalObjsCount; - /* * TIP #280. Track lines to current word. Save the information * on a per-word basis, signaling dynamic words as needed. @@ -5386,22 +5416,12 @@ TclEvalEx( expandRequested = 1; expand[objectsUsed] = 1; - additionalObjsCount = (numElements ? numElements : 1); - + objectsNeeded += (numElements ? numElements : 1); } else { expand[objectsUsed] = 0; - additionalObjsCount = 1; + objectsNeeded++; } - /* Currently max command words in INT_MAX */ - if (additionalObjsCount > INT_MAX || - objectsNeeded > (INT_MAX - additionalObjsCount)) { - code = TclCommandWordLimitError(interp, -1); - Tcl_DecrRefCount(objv[objectsUsed]); - break; - } - objectsNeeded += additionalObjsCount; - if (wordCLNext) { TclContinuationsEnterDerived(objv[objectsUsed], wordStart - outerScript, wordCLNext); @@ -5718,11 +5738,12 @@ void TclArgumentEnter( Tcl_Interp *interp, Tcl_Obj **objv, - int objc, + Tcl_Size objc, CmdFrame *cfPtr) { Interp *iPtr = (Interp *) interp; - int isNew, i; + int isNew; + Tcl_Size i; Tcl_HashEntry *hPtr; CFWord *cfwPtr; @@ -5786,10 +5807,10 @@ void TclArgumentRelease( Tcl_Interp *interp, Tcl_Obj **objv, - int objc) + Tcl_Size objc) { Interp *iPtr = (Interp *) interp; - int i; + Tcl_Size i; for (i = 1; i < objc; i++) { CFWord *cfwPtr; @@ -5834,14 +5855,14 @@ void TclArgumentBCEnter( Tcl_Interp *interp, Tcl_Obj *objv[], - int objc, + Tcl_Size objc, void *codePtr, CmdFrame *cfPtr, int cmd, Tcl_Size pc) { ExtCmdLoc *eclPtr; - int word; + Tcl_Size word; ECL *ePtr; CFWordBC *lastPtr = NULL; Interp *iPtr = (Interp *) interp; @@ -6376,10 +6397,10 @@ ProcessUnexpectedResult( Tcl_ResetResult(interp); if (returnCode == TCL_BREAK) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "invoked \"break\" outside of a loop", -1)); + "invoked \"break\" outside of a loop", TCL_INDEX_NONE)); } else if (returnCode == TCL_CONTINUE) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "invoked \"continue\" outside of a loop", -1)); + "invoked \"continue\" outside of a loop", TCL_INDEX_NONE)); } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "command returned bad code: %d", returnCode)); @@ -6425,7 +6446,7 @@ Tcl_ExprLong( *ptr = 0; } else { - exprPtr = Tcl_NewStringObj(exprstring, -1); + exprPtr = Tcl_NewStringObj(exprstring, TCL_INDEX_NONE); Tcl_IncrRefCount(exprPtr); result = Tcl_ExprLongObj(interp, exprPtr, ptr); Tcl_DecrRefCount(exprPtr); @@ -6450,7 +6471,7 @@ Tcl_ExprDouble( *ptr = 0.0; } else { - exprPtr = Tcl_NewStringObj(exprstring, -1); + exprPtr = Tcl_NewStringObj(exprstring, TCL_INDEX_NONE); Tcl_IncrRefCount(exprPtr); result = Tcl_ExprDoubleObj(interp, exprPtr, ptr); Tcl_DecrRefCount(exprPtr); @@ -6475,7 +6496,7 @@ Tcl_ExprBoolean( return TCL_OK; } else { int result; - Tcl_Obj *exprPtr = Tcl_NewStringObj(exprstring, -1); + Tcl_Obj *exprPtr = Tcl_NewStringObj(exprstring, TCL_INDEX_NONE); Tcl_IncrRefCount(exprPtr); result = Tcl_ExprBooleanObj(interp, exprPtr, ptr); @@ -6632,7 +6653,7 @@ int TclObjInvokeNamespace( Tcl_Interp *interp, /* Interpreter in which command is to be * invoked. */ - int objc, /* Count of arguments. */ + Tcl_Size objc, /* Count of arguments. */ Tcl_Obj *const objv[], /* Argument objects; objv[0] points to the * name of the command to invoke. */ Tcl_Namespace *nsPtr, /* The namespace to use. */ @@ -6676,7 +6697,7 @@ int TclObjInvoke( Tcl_Interp *interp, /* Interpreter in which command is to be * invoked. */ - int objc, /* Count of arguments. */ + Tcl_Size objc, /* Count of arguments. */ Tcl_Obj *const objv[], /* Argument objects; objv[0] points to the * name of the command to invoke. */ int flags) /* Combination of flags controlling the call: @@ -6688,20 +6709,20 @@ TclObjInvoke( } if ((objc < 1) || (objv == NULL)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "illegal argument vector", -1)); + "illegal argument vector", TCL_INDEX_NONE)); return TCL_ERROR; } if ((flags & TCL_INVOKE_HIDDEN) == 0) { Tcl_Panic("TclObjInvoke: called without TCL_INVOKE_HIDDEN"); } - return Tcl_NRCallObjProc(interp, TclNRInvoke, NULL, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRInvoke, NULL, objc, objv); } int TclNRInvoke( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *) interp; @@ -6787,7 +6808,7 @@ Tcl_ExprString( Tcl_SetObjResult(interp, Tcl_NewWideIntObj(0)); } else { - Tcl_Obj *resultPtr, *exprObj = Tcl_NewStringObj(expr, -1); + Tcl_Obj *resultPtr, *exprObj = Tcl_NewStringObj(expr, TCL_INDEX_NONE); Tcl_IncrRefCount(exprObj); code = Tcl_ExprObj(interp, exprObj, &resultPtr); @@ -6901,10 +6922,10 @@ Tcl_VarEval( if (string == NULL) { break; } - Tcl_DStringAppend(&buf, string, -1); + Tcl_DStringAppend(&buf, string, TCL_INDEX_NONE); } - result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); + result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), TCL_INDEX_NONE, 0); Tcl_DStringFree(&buf); return result; } @@ -7032,7 +7053,7 @@ ExprCeilFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Actual parameter list. */ { int code; @@ -7072,7 +7093,7 @@ ExprFloorFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Actual parameter list. */ { int code; @@ -7111,7 +7132,7 @@ static int ExprIsqrtFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Actual parameter list. */ { void *ptr; @@ -7207,7 +7228,7 @@ ExprIsqrtFunc( negarg: Tcl_SetObjResult(interp, Tcl_NewStringObj( - "square root of negative argument", -1)); + "square root of negative argument", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", "domain error: argument not in valid range", NULL); return TCL_ERROR; @@ -7218,7 +7239,7 @@ ExprSqrtFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Actual parameter list. */ { int code; @@ -7272,7 +7293,7 @@ ExprUnaryFunc( * double result. */ Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count */ + Tcl_Size objc, /* Actual parameter count */ Tcl_Obj *const *objv) /* Actual parameter list */ { int code; @@ -7336,7 +7357,7 @@ ExprBinaryFunc( * double result. */ Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Parameter vector. */ { int code; @@ -7386,7 +7407,7 @@ ExprAbsFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Parameter vector. */ { void *ptr; @@ -7494,7 +7515,7 @@ ExprBoolFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Actual parameter vector. */ { int value; @@ -7515,7 +7536,7 @@ ExprDoubleFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Actual parameter vector. */ { double dResult; @@ -7542,7 +7563,7 @@ ExprIntFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Actual parameter vector. */ { double d; @@ -7598,7 +7619,7 @@ ExprWideFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Actual parameter vector. */ { Tcl_WideInt wResult; @@ -7619,13 +7640,14 @@ ExprMaxMinFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv, /* Actual parameter vector. */ int op) /* Comparison direction */ { Tcl_Obj *res; double d; - int type, i; + int type; + Tcl_Size i; void *ptr; if (objc < 2) { @@ -7659,7 +7681,7 @@ ExprMaxFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Actual parameter vector. */ { return ExprMaxMinFunc(NULL, interp, objc, objv, MP_GT); @@ -7670,7 +7692,7 @@ ExprMinFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Actual parameter vector. */ { return ExprMaxMinFunc(NULL, interp, objc, objv, MP_LT); @@ -7681,7 +7703,7 @@ ExprRandFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Actual parameter vector. */ { Interp *iPtr = (Interp *) interp; @@ -7774,7 +7796,7 @@ ExprRoundFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Parameter vector. */ { double d; @@ -7853,7 +7875,7 @@ ExprSrandFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count. */ + Tcl_Size objc, /* Actual parameter count. */ Tcl_Obj *const *objv) /* Parameter vector. */ { Interp *iPtr = (Interp *) interp; @@ -8042,7 +8064,7 @@ ExprIsFiniteFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count */ + Tcl_Size objc, /* Actual parameter count */ Tcl_Obj *const *objv) /* Actual parameter list */ { double d; @@ -8073,7 +8095,7 @@ ExprIsInfinityFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count */ + Tcl_Size objc, /* Actual parameter count */ Tcl_Obj *const *objv) /* Actual parameter list */ { double d; @@ -8103,7 +8125,7 @@ ExprIsNaNFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count */ + Tcl_Size objc, /* Actual parameter count */ Tcl_Obj *const *objv) /* Actual parameter list */ { double d; @@ -8133,7 +8155,7 @@ ExprIsNormalFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count */ + Tcl_Size objc, /* Actual parameter count */ Tcl_Obj *const *objv) /* Actual parameter list */ { double d; @@ -8163,7 +8185,7 @@ ExprIsSubnormalFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count */ + Tcl_Size objc, /* Actual parameter count */ Tcl_Obj *const *objv) /* Actual parameter list */ { double d; @@ -8193,7 +8215,7 @@ ExprIsUnorderedFunc( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count */ + Tcl_Size objc, /* Actual parameter count */ Tcl_Obj *const *objv) /* Actual parameter list */ { double d; @@ -8234,7 +8256,7 @@ FloatClassifyObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter in which to execute the * function. */ - int objc, /* Actual parameter count */ + Tcl_Size objc, /* Actual parameter count */ Tcl_Obj *const *objv) /* Actual parameter list */ { double d; @@ -8342,7 +8364,7 @@ static int DTraceObjCmd( TCL_UNUSED(void *), TCL_UNUSED(Tcl_Interp *), - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { if (TCL_DTRACE_TCL_PROBE_ENABLED()) { @@ -8485,9 +8507,9 @@ TCL_DTRACE_DEBUG_LOG() */ int -Tcl_NRCallObjProc( +Tcl_NRCallObjProc2( Tcl_Interp *interp, - Tcl_ObjCmdProc *objProc, + Tcl_ObjCmdProc2 *objProc, void *clientData, Tcl_Size objc, Tcl_Obj *const objv[]) @@ -8499,28 +8521,26 @@ Tcl_NRCallObjProc( return TclNRRunCallbacks(interp, TCL_OK, rootPtr); } +#ifndef TCL_NO_DEPRECATED int wrapperNRObjProc( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CmdWrapperInfo *info = (CmdWrapperInfo *)clientData; clientData = info->clientData; - Tcl_ObjCmdProc2 *proc = info->proc; + Tcl_ObjCmdProc *proc = info->proc; Tcl_Free(info); - if (objc < 0) { - objc = -1; - } - return proc(clientData, interp, (Tcl_Size)objc, objv); + return proc(clientData, interp, (int)objc, objv); } int -Tcl_NRCallObjProc2( +Tcl_NRCallObjProc( Tcl_Interp *interp, - Tcl_ObjCmdProc2 *objProc, + Tcl_ObjCmdProc *objProc, void *clientData, - ptrdiff_t objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc > INT_MAX) { @@ -8537,6 +8557,7 @@ Tcl_NRCallObjProc2( INT2PTR(objc), objv); return TclNRRunCallbacks(interp, TCL_OK, rootPtr); } +#endif /* TCL_NO_DEPRECATED */ /* *---------------------------------------------------------------------- @@ -8552,45 +8573,43 @@ Tcl_NRCallObjProc2( * Side effects: * If no command named "cmdName" already exists for interp, one is * created. Otherwise, if a command does exist, then if the object-based - * Tcl_ObjCmdProc is TclInvokeStringCommand, we assume Tcl_CreateCommand + * Tcl_ObjCmdProc2 is InvokeStringCommand, we assume Tcl_CreateCommand * was called previously for the same command and just set its - * Tcl_ObjCmdProc to the argument "proc"; otherwise, we delete the old + * Tcl_ObjCmdProc2 to the argument "proc"; otherwise, we delete the old * command. * * In the future, during bytecode evaluation when "cmdName" is seen as * the name of a command by Tcl_EvalObj or Tcl_Eval, the object-based - * Tcl_ObjCmdProc proc will be called. When the command is deleted from + * Tcl_ObjCmdProc2 proc will be called. When the command is deleted from * the table, deleteProc will be called. See the manual entry for details * on the calling sequence. * *---------------------------------------------------------------------- */ +#ifndef TCL_NO_DEPRECATED static int cmdWrapperNreProc( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CmdWrapperInfo *info = (CmdWrapperInfo *)clientData; - if (objc < 0) { - objc = -1; - } return info->nreProc(info->clientData, interp, objc, objv); } Tcl_Command -Tcl_NRCreateCommand2( +Tcl_NRCreateCommand( Tcl_Interp *interp, /* Token for command interpreter (returned by * previous call to Tcl_CreateInterp). */ const char *cmdName, /* Name of command. If it contains namespace * qualifiers, the new command is put in the * specified namespace; otherwise it is put in * the global namespace. */ - Tcl_ObjCmdProc2 *proc, /* Object-based function to associate with + Tcl_ObjCmdProc *proc, /* Object-based function to associate with * name, provides direct access for direct * calls. */ - Tcl_ObjCmdProc2 *nreProc, /* Object-based function to associate with + Tcl_ObjCmdProc *nreProc, /* Object-based function to associate with * name, provides NR implementation */ void *clientData, /* Arbitrary value to pass to object * function. */ @@ -8604,24 +8623,26 @@ Tcl_NRCreateCommand2( info->nreProc = nreProc; info->deleteProc = deleteProc; info->deleteData = clientData; - return Tcl_NRCreateCommand(interp, cmdName, + return Tcl_NRCreateCommand2(interp, cmdName, (proc ? cmdWrapperProc : NULL), (nreProc ? cmdWrapperNreProc : NULL), info, cmdWrapperDeleteProc); } +#endif /* TCL_NO_DEPRECATED */ + Tcl_Command -Tcl_NRCreateCommand( +Tcl_NRCreateCommand2( Tcl_Interp *interp, /* Token for command interpreter (returned by * previous call to Tcl_CreateInterp). */ const char *cmdName, /* Name of command. If it contains namespace * qualifiers, the new command is put in the * specified namespace; otherwise it is put in * the global namespace. */ - Tcl_ObjCmdProc *proc, /* Object-based function to associate with + Tcl_ObjCmdProc2 *proc, /* Object-based function to associate with * name, provides direct access for direct * calls. */ - Tcl_ObjCmdProc *nreProc, /* Object-based function to associate with + Tcl_ObjCmdProc2 *nreProc, /* Object-based function to associate with * name, provides NR implementation */ void *clientData, /* Arbitrary value to pass to object * function. */ @@ -8630,10 +8651,10 @@ Tcl_NRCreateCommand( * this command is deleted. */ { Command *cmdPtr = (Command *) - Tcl_CreateObjCommand(interp, cmdName, proc, clientData, + Tcl_CreateObjCommand2(interp, cmdName, proc, clientData, deleteProc); - cmdPtr->nreProc = nreProc; + cmdPtr->nreProc2 = nreProc; return (Tcl_Command) cmdPtr; } @@ -8642,8 +8663,8 @@ TclNRCreateCommandInNs( Tcl_Interp *interp, const char *cmdName, Tcl_Namespace *nsPtr, - Tcl_ObjCmdProc *proc, - Tcl_ObjCmdProc *nreProc, + Tcl_ObjCmdProc2 *proc, + Tcl_ObjCmdProc2 *nreProc, void *clientData, Tcl_CmdDeleteProc *deleteProc) { @@ -8651,7 +8672,7 @@ TclNRCreateCommandInNs( TclCreateObjCommandInNs(interp, cmdName, nsPtr, proc, clientData, deleteProc); - cmdPtr->nreProc = nreProc; + cmdPtr->nreProc2 = nreProc; return (Tcl_Command) cmdPtr; } @@ -8809,7 +8830,7 @@ int TclNRTailcallObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *) interp; @@ -8821,7 +8842,7 @@ TclNRTailcallObjCmd( if (!(iPtr->varFramePtr->isProcCallFrame & 1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "tailcall can only be called from a proc, lambda or method", -1)); + "tailcall can only be called from a proc, lambda or method", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", NULL); return TCL_ERROR; } @@ -8851,7 +8872,7 @@ TclNRTailcallObjCmd( * namespace, the rest the command to be tailcalled. */ - nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, -1); + nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, TCL_INDEX_NONE); listPtr = Tcl_NewListObj(objc, objv); TclListObjSetElement(interp, listPtr, 0, nsObjPtr); @@ -8971,7 +8992,7 @@ int TclNRYieldObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CoroutineData *corPtr = iPtr->execEnvPtr->corPtr; @@ -8983,7 +9004,7 @@ TclNRYieldObjCmd( if (!corPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "yield can only be called in a coroutine", -1)); + "yield can only be called in a coroutine", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", NULL); return TCL_ERROR; } @@ -9002,7 +9023,7 @@ int TclNRYieldToObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CoroutineData *corPtr = iPtr->execEnvPtr->corPtr; @@ -9016,14 +9037,14 @@ TclNRYieldToObjCmd( if (!corPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "yieldto can only be called in a coroutine", -1)); + "yieldto can only be called in a coroutine", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", NULL); return TCL_ERROR; } if (((Namespace *) nsPtr)->flags & NS_DYING) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "yieldto called in deleted namespace", -1)); + "yieldto called in deleted namespace", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "YIELDTO_IN_DELETED", NULL); return TCL_ERROR; @@ -9036,7 +9057,7 @@ TclNRYieldToObjCmd( */ listPtr = Tcl_NewListObj(objc, objv); - nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, -1); + nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, TCL_INDEX_NONE); TclListObjSetElement(interp, listPtr, 0, nsObjPtr); /* @@ -9258,7 +9279,7 @@ TclNRCoroutineActivateCallback( Tcl_SetObjResult(interp, Tcl_NewStringObj( - "cannot yield: C stack busy", -1)); + "cannot yield: C stack busy", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "CANT_YIELD", NULL); return TCL_ERROR; @@ -9329,7 +9350,7 @@ static int CoroTypeObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Command *cmdPtr; @@ -9345,9 +9366,9 @@ CoroTypeObjCmd( */ cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, objv[1]); - if ((!cmdPtr) || (cmdPtr->nreProc != TclNRInterpCoroutine)) { + if ((!cmdPtr) || (cmdPtr->nreProc2 != TclNRInterpCoroutine)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "can only get coroutine type of a coroutine", -1)); + "can only get coroutine type of a coroutine", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COROUTINE", TclGetString(objv[1]), NULL); return TCL_ERROR; @@ -9358,9 +9379,9 @@ CoroTypeObjCmd( * future. */ - corPtr = (CoroutineData *)cmdPtr->objClientData; + corPtr = (CoroutineData *)cmdPtr->objClientData2; if (!COR_IS_SUSPENDED(corPtr)) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("active", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("active", TCL_INDEX_NONE)); return TCL_OK; } @@ -9371,14 +9392,14 @@ CoroTypeObjCmd( switch (corPtr->nargs) { case COROUTINE_ARGUMENTS_SINGLE_OPTIONAL: - Tcl_SetObjResult(interp, Tcl_NewStringObj("yield", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("yield", TCL_INDEX_NONE)); return TCL_OK; case COROUTINE_ARGUMENTS_ARBITRARY: - Tcl_SetObjResult(interp, Tcl_NewStringObj("yieldto", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("yieldto", TCL_INDEX_NONE)); return TCL_OK; default: Tcl_SetObjResult(interp, Tcl_NewStringObj( - "unknown coroutine type", -1)); + "unknown coroutine type", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "BAD_TYPE", NULL); return TCL_ERROR; } @@ -9406,20 +9427,20 @@ GetCoroutineFromObj( Command *cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, objPtr); - if ((!cmdPtr) || (cmdPtr->nreProc != TclNRInterpCoroutine)) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(errMsg, -1)); + if ((!cmdPtr) || (cmdPtr->nreProc2 != TclNRInterpCoroutine)) { + Tcl_SetObjResult(interp, Tcl_NewStringObj(errMsg, TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COROUTINE", TclGetString(objPtr), NULL); return NULL; } - return (CoroutineData *)cmdPtr->objClientData; + return (CoroutineData *)cmdPtr->objClientData2; } static int TclNRCoroInjectObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CoroutineData *corPtr; @@ -9441,7 +9462,7 @@ TclNRCoroInjectObjCmd( } if (!COR_IS_SUSPENDED(corPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "can only inject a command into a suspended coroutine", -1)); + "can only inject a command into a suspended coroutine", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ACTIVE", NULL); return TCL_ERROR; } @@ -9464,7 +9485,7 @@ static int TclNRCoroProbeObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CoroutineData *corPtr; @@ -9655,7 +9676,7 @@ static int NRInjectObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CoroutineData *corPtr; @@ -9678,7 +9699,7 @@ NRInjectObjCmd( } if (!COR_IS_SUSPENDED(corPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "can only inject a command into a suspended coroutine", -1)); + "can only inject a command into a suspended coroutine", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ACTIVE", NULL); return TCL_ERROR; } @@ -9700,7 +9721,7 @@ int TclNRInterpCoroutine( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { CoroutineData *corPtr = (CoroutineData *)clientData; @@ -9732,7 +9753,7 @@ TclNRInterpCoroutine( if (corPtr->nargs + 1 != objc) { Tcl_SetObjResult(interp, Tcl_NewStringObj("wrong coro nargs; how did we get here? " - "not implemented!", -1)); + "not implemented!", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); return TCL_ERROR; } @@ -9764,7 +9785,7 @@ int TclNRCoroutineObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Command *cmdPtr; @@ -9898,7 +9919,7 @@ int TclInfoCoroutineCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CoroutineData *corPtr = iPtr->execEnvPtr->corPtr; diff --git a/generic/tclBinary.c b/generic/tclBinary.c index dd8b292..b8a3fff 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -72,15 +72,15 @@ static int NeedReversing(int format); static void CopyNumber(const void *from, void *to, size_t length, int type); /* Binary ensemble commands */ -static Tcl_ObjCmdProc BinaryFormatCmd; -static Tcl_ObjCmdProc BinaryScanCmd; +static Tcl_ObjCmdProc2 BinaryFormatCmd; +static Tcl_ObjCmdProc2 BinaryScanCmd; /* Binary encoding sub-ensemble commands */ -static Tcl_ObjCmdProc BinaryEncodeHex; -static Tcl_ObjCmdProc BinaryDecodeHex; -static Tcl_ObjCmdProc BinaryEncode64; -static Tcl_ObjCmdProc BinaryDecode64; -static Tcl_ObjCmdProc BinaryEncodeUu; -static Tcl_ObjCmdProc BinaryDecodeUu; +static Tcl_ObjCmdProc2 BinaryEncodeHex; +static Tcl_ObjCmdProc2 BinaryDecodeHex; +static Tcl_ObjCmdProc2 BinaryEncode64; +static Tcl_ObjCmdProc2 BinaryDecode64; +static Tcl_ObjCmdProc2 BinaryEncodeUu; +static Tcl_ObjCmdProc2 BinaryDecodeUu; /* * The following tables are used by the binary encoders @@ -863,14 +863,14 @@ static int BinaryFormatCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int arg; /* Index of next argument to consume. */ + Tcl_Size arg; /* Index of next argument to consume. */ int value = 0; /* Current integer value to be packed. * Initialized to avoid compiler warning. */ char cmd; /* Current format character. */ - Tcl_Size count; /* Count associated with current format + Tcl_Size count; /* Count associated with current format * character. */ int flags; /* Format field flags */ const char *format; /* Pointer to current position in format @@ -1376,14 +1376,14 @@ static int BinaryScanCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int arg; /* Index of next argument to consume. */ + Tcl_Size arg; /* Index of next argument to consume. */ int value = 0; /* Current integer value to be packed. * Initialized to avoid compiler warning. */ char cmd; /* Current format character. */ - Tcl_Size count; /* Count associated with current format + Tcl_Size count; /* Count associated with current format * character. */ int flags; /* Format field flags */ const char *format; /* Pointer to current position in format @@ -1795,14 +1795,14 @@ GetFormatSpec( (*formatPtr)++; *countPtr = BINARY_ALL; } else if (isdigit(UCHAR(**formatPtr))) { /* INTL: digit */ - unsigned long long count; + unsigned long count; errno = 0; - count = strtoull(*formatPtr, (char **) formatPtr, 10); - if (errno || (count > TCL_SIZE_MAX)) { - *countPtr = TCL_SIZE_MAX; + count = strtoul(*formatPtr, (char **) formatPtr, 10); + if (errno || (count > (unsigned long) INT_MAX)) { + *countPtr = INT_MAX; } else { - *countPtr = count; + *countPtr = (int) count; } } else { *countPtr = BINARY_NOCOUNT; @@ -2460,7 +2460,7 @@ static int BinaryEncodeHex( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *resultObj = NULL; @@ -2508,14 +2508,14 @@ static int BinaryDecodeHex( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *resultObj = NULL; unsigned char *data, *datastart, *dataend; unsigned char *begin, *cursor, c; - int i, index, value, pure = 1, strict = 0; - Tcl_Size size, cut = 0, count = 0; + int index, value, pure = 1, strict = 0; + Tcl_Size i, size, cut = 0, count = 0; int ucs4; enum {OPT_STRICT }; static const char *const optStrings[] = { "-strict", NULL }; @@ -2633,16 +2633,16 @@ static int BinaryEncode64( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *resultObj; unsigned char *data, *limit; - Tcl_Size maxlen = 0; + int maxlen = 0; const char *wrapchar = "\n"; - Tcl_Size wrapcharlen = 1; - int index, purewrap = 1; - Tcl_Size i, offset, size, outindex = 0, count = 0; + Tcl_Size i, wrapcharlen = 1; + int index, size, outindex = 0, purewrap = 1; + Tcl_Size offset, count = 0; enum { OPT_MAXLEN, OPT_WRAPCHAR }; static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL }; @@ -2658,7 +2658,7 @@ BinaryEncode64( } switch (index) { case OPT_MAXLEN: - if (Tcl_GetSizeIntFromObj(interp, objv[i + 1], &maxlen) != TCL_OK) { + if (Tcl_GetIntFromObj(interp, objv[i + 1], &maxlen) != TCL_OK) { return TCL_ERROR; } if (maxlen < 0) { @@ -2759,17 +2759,16 @@ static int BinaryEncodeUu( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *resultObj; unsigned char *data, *start, *cursor; - int i, bits, index; - unsigned int n; - int lineLength = 61; + int bits, index, lineLength = 61; + Tcl_Size rawLength; const unsigned char SingleNewline[] = { UCHAR('\n') }; const unsigned char *wrapchar = SingleNewline; - Tcl_Size j, rawLength, offset, count = 0, wrapcharlen = sizeof(SingleNewline); + Tcl_Size n, i, j, offset, count = 0, wrapcharlen = sizeof(SingleNewline); enum { OPT_MAXLEN, OPT_WRAPCHAR }; static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL }; @@ -2911,14 +2910,14 @@ static int BinaryDecodeUu( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *resultObj = NULL; unsigned char *data, *datastart, *dataend; unsigned char *begin, *cursor; - int i, index, pure = 1, strict = 0, lineLen; - Tcl_Size size, count = 0; + int index, pure = 1, strict = 0, lineLen; + Tcl_Size i, size, count = 0; unsigned char c; int ucs4; enum { OPT_STRICT }; @@ -3085,7 +3084,7 @@ static int BinaryDecode64( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *resultObj = NULL; @@ -3093,8 +3092,8 @@ BinaryDecode64( unsigned char *begin = NULL; unsigned char *cursor = NULL; int pure = 1, strict = 0; - int i, index, cut = 0; - Tcl_Size size, count = 0; + int index, cut = 0; + Tcl_Size i, size, count = 0; int ucs4; enum { OPT_STRICT }; static const char *const optStrings[] = { "-strict", NULL }; diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index 09e140a..184cfca 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -799,7 +799,7 @@ static int MemoryCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Obj values of arguments. */ { const char *fileName; @@ -971,7 +971,7 @@ static int CheckmemCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Interpreter for evaluation. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Obj values of arguments. */ { if (objc != 2) { @@ -1005,8 +1005,8 @@ Tcl_InitMemory( * added */ { TclInitDbCkalloc(); - Tcl_CreateObjCommand(interp, "memory", MemoryCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "checkmem", CheckmemCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "memory", MemoryCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "checkmem", CheckmemCmd, NULL, NULL); } diff --git a/generic/tclClock.c b/generic/tclClock.c index a54e36b..f77ad8f 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -161,16 +161,16 @@ static void GetJulianDayFromEraYearWeekDay(TclDateFields *, int); static void GetJulianDayFromEraYearMonthDay(TclDateFields *, int); static int IsGregorianLeapYear(TclDateFields *); static int WeekdayOnOrBefore(int, int); -static Tcl_ObjCmdProc ClockClicksObjCmd; -static Tcl_ObjCmdProc ClockConvertlocaltoutcObjCmd; -static Tcl_ObjCmdProc ClockGetdatefieldsObjCmd; -static Tcl_ObjCmdProc ClockGetjuliandayfromerayearmonthdayObjCmd; -static Tcl_ObjCmdProc ClockGetjuliandayfromerayearweekdayObjCmd; -static Tcl_ObjCmdProc ClockGetenvObjCmd; -static Tcl_ObjCmdProc ClockMicrosecondsObjCmd; -static Tcl_ObjCmdProc ClockMillisecondsObjCmd; -static Tcl_ObjCmdProc ClockParseformatargsObjCmd; -static Tcl_ObjCmdProc ClockSecondsObjCmd; +static Tcl_ObjCmdProc2 ClockClicksObjCmd; +static Tcl_ObjCmdProc2 ClockConvertlocaltoutcObjCmd; +static Tcl_ObjCmdProc2 ClockGetdatefieldsObjCmd; +static Tcl_ObjCmdProc2 ClockGetjuliandayfromerayearmonthdayObjCmd; +static Tcl_ObjCmdProc2 ClockGetjuliandayfromerayearweekdayObjCmd; +static Tcl_ObjCmdProc2 ClockGetenvObjCmd; +static Tcl_ObjCmdProc2 ClockMicrosecondsObjCmd; +static Tcl_ObjCmdProc2 ClockMillisecondsObjCmd; +static Tcl_ObjCmdProc2 ClockParseformatargsObjCmd; +static Tcl_ObjCmdProc2 ClockSecondsObjCmd; static struct tm * ThreadSafeLocalTime(const time_t *); static void TzsetIfNecessary(void); static void ClockDeleteCmdProc(void *); @@ -183,7 +183,7 @@ struct ClockCommand { const char *name; /* The tail of the command name. The full name * is "::tcl::clock::<name>". When NULL marks * the end of the table. */ - Tcl_ObjCmdProc *objCmdProc; /* Function that implements the command. This + Tcl_ObjCmdProc2 *objCmdProc; /* Function that implements the command. This * will always have the ClockClientData sent * to it, but may well ignore this data. */ }; @@ -274,7 +274,7 @@ TclClockInit( for (clockCmdPtr=clockCommands ; clockCmdPtr->name!=NULL ; clockCmdPtr++) { strcpy(cmdName + TCL_CLOCK_PREFIX_LEN, clockCmdPtr->name); data->refCount++; - Tcl_CreateObjCommand(interp, cmdName, clockCmdPtr->objCmdProc, data, + Tcl_CreateObjCommand2(interp, cmdName, clockCmdPtr->objCmdProc, data, ClockDeleteCmdProc); } @@ -314,7 +314,7 @@ static int ClockConvertlocaltoutcObjCmd( void *clientData, /* Client data */ Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + Tcl_Size objc, /* Parameter count */ Tcl_Obj *const *objv) /* Parameter vector */ { ClockClientData *data = (ClockClientData *)clientData; @@ -406,7 +406,7 @@ int ClockGetdatefieldsObjCmd( void *clientData, /* Opaque pointer to literal pool, etc. */ Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + Tcl_Size objc, /* Parameter count */ Tcl_Obj *const *objv) /* Parameter vector */ { TclDateFields fields; @@ -560,7 +560,7 @@ static int ClockGetjuliandayfromerayearmonthdayObjCmd( void *clientData, /* Opaque pointer to literal pool, etc. */ Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + Tcl_Size objc, /* Parameter count */ Tcl_Obj *const *objv) /* Parameter vector */ { TclDateFields fields; @@ -644,7 +644,7 @@ static int ClockGetjuliandayfromerayearweekdayObjCmd( void *clientData, /* Opaque pointer to literal pool, etc. */ Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + Tcl_Size objc, /* Parameter count */ Tcl_Obj *const *objv) /* Parameter vector */ { TclDateFields fields; @@ -1628,7 +1628,7 @@ int ClockGetenvObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { #ifdef _WIN32 @@ -1731,7 +1731,7 @@ int ClockClicksObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + Tcl_Size objc, /* Parameter count */ Tcl_Obj *const *objv) /* Parameter values */ { static const char *const clicksSwitches[] = { @@ -1801,7 +1801,7 @@ int ClockMillisecondsObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + Tcl_Size objc, /* Parameter count */ Tcl_Obj *const *objv) /* Parameter values */ { Tcl_Time now; @@ -1840,7 +1840,7 @@ int ClockMicrosecondsObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + Tcl_Size objc, /* Parameter count */ Tcl_Obj *const *objv) /* Parameter values */ { if (objc != 1) { @@ -1873,7 +1873,7 @@ static int ClockParseformatargsObjCmd( void *clientData, /* Client data containing literal pool */ Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + Tcl_Size objc, /* Parameter count */ Tcl_Obj *const objv[]) /* Parameter vector */ { ClockClientData *dataPtr = (ClockClientData *)clientData; @@ -1893,7 +1893,7 @@ ClockParseformatargsObjCmd( int optionIndex; /* Index of an option. */ int saw = 0; /* Flag == 1 if option was seen already. */ Tcl_WideInt clockVal; /* Clock value - just used to parse. */ - int i; + Tcl_Size i; /* * Args consist of a time followed by keyword-value pairs. @@ -1991,7 +1991,7 @@ int ClockSecondsObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + Tcl_Size objc, /* Parameter count */ Tcl_Obj *const *objv) /* Parameter values */ { Tcl_Time now; diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index e2186ed..6405803 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -48,12 +48,12 @@ struct ForeachState { static int CheckAccess(Tcl_Interp *interp, Tcl_Obj *pathPtr, int mode); -static Tcl_ObjCmdProc EncodingConvertfromObjCmd; -static Tcl_ObjCmdProc EncodingConverttoObjCmd; -static Tcl_ObjCmdProc EncodingDirsObjCmd; -static Tcl_ObjCmdProc EncodingNamesObjCmd; -static Tcl_ObjCmdProc EncodingProfilesObjCmd; -static Tcl_ObjCmdProc EncodingSystemObjCmd; +static Tcl_ObjCmdProc2 EncodingConvertfromObjCmd; +static Tcl_ObjCmdProc2 EncodingConverttoObjCmd; +static Tcl_ObjCmdProc2 EncodingDirsObjCmd; +static Tcl_ObjCmdProc2 EncodingNamesObjCmd; +static Tcl_ObjCmdProc2 EncodingProfilesObjCmd; +static Tcl_ObjCmdProc2 EncodingSystemObjCmd; static inline int ForeachAssignments(Tcl_Interp *interp, struct ForeachState *statePtr); static inline void ForeachCleanup(Tcl_Interp *interp, @@ -64,7 +64,7 @@ static const char * GetTypeFromMode(int mode); static int StoreStatData(Tcl_Interp *interp, Tcl_Obj *varName, Tcl_StatBuf *statPtr); static int EachloopCmd(Tcl_Interp *interp, int collect, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static Tcl_NRPostProc CatchObjCmdCallback; static Tcl_NRPostProc ExprCallback; static Tcl_NRPostProc ForSetupCallback; @@ -74,31 +74,31 @@ static Tcl_NRPostProc ForPostNextCallback; static Tcl_NRPostProc ForeachLoopStep; static Tcl_NRPostProc EvalCmdErrMsg; -static Tcl_ObjCmdProc FileAttrAccessTimeCmd; -static Tcl_ObjCmdProc FileAttrIsDirectoryCmd; -static Tcl_ObjCmdProc FileAttrIsExecutableCmd; -static Tcl_ObjCmdProc FileAttrIsExistingCmd; -static Tcl_ObjCmdProc FileAttrIsFileCmd; -static Tcl_ObjCmdProc FileAttrIsOwnedCmd; -static Tcl_ObjCmdProc FileAttrIsReadableCmd; -static Tcl_ObjCmdProc FileAttrIsWritableCmd; -static Tcl_ObjCmdProc FileAttrLinkStatCmd; -static Tcl_ObjCmdProc FileAttrModifyTimeCmd; -static Tcl_ObjCmdProc FileAttrSizeCmd; -static Tcl_ObjCmdProc FileAttrStatCmd; -static Tcl_ObjCmdProc FileAttrTypeCmd; -static Tcl_ObjCmdProc FilesystemSeparatorCmd; -static Tcl_ObjCmdProc FilesystemVolumesCmd; -static Tcl_ObjCmdProc PathDirNameCmd; -static Tcl_ObjCmdProc PathExtensionCmd; -static Tcl_ObjCmdProc PathFilesystemCmd; -static Tcl_ObjCmdProc PathJoinCmd; -static Tcl_ObjCmdProc PathNativeNameCmd; -static Tcl_ObjCmdProc PathNormalizeCmd; -static Tcl_ObjCmdProc PathRootNameCmd; -static Tcl_ObjCmdProc PathSplitCmd; -static Tcl_ObjCmdProc PathTailCmd; -static Tcl_ObjCmdProc PathTypeCmd; +static Tcl_ObjCmdProc2 FileAttrAccessTimeCmd; +static Tcl_ObjCmdProc2 FileAttrIsDirectoryCmd; +static Tcl_ObjCmdProc2 FileAttrIsExecutableCmd; +static Tcl_ObjCmdProc2 FileAttrIsExistingCmd; +static Tcl_ObjCmdProc2 FileAttrIsFileCmd; +static Tcl_ObjCmdProc2 FileAttrIsOwnedCmd; +static Tcl_ObjCmdProc2 FileAttrIsReadableCmd; +static Tcl_ObjCmdProc2 FileAttrIsWritableCmd; +static Tcl_ObjCmdProc2 FileAttrLinkStatCmd; +static Tcl_ObjCmdProc2 FileAttrModifyTimeCmd; +static Tcl_ObjCmdProc2 FileAttrSizeCmd; +static Tcl_ObjCmdProc2 FileAttrStatCmd; +static Tcl_ObjCmdProc2 FileAttrTypeCmd; +static Tcl_ObjCmdProc2 FilesystemSeparatorCmd; +static Tcl_ObjCmdProc2 FilesystemVolumesCmd; +static Tcl_ObjCmdProc2 PathDirNameCmd; +static Tcl_ObjCmdProc2 PathExtensionCmd; +static Tcl_ObjCmdProc2 PathFilesystemCmd; +static Tcl_ObjCmdProc2 PathJoinCmd; +static Tcl_ObjCmdProc2 PathNativeNameCmd; +static Tcl_ObjCmdProc2 PathNormalizeCmd; +static Tcl_ObjCmdProc2 PathRootNameCmd; +static Tcl_ObjCmdProc2 PathSplitCmd; +static Tcl_ObjCmdProc2 PathTailCmd; +static Tcl_ObjCmdProc2 PathTypeCmd; /* *---------------------------------------------------------------------- @@ -125,7 +125,7 @@ int Tcl_BreakObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc != 1) { @@ -156,17 +156,17 @@ int Tcl_CatchObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRCatchObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRCatchObjCmd, clientData, objc, objv); } int TclNRCatchObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *varNamePtr = NULL; @@ -203,7 +203,7 @@ CatchObjCmdCallback( int result) { Interp *iPtr = (Interp *) interp; - int objc = PTR2INT(data[0]); + Tcl_Size objc = PTR2INT(data[0]); Tcl_Obj *varNamePtr = (Tcl_Obj *)data[1]; Tcl_Obj *optionVarNamePtr = (Tcl_Obj *)data[2]; int rewind = iPtr->execEnvPtr->rewind; @@ -261,7 +261,7 @@ int Tcl_CdObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *dir; @@ -319,7 +319,7 @@ int Tcl_ConcatObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc >= 2) { @@ -353,7 +353,7 @@ int Tcl_ContinueObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc != 1) { @@ -524,7 +524,7 @@ int EncodingConvertfromObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *data; /* Byte array to convert */ @@ -624,7 +624,7 @@ int EncodingConverttoObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *data; /* String to convert */ @@ -722,7 +722,7 @@ int EncodingDirsObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *dirListObj; @@ -766,7 +766,7 @@ int EncodingNamesObjCmd( TCL_UNUSED(void *), Tcl_Interp* interp, /* Tcl interpreter */ - int objc, /* Number of command line args */ + Tcl_Size objc, /* Number of command line args */ Tcl_Obj* const objv[]) /* Vector of command line args */ { if (objc > 1) { @@ -794,7 +794,7 @@ int EncodingProfilesObjCmd( TCL_UNUSED(void *), Tcl_Interp* interp, /* Tcl interpreter */ - int objc, /* Number of command line args */ + Tcl_Size objc, /* Number of command line args */ Tcl_Obj* const objv[]) /* Vector of command line args */ { if (objc > 1) { @@ -825,7 +825,7 @@ int EncodingSystemObjCmd( TCL_UNUSED(void *), Tcl_Interp* interp, /* Tcl interpreter */ - int objc, /* Number of command line args */ + Tcl_Size objc, /* Number of command line args */ Tcl_Obj* const objv[]) /* Vector of command line args */ { if (objc > 2) { @@ -862,7 +862,7 @@ int Tcl_ErrorObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *options, *optName; @@ -924,17 +924,17 @@ int Tcl_EvalObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNREvalObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNREvalObjCmd, clientData, objc, objv); } int TclNREvalObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *objPtr; @@ -993,7 +993,7 @@ int Tcl_ExitObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_WideInt value; @@ -1040,17 +1040,17 @@ int Tcl_ExprObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRExprObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRExprObjCmd, clientData, objc, objv); } int TclNRExprObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *resultPtr, *objPtr; @@ -1188,7 +1188,7 @@ static int FileAttrAccessTimeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1270,7 +1270,7 @@ static int FileAttrModifyTimeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1349,7 +1349,7 @@ static int FileAttrLinkStatCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1389,7 +1389,7 @@ static int FileAttrStatCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1429,7 +1429,7 @@ static int FileAttrTypeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1467,7 +1467,7 @@ static int FileAttrSizeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1504,7 +1504,7 @@ static int FileAttrIsDirectoryCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1542,7 +1542,7 @@ static int FileAttrIsExecutableCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc != 2) { @@ -1573,7 +1573,7 @@ static int FileAttrIsExistingCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc != 2) { @@ -1604,7 +1604,7 @@ static int FileAttrIsFileCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1642,7 +1642,7 @@ static int FileAttrIsOwnedCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { #ifdef __CYGWIN__ @@ -1689,7 +1689,7 @@ static int FileAttrIsReadableCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc != 2) { @@ -1720,7 +1720,7 @@ static int FileAttrIsWritableCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc != 2) { @@ -1751,7 +1751,7 @@ static int PathDirNameCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirPtr; @@ -1790,7 +1790,7 @@ static int PathExtensionCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirPtr; @@ -1829,7 +1829,7 @@ static int PathRootNameCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirPtr; @@ -1868,7 +1868,7 @@ static int PathTailCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirPtr; @@ -1907,7 +1907,7 @@ static int PathFilesystemCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *fsInfo; @@ -1948,7 +1948,7 @@ static int PathJoinCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc < 2) { @@ -1980,7 +1980,7 @@ static int PathNativeNameCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_DString ds; @@ -2017,7 +2017,7 @@ static int PathNormalizeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *fileName; @@ -2055,7 +2055,7 @@ static int PathSplitCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *res; @@ -2098,7 +2098,7 @@ static int PathTypeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *typeName; @@ -2146,7 +2146,7 @@ static int FilesystemSeparatorCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc < 1 || objc > 2) { @@ -2201,7 +2201,7 @@ static int FilesystemVolumesCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc != 1) { @@ -2492,17 +2492,17 @@ int Tcl_ForObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRForObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRForObjCmd, clientData, objc, objv); } int TclNRForObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -2686,17 +2686,17 @@ int Tcl_ForeachObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRForeachCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRForeachCmd, clientData, objc, objv); } int TclNRForeachCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { return EachloopCmd(interp, TCL_EACH_KEEP_NONE, objc, objv); @@ -2706,17 +2706,17 @@ int Tcl_LmapObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRLmapCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRLmapCmd, clientData, objc, objv); } int TclNRLmapCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { return EachloopCmd(interp, TCL_EACH_COLLECT, objc, objv); @@ -2728,7 +2728,7 @@ EachloopCmd( * evaluation. */ int collect, /* Select collecting or accumulating mode * (TCL_EACH_*) */ - int objc, /* The arguments being passed in... */ + Tcl_Size objc, /* The arguments being passed in... */ Tcl_Obj *const objv[]) { int numLists = (objc-2) / 2; @@ -3037,7 +3037,7 @@ int Tcl_FormatObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *resultPtr; /* Where result is stored finally. */ diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 7beb60a..567de38 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -120,28 +120,28 @@ typedef enum Sequence_Decoded { static int DictionaryCompare(const char *left, const char *right); static Tcl_NRPostProc IfConditionCallback; -static Tcl_ObjCmdProc InfoArgsCmd; -static Tcl_ObjCmdProc InfoBodyCmd; -static Tcl_ObjCmdProc InfoCmdCountCmd; -static Tcl_ObjCmdProc InfoCommandsCmd; -static Tcl_ObjCmdProc InfoCompleteCmd; -static Tcl_ObjCmdProc InfoDefaultCmd; +static Tcl_ObjCmdProc2 InfoArgsCmd; +static Tcl_ObjCmdProc2 InfoBodyCmd; +static Tcl_ObjCmdProc2 InfoCmdCountCmd; +static Tcl_ObjCmdProc2 InfoCommandsCmd; +static Tcl_ObjCmdProc2 InfoCompleteCmd; +static Tcl_ObjCmdProc2 InfoDefaultCmd; /* TIP #348 - New 'info' subcommand 'errorstack' */ -static Tcl_ObjCmdProc InfoErrorStackCmd; +static Tcl_ObjCmdProc2 InfoErrorStackCmd; /* TIP #280 - New 'info' subcommand 'frame' */ -static Tcl_ObjCmdProc InfoFrameCmd; -static Tcl_ObjCmdProc InfoFunctionsCmd; -static Tcl_ObjCmdProc InfoHostnameCmd; -static Tcl_ObjCmdProc InfoLevelCmd; -static Tcl_ObjCmdProc InfoLibraryCmd; -static Tcl_ObjCmdProc InfoLoadedCmd; -static Tcl_ObjCmdProc InfoNameOfExecutableCmd; -static Tcl_ObjCmdProc InfoPatchLevelCmd; -static Tcl_ObjCmdProc InfoProcsCmd; -static Tcl_ObjCmdProc InfoScriptCmd; -static Tcl_ObjCmdProc InfoSharedlibCmd; -static Tcl_ObjCmdProc InfoCmdTypeCmd; -static Tcl_ObjCmdProc InfoTclVersionCmd; +static Tcl_ObjCmdProc2 InfoFrameCmd; +static Tcl_ObjCmdProc2 InfoFunctionsCmd; +static Tcl_ObjCmdProc2 InfoHostnameCmd; +static Tcl_ObjCmdProc2 InfoLevelCmd; +static Tcl_ObjCmdProc2 InfoLibraryCmd; +static Tcl_ObjCmdProc2 InfoLoadedCmd; +static Tcl_ObjCmdProc2 InfoNameOfExecutableCmd; +static Tcl_ObjCmdProc2 InfoPatchLevelCmd; +static Tcl_ObjCmdProc2 InfoProcsCmd; +static Tcl_ObjCmdProc2 InfoScriptCmd; +static Tcl_ObjCmdProc2 InfoSharedlibCmd; +static Tcl_ObjCmdProc2 InfoCmdTypeCmd; +static Tcl_ObjCmdProc2 InfoTclVersionCmd; static SortElement * MergeLists(SortElement *leftPtr, SortElement *rightPtr, SortInfo *infoPtr); static int SortCompare(SortElement *firstPtr, SortElement *second, @@ -208,17 +208,17 @@ int Tcl_IfObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRIfObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRIfObjCmd, clientData, objc, objv); } int TclNRIfObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *boolObj; @@ -250,9 +250,9 @@ IfConditionCallback( int result) { Interp *iPtr = (Interp *) interp; - int objc = PTR2INT(data[0]); + Tcl_Size objc = PTR2INT(data[0]); Tcl_Obj *const *objv = (Tcl_Obj *const *)data[1]; - int i = PTR2INT(data[2]); + Tcl_Size i = PTR2INT(data[2]); Tcl_Obj *boolObj = (Tcl_Obj *)data[3]; int value, thenScriptIndex = 0; const char *clause; @@ -391,7 +391,7 @@ int Tcl_IncrObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *newValuePtr, *incrPtr; @@ -472,7 +472,7 @@ static int InfoArgsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -535,7 +535,7 @@ static int InfoBodyCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -596,7 +596,7 @@ static int InfoCmdCountCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -638,7 +638,7 @@ static int InfoCommandsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *cmdName, *pattern; @@ -915,7 +915,7 @@ static int InfoCompleteCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc != 2) { @@ -952,7 +952,7 @@ static int InfoDefaultCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -1034,7 +1034,7 @@ static int InfoErrorStackCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Interp *target; @@ -1083,7 +1083,7 @@ int TclInfoExistsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *varName; @@ -1128,7 +1128,7 @@ static int InfoFrameCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -1468,7 +1468,7 @@ static int InfoFunctionsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *script; @@ -1533,7 +1533,7 @@ static int InfoHostnameCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *name; @@ -1579,7 +1579,7 @@ static int InfoLevelCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -1653,7 +1653,7 @@ static int InfoLibraryCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *libDirName; @@ -1700,7 +1700,7 @@ static int InfoLoadedCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *interpName, *packageName; @@ -1748,7 +1748,7 @@ static int InfoNameOfExecutableCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc != 1) { @@ -1784,7 +1784,7 @@ static int InfoPatchLevelCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *patchlevel; @@ -1831,7 +1831,7 @@ static int InfoProcsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *cmdName, *pattern; @@ -2018,7 +2018,7 @@ static int InfoScriptCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -2066,7 +2066,7 @@ static int InfoSharedlibCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc != 1) { @@ -2104,7 +2104,7 @@ static int InfoTclVersionCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *version; @@ -2147,7 +2147,7 @@ static int InfoCmdTypeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Command command; @@ -2168,7 +2168,7 @@ InfoCmdTypeCmd( */ if (Tcl_IsSafe(interp) - && (((Command *) command)->objProc == TclAliasObjCmd)) { + && (((Command *) command)->objProc2 == TclAliasObjCmd)) { Tcl_AppendResult(interp, "native", NULL); } else { Tcl_SetObjResult(interp, @@ -2198,7 +2198,7 @@ int Tcl_JoinObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { Tcl_Size length, listLen; @@ -2320,7 +2320,7 @@ int Tcl_LassignObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *listCopyPtr; @@ -2403,7 +2403,7 @@ int Tcl_LindexObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *elemPtr; /* Pointer to the element being extracted. */ @@ -2461,7 +2461,7 @@ int Tcl_LinsertObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *listPtr; @@ -2544,7 +2544,7 @@ int Tcl_ListObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { @@ -2580,7 +2580,7 @@ int Tcl_LlengthObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { @@ -2629,7 +2629,7 @@ int Tcl_LpopObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { @@ -2731,7 +2731,7 @@ int Tcl_LrangeObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { @@ -2813,7 +2813,7 @@ int Tcl_LremoveObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size i, idxc, prevIdx, first, num; @@ -2932,7 +2932,7 @@ int Tcl_LrepeatObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { @@ -3046,7 +3046,7 @@ int Tcl_LreplaceObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *listPtr; @@ -3147,7 +3147,7 @@ int Tcl_LreverseObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ { Tcl_Obj **elemv; @@ -3252,7 +3252,7 @@ int Tcl_LsearchObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ { const char *bytes, *patternBytes; @@ -4014,7 +4014,7 @@ int Tcl_LsetObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ { Tcl_Obj *listPtr; /* Pointer to the list being altered. */ @@ -4210,7 +4210,7 @@ int Tcl_LseqObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { Tcl_Obj *elementCount = NULL; @@ -4222,7 +4222,8 @@ Tcl_LseqObjCmd( Tcl_Obj *arithSeriesPtr; SequenceOperators opmode; SequenceDecoded decoded; - int i, arg_key = 0, value_i = 0; + Tcl_Size i; + int arg_key = 0, value_i = 0; // Default constants Tcl_Obj *zero = Tcl_NewIntObj(0); Tcl_Obj *one = Tcl_NewIntObj(1); @@ -4499,7 +4500,7 @@ int Tcl_LsortObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ { int indices, nocase = 0, indexc; @@ -5020,7 +5021,7 @@ int Tcl_LeditObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ { Tcl_Obj *listPtr; /* Pointer to the list being altered. */ @@ -5032,7 +5033,7 @@ Tcl_LeditObjCmd( Tcl_Size listLen; Tcl_Size numToDelete; - if (objc < 4) { + if (objc + 1 < 5) { Tcl_WrongNumArgs(interp, 1, objv, "listVar first last ?element ...?"); return TCL_ERROR; diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index a4e999c..8c6bb2e 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -85,7 +85,7 @@ int Tcl_PwdObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *retVal; @@ -125,11 +125,11 @@ int Tcl_RegexpObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tcl_Size offset, stringLength, matchLength, cflags, eflags; - int i, indices, match, about, all, doinline, numMatchesSaved; + Tcl_Size i, about, all, offset, stringLength, matchLength, cflags, eflags; + int indices, match, doinline, numMatchesSaved; Tcl_RegExp regExpr; Tcl_Obj *objPtr, *startIndex = NULL, *resultPtr = NULL; Tcl_RegExpInfo info; @@ -372,7 +372,7 @@ Tcl_RegexpObjCmd( * area. (Scriptics Bug 4391/SF Bug #219232) */ - if (i <= (int)info.nsubs && info.matches[i].start >= 0) { + if (i <= info.nsubs && info.matches[i].start >= 0) { start = offset + info.matches[i].start; end = offset + info.matches[i].end; @@ -394,7 +394,7 @@ Tcl_RegexpObjCmd( newPtr = Tcl_NewListObj(2, objs); } else { - if ((i <= (int)info.nsubs) && (info.matches[i].end > 0)) { + if ((i <= info.nsubs) && (info.matches[i].end > 0)) { newPtr = Tcl_GetRange(objPtr, offset + info.matches[i].start, offset + info.matches[i].end - 1); @@ -484,7 +484,7 @@ int Tcl_RegsubObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int result, cflags, all, match, command; @@ -1004,7 +1004,7 @@ int Tcl_RenameObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *oldName, *newName; @@ -1040,7 +1040,7 @@ int Tcl_ReturnObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int code, level; @@ -1087,17 +1087,17 @@ int Tcl_SourceObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRSourceObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRSourceObjCmd, clientData, objc, objv); } int TclNRSourceObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *encodingName = NULL; @@ -1171,7 +1171,7 @@ int Tcl_SplitObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int ch = 0; @@ -1304,7 +1304,7 @@ static int StringFirstCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size start = TCL_INDEX_START; @@ -1348,7 +1348,7 @@ static int StringLastCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size last = TCL_SIZE_MAX; @@ -1392,7 +1392,7 @@ static int StringIndexCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size index, end; @@ -1464,7 +1464,7 @@ static int StringInsertCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter */ - int objc, /* Number of arguments */ + Tcl_Size objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* Argument objects */ { Tcl_Size length; /* String length */ @@ -1521,13 +1521,13 @@ static int StringIsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *string1, *end, *stop; int (*chcomp)(int) = NULL; /* The UniChar comparison function. */ - int i, result = 1, strict = 0; - Tcl_Size failat = 0, length1, length2, length3; + int result = 1, strict = 0; + Tcl_Size i, failat = 0, length1, length2, length3; Tcl_Obj *objPtr, *failVarObj = NULL; Tcl_WideInt w; @@ -1956,7 +1956,7 @@ static int StringMapCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size length1, length2, mapElemc, index; @@ -2232,7 +2232,7 @@ static int StringMatchCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int nocase = 0; @@ -2284,7 +2284,7 @@ static int StringRangeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size first, last, end; @@ -2334,7 +2334,7 @@ static int StringReptCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_WideInt count; @@ -2390,7 +2390,7 @@ static int StringRplcCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size first, last, end; @@ -2467,7 +2467,7 @@ static int StringRevCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc != 2) { @@ -2500,7 +2500,7 @@ static int StringStartCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int ch; @@ -2570,7 +2570,7 @@ static int StringEndCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int ch; @@ -2632,7 +2632,7 @@ static int StringEqualCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { /* @@ -2642,8 +2642,8 @@ StringEqualCmd( */ const char *string2; - int i, match, nocase = 0; - Tcl_Size length, reqlength = -1; + int match, nocase = 0; + Tcl_Size i, length, reqlength = -1; if (objc < 3 || objc > 6) { str_cmp_args: @@ -2708,7 +2708,7 @@ static int StringCmpCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { /* @@ -2734,13 +2734,12 @@ StringCmpCmd( int TclStringCmpOpts( Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects. */ int *nocase, Tcl_Size *reqlength) { - int i; - Tcl_Size length; + Tcl_Size i, length; const char *string; *reqlength = -1; @@ -2798,7 +2797,7 @@ static int StringCatCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *objResultPtr; @@ -2843,7 +2842,7 @@ static int StringLenCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc != 2) { @@ -2877,7 +2876,7 @@ static int StringLowerCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size length1, length2; @@ -2962,7 +2961,7 @@ static int StringUpperCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size length1, length2; @@ -3047,7 +3046,7 @@ static int StringTitleCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size length1, length2; @@ -3132,7 +3131,7 @@ static int StringTrimCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *string1, *string2; @@ -3179,7 +3178,7 @@ static int StringTrimLCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *string1, *string2; @@ -3226,7 +3225,7 @@ static int StringTrimRCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *string1, *string2; @@ -3369,17 +3368,17 @@ int Tcl_SubstObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRSubstObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRSubstObjCmd, clientData, objc, objv); } int TclNRSubstObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int flags; @@ -3417,20 +3416,21 @@ int Tcl_SwitchObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRSwitchObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRSwitchObjCmd, clientData, objc, objv); } int TclNRSwitchObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc1, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int i, mode, foundmode, splitObjs, numMatchesSaved; int noCase; + int objc = objc1; Tcl_Size patternLength, j; const char *pattern; Tcl_Obj *stringObj, *indexVarObj, *matchVarObj; @@ -3960,7 +3960,7 @@ int Tcl_ThrowObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *options; @@ -4022,7 +4022,7 @@ int Tcl_TimeObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *objPtr; @@ -4120,14 +4120,15 @@ int Tcl_TimeRateObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static double measureOverhead = 0; /* global measure-overhead */ double overhead = -1; /* given measure-overhead */ Tcl_Obj *objPtr; - int result, i; + int result; + Tcl_Size i; Tcl_Obj *calibrate = NULL, *direct = NULL; Tcl_WideUInt count = 0; /* Holds repetition count */ Tcl_WideInt maxms = WIDE_MIN; @@ -4154,7 +4155,7 @@ Tcl_TimeRateObjCmd( NRE_callback *rootPtr; ByteCode *codePtr = NULL; - for (i = 1; i < objc - 1; i++) { + for (i = 1; i + 1 < objc; i++) { enum timeRateOptionsEnum index; if (Tcl_GetIndexFromObj(NULL, objv[i], options, "option", TCL_EXACT, @@ -4170,7 +4171,7 @@ Tcl_TimeRateObjCmd( direct = objv[i]; break; case TMRT_OVERHEAD: - if (++i >= objc - 1) { + if (++i + 1 >= objc) { goto usage; } if (Tcl_GetDoubleFromObj(interp, objv[i], &overhead) != TCL_OK) { @@ -4185,7 +4186,7 @@ Tcl_TimeRateObjCmd( } } - if (i >= objc || i < objc - 3) { + if (i >= objc || i + 3 < objc) { usage: Tcl_WrongNumArgs(interp, 1, objv, "?-direct? ?-calibrate? ?-overhead double? " @@ -4666,22 +4667,22 @@ int Tcl_TryObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRTryObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRTryObjCmd, clientData, objc, objv); } int TclNRTryObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *bodyObj, *handlersObj, *finallyObj = NULL; - int i, bodyShared, haveHandlers, code; - Tcl_Size dummy; + int bodyShared, haveHandlers, code; + Tcl_Size i, dummy; static const char *const handlerNames[] = { "finally", "on", "trap", NULL }; @@ -4715,14 +4716,14 @@ TclNRTryObjCmd( } switch (type) { case TryFinally: /* finally script */ - if (i < objc-2) { + if (i+2 < objc) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "finally clause must be last", -1)); Tcl_DecrRefCount(handlersObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "FINALLY", "NONTERMINAL", NULL); return TCL_ERROR; - } else if (i == objc-1) { + } else if (i+1 == objc) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "wrong # args to finally clause: must be" " \"... finally script\"", -1)); @@ -4735,7 +4736,7 @@ TclNRTryObjCmd( break; case TryOn: /* on code variableList script */ - if (i > objc-4) { + if (i+4 > objc) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "wrong # args to on clause: must be \"... on code" " variableList script\"", -1)); @@ -4753,7 +4754,7 @@ TclNRTryObjCmd( goto commonHandler; case TryTrap: /* trap pattern variableList script */ - if (i > objc-4) { + if (i+4 > objc) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "wrong # args to trap clause: " "must be \"... trap pattern variableList script\"", @@ -5244,17 +5245,17 @@ int Tcl_WhileObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRWhileObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRWhileObjCmd, clientData, objc, objv); } int TclNRWhileObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { ForIterData *iterPtr; diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index f86de84..bc56ee9 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -825,7 +825,7 @@ TclCompileClockReadingCmd( return TCL_ERROR; } - TclEmitInstInt1(INST_CLOCK_READ, PTR2INT(cmdPtr->objClientData), envPtr); + TclEmitInstInt1(INST_CLOCK_READ, PTR2INT(cmdPtr->objClientData2), envPtr); return TCL_OK; } @@ -2945,7 +2945,7 @@ FreeForeachInfo( { ForeachInfo *infoPtr = (ForeachInfo *)clientData; ForeachVarList *listPtr; - size_t i, numLists = infoPtr->numLists; + Tcl_Size i, numLists = infoPtr->numLists; for (i = 0; i < numLists; i++) { listPtr = infoPtr->varLists[i]; @@ -3422,9 +3422,9 @@ TclPushVarName( { const char *p; const char *last, *name, *elName; - size_t n; + Tcl_Size n; Tcl_Token *elemTokenPtr = NULL; - size_t nameLen, elNameLen; + Tcl_Size nameLen, elNameLen; int simpleVarName, localIndex; int elemTokenCount = 0, allocedTokens = 0, removedParen = 0; diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index a8d60dd..9d585e0 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -2621,7 +2621,7 @@ int TclSingleOpCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData; @@ -2674,7 +2674,7 @@ int TclSortingOpCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { int code = TCL_OK; @@ -2687,7 +2687,8 @@ TclSortingOpCmd( 2 * (objc-2) * sizeof(Tcl_Obj *)); OpNode *nodes = (OpNode *)TclStackAlloc(interp, 2 * (objc-2) * sizeof(OpNode)); unsigned char lexeme; - int i, lastAnd = 1; + Tcl_Size i; + int lastAnd = 1; Tcl_Obj *const *litObjPtrPtr = litObjv; ParseLexeme(occdPtr->op, strlen(occdPtr->op), &lexeme, NULL); @@ -2754,7 +2755,7 @@ int TclVariadicOpCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData; @@ -2813,7 +2814,8 @@ TclVariadicOpCmd( } else { Tcl_Obj *const *litObjv = objv + 1; OpNode *nodes = (OpNode *)TclStackAlloc(interp, (objc-1) * sizeof(OpNode)); - int i, lastOp = OT_LITERAL; + Tcl_Size i; + int lastOp = OT_LITERAL; nodes[0].lexeme = START; nodes[0].mark = MARK_RIGHT; @@ -2873,7 +2875,7 @@ int TclNoIdentOpCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData; diff --git a/generic/tclCompile.h b/generic/tclCompile.h index 22abb46..9cb2188 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -1064,8 +1064,7 @@ typedef struct { *---------------------------------------------------------------- */ -#if TCL_MAJOR_VERSION > 8 -MODULE_SCOPE Tcl_ObjCmdProc TclNRInterpCoroutine; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRInterpCoroutine; /* *---------------------------------------------------------------- @@ -1183,10 +1182,10 @@ MODULE_SCOPE void TclReleaseByteCode(ByteCode *codePtr); MODULE_SCOPE void TclReleaseLiteral(Tcl_Interp *interp, Tcl_Obj *objPtr); MODULE_SCOPE void TclInvalidateCmdLiteral(Tcl_Interp *interp, const char *name, Namespace *nsPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclSingleOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclSortingOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclVariadicOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNoIdentOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclSingleOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclSortingOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclVariadicOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNoIdentOpCmd; #ifdef TCL_COMPILE_DEBUG MODULE_SCOPE void TclVerifyGlobalLiteralTable(Interp *iPtr); MODULE_SCOPE void TclVerifyLocalLiteralTable(CompileEnv *envPtr); @@ -1203,8 +1202,6 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst); MODULE_SCOPE int TclPushProcCallFrame(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int isLambda); -#endif /* TCL_MAJOR_VERSION > 8 */ - /* *---------------------------------------------------------------- diff --git a/generic/tclConfig.c b/generic/tclConfig.c index 8f58ca8..5e1f17b 100644 --- a/generic/tclConfig.c +++ b/generic/tclConfig.c @@ -41,7 +41,7 @@ typedef struct { * Static functions in this file: */ -static Tcl_ObjCmdProc QueryConfigObjCmd; +static Tcl_ObjCmdProc2 QueryConfigObjCmd; static Tcl_CmdDeleteProc QueryConfigDelete; static Tcl_InterpDeleteProc ConfigDictDeleteProc; static Tcl_Obj * GetConfigDict(Tcl_Interp *interp); @@ -163,7 +163,7 @@ Tcl_RegisterConfig( TclDStringAppendLiteral(&cmdName, "::pkgconfig"); - if (Tcl_CreateObjCommand(interp, Tcl_DStringValue(&cmdName), + if (Tcl_CreateObjCommand2(interp, Tcl_DStringValue(&cmdName), QueryConfigObjCmd, cdPtr, QueryConfigDelete) == NULL) { Tcl_Panic("%s: %s", "Tcl_RegisterConfig", "Unable to create query command for package configuration"); @@ -193,7 +193,7 @@ static int QueryConfigObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { QCCD *cdPtr = (QCCD *)clientData; diff --git a/generic/tclDate.c b/generic/tclDate.c index 52bdf4c..aeddacf 100644 --- a/generic/tclDate.c +++ b/generic/tclDate.c @@ -2745,8 +2745,8 @@ int TclClockOldscanObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Count of parameters */ - Tcl_Obj *const *objv) /* Parameters */ + Tcl_Size objc, /* Count of parameters */ + Tcl_Obj *const objv[]) /* Parameters */ { Tcl_Obj *result, *resultElement; int yr, mo, da; diff --git a/generic/tclDecls.h b/generic/tclDecls.h index feb7a64..730049b 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -33,6 +33,10 @@ # define TCL_DEPRECATED(msg) EXTERN #endif +#ifdef TCL_NO_DEPRECATED +# define Tcl_ObjCmdProc void +# define Tcl_CmdObjTraceProc void +#endif /* TCL_NO_DEPRECATED */ /* * WARNING: This file is automatically generated by the tools/genStubs.tcl @@ -813,7 +817,7 @@ EXTERN void Tcl_GetEncodingNames(Tcl_Interp *interp); /* 304 */ EXTERN int Tcl_GetIndexFromObjStruct(Tcl_Interp *interp, Tcl_Obj *objPtr, const void *tablePtr, - Tcl_Size offset, const char *msg, int flags, + size_t offset, const char *msg, int flags, void *indexPtr); /* 305 */ EXTERN void * Tcl_GetThreadData(Tcl_ThreadDataKey *keyPtr, @@ -2183,7 +2187,7 @@ typedef struct TclStubs { Tcl_Encoding (*tcl_GetEncoding) (Tcl_Interp *interp, const char *name); /* 301 */ const char * (*tcl_GetEncodingName) (Tcl_Encoding encoding); /* 302 */ void (*tcl_GetEncodingNames) (Tcl_Interp *interp); /* 303 */ - int (*tcl_GetIndexFromObjStruct) (Tcl_Interp *interp, Tcl_Obj *objPtr, const void *tablePtr, Tcl_Size offset, const char *msg, int flags, void *indexPtr); /* 304 */ + int (*tcl_GetIndexFromObjStruct) (Tcl_Interp *interp, Tcl_Obj *objPtr, const void *tablePtr, size_t offset, const char *msg, int flags, void *indexPtr); /* 304 */ void * (*tcl_GetThreadData) (Tcl_ThreadDataKey *keyPtr, Tcl_Size size); /* 305 */ Tcl_Obj * (*tcl_GetVar2Ex) (Tcl_Interp *interp, const char *part1, const char *part2, int flags); /* 306 */ void * (*tcl_InitNotifier) (void); /* 307 */ @@ -3904,6 +3908,11 @@ extern const TclStubs *tclStubsPtr; #undef TclUnusedStubEntry +#ifdef TCL_NO_DEPRECATED +# undef Tcl_ObjCmdProc +# undef Tcl_CmdObjTraceProc +#endif /* TCL_NO_DEPRECATED */ + #ifdef _WIN32 # undef Tcl_CreateFileHandler # undef Tcl_DeleteFileHandler @@ -4254,7 +4263,12 @@ extern const TclStubs *tclStubsPtr; #undef TclUtfCharComplete #undef TclUtfNext #undef TclUtfPrev -#ifndef TCL_NO_DEPRECATED +#ifdef TCL_NO_DEPRECATED +# undef Tcl_CreateObjCommand +# undef Tcl_CreateObjTrace +# undef Tcl_NRCallObjProc +# undef Tcl_NRCreateCommand +#else # define Tcl_CreateSlave Tcl_CreateChild # define Tcl_GetSlave Tcl_GetChild # define Tcl_GetMaster Tcl_GetParent diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index f996f4b..31401ec 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -24,25 +24,25 @@ struct Dict; */ static void DeleteDict(struct Dict *dict); -static Tcl_ObjCmdProc DictAppendCmd; -static Tcl_ObjCmdProc DictCreateCmd; -static Tcl_ObjCmdProc DictExistsCmd; -static Tcl_ObjCmdProc DictFilterCmd; -static Tcl_ObjCmdProc DictGetCmd; -static Tcl_ObjCmdProc DictGetDefCmd; -static Tcl_ObjCmdProc DictIncrCmd; -static Tcl_ObjCmdProc DictInfoCmd; -static Tcl_ObjCmdProc DictKeysCmd; -static Tcl_ObjCmdProc DictLappendCmd; -static Tcl_ObjCmdProc DictMergeCmd; -static Tcl_ObjCmdProc DictRemoveCmd; -static Tcl_ObjCmdProc DictReplaceCmd; -static Tcl_ObjCmdProc DictSetCmd; -static Tcl_ObjCmdProc DictSizeCmd; -static Tcl_ObjCmdProc DictUnsetCmd; -static Tcl_ObjCmdProc DictUpdateCmd; -static Tcl_ObjCmdProc DictValuesCmd; -static Tcl_ObjCmdProc DictWithCmd; +static Tcl_ObjCmdProc2 DictAppendCmd; +static Tcl_ObjCmdProc2 DictCreateCmd; +static Tcl_ObjCmdProc2 DictExistsCmd; +static Tcl_ObjCmdProc2 DictFilterCmd; +static Tcl_ObjCmdProc2 DictGetCmd; +static Tcl_ObjCmdProc2 DictGetDefCmd; +static Tcl_ObjCmdProc2 DictIncrCmd; +static Tcl_ObjCmdProc2 DictInfoCmd; +static Tcl_ObjCmdProc2 DictKeysCmd; +static Tcl_ObjCmdProc2 DictLappendCmd; +static Tcl_ObjCmdProc2 DictMergeCmd; +static Tcl_ObjCmdProc2 DictRemoveCmd; +static Tcl_ObjCmdProc2 DictReplaceCmd; +static Tcl_ObjCmdProc2 DictSetCmd; +static Tcl_ObjCmdProc2 DictSizeCmd; +static Tcl_ObjCmdProc2 DictUnsetCmd; +static Tcl_ObjCmdProc2 DictUpdateCmd; +static Tcl_ObjCmdProc2 DictValuesCmd; +static Tcl_ObjCmdProc2 DictWithCmd; static Tcl_DupInternalRepProc DupDictInternalRep; static Tcl_FreeInternalRepProc FreeDictInternalRep; static void InvalidateDictChain(Tcl_Obj *dictObj); @@ -57,8 +57,8 @@ static inline int DeleteChainEntry(struct Dict *dict, Tcl_Obj *keyPtr); static Tcl_NRPostProc FinalizeDictUpdate; static Tcl_NRPostProc FinalizeDictWith; -static Tcl_ObjCmdProc DictForNRCmd; -static Tcl_ObjCmdProc DictMapNRCmd; +static Tcl_ObjCmdProc2 DictForNRCmd; +static Tcl_ObjCmdProc2 DictMapNRCmd; static Tcl_NRPostProc DictForLoopCallback; static Tcl_NRPostProc DictMapLoopCallback; @@ -1491,11 +1491,11 @@ static int DictCreateCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictObj; - int i; + Tcl_Size i; /* * Must have an even number of arguments; note that number of preceding @@ -1541,7 +1541,7 @@ static int DictGetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr = NULL; @@ -1634,7 +1634,7 @@ static int DictGetDefCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *keyPtr, *valuePtr, *defaultPtr; @@ -1699,11 +1699,11 @@ static int DictReplaceCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr; - int i; + Tcl_Size i; if ((objc < 2) || (objc & 1)) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key value ...?"); @@ -1747,11 +1747,11 @@ static int DictRemoveCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr; - int i; + Tcl_Size i; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...?"); @@ -1795,12 +1795,12 @@ static int DictMergeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *targetObj, *keyObj = NULL, *valueObj = NULL; - int allocatedDict = 0; - int i, done; + int done, allocatedDict = 0; + Tcl_Size i; Tcl_DictSearch search; if (objc == 1) { @@ -1882,7 +1882,7 @@ static int DictKeysCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *listPtr; @@ -1961,7 +1961,7 @@ static int DictValuesCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *valuePtr = NULL, *listPtr; @@ -2021,7 +2021,7 @@ static int DictSizeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int result; @@ -2060,7 +2060,7 @@ static int DictExistsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr; @@ -2102,7 +2102,7 @@ static int DictInfoCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Dict *dict; @@ -2146,7 +2146,7 @@ static int DictIncrCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int code = TCL_OK; @@ -2267,11 +2267,12 @@ static int DictLappendCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr, *resultPtr; - int i, allocatedDict = 0, allocatedValue = 0; + int allocatedDict = 0, allocatedValue = 0; + Tcl_Size i; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?"); @@ -2354,7 +2355,7 @@ static int DictAppendCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr, *resultPtr; @@ -2456,7 +2457,7 @@ static int DictForNRCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Interp *iPtr = (Interp *) interp; @@ -2652,7 +2653,7 @@ static int DictMapNRCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Interp *iPtr = (Interp *) interp; @@ -2865,7 +2866,7 @@ static int DictSetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *resultPtr; @@ -2925,7 +2926,7 @@ static int DictUnsetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *resultPtr; @@ -2984,7 +2985,7 @@ static int DictFilterCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Interp *iPtr = (Interp *) interp; @@ -3058,7 +3059,7 @@ DictFilterCmd( resultObj = Tcl_NewDictObj(); while (!done) { - int i; + Tcl_Size i; for (i=3 ; i<objc ; i++) { pattern = TclGetString(objv[i]); @@ -3084,7 +3085,7 @@ DictFilterCmd( } resultObj = Tcl_NewDictObj(); while (!done) { - int i; + Tcl_Size i; for (i=3 ; i<objc ; i++) { pattern = TclGetString(objv[i]); @@ -3270,13 +3271,12 @@ static int DictUpdateCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Interp *iPtr = (Interp *) interp; Tcl_Obj *dictPtr, *objPtr; - int i; - Tcl_Size dummy; + Tcl_Size i, dummy; if (objc < 5 || !(objc & 1)) { Tcl_WrongNumArgs(interp, 1, objv, @@ -3429,7 +3429,7 @@ static int DictWithCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Interp *iPtr = (Interp *) interp; diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index db781db..09bfa04 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -1270,7 +1270,7 @@ int Tcl_DisassembleObjCmd( void *clientData, /* What type of operation. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const types[] = { diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 1a2fa14..8cc15ad 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -19,10 +19,10 @@ static inline Tcl_Obj * NewNsObj(Tcl_Namespace *namespacePtr); static inline int EnsembleUnknownCallback(Tcl_Interp *interp, - EnsembleConfig *ensemblePtr, int objc, + EnsembleConfig *ensemblePtr, Tcl_Size objc, Tcl_Obj *const objv[], Tcl_Obj **prefixObjPtr); static int NsEnsembleImplementationCmdNR(void *clientData, - Tcl_Interp *interp,int objc,Tcl_Obj *const objv[]); + Tcl_Interp *interp,Tcl_Size objc,Tcl_Obj *const objv[]); static void BuildEnsembleConfig(EnsembleConfig *ensemblePtr); static int NsEnsembleStringOrder(const void *strPtr1, const void *strPtr2); @@ -154,7 +154,7 @@ int TclNamespaceEnsembleCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Namespace *namespacePtr; @@ -796,7 +796,7 @@ Tcl_SetEnsembleSubcommandList( EnsembleConfig *ensemblePtr; Tcl_Obj *oldList; - if (cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 != TclEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); @@ -813,7 +813,7 @@ Tcl_SetEnsembleSubcommandList( } } - ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData; + ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData2; oldList = ensemblePtr->subcmdList; ensemblePtr->subcmdList = subcmdList; if (subcmdList != NULL) { @@ -872,7 +872,7 @@ Tcl_SetEnsembleParameterList( Tcl_Obj *oldList; Tcl_Size length; - if (cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 != TclEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); @@ -889,7 +889,7 @@ Tcl_SetEnsembleParameterList( } } - ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData; + ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData2; oldList = ensemblePtr->parameterList; ensemblePtr->parameterList = paramList; if (paramList != NULL) { @@ -948,7 +948,7 @@ Tcl_SetEnsembleMappingDict( EnsembleConfig *ensemblePtr; Tcl_Obj *oldDict; - if (cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 != TclEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); @@ -990,7 +990,7 @@ Tcl_SetEnsembleMappingDict( } } - ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData; + ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData2; oldDict = ensemblePtr->subcommandDict; ensemblePtr->subcommandDict = mapDict; if (mapDict != NULL) { @@ -1048,7 +1048,7 @@ Tcl_SetEnsembleUnknownHandler( EnsembleConfig *ensemblePtr; Tcl_Obj *oldList; - if (cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 != TclEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); @@ -1065,7 +1065,7 @@ Tcl_SetEnsembleUnknownHandler( } } - ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData; + ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData2; oldList = ensemblePtr->unknownHandler; ensemblePtr->unknownHandler = unknownList; if (unknownList != NULL) { @@ -1114,14 +1114,14 @@ Tcl_SetEnsembleFlags( EnsembleConfig *ensemblePtr; int wasCompiled; - if (cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 != TclEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); return TCL_ERROR; } - ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData; + ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData2; wasCompiled = ensemblePtr->flags & ENSEMBLE_COMPILE; /* @@ -1190,7 +1190,7 @@ Tcl_GetEnsembleSubcommandList( Command *cmdPtr = (Command *) token; EnsembleConfig *ensemblePtr; - if (cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 != TclEnsembleImplementationCmd) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); @@ -1199,7 +1199,7 @@ Tcl_GetEnsembleSubcommandList( return TCL_ERROR; } - ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData; + ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData2; *subcmdListPtr = ensemblePtr->subcmdList; return TCL_OK; } @@ -1232,7 +1232,7 @@ Tcl_GetEnsembleParameterList( Command *cmdPtr = (Command *) token; EnsembleConfig *ensemblePtr; - if (cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 != TclEnsembleImplementationCmd) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); @@ -1241,7 +1241,7 @@ Tcl_GetEnsembleParameterList( return TCL_ERROR; } - ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData; + ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData2; *paramListPtr = ensemblePtr->parameterList; return TCL_OK; } @@ -1274,7 +1274,7 @@ Tcl_GetEnsembleMappingDict( Command *cmdPtr = (Command *) token; EnsembleConfig *ensemblePtr; - if (cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 != TclEnsembleImplementationCmd) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); @@ -1283,7 +1283,7 @@ Tcl_GetEnsembleMappingDict( return TCL_ERROR; } - ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData; + ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData2; *mapDictPtr = ensemblePtr->subcommandDict; return TCL_OK; } @@ -1315,7 +1315,7 @@ Tcl_GetEnsembleUnknownHandler( Command *cmdPtr = (Command *) token; EnsembleConfig *ensemblePtr; - if (cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 != TclEnsembleImplementationCmd) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); @@ -1324,7 +1324,7 @@ Tcl_GetEnsembleUnknownHandler( return TCL_ERROR; } - ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData; + ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData2; *unknownListPtr = ensemblePtr->unknownHandler; return TCL_OK; } @@ -1356,7 +1356,7 @@ Tcl_GetEnsembleFlags( Command *cmdPtr = (Command *) token; EnsembleConfig *ensemblePtr; - if (cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 != TclEnsembleImplementationCmd) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); @@ -1365,7 +1365,7 @@ Tcl_GetEnsembleFlags( return TCL_ERROR; } - ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData; + ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData2; *flagsPtr = ensemblePtr->flags; return TCL_OK; } @@ -1397,7 +1397,7 @@ Tcl_GetEnsembleNamespace( Command *cmdPtr = (Command *) token; EnsembleConfig *ensemblePtr; - if (cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 != TclEnsembleImplementationCmd) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); @@ -1406,7 +1406,7 @@ Tcl_GetEnsembleNamespace( return TCL_ERROR; } - ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData; + ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData2; *namespacePtrPtr = (Tcl_Namespace *) ensemblePtr->nsPtr; return TCL_OK; } @@ -1447,7 +1447,7 @@ Tcl_FindEnsemble( return NULL; } - if (cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 != TclEnsembleImplementationCmd) { /* * Reuse existing infrastructure for following import link chains * rather than duplicating it. @@ -1456,7 +1456,7 @@ Tcl_FindEnsemble( cmdPtr = (Command *) TclGetOriginalCommand((Tcl_Command) cmdPtr); if (cmdPtr == NULL - || cmdPtr->objProc != TclEnsembleImplementationCmd) { + || cmdPtr->objProc2 != TclEnsembleImplementationCmd) { if (flags & TCL_LEAVE_ERR_MSG) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" is not an ensemble command", @@ -1494,11 +1494,11 @@ Tcl_IsEnsemble( { Command *cmdPtr = (Command *) token; - if (cmdPtr->objProc == TclEnsembleImplementationCmd) { + if (cmdPtr->objProc2 == TclEnsembleImplementationCmd) { return 1; } cmdPtr = (Command *) TclGetOriginalCommand((Tcl_Command) cmdPtr); - if (cmdPtr == NULL || cmdPtr->objProc != TclEnsembleImplementationCmd) { + if (cmdPtr == NULL || cmdPtr->objProc2 != TclEnsembleImplementationCmd) { return 0; } return 1; @@ -1625,7 +1625,7 @@ TclMakeEnsemble( Tcl_AppendToObj(toObj, map[i].name, -1); Tcl_DictObjPut(NULL, mapDict, fromObj, toObj); - if (map[i].proc || map[i].nreProc) { + if (map[i].proc2 || map[i].nreProc2) { /* * If the command is unsafe, hide it when we're in a safe * interpreter. The code to do this is really hokey! It also @@ -1636,8 +1636,8 @@ TclMakeEnsemble( if (map[i].unsafe && Tcl_IsSafe(interp)) { cmdPtr = (Command *) - Tcl_NRCreateCommand(interp, "___tmp", map[i].proc, - map[i].nreProc, map[i].clientData, NULL); + Tcl_NRCreateCommand2(interp, "___tmp", map[i].proc2, + map[i].nreProc2, map[i].clientData, NULL); Tcl_DStringSetLength(&hiddenBuf, hiddenLen); if (Tcl_HideCommand(interp, "___tmp", Tcl_DStringAppend(&hiddenBuf, map[i].name, -1))) { @@ -1649,8 +1649,8 @@ TclMakeEnsemble( */ cmdPtr = (Command *) - Tcl_NRCreateCommand(interp, TclGetString(toObj), - map[i].proc, map[i].nreProc, map[i].clientData, + Tcl_NRCreateCommand2(interp, TclGetString(toObj), + map[i].proc2, map[i].nreProc2, map[i].clientData, NULL); } cmdPtr->compileProc = map[i].compileProc; @@ -1693,10 +1693,10 @@ int TclEnsembleImplementationCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { - return Tcl_NRCallObjProc(interp, NsEnsembleImplementationCmdNR, + return Tcl_NRCallObjProc2(interp, NsEnsembleImplementationCmdNR, clientData, objc, objv); } @@ -1704,7 +1704,7 @@ static int NsEnsembleImplementationCmdNR( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { EnsembleConfig *ensemblePtr = (EnsembleConfig *)clientData; @@ -2291,7 +2291,7 @@ static inline int EnsembleUnknownCallback( Tcl_Interp *interp, EnsembleConfig *ensemblePtr, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[], Tcl_Obj **prefixObjPtr) { diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 68a2c97..812c5f7 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -55,8 +55,8 @@ typedef struct { */ typedef struct { - int *donePtr; /* Pointer to flag to signal or NULL. */ - int sequence; /* Order of occurrence. */ + Tcl_Size *donePtr; /* Pointer to flag to signal or NULL. */ + Tcl_Size sequence; /* Order of occurrence. */ int mask; /* 0, or TCL_READABLE/TCL_WRITABLE. */ Tcl_Obj *sourceObj; /* Name of the event source, either a * variable name or channel name. */ @@ -320,7 +320,7 @@ int TclDefaultBgErrorHandlerObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *keyPtr, *valuePtr; @@ -1490,11 +1490,12 @@ int Tcl_VwaitObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int i, done = 0, timedOut = 0, foundEvent, any = 1, timeout = 0; - int numItems = 0, extended = 0, result, mode, mask = TCL_ALL_EVENTS; + Tcl_Size i, done = 0, numItems = 0, timedOut = 0; + int foundEvent, any = 1, timeout = 0; + int extended = 0, result, mode, mask = TCL_ALL_EVENTS; Tcl_InterpState saved = NULL; Tcl_TimerToken timer = NULL; Tcl_Time before, after; @@ -1592,7 +1593,7 @@ Tcl_VwaitObjCmd( goto done; } vwaitItems[numItems].donePtr = &done; - vwaitItems[numItems].sequence = -1; + vwaitItems[numItems].sequence = TCL_INDEX_NONE; vwaitItems[numItems].mask = 0; vwaitItems[numItems].sourceObj = objv[i]; numItems++; @@ -1616,7 +1617,7 @@ Tcl_VwaitObjCmd( Tcl_CreateChannelHandler(chan, TCL_READABLE, VwaitChannelReadProc, &vwaitItems[numItems]); vwaitItems[numItems].donePtr = &done; - vwaitItems[numItems].sequence = -1; + vwaitItems[numItems].sequence = TCL_INDEX_NONE; vwaitItems[numItems].mask = TCL_READABLE; vwaitItems[numItems].sourceObj = objv[i]; numItems++; @@ -1640,7 +1641,7 @@ Tcl_VwaitObjCmd( Tcl_CreateChannelHandler(chan, TCL_WRITABLE, VwaitChannelWriteProc, &vwaitItems[numItems]); vwaitItems[numItems].donePtr = &done; - vwaitItems[numItems].sequence = -1; + vwaitItems[numItems].sequence = TCL_INDEX_NONE; vwaitItems[numItems].mask = TCL_WRITABLE; vwaitItems[numItems].sourceObj = objv[i]; numItems++; @@ -1674,7 +1675,7 @@ Tcl_VwaitObjCmd( break; } vwaitItems[numItems].donePtr = &done; - vwaitItems[numItems].sequence = -1; + vwaitItems[numItems].sequence = TCL_INDEX_NONE; vwaitItems[numItems].mask = 0; vwaitItems[numItems].sourceObj = objv[i]; numItems++; @@ -1698,7 +1699,7 @@ Tcl_VwaitObjCmd( if (timeout > 0) { vwaitItems[numItems].donePtr = &timedOut; - vwaitItems[numItems].sequence = -1; + vwaitItems[numItems].sequence = TCL_INDEX_NONE; vwaitItems[numItems].mask = 0; vwaitItems[numItems].sourceObj = NULL; timer = Tcl_CreateTimerHandler(timeout, VwaitTimeoutProc, @@ -1816,7 +1817,7 @@ Tcl_VwaitObjCmd( if (result == TCL_OK) { if (extended) { - int k; + Tcl_Size k; Tcl_Obj *listObj, *keyObj; TclNewObj(listObj); @@ -1943,7 +1944,7 @@ int Tcl_UpdateObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int flags = 0; /* Initialized to avoid compiler warning. */ diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 647e3db..14cd6f4 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -612,7 +612,7 @@ static const size_t Exp64ValueSize = sizeof(Exp64Value) / sizeof(Tcl_WideInt); */ #ifdef TCL_COMPILE_STATS -static Tcl_ObjCmdProc EvalStatsCmd; +static Tcl_ObjCmdProc2 EvalStatsCmd; #endif /* TCL_COMPILE_STATS */ #ifdef TCL_COMPILE_DEBUG static const char * GetOpcodeName(const unsigned char *pc); @@ -754,7 +754,7 @@ InitByteCodeExecution( } #endif #ifdef TCL_COMPILE_STATS - Tcl_CreateObjCommand(interp, "evalstats", EvalStatsCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "evalstats", EvalStatsCmd, NULL, NULL); #endif /* TCL_COMPILE_STATS */ } @@ -1848,7 +1848,7 @@ ArgumentBCEnter( ByteCode *codePtr, TEBCdata *tdPtr, const unsigned char *pc, - int objc, + Tcl_Size objc, Tcl_Obj **objv) { int cmd; @@ -2825,12 +2825,8 @@ TEBCresume( pc += pcAdjustment; TEBC_YIELD(); - if (objc > INT_MAX) { - return TclCommandWordLimitError(interp, objc); - } else { - return TclNREvalObjv(interp, objc, objv, + return TclNREvalObjv(interp, objc, objv, TCL_EVAL_NOERR | TCL_EVAL_SOURCE_IN_FRAME, NULL); - } case INST_INVOKE_REPLACE: objc = TclGetUInt4AtPtr(pc+1); @@ -4584,11 +4580,17 @@ TEBCresume( Method *const mPtr = contextPtr->callPtr->chain[newDepth].mPtr; - if (mPtr->typePtr->version < TCL_OO_METHOD_VERSION_2) { - return mPtr->typePtr->callProc(mPtr->clientData, interp, +#ifndef TCL_NO_DEPRECATED + if (mPtr->typePtr->version == TCL_OO_METHOD_VERSION_1) { + if (objc > INT_MAX) { + TRACE_ERROR(interp); + goto gotError; + } + return ((Tcl_MethodCallProc *)(void *)mPtr->typePtr->callProc)(mPtr->clientData, interp, (Tcl_ObjectContext) contextPtr, opnd, objv); } - return ((Tcl_MethodCallProc2 *)(void *)(mPtr->typePtr->callProc))(mPtr->clientData, interp, +#endif /* TCL_NO_DEPRECATED */ + return mPtr->typePtr->callProc(mPtr->clientData, interp, (Tcl_ObjectContext) contextPtr, opnd, objv); } @@ -9022,7 +9024,7 @@ IllegalExprOperandType( Tcl_Obj * TclGetSourceFromFrame( CmdFrame *cfPtr, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (cfPtr == NULL) { @@ -9446,7 +9448,7 @@ static int EvalStatsCmd( TCL_UNUSED(void *), /* Unused. */ Tcl_Interp *interp, /* The current interpreter. */ - int objc, /* The number of arguments. */ + Tcl_Size objc, /* The number of arguments. */ Tcl_Obj *const objv[]) /* The argument strings. */ { Interp *iPtr = (Interp *) interp; diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index ca4ff27..7c8fa2b 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -22,9 +22,9 @@ static int CopyRenameOneFile(Tcl_Interp *interp, int copyFlag, int force); static Tcl_Obj * FileBasename(Tcl_Interp *interp, Tcl_Obj *pathPtr); static int FileCopyRename(Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[], int copyFlag); -static int FileForceOption(Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[], int *forcePtr); + Tcl_Size objc, Tcl_Obj *const objv[], int copyFlag); +static size_t FileForceOption(Tcl_Interp *interp, + Tcl_Size objc, Tcl_Obj *const objv[], int *forcePtr); /* *--------------------------------------------------------------------------- @@ -50,7 +50,7 @@ TclFileRenameCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Interp for error reporting or recursive * calls in the case of a tricky rename. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */ { return FileCopyRename(interp, objc, objv, 0); @@ -79,7 +79,7 @@ TclFileCopyCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Used for error reporting or recursive calls * in the case of a tricky copy. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */ { return FileCopyRename(interp, objc, objv, 1); @@ -105,17 +105,18 @@ TclFileCopyCmd( static int FileCopyRename( Tcl_Interp *interp, /* Used for error reporting. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument strings passed to Tcl_FileCmd. */ int copyFlag) /* If non-zero, copy source(s). Otherwise, * rename them. */ { - int i, result, force; + int result, force; + Tcl_Size i; Tcl_StatBuf statBuf; Tcl_Obj *target; i = FileForceOption(interp, objc - 1, objv + 1, &force); - if (i < 0) { + if (i == TCL_INDEX_NONE) { return TCL_ERROR; } i++; @@ -216,12 +217,12 @@ int TclFileMakeDirsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Used for error reporting. */ - int objc, /* Number of arguments */ + Tcl_Size objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */ { Tcl_Obj *errfile = NULL; - int result, i; - Tcl_Size j, pobjc; + int result; + Tcl_Size i, j, pobjc; Tcl_Obj *split = NULL; Tcl_Obj *target = NULL; Tcl_StatBuf statBuf; @@ -341,15 +342,16 @@ int TclFileDeleteCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Used for error reporting */ - int objc, /* Number of arguments */ + Tcl_Size objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */ { - int i, force, result; + int force, result; + Tcl_Size i; Tcl_Obj *errfile; Tcl_Obj *errorBuffer = NULL; i = FileForceOption(interp, objc - 1, objv + 1, &force); - if (i < 0) { + if (i == TCL_INDEX_NONE) { return TCL_ERROR; } @@ -816,16 +818,17 @@ CopyRenameOneFile( *--------------------------------------------------------------------------- */ -static int +static size_t FileForceOption( Tcl_Interp *interp, /* Interp, for error return. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument strings. First command line * option, if it exists, begins at 0. */ int *forcePtr) /* If the "-force" was specified, *forcePtr is * filled with 1, otherwise with 0. */ { - int force, i, idx; + int force, idx; + Tcl_Size i; static const char *const options[] = { "-force", "--", NULL }; @@ -837,7 +840,7 @@ FileForceOption( } if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", TCL_EXACT, &idx) != TCL_OK) { - return -1; + return TCL_INDEX_NONE; } if (idx == 0 /* -force */) { force = 1; @@ -940,7 +943,7 @@ int TclFileAttrsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* The interpreter for error reporting. */ - int objc, /* Number of command line arguments. */ + Tcl_Size objc, /* Number of command line arguments. */ Tcl_Obj *const objv[]) /* The command line objects. */ { int result; @@ -1090,7 +1093,8 @@ TclFileAttrsCmd( * Set option/value pairs. */ - int i, index; + Tcl_Size i; + int index; if (numObjStrings == 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -1156,7 +1160,7 @@ int TclFileLinkCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *contents; @@ -1307,7 +1311,7 @@ int TclFileReadLinkCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *contents; @@ -1358,7 +1362,7 @@ int TclFileTemporaryCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *nameVarObj = NULL; /* Variable to store the name of the temporary @@ -1517,7 +1521,7 @@ int TclFileTempDirCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirNameObj; /* Object that will contain the directory @@ -1662,7 +1666,7 @@ int TclFileHomeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *homeDirObj; @@ -1700,7 +1704,7 @@ int TclFileTildeExpandCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *expandedPathObj; diff --git a/generic/tclFileName.c b/generic/tclFileName.c index c9148c1..77a0d8d 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -1114,11 +1114,11 @@ int Tcl_GlobObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int i, globFlags, join, dir, result; - Tcl_Size length; + int globFlags, join, dir, result; + Tcl_Size i, length; char *string; const char *separators; Tcl_Obj *typePtr, *look; diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y index e282c9b..d4ac758 100644 --- a/generic/tclGetDate.y +++ b/generic/tclGetDate.y @@ -961,8 +961,8 @@ int TclClockOldscanObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Count of parameters */ - Tcl_Obj *const *objv) /* Parameters */ + Tcl_Size objc, /* Count of parameters */ + Tcl_Obj *const objv[]) /* Parameters */ { Tcl_Obj *result, *resultElement; int yr, mo, da; diff --git a/generic/tclHistory.c b/generic/tclHistory.c index dc5a67d..aa284fc 100644 --- a/generic/tclHistory.c +++ b/generic/tclHistory.c @@ -145,7 +145,7 @@ Tcl_RecordAndEvalObj( result = Tcl_GetCommandInfo(interp, "::history", &info); if (result && (info.deleteProc == TclProcDeleteProc)) { - Proc *procPtr = (Proc *) info.objClientData; + Proc *procPtr = (Proc *) info.objClientData2; call = (procPtr->cmdPtr->compileProc != TclCompileNoOp); } diff --git a/generic/tclIO.c b/generic/tclIO.c index 21aef59..65e327d 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -9174,7 +9174,7 @@ Tcl_FileEventObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Interpreter in which the channel for which * to create the handler is found. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Channel *chanPtr; /* The channel to create the handler for. */ diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 93c50ec..e4cbe1b 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -39,8 +39,8 @@ static Tcl_ThreadDataKey dataKey; static Tcl_ExitProc FinalizeIOCmdTSD; static Tcl_TcpAcceptProc AcceptCallbackProc; -static Tcl_ObjCmdProc ChanPendingObjCmd; -static Tcl_ObjCmdProc ChanTruncateObjCmd; +static Tcl_ObjCmdProc2 ChanPendingObjCmd; +static Tcl_ObjCmdProc2 ChanTruncateObjCmd; static void RegisterTcpServerInterpCleanup( Tcl_Interp *interp, AcceptCallback *acceptCallbackPtr); @@ -100,7 +100,7 @@ int Tcl_PutsObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; /* The channel to puts on. */ @@ -213,7 +213,7 @@ int Tcl_FlushObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *chanObjPtr; @@ -277,7 +277,7 @@ int Tcl_GetsObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; /* The channel to read from. */ @@ -363,14 +363,15 @@ int Tcl_ReadObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; /* The channel to read from. */ - int newline, i; /* Discard newline at end? */ + int newline; /* Discard newline at end? */ Tcl_WideInt toRead; /* How many bytes to read? */ Tcl_Size charactersRead; /* How many characters were read? */ int mode; /* Mode in which channel is opened. */ + Tcl_Size i; Tcl_Obj *resultPtr, *chanObjPtr; if ((objc != 2) && (objc != 3)) { @@ -490,7 +491,7 @@ int Tcl_SeekObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; /* The channel to tell on. */ @@ -565,7 +566,7 @@ int Tcl_TellObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; /* The channel to tell on. */ @@ -627,7 +628,7 @@ int Tcl_CloseObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; /* The channel to close. */ @@ -698,7 +699,7 @@ Tcl_CloseObjCmd( Tcl_Obj *resultPtr = Tcl_GetObjResult(interp); const char *string; - Tcl_Size len; + size_t len; if (Tcl_IsShared(resultPtr)) { resultPtr = Tcl_DuplicateObj(resultPtr); @@ -735,12 +736,12 @@ int Tcl_FconfigureObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *optionName, *valueName; Tcl_Channel chan; /* The channel to set a mode on. */ - int i; /* Iterate over arg-value pairs. */ + Tcl_Size i; /* Iterate over arg-value pairs. */ if ((objc < 2) || (((objc % 2) == 1) && (objc != 3))) { Tcl_WrongNumArgs(interp, 1, objv, "channelId ?-option value ...?"); @@ -810,7 +811,7 @@ int Tcl_EofObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; @@ -849,7 +850,7 @@ int Tcl_ExecObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *resultPtr; @@ -857,8 +858,8 @@ Tcl_ExecObjCmd( * on the _Tcl_ stack. */ const char *string; Tcl_Channel chan; - int argc, background, i, index, keepNewline, result, skip, ignoreStderr; - Tcl_Size length; + int argc, background, i, index, keepNewline, result, ignoreStderr; + Tcl_Size length, skip; static const char *const options[] = { "-ignorestderr", "-keepnewline", "--", NULL }; @@ -1016,7 +1017,7 @@ int Tcl_FblockedObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; @@ -1062,7 +1063,7 @@ int Tcl_OpenObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int pipeline, prot; @@ -1438,7 +1439,7 @@ int Tcl_SocketObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const socketOptions[] = { @@ -1449,8 +1450,8 @@ Tcl_SocketObjCmd( SKT_ASYNC, SKT_BACKLOG, SKT_MYADDR, SKT_MYPORT, SKT_REUSEADDR, SKT_REUSEPORT, SKT_SERVER } optionIndex; - int a, server = 0, myport = 0, async = 0, reusep = -1, - reusea = -1, backlog = -1; + int server = 0, myport = 0, async = 0, reusep = -1, reusea = -1, backlog = -1; + Tcl_Size a; unsigned int flags = 0; const char *host, *port, *myaddr = NULL; Tcl_Obj *script = NULL; @@ -1689,11 +1690,12 @@ int Tcl_FcopyObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel inChan, outChan; - int mode, i, index; + int mode, index; + Tcl_Size i; Tcl_WideInt toRead; Tcl_Obj *cmdPtr; static const char *const switches[] = { "-size", "-command", NULL }; @@ -1784,7 +1786,7 @@ static int ChanPendingObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; @@ -1846,7 +1848,7 @@ static int ChanTruncateObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; @@ -1919,7 +1921,7 @@ static int ChanPipeObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel rchan, wchan; @@ -1970,7 +1972,7 @@ int TclChannelNamesCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc < 1 || objc > 2) { diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index f2138c4..5aef778 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -502,7 +502,7 @@ int TclChanCreateObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { ReflectedChannel *rcPtr; /* Instance data of the new channel */ @@ -821,7 +821,7 @@ int TclChanPostEventObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { /* diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index 90e7195..db6782b 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -497,7 +497,7 @@ int TclChanPushObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { ReflectedTransform *rtPtr; /* Instance data of the new (transform) @@ -742,7 +742,7 @@ int TclChanPopObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { /* diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index 5697fd8..88e5d52 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -26,9 +26,9 @@ static int GetIndexFromObjList(Tcl_Interp *interp, static void UpdateStringOfIndex(Tcl_Obj *objPtr); static void DupIndex(Tcl_Obj *srcPtr, Tcl_Obj *dupPtr); static void FreeIndex(Tcl_Obj *objPtr); -static Tcl_ObjCmdProc PrefixAllObjCmd; -static Tcl_ObjCmdProc PrefixLongestObjCmd; -static Tcl_ObjCmdProc PrefixMatchObjCmd; +static Tcl_ObjCmdProc2 PrefixAllObjCmd; +static Tcl_ObjCmdProc2 PrefixLongestObjCmd; +static Tcl_ObjCmdProc2 PrefixMatchObjCmd; static void PrintUsage(Tcl_Interp *interp, const Tcl_ArgvInfo *argTable); @@ -56,8 +56,8 @@ static const Tcl_ObjType indexType = { typedef struct { void *tablePtr; /* Pointer to the table of strings */ - Tcl_Size offset; /* Offset between table entries */ - Tcl_Size index; /* Selected index into table. */ + size_t offset; /* Offset between table entries */ + size_t index; /* Selected index into table. */ } IndexRep; /* @@ -69,7 +69,7 @@ typedef struct { #define NEXT_ENTRY(table, offset) \ (&(STRING_AT(table, offset))) #define EXPAND_OF(indexRep) \ - (((indexRep)->index != TCL_INDEX_NONE) ? STRING_AT((indexRep)->tablePtr, (indexRep)->offset*(indexRep)->index) : "") + (((indexRep)->index != (size_t)-1) ? STRING_AT((indexRep)->tablePtr, (indexRep)->offset*(indexRep)->index) : "") /* *---------------------------------------------------------------------- @@ -191,7 +191,7 @@ Tcl_GetIndexFromObjStruct( * offset, the third plus the offset again, * etc. The last entry must be NULL and there * must not be duplicate entries. */ - Tcl_Size offset, /* The number of bytes between entries */ + size_t offset, /* The number of bytes between entries */ const char *msg, /* Identifying word to use in error * messages. */ int flags, /* 0, TCL_EXACT, TCL_NULL_OK or TCL_INDEX_TEMP_TABLE */ @@ -205,8 +205,9 @@ Tcl_GetIndexFromObjStruct( IndexRep *indexRep; const Tcl_ObjInternalRep *irPtr; - if (offset < (Tcl_Size) sizeof(char *)) { - return TclIndexInvalidError(interp, "struct offset", offset); + /* Protect against invalid values, like TCL_INDEX_NONE or 0. */ + if (offset+1 <= sizeof(char *)) { + offset = sizeof(char *); } /* * See if there is a valid cached result from a previous lookup. @@ -218,7 +219,7 @@ Tcl_GetIndexFromObjStruct( indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1; if ((indexRep->tablePtr == tablePtr) && (indexRep->offset == offset) - && (indexRep->index != TCL_INDEX_NONE)) { + && (indexRep->index != (size_t)-1)) { index = indexRep->index; goto uncachedDone; } @@ -504,11 +505,11 @@ static int PrefixMatchObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int flags = 0, result, dummy, i; - Tcl_Size dummyLength, errorLength; + int flags = 0, result, dummy; + Tcl_Size dummyLength, errorLength, i; Tcl_Obj *errorPtr = NULL; const char *message = "option"; Tcl_Obj *tablePtr, *objPtr, *resultPtr; @@ -628,7 +629,7 @@ static int PrefixAllObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int result; @@ -686,7 +687,7 @@ static int PrefixLongestObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int result; diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 78e87ac..16d5ef3 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -137,14 +137,15 @@ declare 46 { declare 51 { int TclInterpInit(Tcl_Interp *interp) } -declare 53 { - int TclInvokeObjectCommand(void *clientData, Tcl_Interp *interp, - int argc, const char **argv) -} -declare 54 { - int TclInvokeStringCommand(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]) -} +# Removed in 9.0 +#declare 53 { +# int TclInvokeObjectCommand(void *clientData, Tcl_Interp *interp, +# int argc, const char **argv) +#} +#declare 54 { +# int TclInvokeStringCommand(void *clientData, Tcl_Interp *interp, +# int objc, Tcl_Obj *const objv[]) +#} declare 55 { Proc *TclIsProc(Command *cmdPtr) } @@ -162,14 +163,16 @@ declare 61 { declare 62 { int TclObjCommandComplete(Tcl_Obj *cmdPtr) } -declare 63 { - int TclObjInterpProc(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]) -} -declare 64 { - int TclObjInvoke(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], - int flags) -} +# Removed in 9.0 +#declare 63 { +# int TclObjInterpProc(void *clientData, Tcl_Interp *interp, +# int objc, Tcl_Obj *const objv[]) +#} +# Removed in 9.0 +#declare 64 { +# int TclObjInvoke(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], +# int flags) +#} declare 69 { void *TclpAlloc(TCL_HASH_TYPE size) } @@ -608,10 +611,11 @@ declare 237 { # NRE functions for "rogue" extensions to exploit NRE; they will need to # include NRE.h too. -declare 238 { - int TclNRInterpProc(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]) -} +# Removed in 9.0 +#declare 238 { +# int TclNRInterpProc(void *clientData, Tcl_Interp *interp, +# size_t objc, Tcl_Obj *const objv[]) +#} declare 239 { int TclNRInterpProcCore(Tcl_Interp *interp, Tcl_Obj *procNameObj, Tcl_Size skip, ProcErrorProc *errorProc) diff --git a/generic/tclInt.h b/generic/tclInt.h index 8f87523..f97549e 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -1641,9 +1641,9 @@ typedef struct ByteCodeStats { typedef struct { const char *name; /* The name of the subcommand. */ - Tcl_ObjCmdProc *proc; /* The implementation of the subcommand. */ + Tcl_ObjCmdProc2 *proc2; /* The implementation of the subcommand. */ CompileProc *compileProc; /* The compiler for the subcommand. */ - Tcl_ObjCmdProc *nreProc; /* NRE implementation of this command. */ + Tcl_ObjCmdProc2 *nreProc2; /* NRE implementation of this command. */ void *clientData; /* Any clientData to give the command. */ int unsafe; /* Whether this command is to be hidden by * default in a safe interpreter. */ @@ -1720,8 +1720,8 @@ typedef struct Command { * renamed, deleted, hidden, or exposed. */ CompileProc *compileProc; /* Procedure called to compile command. NULL * if no compile proc exists for command. */ - Tcl_ObjCmdProc *objProc; /* Object-based command procedure. */ - void *objClientData; /* Arbitrary value passed to object proc. */ + Tcl_ObjCmdProc2 *objProc2; /* Object-based command procedure. */ + void *objClientData2; /* Arbitrary value passed to object proc. */ Tcl_CmdProc *proc; /* String-based command procedure. */ void *clientData; /* Arbitrary value passed to string proc. */ Tcl_CmdDeleteProc *deleteProc; @@ -1739,7 +1739,7 @@ typedef struct Command { * command. */ CommandTrace *tracePtr; /* First in list of all traces set for this * command. */ - Tcl_ObjCmdProc *nreProc; /* NRE implementation of this command. */ + Tcl_ObjCmdProc2 *nreProc2; /* NRE implementation of this command. */ } Command; /* @@ -2965,31 +2965,31 @@ enum CheckEmptyStringResult { *---------------------------------------------------------------- */ -MODULE_SCOPE Tcl_ObjCmdProc TclNRApplyObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNREvalObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRCatchObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRExprObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRForObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRForeachCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRIfObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRLmapCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRPackageObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRSourceObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRSubstObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRSwitchObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRTryObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRUplevelObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRWhileObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRApplyObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNREvalObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRCatchObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRExprObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRForObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRForeachCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRIfObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRLmapCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRPackageObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRSourceObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRSubstObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRSwitchObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRTryObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRUplevelObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRWhileObjCmd; MODULE_SCOPE Tcl_NRPostProc TclNRForIterCallback; MODULE_SCOPE Tcl_NRPostProc TclNRCoroutineActivateCallback; -MODULE_SCOPE Tcl_ObjCmdProc TclNRTailcallObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRTailcallObjCmd; MODULE_SCOPE Tcl_NRPostProc TclNRTailcallEval; -MODULE_SCOPE Tcl_ObjCmdProc TclNRCoroutineObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRYieldObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRYieldmObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRYieldToObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRInvoke; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRCoroutineObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRYieldObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRYieldmObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRYieldToObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRInvoke; MODULE_SCOPE Tcl_NRPostProc TclNRReleaseValues; MODULE_SCOPE void TclSetTailcall(Tcl_Interp *interp, Tcl_Obj *tailcallPtr); @@ -3068,11 +3068,11 @@ MODULE_SCOPE void TclAdvanceContinuations(Tcl_Size *line, int **next, MODULE_SCOPE void TclAdvanceLines(Tcl_Size *line, const char *start, const char *end); MODULE_SCOPE void TclArgumentEnter(Tcl_Interp *interp, - Tcl_Obj *objv[], int objc, CmdFrame *cf); + Tcl_Obj *objv[], Tcl_Size objc, CmdFrame *cf); MODULE_SCOPE void TclArgumentRelease(Tcl_Interp *interp, - Tcl_Obj *objv[], int objc); + Tcl_Obj *objv[], Tcl_Size objc); MODULE_SCOPE void TclArgumentBCEnter(Tcl_Interp *interp, - Tcl_Obj *objv[], int objc, + Tcl_Obj *objv[], Tcl_Size objc, void *codePtr, CmdFrame *cfPtr, int cmd, Tcl_Size pc); MODULE_SCOPE void TclArgumentBCRelease(Tcl_Interp *interp, CmdFrame *cfPtr); @@ -3093,7 +3093,7 @@ MODULE_SCOPE int TclCheckArrayTraces(Tcl_Interp *interp, Var *varPtr, MODULE_SCOPE int TclCheckEmptyString(Tcl_Obj *objPtr); MODULE_SCOPE int TclChanCaughtErrorBypass(Tcl_Interp *interp, Tcl_Channel chan); -MODULE_SCOPE Tcl_ObjCmdProc TclChannelNamesCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclChannelNamesCmd; MODULE_SCOPE Tcl_NRPostProc TclClearRootEnsemble; MODULE_SCOPE int TclCompareTwoNumbers(Tcl_Obj *valuePtr, Tcl_Obj *value2Ptr); @@ -3108,7 +3108,7 @@ MODULE_SCOPE Tcl_Size TclConvertElement(const char *src, Tcl_Size length, char *dst, int flags); MODULE_SCOPE Tcl_Command TclCreateObjCommandInNs(Tcl_Interp *interp, const char *cmdName, Tcl_Namespace *nsPtr, - Tcl_ObjCmdProc *proc, void *clientData, + Tcl_ObjCmdProc2 *proc, void *clientData, Tcl_CmdDeleteProc *deleteProc); MODULE_SCOPE Tcl_Command TclCreateEnsembleInNs(Tcl_Interp *interp, const char *name, Tcl_Namespace *nameNamespacePtr, @@ -3123,17 +3123,17 @@ MODULE_SCOPE int TclFindDictElement(Tcl_Interp *interp, MODULE_SCOPE int TclEvalEx(Tcl_Interp *interp, const char *script, Tcl_Size numBytes, int flags, Tcl_Size line, int *clNextOuter, const char *outerScript); -MODULE_SCOPE Tcl_ObjCmdProc TclFileAttrsCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclFileCopyCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclFileDeleteCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclFileLinkCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclFileMakeDirsCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclFileReadLinkCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclFileRenameCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclFileTempDirCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclFileTemporaryCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclFileHomeCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclFileTildeExpandCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclFileAttrsCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclFileCopyCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclFileDeleteCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclFileLinkCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclFileMakeDirsCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclFileReadLinkCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclFileRenameCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclFileTempDirCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclFileTemporaryCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclFileHomeCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclFileTildeExpandCmd; MODULE_SCOPE void TclCreateLateExitHandler(Tcl_ExitProc *proc, void *clientData); MODULE_SCOPE void TclDeleteLateExitHandler(Tcl_ExitProc *proc, @@ -3175,7 +3175,7 @@ MODULE_SCOPE int TclFSFileAttrIndex(Tcl_Obj *pathPtr, const char *attributeName, int *indexPtr); MODULE_SCOPE Tcl_Command TclNRCreateCommandInNs(Tcl_Interp *interp, const char *cmdName, Tcl_Namespace *nsPtr, - Tcl_ObjCmdProc *proc, Tcl_ObjCmdProc *nreProc, + Tcl_ObjCmdProc2 *proc, Tcl_ObjCmdProc2 *nreProc, void *clientData, Tcl_CmdDeleteProc *deleteProc); MODULE_SCOPE int TclNREvalFile(Tcl_Interp *interp, Tcl_Obj *pathPtr, const char *encodingName); @@ -3194,7 +3194,7 @@ MODULE_SCOPE int TclGetOpenModeEx(Tcl_Interp *interp, const char *modeString, int *seekFlagPtr, int *binaryPtr); MODULE_SCOPE Tcl_Obj * TclGetProcessGlobalValue(ProcessGlobalValue *pgvPtr); -MODULE_SCOPE Tcl_Obj * TclGetSourceFromFrame(CmdFrame *cfPtr, int objc, +MODULE_SCOPE Tcl_Obj * TclGetSourceFromFrame(CmdFrame *cfPtr, Tcl_Size objc, Tcl_Obj *const objv[]); MODULE_SCOPE char * TclGetStringStorage(Tcl_Obj *objPtr, Tcl_Size *sizePtr); @@ -3207,12 +3207,12 @@ MODULE_SCOPE int TclIncrObj(Tcl_Interp *interp, Tcl_Obj *valuePtr, Tcl_Obj *incrPtr); MODULE_SCOPE Tcl_Obj * TclIncrObjVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *incrPtr, int flags); -MODULE_SCOPE Tcl_ObjCmdProc TclInfoExistsCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclInfoCoroutineCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclInfoExistsCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclInfoCoroutineCmd; MODULE_SCOPE Tcl_Obj * TclInfoFrame(Tcl_Interp *interp, CmdFrame *framePtr); -MODULE_SCOPE Tcl_ObjCmdProc TclInfoGlobalsCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclInfoLocalsCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclInfoVarsCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclInfoGlobalsCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclInfoLocalsCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclInfoVarsCmd; MODULE_SCOPE void TclInitAlloc(void); MODULE_SCOPE void TclInitDbCkalloc(void); MODULE_SCOPE void TclInitDoubleConversion(void); @@ -3260,7 +3260,7 @@ MODULE_SCOPE Tcl_Command TclMakeEnsemble(Tcl_Interp *interp, const char *name, MODULE_SCOPE int TclMakeSafe(Tcl_Interp *interp); MODULE_SCOPE Tcl_Size TclMaxListLength(const char *bytes, Tcl_Size numBytes, const char **endPtr); -MODULE_SCOPE int TclMergeReturnOptions(Tcl_Interp *interp, int objc, +MODULE_SCOPE int TclMergeReturnOptions(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], Tcl_Obj **optionsPtrPtr, int *codePtr, int *levelPtr); MODULE_SCOPE Tcl_Obj * TclNoErrorStack(Tcl_Interp *interp, Tcl_Obj *options); @@ -3270,8 +3270,18 @@ MODULE_SCOPE int TclNamespaceDeleted(Namespace *nsPtr); MODULE_SCOPE void TclObjVarErrMsg(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, const char *operation, const char *reason, int index); +MODULE_SCOPE int TclObjInterpProc(void *clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +MODULE_SCOPE int TclObjInterpProc2(void *clientData, + Tcl_Interp *interp, Tcl_Size objc, + Tcl_Obj *const objv[]); +#define TclObjInterpProc TclGetObjInterpProc() +#define TclObjInterpProc2 TclGetObjInterpProc2() +MODULE_SCOPE int TclObjInvoke(Tcl_Interp *interp, Tcl_Size objc, + Tcl_Obj *const objv[], int flags); MODULE_SCOPE int TclObjInvokeNamespace(Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[], + Tcl_Size objc, Tcl_Obj *const objv[], Tcl_Namespace *nsPtr, int flags); MODULE_SCOPE int TclObjUnsetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags); @@ -3391,7 +3401,7 @@ MODULE_SCOPE void * TclStackRealloc(Tcl_Interp *interp, void *ptr, typedef int (*memCmpFn_t)(const void*, const void*, size_t); MODULE_SCOPE int TclStringCmp(Tcl_Obj *value1Ptr, Tcl_Obj *value2Ptr, int checkEq, int nocase, Tcl_Size reqlength); -MODULE_SCOPE int TclStringCmpOpts(Tcl_Interp *interp, int objc, +MODULE_SCOPE int TclStringCmpOpts(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int *nocase, Tcl_Size *reqlength); MODULE_SCOPE int TclStringMatch(const char *str, Tcl_Size strLen, @@ -3417,7 +3427,7 @@ MODULE_SCOPE Tcl_Size TclTrimRight(const char *bytes, Tcl_Size numBytes, const char *trim, Tcl_Size numTrim); MODULE_SCOPE const char*TclGetCommandTypeName(Tcl_Command command); MODULE_SCOPE void TclRegisterCommandTypeName( - Tcl_ObjCmdProc *implementationProc, + Tcl_ObjCmdProc2 *implementationProc, const char *nameStr); MODULE_SCOPE int TclUtfCmp(const char *cs, const char *ct); MODULE_SCOPE int TclUtfCasecmp(const char *cs, const char *ct); @@ -3489,28 +3499,28 @@ MODULE_SCOPE int TclIsSpaceProc(int byte); *---------------------------------------------------------------- */ -MODULE_SCOPE Tcl_ObjCmdProc Tcl_AfterObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_AppendObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ApplyObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_AfterObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_AppendObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ApplyObjCmd; MODULE_SCOPE Tcl_Command TclInitArrayCmd(Tcl_Interp *interp); MODULE_SCOPE Tcl_Command TclInitBinaryCmd(Tcl_Interp *interp); -MODULE_SCOPE Tcl_ObjCmdProc Tcl_BreakObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_CatchObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_CdObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_BreakObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_CatchObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_CdObjCmd; MODULE_SCOPE Tcl_Command TclInitChanCmd(Tcl_Interp *interp); -MODULE_SCOPE Tcl_ObjCmdProc TclChanCreateObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclChanPostEventObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclChanPopObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclChanPushObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclChanCreateObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclChanPostEventObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclChanPopObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclChanPushObjCmd; MODULE_SCOPE void TclClockInit(Tcl_Interp *interp); -MODULE_SCOPE Tcl_ObjCmdProc TclClockOldscanObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_CloseObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ConcatObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ContinueObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclClockOldscanObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_CloseObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ConcatObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ContinueObjCmd; MODULE_SCOPE Tcl_TimerToken TclCreateAbsoluteTimerHandler( Tcl_Time *timePtr, Tcl_TimerProc *proc, void *clientData); -MODULE_SCOPE Tcl_ObjCmdProc TclDefaultBgErrorHandlerObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclDefaultBgErrorHandlerObjCmd; MODULE_SCOPE Tcl_Command TclInitDictCmd(Tcl_Interp *interp); MODULE_SCOPE int TclDictWithFinish(Tcl_Interp *interp, Var *varPtr, Var *arrayPtr, Tcl_Obj *part1Ptr, @@ -3518,91 +3528,91 @@ MODULE_SCOPE int TclDictWithFinish(Tcl_Interp *interp, Var *varPtr, Tcl_Obj *const pathv[], Tcl_Obj *keysPtr); MODULE_SCOPE Tcl_Obj * TclDictWithInit(Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Size pathc, Tcl_Obj *const pathv[]); -MODULE_SCOPE Tcl_ObjCmdProc Tcl_DisassembleObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_DisassembleObjCmd; /* Assemble command function */ -MODULE_SCOPE Tcl_ObjCmdProc Tcl_AssembleObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNRAssembleObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_AssembleObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNRAssembleObjCmd; MODULE_SCOPE Tcl_Command TclInitEncodingCmd(Tcl_Interp *interp); -MODULE_SCOPE Tcl_ObjCmdProc Tcl_EofObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ErrorObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_EvalObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ExecObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ExitObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ExprObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_FblockedObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_FconfigureObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_FcopyObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_EofObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ErrorObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_EvalObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ExecObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ExitObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ExprObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_FblockedObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_FconfigureObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_FcopyObjCmd; MODULE_SCOPE Tcl_Command TclInitFileCmd(Tcl_Interp *interp); -MODULE_SCOPE Tcl_ObjCmdProc Tcl_FileEventObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_FlushObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ForObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ForeachObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_FormatObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_GetsObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_GlobalObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_GlobObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_IfObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_IncrObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_FileEventObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_FlushObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ForObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ForeachObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_FormatObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_GetsObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_GlobalObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_GlobObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_IfObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_IncrObjCmd; MODULE_SCOPE Tcl_Command TclInitInfoCmd(Tcl_Interp *interp); -MODULE_SCOPE Tcl_ObjCmdProc Tcl_InterpObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_JoinObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LappendObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LassignObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LeditObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LindexObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LinsertObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LlengthObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ListObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LmapObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LoadObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LpopObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LrangeObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LremoveObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LrepeatObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LreplaceObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LreverseObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LsearchObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LseqObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LsetObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_LsortObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_InterpObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_JoinObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LappendObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LassignObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LeditObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LindexObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LinsertObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LlengthObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ListObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LmapObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LoadObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LpopObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LrangeObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LremoveObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LrepeatObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LreplaceObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LreverseObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LsearchObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LseqObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LsetObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_LsortObjCmd; MODULE_SCOPE Tcl_Command TclInitNamespaceCmd(Tcl_Interp *interp); -MODULE_SCOPE Tcl_ObjCmdProc TclNamespaceEnsembleCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_OpenObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_PackageObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_PidObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNamespaceEnsembleCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_OpenObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_PackageObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_PidObjCmd; MODULE_SCOPE Tcl_Command TclInitPrefixCmd(Tcl_Interp *interp); -MODULE_SCOPE Tcl_ObjCmdProc Tcl_PutsObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_PwdObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ReadObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_RegexpObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_RegsubObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_RenameObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_RepresentationCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ReturnObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ScanObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_SeekObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_SetObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_SplitObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_SocketObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_SourceObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_PutsObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_PwdObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ReadObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_RegexpObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_RegsubObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_RenameObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_RepresentationCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ReturnObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ScanObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_SeekObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_SetObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_SplitObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_SocketObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_SourceObjCmd; MODULE_SCOPE Tcl_Command TclInitStringCmd(Tcl_Interp *interp); -MODULE_SCOPE Tcl_ObjCmdProc Tcl_SubstObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_SwitchObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_TellObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_ThrowObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_TimeObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_TimeRateObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_TraceObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_TryObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_UnloadObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_UnsetObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_UpdateObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_UplevelObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_UpvarObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_VariableObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_VwaitObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc Tcl_WhileObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_SubstObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_SwitchObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_TellObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_ThrowObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_TimeObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_TimeRateObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_TraceObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_TryObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_UnloadObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_UnsetObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_UpdateObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_UplevelObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_UpvarObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_VariableObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_VwaitObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 Tcl_WhileObjCmd; /* *---------------------------------------------------------------- @@ -3932,71 +3942,71 @@ MODULE_SCOPE int TclCompileBasicMin2ArgCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclInvertOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclInvertOpCmd; MODULE_SCOPE int TclCompileInvertOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclNotOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNotOpCmd; MODULE_SCOPE int TclCompileNotOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclAddOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclAddOpCmd; MODULE_SCOPE int TclCompileAddOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclMulOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclMulOpCmd; MODULE_SCOPE int TclCompileMulOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclAndOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclAndOpCmd; MODULE_SCOPE int TclCompileAndOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclOrOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOrOpCmd; MODULE_SCOPE int TclCompileOrOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclXorOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclXorOpCmd; MODULE_SCOPE int TclCompileXorOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclPowOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclPowOpCmd; MODULE_SCOPE int TclCompilePowOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclLshiftOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclLshiftOpCmd; MODULE_SCOPE int TclCompileLshiftOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclRshiftOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclRshiftOpCmd; MODULE_SCOPE int TclCompileRshiftOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclModOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclModOpCmd; MODULE_SCOPE int TclCompileModOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclNeqOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNeqOpCmd; MODULE_SCOPE int TclCompileNeqOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclStrneqOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclStrneqOpCmd; MODULE_SCOPE int TclCompileStrneqOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclInOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclInOpCmd; MODULE_SCOPE int TclCompileInOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclNiOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNiOpCmd; MODULE_SCOPE int TclCompileNiOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclMinusOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclMinusOpCmd; MODULE_SCOPE int TclCompileMinusOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); -MODULE_SCOPE Tcl_ObjCmdProc TclDivOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclDivOpCmd; MODULE_SCOPE int TclCompileDivOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); @@ -4130,14 +4140,14 @@ MODULE_SCOPE int TclUniCharCaseMatch(const Tcl_UniChar *uniStr, * Just for the purposes of command-type registration. */ -MODULE_SCOPE Tcl_ObjCmdProc TclEnsembleImplementationCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclAliasObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclLocalAliasObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclChildObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclInvokeImportedCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOOPublicObjectCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOOPrivateObjectCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOOMyClassObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclEnsembleImplementationCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclAliasObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclLocalAliasObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclChildObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclInvokeImportedCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOOPublicObjectCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOOPrivateObjectCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOOMyClassObjCmd; /* * TIP #462. @@ -4176,10 +4186,8 @@ MODULE_SCOPE Tcl_Obj * TclGetArrayDefault(Var *arrayPtr); */ MODULE_SCOPE int TclIndexEncode(Tcl_Interp *interp, Tcl_Obj *objPtr, - int before, int after, int *indexPtr); + Tcl_Size before, Tcl_Size after, int *indexPtr); MODULE_SCOPE Tcl_Size TclIndexDecode(int encoded, Tcl_Size endValue); -MODULE_SCOPE int TclIndexInvalidError(Tcl_Interp *interp, - const char *idxType, Tcl_Size idx); /* * Error message utility functions diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index 46479fb..b34fa00 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -27,6 +27,10 @@ # endif #endif +#ifdef TCL_NO_DEPRECATED +#define Tcl_ObjCmdProc void +#endif + /* * WARNING: This file is automatically generated by the tools/genStubs.tcl * script. Any modifications to the function declarations below should be made @@ -144,14 +148,8 @@ EXTERN int TclInExit(void); /* 51 */ EXTERN int TclInterpInit(Tcl_Interp *interp); /* Slot 52 is reserved */ -/* 53 */ -EXTERN int TclInvokeObjectCommand(void *clientData, - Tcl_Interp *interp, int argc, - const char **argv); -/* 54 */ -EXTERN int TclInvokeStringCommand(void *clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); +/* Slot 53 is reserved */ +/* Slot 54 is reserved */ /* 55 */ EXTERN Proc * TclIsProc(Command *cmdPtr); /* Slot 56 is reserved */ @@ -168,13 +166,8 @@ EXTERN int TclNeedSpace(const char *start, const char *end); EXTERN Tcl_Obj * TclNewProcBodyObj(Proc *procPtr); /* 62 */ EXTERN int TclObjCommandComplete(Tcl_Obj *cmdPtr); -/* 63 */ -EXTERN int TclObjInterpProc(void *clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -/* 64 */ -EXTERN int TclObjInvoke(Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[], int flags); +/* Slot 63 is reserved */ +/* Slot 64 is reserved */ /* Slot 65 is reserved */ /* Slot 66 is reserved */ /* Slot 67 is reserved */ @@ -503,9 +496,7 @@ EXTERN void TclInitVarHashTable(TclVarHashTable *tablePtr, /* Slot 236 is reserved */ /* 237 */ EXTERN int TclResetCancellation(Tcl_Interp *interp, int force); -/* 238 */ -EXTERN int TclNRInterpProc(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); +/* Slot 238 is reserved */ /* 239 */ EXTERN int TclNRInterpProcCore(Tcl_Interp *interp, Tcl_Obj *procNameObj, Tcl_Size skip, @@ -641,8 +632,8 @@ typedef struct TclIntStubs { void (*reserved50)(void); int (*tclInterpInit) (Tcl_Interp *interp); /* 51 */ void (*reserved52)(void); - int (*tclInvokeObjectCommand) (void *clientData, Tcl_Interp *interp, int argc, const char **argv); /* 53 */ - int (*tclInvokeStringCommand) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 54 */ + void (*reserved53)(void); + void (*reserved54)(void); Proc * (*tclIsProc) (Command *cmdPtr); /* 55 */ void (*reserved56)(void); void (*reserved57)(void); @@ -651,8 +642,8 @@ typedef struct TclIntStubs { int (*tclNeedSpace) (const char *start, const char *end); /* 60 */ Tcl_Obj * (*tclNewProcBodyObj) (Proc *procPtr); /* 61 */ int (*tclObjCommandComplete) (Tcl_Obj *cmdPtr); /* 62 */ - int (*tclObjInterpProc) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 63 */ - int (*tclObjInvoke) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags); /* 64 */ + void (*reserved63)(void); + void (*reserved64)(void); void (*reserved65)(void); void (*reserved66)(void); void (*reserved67)(void); @@ -826,7 +817,7 @@ typedef struct TclIntStubs { void (*tclInitVarHashTable) (TclVarHashTable *tablePtr, Namespace *nsPtr); /* 235 */ void (*reserved236)(void); int (*tclResetCancellation) (Tcl_Interp *interp, int force); /* 237 */ - int (*tclNRInterpProc) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 238 */ + void (*reserved238)(void); int (*tclNRInterpProcCore) (Tcl_Interp *interp, Tcl_Obj *procNameObj, Tcl_Size skip, ProcErrorProc *errorProc); /* 239 */ int (*tclNRRunCallbacks) (Tcl_Interp *interp, int result, struct NRE_callback *rootPtr); /* 240 */ int (*tclNREvalObjEx) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags, const CmdFrame *invoker, int word); /* 241 */ @@ -943,10 +934,8 @@ extern const TclIntStubs *tclIntStubsPtr; #define TclInterpInit \ (tclIntStubsPtr->tclInterpInit) /* 51 */ /* Slot 52 is reserved */ -#define TclInvokeObjectCommand \ - (tclIntStubsPtr->tclInvokeObjectCommand) /* 53 */ -#define TclInvokeStringCommand \ - (tclIntStubsPtr->tclInvokeStringCommand) /* 54 */ +/* Slot 53 is reserved */ +/* Slot 54 is reserved */ #define TclIsProc \ (tclIntStubsPtr->tclIsProc) /* 55 */ /* Slot 56 is reserved */ @@ -960,10 +949,8 @@ extern const TclIntStubs *tclIntStubsPtr; (tclIntStubsPtr->tclNewProcBodyObj) /* 61 */ #define TclObjCommandComplete \ (tclIntStubsPtr->tclObjCommandComplete) /* 62 */ -#define TclObjInterpProc \ - (tclIntStubsPtr->tclObjInterpProc) /* 63 */ -#define TclObjInvoke \ - (tclIntStubsPtr->tclObjInvoke) /* 64 */ +/* Slot 63 is reserved */ +/* Slot 64 is reserved */ /* Slot 65 is reserved */ /* Slot 66 is reserved */ /* Slot 67 is reserved */ @@ -1222,8 +1209,7 @@ extern const TclIntStubs *tclIntStubsPtr; /* Slot 236 is reserved */ #define TclResetCancellation \ (tclIntStubsPtr->tclResetCancellation) /* 237 */ -#define TclNRInterpProc \ - (tclIntStubsPtr->tclNRInterpProc) /* 238 */ +/* Slot 238 is reserved */ #define TclNRInterpProcCore \ (tclIntStubsPtr->tclNRInterpProcCore) /* 239 */ #define TclNRRunCallbacks \ @@ -1274,6 +1260,10 @@ extern const TclIntStubs *tclIntStubsPtr; /* !END!: Do not edit above this line. */ +#ifdef TCL_NO_DEPRECATED +#undef Tcl_ObjCmdProc +#endif + #if defined(USE_TCL_STUBS) #undef Tcl_StaticLibrary #define Tcl_StaticLibrary \ @@ -1289,10 +1279,6 @@ extern const TclIntStubs *tclIntStubsPtr; ((unsigned long)tclIntStubsPtr->tclpGetSeconds()) #endif -#undef TclObjInterpProc -#define TclObjInterpProc TclGetObjInterpProc() -#define TclObjInterpProc2 TclGetObjInterpProc2() - #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT diff --git a/generic/tclInterp.c b/generic/tclInterp.c index aaa2291..b3b34dc 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -215,52 +215,52 @@ struct LimitHandler { static int AliasCreate(Tcl_Interp *interp, Tcl_Interp *childInterp, Tcl_Interp *parentInterp, - Tcl_Obj *namePtr, Tcl_Obj *targetPtr, int objc, + Tcl_Obj *namePtr, Tcl_Obj *targetPtr, Tcl_Size objc, Tcl_Obj *const objv[]); static int AliasDelete(Tcl_Interp *interp, Tcl_Interp *childInterp, Tcl_Obj *namePtr); static int AliasDescribe(Tcl_Interp *interp, Tcl_Interp *childInterp, Tcl_Obj *objPtr); static int AliasList(Tcl_Interp *interp, Tcl_Interp *childInterp); -static Tcl_ObjCmdProc AliasNRCmd; +static Tcl_ObjCmdProc2 AliasNRCmd; static Tcl_CmdDeleteProc AliasObjCmdDeleteProc; static Tcl_Interp * GetInterp(Tcl_Interp *interp, Tcl_Obj *pathPtr); -static Tcl_Interp * GetInterp2(Tcl_Interp *interp, int objc, +static Tcl_Interp * GetInterp2(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); static Tcl_InterpDeleteProc InterpInfoDeleteProc; static int ChildBgerror(Tcl_Interp *interp, - Tcl_Interp *childInterp, int objc, + Tcl_Interp *childInterp, Tcl_Size objc, Tcl_Obj *const objv[]); static Tcl_Interp * ChildCreate(Tcl_Interp *interp, Tcl_Obj *pathPtr, int safe); static int ChildDebugCmd(Tcl_Interp *interp, Tcl_Interp *childInterp, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static int ChildEval(Tcl_Interp *interp, Tcl_Interp *childInterp, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static int ChildExpose(Tcl_Interp *interp, - Tcl_Interp *childInterp, int objc, + Tcl_Interp *childInterp, Tcl_Size objc, Tcl_Obj *const objv[]); static int ChildHide(Tcl_Interp *interp, Tcl_Interp *childInterp, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static int ChildHidden(Tcl_Interp *interp, Tcl_Interp *childInterp); static int ChildInvokeHidden(Tcl_Interp *interp, Tcl_Interp *childInterp, const char *namespaceName, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static int ChildMarkTrusted(Tcl_Interp *interp, Tcl_Interp *childInterp); static Tcl_CmdDeleteProc ChildObjCmdDeleteProc; static int ChildRecursionLimit(Tcl_Interp *interp, - Tcl_Interp *childInterp, int objc, + Tcl_Interp *childInterp, Tcl_Size objc, Tcl_Obj *const objv[]); static int ChildCommandLimitCmd(Tcl_Interp *interp, - Tcl_Interp *childInterp, int consumedObjc, - int objc, Tcl_Obj *const objv[]); + Tcl_Interp *childInterp, Tcl_Size consumedObjc, + Tcl_Size objc, Tcl_Obj *const objv[]); static int ChildTimeLimitCmd(Tcl_Interp *interp, - Tcl_Interp *childInterp, int consumedObjc, - int objc, Tcl_Obj *const objv[]); + Tcl_Interp *childInterp, Tcl_Size consumedObjc, + Tcl_Size objc, Tcl_Obj *const objv[]); static void InheritLimitsFromParent(Tcl_Interp *childInterp, Tcl_Interp *parentInterp); static void SetScriptLimitCallback(Tcl_Interp *interp, int type, @@ -274,8 +274,8 @@ static void TimeLimitCallback(void *clientData); /* NRE enabling */ static Tcl_NRPostProc NRPostInvokeHidden; -static Tcl_ObjCmdProc NRInterpCmd; -static Tcl_ObjCmdProc NRChildCmd; +static Tcl_ObjCmdProc2 NRInterpCmd; +static Tcl_ObjCmdProc2 NRChildCmd; /* @@ -496,7 +496,7 @@ TclInterpInit( childPtr->interpCmd = NULL; Tcl_InitHashTable(&childPtr->aliasTable, TCL_STRING_KEYS); - Tcl_NRCreateCommand(interp, "interp", Tcl_InterpObjCmd, NRInterpCmd, + Tcl_NRCreateCommand2(interp, "interp", Tcl_InterpObjCmd, NRInterpCmd, NULL, NULL); Tcl_CallWhenDeleted(interp, InterpInfoDeleteProc, NULL); @@ -603,17 +603,17 @@ int Tcl_InterpObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, NRInterpCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, NRInterpCmd, clientData, objc, objv); } static int NRInterpCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Interp *childInterp; @@ -709,7 +709,8 @@ NRInterpCmd( } return ChildBgerror(interp, childInterp, objc - 3, objv + 3); case OPT_CANCEL: { - int i, flags; + Tcl_Size i; + int flags; Tcl_Obj *resultObjPtr; static const char *const cancelOptions[] = { "-unwind", "--", NULL @@ -781,7 +782,8 @@ NRInterpCmd( return Tcl_CancelEval(childInterp, resultObjPtr, 0, flags); } case OPT_CREATE: { - int i, last, safe; + int last, safe; + Tcl_Size i; Tcl_Obj *childPtr; char buf[16 + TCL_INTEGER_SPACE]; static const char *const createOptions[] = { @@ -832,7 +834,7 @@ NRInterpCmd( for (i = 0; ; i++) { Tcl_CmdInfo cmdInfo; - snprintf(buf, sizeof(buf), "interp%d", i); + snprintf(buf, sizeof(buf), "interp%" TCL_Z_MODIFIER "d", i); if (Tcl_GetCommandInfo(interp, buf, &cmdInfo) == 0) { break; } @@ -863,7 +865,7 @@ NRInterpCmd( } return ChildDebugCmd(interp, childInterp, objc - 3, objv + 3); case OPT_DELETE: { - int i; + Tcl_Size i; InterpInfo *iiPtr; for (i = 2; i < objc; i++) { @@ -941,7 +943,7 @@ NRInterpCmd( Tcl_SetObjResult(interp, Tcl_NewBooleanObj(Tcl_IsSafe(childInterp))); return TCL_OK; case OPT_INVOKEHID: { - int i; + Tcl_Size i; const char *namespaceName; static const char *const hiddenOptions[] = { "-global", "-namespace", "--", NULL @@ -1162,7 +1164,7 @@ static Tcl_Interp * GetInterp2( Tcl_Interp *interp, /* Default interp if no interp was specified * on the command line. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc == 2) { @@ -1431,8 +1433,8 @@ TclPreventAliasLoop( * create or rename the command. */ - if (cmdPtr->objProc != TclAliasObjCmd - && cmdPtr->objProc != TclLocalAliasObjCmd) { + if (cmdPtr->objProc2 != TclAliasObjCmd + && cmdPtr->objProc2 != TclLocalAliasObjCmd) { return TCL_OK; } @@ -1442,7 +1444,7 @@ TclPreventAliasLoop( * chain then we have a loop. */ - aliasPtr = (Alias *)cmdPtr->objClientData; + aliasPtr = (Alias *)cmdPtr->objClientData2; nextAliasPtr = aliasPtr; while (1) { Tcl_Obj *cmdNamePtr; @@ -1487,11 +1489,11 @@ TclPreventAliasLoop( * Otherwise we do not have a loop. */ - if (aliasCmdPtr->objProc != TclAliasObjCmd - && aliasCmdPtr->objProc != TclLocalAliasObjCmd) { + if (aliasCmdPtr->objProc2 != TclAliasObjCmd + && aliasCmdPtr->objProc2 != TclLocalAliasObjCmd) { return TCL_OK; } - nextAliasPtr = (Alias *)aliasCmdPtr->objClientData; + nextAliasPtr = (Alias *)aliasCmdPtr->objClientData2; } } @@ -1521,7 +1523,7 @@ AliasCreate( * invoked. */ Tcl_Obj *namePtr, /* Name of alias cmd. */ Tcl_Obj *targetNamePtr, /* Name of target cmd. */ - int objc, /* Additional arguments to store */ + Tcl_Size objc, /* Additional arguments to store */ Tcl_Obj *const objv[]) /* with alias. */ { Alias *aliasPtr; @@ -1530,7 +1532,8 @@ AliasCreate( Child *childPtr; Parent *parentPtr; Tcl_Obj **prefv; - int isNew, i; + int isNew; + Tcl_Size i; aliasPtr = (Alias *)Tcl_Alloc(sizeof(Alias) + objc * sizeof(Tcl_Obj *)); aliasPtr->token = namePtr; @@ -1551,11 +1554,11 @@ AliasCreate( Tcl_Preserve(parentInterp); if (childInterp == parentInterp) { - aliasPtr->childCmd = Tcl_NRCreateCommand(childInterp, + aliasPtr->childCmd = Tcl_NRCreateCommand2(childInterp, TclGetString(namePtr), TclLocalAliasObjCmd, AliasNRCmd, aliasPtr, AliasObjCmdDeleteProc); } else { - aliasPtr->childCmd = Tcl_CreateObjCommand(childInterp, + aliasPtr->childCmd = Tcl_CreateObjCommand2(childInterp, TclGetString(namePtr), TclAliasObjCmd, aliasPtr, AliasObjCmdDeleteProc); } @@ -1822,7 +1825,7 @@ static int AliasNRCmd( void *clientData, /* Alias record. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument vector. */ { Alias *aliasPtr = (Alias *)clientData; @@ -1875,7 +1878,7 @@ int TclAliasObjCmd( void *clientData, /* Alias record. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument vector. */ { #define ALIAS_CMDV_PREALLOC 10 @@ -1966,7 +1969,7 @@ int TclLocalAliasObjCmd( void *clientData, /* Alias record. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument vector. */ { #define ALIAS_CMDV_PREALLOC 10 @@ -2377,7 +2380,7 @@ static int ChildBgerror( Tcl_Interp *interp, /* Interp for error return. */ Tcl_Interp *childInterp, /* Interp in which limit is set/queried. */ - int objc, /* Set or Query. */ + Tcl_Size objc, /* Set or Query. */ Tcl_Obj *const objv[]) /* Argument strings. */ { if (objc) { @@ -2467,7 +2470,7 @@ ChildCreate( childPtr->parentInterp = parentInterp; childPtr->childEntryPtr = hPtr; childPtr->childInterp = childInterp; - childPtr->interpCmd = Tcl_NRCreateCommand(parentInterp, path, + childPtr->interpCmd = Tcl_NRCreateCommand2(parentInterp, path, TclChildObjCmd, NRChildCmd, childInterp, ChildObjCmdDeleteProc); Tcl_InitHashTable(&childPtr->aliasTable, TCL_STRING_KEYS); Tcl_SetHashValue(hPtr, childPtr); @@ -2554,17 +2557,17 @@ int TclChildObjCmd( void *clientData, /* Child interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, NRChildCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, NRChildCmd, clientData, objc, objv); } static int NRChildCmd( void *clientData, /* Child interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Interp *childInterp = (Tcl_Interp *)clientData; @@ -2665,7 +2668,7 @@ NRChildCmd( Tcl_SetObjResult(interp, Tcl_NewBooleanObj(Tcl_IsSafe(childInterp))); return TCL_OK; case OPT_INVOKEHIDDEN: { - int i; + Tcl_Size i; const char *namespaceName; static const char *const hiddenOptions[] = { "-global", "-namespace", "--", NULL @@ -2814,7 +2817,7 @@ ChildDebugCmd( Tcl_Interp *interp, /* Interp for error return. */ Tcl_Interp *childInterp, /* The child interpreter in which command * will be evaluated. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const debugTypes[] = { @@ -2885,7 +2888,7 @@ ChildEval( Tcl_Interp *interp, /* Interp for error return. */ Tcl_Interp *childInterp, /* The child interpreter in which command * will be evaluated. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int result; @@ -2948,7 +2951,7 @@ static int ChildExpose( Tcl_Interp *interp, /* Interp for error return. */ Tcl_Interp *childInterp, /* Interp in which command will be exposed. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ { const char *name; @@ -2992,7 +2995,7 @@ static int ChildRecursionLimit( Tcl_Interp *interp, /* Interp for error return. */ Tcl_Interp *childInterp, /* Interp in which limit is set/queried. */ - int objc, /* Set or Query. */ + Tcl_Size objc, /* Set or Query. */ Tcl_Obj *const objv[]) /* Argument strings. */ { Interp *iPtr; @@ -3054,7 +3057,7 @@ static int ChildHide( Tcl_Interp *interp, /* Interp for error return. */ Tcl_Interp *childInterp, /* Interp in which command will be exposed. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ { const char *name; @@ -3139,7 +3142,7 @@ ChildInvokeHidden( Tcl_Interp *childInterp, /* The child interpreter in which command will * be invoked. */ const char *namespaceName, /* The namespace to use, if any. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int result; @@ -4484,8 +4487,8 @@ static int ChildCommandLimitCmd( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Interp *childInterp, /* Interpreter being adjusted. */ - int consumedObjc, /* Number of args already parsed. */ - int objc, /* Total number of arguments. */ + Tcl_Size consumedObjc, /* Number of args already parsed. */ + Tcl_Size objc, /* Total number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const options[] = { @@ -4585,8 +4588,7 @@ ChildCommandLimitCmd( Tcl_WrongNumArgs(interp, consumedObjc, objv, "?-option value ...?"); return TCL_ERROR; } else { - int i; - Tcl_Size scriptLen = 0, limitLen = 0; + Tcl_Size i, scriptLen = 0, limitLen = 0; Tcl_Obj *scriptObj = NULL, *granObj = NULL, *limitObj = NULL; int gran = 0, limit = 0; @@ -4672,8 +4674,8 @@ static int ChildTimeLimitCmd( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Interp *childInterp, /* Interpreter being adjusted. */ - int consumedObjc, /* Number of args already parsed. */ - int objc, /* Total number of arguments. */ + Tcl_Size consumedObjc, /* Number of args already parsed. */ + Tcl_Size objc, /* Total number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const options[] = { @@ -4790,8 +4792,7 @@ ChildTimeLimitCmd( Tcl_WrongNumArgs(interp, consumedObjc, objv, "?-option value ...?"); return TCL_ERROR; } else { - int i; - Tcl_Size scriptLen = 0, milliLen = 0, secLen = 0; + Tcl_Size i, scriptLen = 0, milliLen = 0, secLen = 0; Tcl_Obj *scriptObj = NULL, *granObj = NULL; Tcl_Obj *milliObj = NULL, *secObj = NULL; int gran = 0; diff --git a/generic/tclLoad.c b/generic/tclLoad.c index 0e59c7b..2ffee70 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -126,7 +126,7 @@ int Tcl_LoadObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Interp *target; @@ -552,14 +552,15 @@ int Tcl_UnloadObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Interp *target; /* Which interpreter to unload from. */ LoadedLibrary *libraryPtr; Tcl_DString pfx, tmp; InterpLibrary *ipFirstPtr, *ipPtr; - int i, code, complain = 1, keepLibrary = 0; + Tcl_Size i; + int code, complain = 1, keepLibrary = 0; const char *fullFileName = ""; const char *prefix; static const char *const options[] = { diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 0a4bf58..d7858da 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -91,28 +91,28 @@ static void FreeNsNameInternalRep(Tcl_Obj *objPtr); static int GetNamespaceFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Namespace **nsPtrPtr); static int InvokeImportedNRCmd(void *clientData, - Tcl_Interp *interp,int objc,Tcl_Obj *const objv[]); -static Tcl_ObjCmdProc NamespaceChildrenCmd; -static Tcl_ObjCmdProc NamespaceCodeCmd; -static Tcl_ObjCmdProc NamespaceCurrentCmd; -static Tcl_ObjCmdProc NamespaceDeleteCmd; -static Tcl_ObjCmdProc NamespaceEvalCmd; -static Tcl_ObjCmdProc NRNamespaceEvalCmd; -static Tcl_ObjCmdProc NamespaceExistsCmd; -static Tcl_ObjCmdProc NamespaceExportCmd; -static Tcl_ObjCmdProc NamespaceForgetCmd; + Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); +static Tcl_ObjCmdProc2 NamespaceChildrenCmd; +static Tcl_ObjCmdProc2 NamespaceCodeCmd; +static Tcl_ObjCmdProc2 NamespaceCurrentCmd; +static Tcl_ObjCmdProc2 NamespaceDeleteCmd; +static Tcl_ObjCmdProc2 NamespaceEvalCmd; +static Tcl_ObjCmdProc2 NRNamespaceEvalCmd; +static Tcl_ObjCmdProc2 NamespaceExistsCmd; +static Tcl_ObjCmdProc2 NamespaceExportCmd; +static Tcl_ObjCmdProc2 NamespaceForgetCmd; static void NamespaceFree(Namespace *nsPtr); -static Tcl_ObjCmdProc NamespaceImportCmd; -static Tcl_ObjCmdProc NamespaceInscopeCmd; -static Tcl_ObjCmdProc NRNamespaceInscopeCmd; -static Tcl_ObjCmdProc NamespaceOriginCmd; -static Tcl_ObjCmdProc NamespaceParentCmd; -static Tcl_ObjCmdProc NamespacePathCmd; -static Tcl_ObjCmdProc NamespaceQualifiersCmd; -static Tcl_ObjCmdProc NamespaceTailCmd; -static Tcl_ObjCmdProc NamespaceUpvarCmd; -static Tcl_ObjCmdProc NamespaceUnknownCmd; -static Tcl_ObjCmdProc NamespaceWhichCmd; +static Tcl_ObjCmdProc2 NamespaceImportCmd; +static Tcl_ObjCmdProc2 NamespaceInscopeCmd; +static Tcl_ObjCmdProc2 NRNamespaceInscopeCmd; +static Tcl_ObjCmdProc2 NamespaceOriginCmd; +static Tcl_ObjCmdProc2 NamespaceParentCmd; +static Tcl_ObjCmdProc2 NamespacePathCmd; +static Tcl_ObjCmdProc2 NamespaceQualifiersCmd; +static Tcl_ObjCmdProc2 NamespaceTailCmd; +static Tcl_ObjCmdProc2 NamespaceUpvarCmd; +static Tcl_ObjCmdProc2 NamespaceUnknownCmd; +static Tcl_ObjCmdProc2 NamespaceWhichCmd; static int SetNsNameFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static void UnlinkNsPath(Namespace *nsPtr); @@ -950,7 +950,7 @@ Tcl_DeleteNamespace( for (entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search); entryPtr != NULL;) { cmdPtr = (Command *)Tcl_GetHashValue(entryPtr); - if (cmdPtr->nreProc == TclNRInterpCoroutine) { + if (cmdPtr->nreProc2 == TclNRInterpCoroutine) { Tcl_DeleteCommandFromToken((Tcl_Interp *) iPtr, (Tcl_Command) cmdPtr); entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search); @@ -1779,7 +1779,7 @@ DoImport( Command *linkCmd = cmdPtr; while (linkCmd->deleteProc == DeleteImportedCmd) { - dataPtr = (ImportedCmdData *)linkCmd->objClientData; + dataPtr = (ImportedCmdData *)linkCmd->objClientData2; linkCmd = dataPtr->realCmdPtr; if (overwrite == linkCmd) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -1794,7 +1794,7 @@ DoImport( } dataPtr = (ImportedCmdData *)Tcl_Alloc(sizeof(ImportedCmdData)); - importedCmd = Tcl_NRCreateCommand(interp, Tcl_DStringValue(&ds), + importedCmd = Tcl_NRCreateCommand2(interp, Tcl_DStringValue(&ds), TclInvokeImportedCmd, InvokeImportedNRCmd, dataPtr, DeleteImportedCmd); dataPtr->realCmdPtr = cmdPtr; @@ -1817,7 +1817,7 @@ DoImport( Command *overwrite = (Command *)Tcl_GetHashValue(found); if (overwrite->deleteProc == DeleteImportedCmd) { - ImportedCmdData *dataPtr = (ImportedCmdData *)overwrite->objClientData; + ImportedCmdData *dataPtr = (ImportedCmdData *)overwrite->objClientData2; if (dataPtr->realCmdPtr == Tcl_GetHashValue(hPtr)) { /* @@ -1954,7 +1954,7 @@ Tcl_ForgetImport( */ Command *cmdPtr = (Command *) token; - ImportedCmdData *dataPtr = (ImportedCmdData *)cmdPtr->objClientData; + ImportedCmdData *dataPtr = (ImportedCmdData *)cmdPtr->objClientData2; Tcl_Command firstToken = (Tcl_Command) dataPtr->realCmdPtr; if (firstToken == origin) { @@ -2009,7 +2009,7 @@ TclGetOriginalCommand( } while (cmdPtr->deleteProc == DeleteImportedCmd) { - dataPtr = (ImportedCmdData *)cmdPtr->objClientData; + dataPtr = (ImportedCmdData *)cmdPtr->objClientData2; cmdPtr = dataPtr->realCmdPtr; } return (Tcl_Command) cmdPtr; @@ -2039,7 +2039,7 @@ InvokeImportedNRCmd( void *clientData, /* Points to the imported command's * ImportedCmdData structure. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { ImportedCmdData *dataPtr = (ImportedCmdData *)clientData; @@ -2054,10 +2054,10 @@ TclInvokeImportedCmd( void *clientData, /* Points to the imported command's * ImportedCmdData structure. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { - return Tcl_NRCallObjProc(interp, InvokeImportedNRCmd, clientData, + return Tcl_NRCallObjProc2(interp, InvokeImportedNRCmd, clientData, objc, objv); } @@ -3010,7 +3010,7 @@ static int NamespaceChildrenCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Namespace *namespacePtr; @@ -3139,7 +3139,7 @@ static int NamespaceCodeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Namespace *currNsPtr; @@ -3220,7 +3220,7 @@ static int NamespaceCurrentCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Namespace *currNsPtr; @@ -3283,12 +3283,12 @@ static int NamespaceDeleteCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Namespace *namespacePtr; const char *name; - int i; + Tcl_Size i; if (objc < 1) { Tcl_WrongNumArgs(interp, 1, objv, "?name name...?"); @@ -3360,10 +3360,10 @@ static int NamespaceEvalCmd( void *clientData, /* Arbitrary value passed to cmd. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, NRNamespaceEvalCmd, clientData, objc, + return Tcl_NRCallObjProc2(interp, NRNamespaceEvalCmd, clientData, objc, objv); } @@ -3371,7 +3371,7 @@ static int NRNamespaceEvalCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -3503,7 +3503,7 @@ static int NamespaceExistsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Namespace *namespacePtr; @@ -3558,10 +3558,10 @@ static int NamespaceExportCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int firstArg, i; + Tcl_Size firstArg, i; if (objc < 1) { Tcl_WrongNumArgs(interp, 1, objv, "?-clear? ?pattern pattern...?"); @@ -3640,11 +3640,12 @@ static int NamespaceForgetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *pattern; - int i, result; + Tcl_Size i; + int result; if (objc < 1) { Tcl_WrongNumArgs(interp, 1, objv, "?pattern pattern...?"); @@ -3705,13 +3706,13 @@ static int NamespaceImportCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int allowOverwrite = 0; const char *string, *pattern; - int i, result; - int firstArg; + Tcl_Size i, firstArg; + int result; if (objc < 1) { Tcl_WrongNumArgs(interp, 1, objv, "?-force? ?pattern pattern...?"); @@ -3809,10 +3810,10 @@ static int NamespaceInscopeCmd( void *clientData, /* Arbitrary value passed to cmd. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, NRNamespaceInscopeCmd, clientData, objc, + return Tcl_NRCallObjProc2(interp, NRNamespaceInscopeCmd, clientData, objc, objv); } @@ -3820,12 +3821,12 @@ static int NRNamespaceInscopeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Namespace *namespacePtr; CallFrame *framePtr, **framePtrPtr; - int i; + Tcl_Size i; Tcl_Obj *cmdObjPtr; if (objc < 3) { @@ -3917,7 +3918,7 @@ static int NamespaceOriginCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Command cmd, origCmd; @@ -3977,7 +3978,7 @@ static int NamespaceParentCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Namespace *nsPtr; @@ -4035,7 +4036,7 @@ static int NamespacePathCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Namespace *nsPtr = (Namespace *) TclGetCurrentNamespace(interp); @@ -4262,7 +4263,7 @@ static int NamespaceQualifiersCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *name, *p; @@ -4330,7 +4331,7 @@ static int NamespaceUnknownCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Namespace *currNsPtr; @@ -4517,7 +4518,7 @@ static int NamespaceTailCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *name, *p; @@ -4575,7 +4576,7 @@ static int NamespaceUpvarCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -4649,7 +4650,7 @@ static int NamespaceWhichCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const opts[] = { diff --git a/generic/tclOO.c b/generic/tclOO.c index b05fe1f..dfe19b1 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -22,7 +22,7 @@ static const struct { const char *name; - Tcl_ObjCmdProc *objProc; + Tcl_ObjCmdProc2 *objProc; int flag; } defineCmds[] = { {"constructor", TclOODefineConstructorObjCmd, 0}, @@ -81,18 +81,18 @@ static Tcl_InterpDeleteProc KillFoundation; static void MyDeleted(void *clientData); static void ObjectNamespaceDeleted(void *clientData); static Tcl_CommandTraceProc ObjectRenamedTrace; -static inline void RemoveClass(Class **list, size_t num, size_t idx); -static inline void RemoveObject(Object **list, size_t num, size_t idx); +static inline void RemoveClass(Class **list, int num, int idx); +static inline void RemoveObject(Object **list, int num, int idx); static inline void SquelchCachedName(Object *oPtr); static int PublicNRObjectCmd(void *clientData, - Tcl_Interp *interp, int objc, + Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const *objv); static int PrivateNRObjectCmd(void *clientData, - Tcl_Interp *interp, int objc, + Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const *objv); static int MyClassNRObjCmd(void *clientData, - Tcl_Interp *interp, int objc, + Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const *objv); static void MyClassDeleted(void *clientData); @@ -106,7 +106,7 @@ static void MyClassDeleted(void *clientData); #define DCM(name,visibility,proc) \ {name,visibility,\ - {TCL_OO_METHOD_VERSION_CURRENT,"core method: "#name,proc,NULL,NULL}} + {TCL_OO_METHOD_VERSION_2,"core method: "#name,proc,NULL,NULL}} static const DeclaredClassMethod objMethods[] = { DCM("destroy", 1, TclOO_Object_Destroy), @@ -126,8 +126,8 @@ static const DeclaredClassMethod objMethods[] = { * And for the oo::class constructor... */ -static const Tcl_MethodType classConstructor = { - TCL_OO_METHOD_VERSION_CURRENT, +static const Tcl_MethodType2 classConstructor = { + TCL_OO_METHOD_VERSION_2, "oo::class constructor", TclOO_Class_Constructor, NULL, NULL }; @@ -201,10 +201,10 @@ MODULE_SCOPE const TclOOStubs tclOOStubs; static inline void RemoveClass( Class **list, - size_t num, - size_t idx) + int num, + int idx) { - for (; idx + 1 < num; idx++) { + for (; idx < num - 1; idx++) { list[idx] = list[idx + 1]; } list[idx] = NULL; @@ -213,10 +213,10 @@ RemoveClass( static inline void RemoveObject( Object **list, - size_t num, - size_t idx) + int num, + int idx) { - for (; idx + 1 < num; idx++) { + for (; idx < num - 1; idx++) { list[idx] = list[idx + 1]; } list[idx] = NULL; @@ -339,7 +339,7 @@ InitFoundation( Tcl_IncrRefCount(fPtr->destructorName); Tcl_IncrRefCount(fPtr->clonedName); Tcl_IncrRefCount(fPtr->defineName); - Tcl_CreateObjCommand(interp, "::oo::UnknownDefinition", + Tcl_CreateObjCommand2(interp, "::oo::UnknownDefinition", TclOOUnknownDefinition, NULL, NULL); TclNewLiteralStringObj(namePtr, "::oo::UnknownDefinition"); Tcl_SetNamespaceUnknownHandler(interp, fPtr->defineNs, namePtr); @@ -353,14 +353,14 @@ InitFoundation( for (i = 0 ; defineCmds[i].name ; i++) { TclDStringAppendLiteral(&buffer, "::oo::define::"); Tcl_DStringAppend(&buffer, defineCmds[i].name, -1); - Tcl_CreateObjCommand(interp, Tcl_DStringValue(&buffer), + Tcl_CreateObjCommand2(interp, Tcl_DStringValue(&buffer), defineCmds[i].objProc, INT2PTR(defineCmds[i].flag), NULL); Tcl_DStringFree(&buffer); } for (i = 0 ; objdefCmds[i].name ; i++) { TclDStringAppendLiteral(&buffer, "::oo::objdefine::"); Tcl_DStringAppend(&buffer, objdefCmds[i].name, -1); - Tcl_CreateObjCommand(interp, Tcl_DStringValue(&buffer), + Tcl_CreateObjCommand2(interp, Tcl_DStringValue(&buffer), objdefCmds[i].objProc, INT2PTR(objdefCmds[i].flag), NULL); Tcl_DStringFree(&buffer); } @@ -401,20 +401,20 @@ InitFoundation( * ensemble. */ - cmdPtr = (Command *) Tcl_NRCreateCommand(interp, "::oo::Helpers::next", + cmdPtr = (Command *) Tcl_NRCreateCommand2(interp, "::oo::Helpers::next", NULL, TclOONextObjCmd, NULL, NULL); cmdPtr->compileProc = TclCompileObjectNextCmd; - cmdPtr = (Command *) Tcl_NRCreateCommand(interp, "::oo::Helpers::nextto", + cmdPtr = (Command *) Tcl_NRCreateCommand2(interp, "::oo::Helpers::nextto", NULL, TclOONextToObjCmd, NULL, NULL); cmdPtr->compileProc = TclCompileObjectNextToCmd; - cmdPtr = (Command *) Tcl_CreateObjCommand(interp, "::oo::Helpers::self", + cmdPtr = (Command *) Tcl_CreateObjCommand2(interp, "::oo::Helpers::self", TclOOSelfObjCmd, NULL, NULL); cmdPtr->compileProc = TclCompileObjectSelfCmd; - Tcl_CreateObjCommand(interp, "::oo::define", TclOODefineObjCmd, NULL, + Tcl_CreateObjCommand2(interp, "::oo::define", TclOODefineObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "::oo::objdefine", TclOOObjDefObjCmd, NULL, + Tcl_CreateObjCommand2(interp, "::oo::objdefine", TclOOObjDefObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "::oo::copy", TclOOCopyObjectCmd, NULL,NULL); + Tcl_CreateObjCommand2(interp, "::oo::copy", TclOOCopyObjectCmd, NULL,NULL); TclOOInitInfo(interp); /* @@ -737,7 +737,7 @@ AllocObject( */ cmdPtr = (Command *) oPtr->command; - cmdPtr->nreProc = PublicNRObjectCmd; + cmdPtr->nreProc2 = PublicNRObjectCmd; cmdPtr->tracePtr = tracePtr = (CommandTrace *)Tcl_Alloc(sizeof(CommandTrace)); tracePtr->traceProc = ObjectRenamedTrace; tracePtr->clientData = oPtr; @@ -1167,7 +1167,7 @@ ObjectNamespaceDeleted( contextPtr->callPtr->flags |= DESTRUCTOR; contextPtr->skip = 0; state = Tcl_SaveInterpState(interp, TCL_OK); - result = Tcl_NRCallObjProc(interp, TclOOInvokeContext, + result = Tcl_NRCallObjProc2(interp, TclOOInvokeContext, contextPtr, 0, NULL); if (result != TCL_OK) { Tcl_BackgroundException(interp, result); @@ -1683,7 +1683,7 @@ Tcl_NewObjectInstance( } /* - * Run constructors, except when objc < 0, which is a special flag case + * Run constructors, except when objc == TCL_INDEX_NONE, which is a special flag case * used for object cloning only. */ @@ -1704,7 +1704,7 @@ Tcl_NewObjectInstance( */ isRoot = TclInitRewriteEnsemble(interp, skip, skip, objv); - result = Tcl_NRCallObjProc(interp, TclOOInvokeContext, contextPtr, + result = Tcl_NRCallObjProc2(interp, TclOOInvokeContext, contextPtr, objc, objv); if (isRoot) { @@ -2212,7 +2212,7 @@ Tcl_CopyObjectInstance( Tcl_IncrRefCount(args[0]); Tcl_IncrRefCount(args[1]); Tcl_IncrRefCount(args[2]); - result = Tcl_NRCallObjProc(interp, TclOOInvokeContext, contextPtr, 3, + result = Tcl_NRCallObjProc2(interp, TclOOInvokeContext, contextPtr, 3, args); TclDecrRefCount(args[0]); TclDecrRefCount(args[1]); @@ -2506,17 +2506,17 @@ int TclOOPublicObjectCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { - return Tcl_NRCallObjProc(interp, PublicNRObjectCmd, clientData,objc,objv); + return Tcl_NRCallObjProc2(interp, PublicNRObjectCmd, clientData,objc,objv); } static int PublicNRObjectCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { return TclOOObjectCmdCore((Object *)clientData, interp, objc, objv, PUBLIC_METHOD, @@ -2527,17 +2527,17 @@ int TclOOPrivateObjectCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { - return Tcl_NRCallObjProc(interp, PrivateNRObjectCmd,clientData,objc,objv); + return Tcl_NRCallObjProc2(interp, PrivateNRObjectCmd,clientData,objc,objv); } static int PrivateNRObjectCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { return TclOOObjectCmdCore((Object *)clientData, interp, objc, objv, 0, NULL); @@ -2588,17 +2588,17 @@ int TclOOMyClassObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { - return Tcl_NRCallObjProc(interp, MyClassNRObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, MyClassNRObjCmd, clientData, objc, objv); } static int MyClassNRObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *)clientData; @@ -2610,7 +2610,7 @@ MyClassNRObjCmd( return TclOOObjectCmdCore(oPtr->selfCls->thisPtr, interp, objc, objv, 0, NULL); } - + /* * ---------------------------------------------------------------------- * @@ -2853,7 +2853,7 @@ Tcl_ObjectContextInvokeNext( * Invoke the (advanced) method call context in the caller context. */ - result = Tcl_NRCallObjProc(interp, TclOOInvokeContext, contextPtr, objc, + result = Tcl_NRCallObjProc2(interp, TclOOInvokeContext, contextPtr, objc, objv); /* @@ -2968,13 +2968,13 @@ Tcl_GetObjectFromObj( if (cmdPtr == NULL) { goto notAnObject; } - if (cmdPtr->objProc != TclOOPublicObjectCmd) { + if (cmdPtr->objProc2 != TclOOPublicObjectCmd) { cmdPtr = (Command *) TclGetOriginalCommand((Tcl_Command) cmdPtr); - if (cmdPtr == NULL || cmdPtr->objProc != TclOOPublicObjectCmd) { + if (cmdPtr == NULL || cmdPtr->objProc2 != TclOOPublicObjectCmd) { goto notAnObject; } } - return (Tcl_Object)cmdPtr->objClientData; + return (Tcl_Object)cmdPtr->objClientData2; notAnObject: Tcl_SetObjResult(interp, Tcl_ObjPrintf( diff --git a/generic/tclOO.decls b/generic/tclOO.decls index 2df34d0..8da6958 100644 --- a/generic/tclOO.decls +++ b/generic/tclOO.decls @@ -164,13 +164,13 @@ declare 0 { declare 1 { Tcl_Method TclOOMakeProcInstanceMethod(Tcl_Interp *interp, Object *oPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, - const Tcl_MethodType *typePtr, void *clientData, + const Tcl_MethodType2 *typePtr, void *clientData, Proc **procPtrPtr) } declare 2 { Tcl_Method TclOOMakeProcMethod(Tcl_Interp *interp, Class *clsPtr, int flags, Tcl_Obj *nameObj, const char *namePtr, - Tcl_Obj *argsObj, Tcl_Obj *bodyObj, const Tcl_MethodType *typePtr, + Tcl_Obj *argsObj, Tcl_Obj *bodyObj, const Tcl_MethodType2 *typePtr, void *clientData, Proc **procPtrPtr) } declare 3 { diff --git a/generic/tclOO.h b/generic/tclOO.h index 524acb9..a70a018 100644 --- a/generic/tclOO.h +++ b/generic/tclOO.h @@ -60,8 +60,10 @@ typedef struct Tcl_ObjectContext_ *Tcl_ObjectContext; * and to allow the attachment of arbitrary data to objects and classes. */ +#ifndef TCL_NO_DEPRECATED typedef int (Tcl_MethodCallProc)(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext objectContext, int objc, Tcl_Obj *const *objv); +#endif /* TCL_NO_DEPRECATED */ typedef int (Tcl_MethodCallProc2)(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext objectContext, Tcl_Size objc, Tcl_Obj *const *objv); typedef void (Tcl_MethodDeleteProc)(void *clientData); @@ -77,6 +79,7 @@ typedef int (Tcl_ObjectMapMethodNameProc)(Tcl_Interp *interp, * how to create a clone of it (when the object or class is copied). */ +#ifndef TCL_NO_DEPRECATED typedef struct { int version; /* Structure version field. Always to be equal * to TCL_OO_METHOD_VERSION_(1|CURRENT) in @@ -93,6 +96,7 @@ typedef struct { * data, or NULL if the type-specific data can * be copied directly. */ } Tcl_MethodType; +#endif /* TCL_NO_DEPRECATED */ typedef struct { int version; /* Structure version field. Always to be equal diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c index e644a2f..31c2471 100644 --- a/generic/tclOOBasic.c +++ b/generic/tclOOBasic.c @@ -80,18 +80,18 @@ TclOO_Class_Constructor( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) Tcl_ObjectContextObject(context); Tcl_Obj **invoke, *nameObj; - size_t skip = Tcl_ObjectContextSkippedArgs(context); - if ((size_t)objc > skip + 1) { + Tcl_Size skip = Tcl_ObjectContextSkippedArgs(context); + if (objc > skip + 1) { Tcl_WrongNumArgs(interp, skip, objv, "?definitionScript?"); return TCL_ERROR; - } else if ((size_t)objc == skip) { + } else if (objc == skip) { return TCL_OK; } @@ -180,7 +180,7 @@ TclOO_Class_Create( Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* The actual arguments. */ { Object *oPtr = (Object *) Tcl_ObjectContextObject(context); @@ -245,7 +245,7 @@ TclOO_Class_CreateNs( Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* The actual arguments. */ { Object *oPtr = (Object *) Tcl_ObjectContextObject(context); @@ -318,7 +318,7 @@ TclOO_Class_New( Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* The actual arguments. */ { Object *oPtr = (Object *) Tcl_ObjectContextObject(context); @@ -362,13 +362,13 @@ TclOO_Object_Destroy( Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* The actual arguments. */ { Object *oPtr = (Object *) Tcl_ObjectContextObject(context); CallContext *contextPtr; - if (objc != (int)Tcl_ObjectContextSkippedArgs(context)) { + if (objc != Tcl_ObjectContextSkippedArgs(context)) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, NULL); return TCL_ERROR; @@ -423,17 +423,17 @@ TclOO_Object_Eval( Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* The actual arguments. */ { CallContext *contextPtr = (CallContext *) context; Tcl_Object object = Tcl_ObjectContextObject(context); - size_t skip = Tcl_ObjectContextSkippedArgs(context); + Tcl_Size skip = Tcl_ObjectContextSkippedArgs(context); CallFrame *framePtr, **framePtrPtr = &framePtr; Tcl_Obj *scriptPtr; CmdFrame *invoker; - if ((size_t)objc < skip + 1) { + if (objc < skip+1) { Tcl_WrongNumArgs(interp, skip, objv, "arg ?arg ...?"); return TCL_ERROR; } @@ -461,7 +461,7 @@ TclOO_Object_Eval( * object when it decrements its refcount after eval'ing it. */ - if ((size_t)objc != skip+1) { + if (objc != skip+1) { scriptPtr = Tcl_ConcatObj(objc-skip, objv+skip); invoker = NULL; } else { @@ -524,7 +524,7 @@ TclOO_Object_Unknown( Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* The actual arguments. */ { CallContext *contextPtr = (CallContext *) context; @@ -631,7 +631,7 @@ TclOO_Object_LinkVar( Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* The actual arguments. */ { Interp *iPtr = (Interp *) interp; @@ -733,7 +733,7 @@ TclOO_Object_VarName( Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* The actual arguments. */ { Var *varPtr, *aryVar; @@ -741,7 +741,7 @@ TclOO_Object_VarName( CallFrame *framePtr = ((Interp *) interp)->varFramePtr; const char *arg; - if ((int)Tcl_ObjectContextSkippedArgs(context)+1 != objc) { + if (Tcl_ObjectContextSkippedArgs(context)+1 != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, "varName"); return TCL_ERROR; @@ -869,7 +869,7 @@ int TclOONextObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Interp *iPtr = (Interp *) interp; @@ -905,7 +905,7 @@ int TclOONextToObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Interp *iPtr = (Interp *) interp; @@ -1038,7 +1038,7 @@ int TclOOSelfObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { static const char *const subcmds[] = { @@ -1274,7 +1274,7 @@ int TclOOCopyObjectCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Object oPtr, o2Ptr; diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index 5c9c986..f938708 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -312,7 +312,7 @@ TclOOInvokeContext( * other sorts of context handling (e.g., * commands, variables) depending on method * implementation. */ - int objc, /* The number of arguments. */ + Tcl_Size objc, /* The number of arguments. */ Tcl_Obj *const objv[]) /* The arguments as actually seen. */ { CallContext *const contextPtr = (CallContext *)clientData; @@ -370,11 +370,17 @@ TclOOInvokeContext( * Run the method implementation. */ - if (mPtr->typePtr->version < TCL_OO_METHOD_VERSION_2) { - return (mPtr->typePtr->callProc)(mPtr->clientData, interp, +#ifndef TCL_NO_DEPRECATED + if (mPtr->typePtr->version == TCL_OO_METHOD_VERSION_1) { + if (objc > INT_MAX) { + Tcl_WrongNumArgs(interp, 1, objv, "?args?"); + return TCL_ERROR; + } + return ((Tcl_MethodCallProc *)(void *)mPtr->typePtr->callProc)(mPtr->clientData, interp, (Tcl_ObjectContext) contextPtr, objc, objv); } - return ((Tcl_MethodCallProc2 *)(void *)(mPtr->typePtr->callProc))(mPtr->clientData, interp, +#endif /* TCL_NO_DEPRECATED */ + return mPtr->typePtr->callProc(mPtr->clientData, interp, (Tcl_ObjectContext) contextPtr, objc, objv); } diff --git a/generic/tclOODecls.h b/generic/tclOODecls.h index cf55478..818beba 100644 --- a/generic/tclOODecls.h +++ b/generic/tclOODecls.h @@ -18,6 +18,10 @@ # define USE_TCLOO_STUBS #endif +#ifdef TCL_NO_DEPRECATED +# define Tcl_MethodType void +#endif + /* !BEGIN!: Do not edit below this line. */ #ifdef __cplusplus @@ -270,4 +274,11 @@ extern const TclOOStubs *tclOOStubsPtr; /* !END!: Do not edit above this line. */ +#ifdef TCL_NO_DEPRECATED +# undef Tcl_MethodType +# undef Tcl_MethodIsType +# undef Tcl_NewInstanceMethod +# undef Tcl_NewMethod +#endif + #endif /* _TCLOODECLS */ diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index 84204f9..c46764b 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -35,18 +35,18 @@ struct DeclaredSlot { const char *name; - const Tcl_MethodType getterType; - const Tcl_MethodType setterType; - const Tcl_MethodType resolverType; + const Tcl_MethodType2 getterType; + const Tcl_MethodType2 setterType; + const Tcl_MethodType2 resolverType; }; #define SLOT(name,getter,setter,resolver) \ {"::oo::" name, \ - {TCL_OO_METHOD_VERSION_CURRENT, "core method: " name " Getter", \ + {TCL_OO_METHOD_VERSION_2, "core method: " name " Getter", \ getter, NULL, NULL}, \ - {TCL_OO_METHOD_VERSION_CURRENT, "core method: " name " Setter", \ + {TCL_OO_METHOD_VERSION_2, "core method: " name " Setter", \ setter, NULL, NULL}, \ - {TCL_OO_METHOD_VERSION_CURRENT, "core method: " name " Resolver", \ + {TCL_OO_METHOD_VERSION_2, "core method: " name " Resolver", \ resolver, NULL, NULL}} /* @@ -66,63 +66,63 @@ static inline void GenerateErrorInfo(Tcl_Interp *interp, Object *oPtr, Tcl_Obj *savedNameObj, const char *typeOfSubject); static inline int MagicDefinitionInvoke(Tcl_Interp *interp, Tcl_Namespace *nsPtr, int cmdIndex, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static inline Class * GetClassInOuterContext(Tcl_Interp *interp, Tcl_Obj *className, const char *errMsg); static inline Tcl_Namespace *GetNamespaceInOuterContext(Tcl_Interp *interp, Tcl_Obj *namespaceName); static inline int InitDefineContext(Tcl_Interp *interp, Tcl_Namespace *namespacePtr, Object *oPtr, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static inline void RecomputeClassCacheFlag(Object *oPtr); static int RenameDeleteMethod(Tcl_Interp *interp, Object *oPtr, int useClass, Tcl_Obj *const fromPtr, Tcl_Obj *const toPtr); static int ClassFilterGet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ClassFilterSet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ClassMixinGet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ClassMixinSet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ClassSuperGet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ClassSuperSet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ClassVarsGet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ClassVarsSet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ObjFilterGet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ObjFilterSet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ObjMixinGet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ObjMixinSet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ObjVarsGet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ObjVarsSet(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static int ResolveClass(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); /* * Now define the slots used in declarations. @@ -698,7 +698,7 @@ int TclOOUnknownDefinition( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Namespace *nsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); @@ -839,7 +839,7 @@ InitDefineContext( Tcl_Interp *interp, Tcl_Namespace *namespacePtr, Object *oPtr, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CallFrame *framePtr, **framePtrPtr = &framePtr; @@ -1028,7 +1028,7 @@ MagicDefinitionInvoke( Tcl_Interp *interp, Tcl_Namespace *nsPtr, int cmdIndex, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *objPtr, *obj2Ptr, **objs; @@ -1096,7 +1096,7 @@ int TclOODefineObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Namespace *nsPtr; @@ -1172,7 +1172,7 @@ int TclOOObjDefObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Namespace *nsPtr; @@ -1241,7 +1241,7 @@ int TclOODefineSelfObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Namespace *nsPtr; @@ -1312,7 +1312,7 @@ int TclOODefineObjSelfObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr; @@ -1346,7 +1346,7 @@ int TclOODefinePrivateObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int isInstancePrivate = (clientData != NULL); @@ -1419,7 +1419,7 @@ int TclOODefineClassObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr; @@ -1528,7 +1528,7 @@ int TclOODefineConstructorObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr; @@ -1597,7 +1597,7 @@ int TclOODefineDefnNsObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { static const char *kindList[] = { @@ -1682,12 +1682,12 @@ int TclOODefineDeleteMethodObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int isInstanceDeleteMethod = (clientData != NULL); Object *oPtr; - int i; + Tcl_Size i; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "name ?name ...?"); @@ -1739,7 +1739,7 @@ int TclOODefineDestructorObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr; @@ -1804,7 +1804,7 @@ int TclOODefineExportObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int isInstanceExport = (clientData != NULL); @@ -1812,7 +1812,8 @@ TclOODefineExportObjCmd( Method *mPtr; Tcl_HashEntry *hPtr; Class *clsPtr; - int i, isNew, changed = 0; + Tcl_Size i; + int isNew, changed = 0; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "name ?name ...?"); @@ -1900,7 +1901,7 @@ int TclOODefineForwardObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int isInstanceForward = (clientData != NULL); @@ -1964,7 +1965,7 @@ int TclOODefineMethodObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { /* @@ -2060,7 +2061,7 @@ int TclOODefineRenameMethodObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int isInstanceRenameMethod = (clientData != NULL); @@ -2117,7 +2118,7 @@ int TclOODefineUnexportObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int isInstanceUnexport = (clientData != NULL); @@ -2125,7 +2126,8 @@ TclOODefineUnexportObjCmd( Method *mPtr; Tcl_HashEntry *hPtr; Class *clsPtr; - int i, isNew, changed = 0; + Tcl_Size i; + int isNew, changed = 0; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "name ?name ...?"); @@ -2319,7 +2321,7 @@ ClassFilterGet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2353,7 +2355,7 @@ ClassFilterSet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2399,7 +2401,7 @@ ClassMixinGet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2436,7 +2438,7 @@ ClassMixinSet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2505,7 +2507,7 @@ ClassSuperGet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2541,7 +2543,7 @@ ClassSuperSet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2673,7 +2675,7 @@ ClassVarsGet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2717,7 +2719,7 @@ ClassVarsSet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2788,7 +2790,7 @@ ObjFilterGet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2816,7 +2818,7 @@ ObjFilterSet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2856,7 +2858,7 @@ ObjMixinGet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2888,7 +2890,7 @@ ObjMixinSet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2942,7 +2944,7 @@ ObjVarsGet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -2980,7 +2982,7 @@ ObjVarsSet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -3045,10 +3047,10 @@ ResolveClass( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { - int idx = Tcl_ObjectContextSkippedArgs(context); + Tcl_Size idx = Tcl_ObjectContextSkippedArgs(context); Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); Class *clsPtr; diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c index 1f27b41..a83e7a1 100644 --- a/generic/tclOOInfo.c +++ b/generic/tclOOInfo.c @@ -17,33 +17,33 @@ #include "tclOOInt.h" static inline Class * GetClassFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr); -static Tcl_ObjCmdProc InfoObjectCallCmd; -static Tcl_ObjCmdProc InfoObjectClassCmd; -static Tcl_ObjCmdProc InfoObjectDefnCmd; -static Tcl_ObjCmdProc InfoObjectFiltersCmd; -static Tcl_ObjCmdProc InfoObjectForwardCmd; -static Tcl_ObjCmdProc InfoObjectIdCmd; -static Tcl_ObjCmdProc InfoObjectIsACmd; -static Tcl_ObjCmdProc InfoObjectMethodsCmd; -static Tcl_ObjCmdProc InfoObjectMethodTypeCmd; -static Tcl_ObjCmdProc InfoObjectMixinsCmd; -static Tcl_ObjCmdProc InfoObjectNsCmd; -static Tcl_ObjCmdProc InfoObjectVarsCmd; -static Tcl_ObjCmdProc InfoObjectVariablesCmd; -static Tcl_ObjCmdProc InfoClassCallCmd; -static Tcl_ObjCmdProc InfoClassConstrCmd; -static Tcl_ObjCmdProc InfoClassDefnCmd; -static Tcl_ObjCmdProc InfoClassDefnNsCmd; -static Tcl_ObjCmdProc InfoClassDestrCmd; -static Tcl_ObjCmdProc InfoClassFiltersCmd; -static Tcl_ObjCmdProc InfoClassForwardCmd; -static Tcl_ObjCmdProc InfoClassInstancesCmd; -static Tcl_ObjCmdProc InfoClassMethodsCmd; -static Tcl_ObjCmdProc InfoClassMethodTypeCmd; -static Tcl_ObjCmdProc InfoClassMixinsCmd; -static Tcl_ObjCmdProc InfoClassSubsCmd; -static Tcl_ObjCmdProc InfoClassSupersCmd; -static Tcl_ObjCmdProc InfoClassVariablesCmd; +static Tcl_ObjCmdProc2 InfoObjectCallCmd; +static Tcl_ObjCmdProc2 InfoObjectClassCmd; +static Tcl_ObjCmdProc2 InfoObjectDefnCmd; +static Tcl_ObjCmdProc2 InfoObjectFiltersCmd; +static Tcl_ObjCmdProc2 InfoObjectForwardCmd; +static Tcl_ObjCmdProc2 InfoObjectIdCmd; +static Tcl_ObjCmdProc2 InfoObjectIsACmd; +static Tcl_ObjCmdProc2 InfoObjectMethodsCmd; +static Tcl_ObjCmdProc2 InfoObjectMethodTypeCmd; +static Tcl_ObjCmdProc2 InfoObjectMixinsCmd; +static Tcl_ObjCmdProc2 InfoObjectNsCmd; +static Tcl_ObjCmdProc2 InfoObjectVarsCmd; +static Tcl_ObjCmdProc2 InfoObjectVariablesCmd; +static Tcl_ObjCmdProc2 InfoClassCallCmd; +static Tcl_ObjCmdProc2 InfoClassConstrCmd; +static Tcl_ObjCmdProc2 InfoClassDefnCmd; +static Tcl_ObjCmdProc2 InfoClassDefnNsCmd; +static Tcl_ObjCmdProc2 InfoClassDestrCmd; +static Tcl_ObjCmdProc2 InfoClassFiltersCmd; +static Tcl_ObjCmdProc2 InfoClassForwardCmd; +static Tcl_ObjCmdProc2 InfoClassInstancesCmd; +static Tcl_ObjCmdProc2 InfoClassMethodsCmd; +static Tcl_ObjCmdProc2 InfoClassMethodTypeCmd; +static Tcl_ObjCmdProc2 InfoClassMixinsCmd; +static Tcl_ObjCmdProc2 InfoClassSubsCmd; +static Tcl_ObjCmdProc2 InfoClassSupersCmd; +static Tcl_ObjCmdProc2 InfoClassVariablesCmd; /* * List of commands that are used to implement the [info object] subcommands. @@ -173,7 +173,7 @@ static int InfoObjectClassCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -230,7 +230,7 @@ static int InfoObjectDefnCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -304,7 +304,7 @@ static int InfoObjectFiltersCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Size i; @@ -343,7 +343,7 @@ static int InfoObjectForwardCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -400,7 +400,7 @@ static int InfoObjectIsACmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { static const char *const categories[] = { @@ -520,7 +520,7 @@ static int InfoObjectMethodsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -551,7 +551,7 @@ InfoObjectMethodsCmd( return TCL_ERROR; } if (objc != 2) { - int i; + Tcl_Size i; for (i=2 ; i<objc ; i++) { if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0, @@ -640,7 +640,7 @@ static int InfoObjectMethodTypeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -697,7 +697,7 @@ static int InfoObjectMixinsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Class *mixinPtr; @@ -740,7 +740,7 @@ static int InfoObjectIdCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -772,7 +772,7 @@ static int InfoObjectNsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -805,7 +805,7 @@ static int InfoObjectVariablesCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -860,7 +860,7 @@ static int InfoObjectVarsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -921,7 +921,7 @@ static int InfoClassConstrCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Proc *procPtr; @@ -982,7 +982,7 @@ static int InfoClassDefnCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_HashEntry *hPtr; @@ -1050,7 +1050,7 @@ static int InfoClassDefnNsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { static const char *kindList[] = { @@ -1100,7 +1100,7 @@ static int InfoClassDestrCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Proc *procPtr; @@ -1144,7 +1144,7 @@ static int InfoClassFiltersCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Size i; @@ -1182,7 +1182,7 @@ static int InfoClassForwardCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_HashEntry *hPtr; @@ -1233,7 +1233,7 @@ static int InfoClassInstancesCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -1281,7 +1281,7 @@ static int InfoClassMethodsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { int flag = PUBLIC_METHOD, recurse = 0, scope = -1; @@ -1310,7 +1310,7 @@ InfoClassMethodsCmd( return TCL_ERROR; } if (objc != 2) { - int i; + Tcl_Size i; for (i=2 ; i<objc ; i++) { if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0, @@ -1397,7 +1397,7 @@ static int InfoClassMethodTypeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_HashEntry *hPtr; @@ -1449,7 +1449,7 @@ static int InfoClassMixinsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Class *clsPtr, *mixinPtr; @@ -1491,7 +1491,7 @@ static int InfoClassSubsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Class *clsPtr, *subclassPtr; @@ -1546,7 +1546,7 @@ static int InfoClassSupersCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Class *clsPtr, *superPtr; @@ -1585,7 +1585,7 @@ static int InfoClassVariablesCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Class *clsPtr; @@ -1640,7 +1640,7 @@ static int InfoObjectCallCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -1686,7 +1686,7 @@ static int InfoClassCallCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Class *clsPtr; diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h index c3f6fc2..c0c8831 100644 --- a/generic/tclOOInt.h +++ b/generic/tclOOInt.h @@ -42,7 +42,7 @@ struct Object; */ typedef struct Method { - const Tcl_MethodType *typePtr; + const Tcl_MethodType2 *typePtr; /* The type of method. If NULL, this is a * special flag record which is just used for * the setting of the flags field. */ @@ -437,7 +437,7 @@ typedef struct CallContext { typedef struct { const char *name; /* Name of the method in question. */ int isPublic; /* Whether the method is public by default. */ - Tcl_MethodType definition; /* How to call the method. */ + Tcl_MethodType2 definition; /* How to call the method. */ } DeclaredClassMethod; /* @@ -447,40 +447,40 @@ typedef struct { */ MODULE_SCOPE int TclOOInit(Tcl_Interp *interp); -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOOObjDefObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineConstructorObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineDefnNsObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineDeleteMethodObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineDestructorObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineExportObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineForwardObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineMethodObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineRenameMethodObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineUnexportObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineClassObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineSelfObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefineObjSelfObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOODefinePrivateObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOOUnknownDefinition; -MODULE_SCOPE Tcl_ObjCmdProc TclOOCopyObjectCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOONextObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOONextToObjCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOOSelfObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOOObjDefObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineConstructorObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineDefnNsObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineDeleteMethodObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineDestructorObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineExportObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineForwardObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineMethodObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineRenameMethodObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineUnexportObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineClassObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineSelfObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefineObjSelfObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOODefinePrivateObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOOUnknownDefinition; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOOCopyObjectCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOONextObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOONextToObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOOSelfObjCmd; /* * Method implementations (in tclOOBasic.c). */ -MODULE_SCOPE Tcl_MethodCallProc TclOO_Class_Constructor; -MODULE_SCOPE Tcl_MethodCallProc TclOO_Class_Create; -MODULE_SCOPE Tcl_MethodCallProc TclOO_Class_CreateNs; -MODULE_SCOPE Tcl_MethodCallProc TclOO_Class_New; -MODULE_SCOPE Tcl_MethodCallProc TclOO_Object_Destroy; -MODULE_SCOPE Tcl_MethodCallProc TclOO_Object_Eval; -MODULE_SCOPE Tcl_MethodCallProc TclOO_Object_LinkVar; -MODULE_SCOPE Tcl_MethodCallProc TclOO_Object_Unknown; -MODULE_SCOPE Tcl_MethodCallProc TclOO_Object_VarName; +MODULE_SCOPE Tcl_MethodCallProc2 TclOO_Class_Constructor; +MODULE_SCOPE Tcl_MethodCallProc2 TclOO_Class_Create; +MODULE_SCOPE Tcl_MethodCallProc2 TclOO_Class_CreateNs; +MODULE_SCOPE Tcl_MethodCallProc2 TclOO_Class_New; +MODULE_SCOPE Tcl_MethodCallProc2 TclOO_Object_Destroy; +MODULE_SCOPE Tcl_MethodCallProc2 TclOO_Object_Eval; +MODULE_SCOPE Tcl_MethodCallProc2 TclOO_Object_LinkVar; +MODULE_SCOPE Tcl_MethodCallProc2 TclOO_Object_Unknown; +MODULE_SCOPE Tcl_MethodCallProc2 TclOO_Object_VarName; /* * Private definitions, some of which perhaps ought to be exposed properly or @@ -492,16 +492,13 @@ MODULE_SCOPE void TclOOAddToMixinSubs(Class *subPtr, Class *mixinPtr); MODULE_SCOPE void TclOOAddToSubclasses(Class *subPtr, Class *superPtr); MODULE_SCOPE Class * TclOOAllocClass(Tcl_Interp *interp, Object *useThisObj); -MODULE_SCOPE int TclMethodIsType(Tcl_Method method, - const Tcl_MethodType *typePtr, - void **clientDataPtr); MODULE_SCOPE Tcl_Method TclNewInstanceMethod(Tcl_Interp *interp, Tcl_Object object, Tcl_Obj *nameObj, - int flags, const Tcl_MethodType *typePtr, + int flags, const Tcl_MethodType2 *typePtr, void *clientData); MODULE_SCOPE Tcl_Method TclNewMethod(Tcl_Interp *interp, Tcl_Class cls, Tcl_Obj *nameObj, int flags, - const Tcl_MethodType *typePtr, + const Tcl_MethodType2 *typePtr, void *clientData); MODULE_SCOPE int TclNRNewObjectInstance(Tcl_Interp *interp, Tcl_Class cls, const char *nameStr, @@ -541,7 +538,7 @@ MODULE_SCOPE int TclOOGetSortedMethodList(Object *oPtr, MODULE_SCOPE int TclOOInit(Tcl_Interp *interp); MODULE_SCOPE void TclOOInitInfo(Tcl_Interp *interp); MODULE_SCOPE int TclOOInvokeContext(void *clientData, - Tcl_Interp *interp, int objc, + Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); MODULE_SCOPE int TclNRObjectContextInvokeNext(Tcl_Interp *interp, Tcl_ObjectContext context, Tcl_Size objc, diff --git a/generic/tclOOIntDecls.h b/generic/tclOOIntDecls.h index 730a73a..06feeff 100644 --- a/generic/tclOOIntDecls.h +++ b/generic/tclOOIntDecls.h @@ -21,14 +21,14 @@ TCLAPI Tcl_Object TclOOGetDefineCmdContext(Tcl_Interp *interp); TCLAPI Tcl_Method TclOOMakeProcInstanceMethod(Tcl_Interp *interp, Object *oPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, - const Tcl_MethodType *typePtr, + const Tcl_MethodType2 *typePtr, void *clientData, Proc **procPtrPtr); /* 2 */ TCLAPI Tcl_Method TclOOMakeProcMethod(Tcl_Interp *interp, Class *clsPtr, int flags, Tcl_Obj *nameObj, const char *namePtr, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, - const Tcl_MethodType *typePtr, + const Tcl_MethodType2 *typePtr, void *clientData, Proc **procPtrPtr); /* 3 */ TCLAPI Method * TclOONewProcInstanceMethod(Tcl_Interp *interp, @@ -97,8 +97,8 @@ typedef struct TclOOIntStubs { void *hooks; Tcl_Object (*tclOOGetDefineCmdContext) (Tcl_Interp *interp); /* 0 */ - Tcl_Method (*tclOOMakeProcInstanceMethod) (Tcl_Interp *interp, Object *oPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, const Tcl_MethodType *typePtr, void *clientData, Proc **procPtrPtr); /* 1 */ - Tcl_Method (*tclOOMakeProcMethod) (Tcl_Interp *interp, Class *clsPtr, int flags, Tcl_Obj *nameObj, const char *namePtr, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, const Tcl_MethodType *typePtr, void *clientData, Proc **procPtrPtr); /* 2 */ + Tcl_Method (*tclOOMakeProcInstanceMethod) (Tcl_Interp *interp, Object *oPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, const Tcl_MethodType2 *typePtr, void *clientData, Proc **procPtrPtr); /* 1 */ + Tcl_Method (*tclOOMakeProcMethod) (Tcl_Interp *interp, Class *clsPtr, int flags, Tcl_Obj *nameObj, const char *namePtr, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, const Tcl_MethodType2 *typePtr, void *clientData, Proc **procPtrPtr); /* 2 */ Method * (*tclOONewProcInstanceMethod) (Tcl_Interp *interp, Object *oPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, ProcedureMethod **pmPtrPtr); /* 3 */ Method * (*tclOONewProcMethod) (Tcl_Interp *interp, Class *clsPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, ProcedureMethod **pmPtrPtr); /* 4 */ int (*tclOOObjectCmdCore) (Object *oPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const *objv, int publicOnly, Class *startCls); /* 5 */ diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 34437c7..1eb897e 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -63,18 +63,18 @@ typedef struct { * Function declarations for things defined in this file. */ -static Tcl_Obj ** InitEnsembleRewrite(Tcl_Interp *interp, int objc, +static Tcl_Obj ** InitEnsembleRewrite(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const *objv, int toRewrite, int rewriteLength, Tcl_Obj *const *rewriteObjs, int *lengthPtr); static int InvokeProcedureMethod(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static Tcl_NRPostProc FinalizeForwardCall; static Tcl_NRPostProc FinalizePMCall; static int PushMethodCallFrame(Tcl_Interp *interp, CallContext *contextPtr, ProcedureMethod *pmPtr, - int objc, Tcl_Obj *const *objv, + Tcl_Size objc, Tcl_Obj *const *objv, PMFrameData *fdPtr); static void DeleteProcedureMethodRecord(ProcedureMethod *pmPtr); static void DeleteProcedureMethod(void *clientData); @@ -86,7 +86,7 @@ static ProcErrorProc DestructorErrorHandler; static Tcl_Obj * RenderDeclarerName(void *clientData); static int InvokeForwardMethod(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, Tcl_Obj *const *objv); + Tcl_Size objc, Tcl_Obj *const *objv); static void DeleteForwardMethod(void *clientData); static int CloneForwardMethod(Tcl_Interp *interp, void *clientData, void **newClientData); @@ -97,12 +97,12 @@ static Tcl_ResolveCompiledVarProc ProcedureMethodCompiledVarResolver; * The types of methods defined by the core OO system. */ -static const Tcl_MethodType procMethodType = { - TCL_OO_METHOD_VERSION_CURRENT, "method", +static const Tcl_MethodType2 procMethodType = { + TCL_OO_METHOD_VERSION_2, "method", InvokeProcedureMethod, DeleteProcedureMethod, CloneProcedureMethod }; -static const Tcl_MethodType fwdMethodType = { - TCL_OO_METHOD_VERSION_CURRENT, "forward", +static const Tcl_MethodType2 fwdMethodType = { + TCL_OO_METHOD_VERSION_2, "forward", InvokeForwardMethod, DeleteForwardMethod, CloneForwardMethod }; @@ -134,7 +134,7 @@ TclNewInstanceMethod( * up to caller to manage storage (e.g., when * it is a constructor or destructor). */ int flags, /* Whether this is a public method. */ - const Tcl_MethodType *typePtr, + const Tcl_MethodType2 *typePtr, /* The type of method this is, which defines * how to invoke, delete and clone the * method. */ @@ -187,6 +187,8 @@ TclNewInstanceMethod( oPtr->epoch++; return (Tcl_Method) mPtr; } + +#ifndef TCL_NO_DEPRECATED Tcl_Method Tcl_NewInstanceMethod( TCL_UNUSED(Tcl_Interp *), @@ -203,12 +205,14 @@ Tcl_NewInstanceMethod( void *clientData) /* Some data associated with the particular * method to be created. */ { - if (typePtr->version > TCL_OO_METHOD_VERSION_1) { + if (typePtr->version != TCL_OO_METHOD_VERSION_1) { Tcl_Panic("%s: Wrong version in typePtr->version, should be TCL_OO_METHOD_VERSION_1", "Tcl_NewInstanceMethod"); } return TclNewInstanceMethod(NULL, object, nameObj, flags, - (const Tcl_MethodType *)typePtr, clientData); + (const Tcl_MethodType2 *)typePtr, clientData); } +#endif /* TCL_NO_DEPRECATED */ + Tcl_Method Tcl_NewInstanceMethod2( TCL_UNUSED(Tcl_Interp *), @@ -229,7 +233,7 @@ Tcl_NewInstanceMethod2( Tcl_Panic("%s: Wrong version in typePtr->version, should be TCL_OO_METHOD_VERSION_2", "Tcl_NewInstanceMethod2"); } return TclNewInstanceMethod(NULL, object, nameObj, flags, - (const Tcl_MethodType *)typePtr, clientData); + typePtr, clientData); } /* @@ -250,7 +254,7 @@ TclNewMethod( * for constructors or destructors); if so, up * to caller to manage storage. */ int flags, /* Whether this is a public method. */ - const Tcl_MethodType *typePtr, + const Tcl_MethodType2 *typePtr, /* The type of method this is, which defines * how to invoke, delete and clone the * method. */ @@ -300,6 +304,7 @@ TclNewMethod( return (Tcl_Method) mPtr; } +#ifndef TCL_NO_DEPRECATED Tcl_Method Tcl_NewMethod( TCL_UNUSED(Tcl_Interp *), @@ -315,11 +320,12 @@ Tcl_NewMethod( void *clientData) /* Some data associated with the particular * method to be created. */ { - if (typePtr->version > TCL_OO_METHOD_VERSION_1) { + if (typePtr->version != TCL_OO_METHOD_VERSION_1) { Tcl_Panic("%s: Wrong version in typePtr->version, should be TCL_OO_METHOD_VERSION_1", "Tcl_NewMethod"); } - return TclNewMethod(NULL, cls, nameObj, flags, typePtr, clientData); + return TclNewMethod(NULL, cls, nameObj, flags, (const Tcl_MethodType2 *)typePtr, clientData); } +#endif /* TCL_NO_DEPRECATED */ Tcl_Method Tcl_NewMethod2( @@ -339,7 +345,7 @@ Tcl_NewMethod2( if (typePtr->version < TCL_OO_METHOD_VERSION_2) { Tcl_Panic("%s: Wrong version in typePtr->version, should be TCL_OO_METHOD_VERSION_2", "Tcl_NewMethod2"); } - return TclNewMethod(NULL, cls, nameObj, flags, (const Tcl_MethodType *)typePtr, clientData); + return TclNewMethod(NULL, cls, nameObj, flags, typePtr, clientData); } /* @@ -534,7 +540,7 @@ TclOOMakeProcInstanceMethod( * which _must not_ be NULL. */ Tcl_Obj *bodyObj, /* The body of the method, which _must not_ be * NULL. */ - const Tcl_MethodType *typePtr, + const Tcl_MethodType2 *typePtr, /* The type of the method to create. */ void *clientData, /* The per-method type-specific data. */ Proc **procPtrPtr) /* A pointer to the variable in which to write @@ -647,7 +653,7 @@ TclOOMakeProcMethod( * which _must not_ be NULL. */ Tcl_Obj *bodyObj, /* The body of the method, which _must not_ be * NULL. */ - const Tcl_MethodType *typePtr, + const Tcl_MethodType2 *typePtr, /* The type of the method to create. */ void *clientData, /* The per-method type-specific data. */ Proc **procPtrPtr) /* A pointer to the variable in which to write @@ -747,7 +753,7 @@ InvokeProcedureMethod( void *clientData, /* Pointer to some per-method context. */ Tcl_Interp *interp, Tcl_ObjectContext context, /* The method calling context. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Arguments as actually seen. */ { ProcedureMethod *pmPtr = (ProcedureMethod *)clientData; @@ -870,7 +876,7 @@ PushMethodCallFrame( CallContext *contextPtr, /* Current method call context. */ ProcedureMethod *pmPtr, /* Information about this procedure-like * method. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv, /* Array of arguments. */ PMFrameData *fdPtr) /* Place to store information about the call * frame. */ @@ -1548,7 +1554,7 @@ InvokeForwardMethod( void *clientData, /* Pointer to some per-method context. */ Tcl_Interp *interp, Tcl_ObjectContext context, /* The method calling context. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Arguments as actually seen. */ { CallContext *contextPtr = (CallContext *) context; @@ -1699,7 +1705,7 @@ TclOOGetFwdFromMethod( static Tcl_Obj ** InitEnsembleRewrite( Tcl_Interp *interp, /* Place to log the rewrite info. */ - int objc, /* Number of real arguments. */ + Tcl_Size objc, /* Number of real arguments. */ Tcl_Obj *const *objv, /* The real arguments. */ int toRewrite, /* Number of real arguments to replace. */ int rewriteLength, /* Number of arguments to insert instead. */ @@ -1759,23 +1765,7 @@ Tcl_MethodName( return ((Method *) method)->namePtr; } -int -TclMethodIsType( - Tcl_Method method, - const Tcl_MethodType *typePtr, - void **clientDataPtr) -{ - Method *mPtr = (Method *) method; - - if (mPtr->typePtr == typePtr) { - if (clientDataPtr != NULL) { - *clientDataPtr = mPtr->clientData; - } - return 1; - } - return 0; -} - +#ifndef TCL_NO_DEPRECATED int Tcl_MethodIsType( Tcl_Method method, @@ -1784,10 +1774,10 @@ Tcl_MethodIsType( { Method *mPtr = (Method *) method; - if (typePtr->version > TCL_OO_METHOD_VERSION_1) { + if (typePtr->version != TCL_OO_METHOD_VERSION_1) { Tcl_Panic("%s: Wrong version in typePtr->version, should be TCL_OO_METHOD_VERSION_1", "Tcl_MethodIsType"); } - if (mPtr->typePtr == typePtr) { + if (mPtr->typePtr == (const Tcl_MethodType2 *)typePtr) { if (clientDataPtr != NULL) { *clientDataPtr = mPtr->clientData; } @@ -1795,6 +1785,7 @@ Tcl_MethodIsType( } return 0; } +#endif /* TCL_NO_DEPRECATED */ int Tcl_MethodIsType2( @@ -1807,7 +1798,7 @@ Tcl_MethodIsType2( if (typePtr->version < TCL_OO_METHOD_VERSION_2) { Tcl_Panic("%s: Wrong version in typePtr->version, should be TCL_OO_METHOD_VERSION_2", "Tcl_MethodIsType2"); } - if (mPtr->typePtr == (const Tcl_MethodType *)typePtr) { + if (mPtr->typePtr == typePtr) { if (clientDataPtr != NULL) { *clientDataPtr = mPtr->clientData; } diff --git a/generic/tclOOStubInit.c b/generic/tclOOStubInit.c index 7b653cb..0ba5ce6 100644 --- a/generic/tclOOStubInit.c +++ b/generic/tclOOStubInit.c @@ -14,6 +14,12 @@ MODULE_SCOPE const TclOOStubs tclOOStubs; #pragma GCC dependency "tclOO.decls" #endif +#ifdef TCL_NO_DEPRECATED +# define Tcl_MethodIsType 0 +# define Tcl_NewInstanceMethod 0 +# define Tcl_NewMethod 0 +#endif + /* !BEGIN!: Do not edit below this line. */ static const TclOOIntStubs tclOOIntStubs = { diff --git a/generic/tclObj.c b/generic/tclObj.c index 0c9c405..d43b4cf 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4544,7 +4544,7 @@ int Tcl_RepresentationCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *descObj; diff --git a/generic/tclPkg.c b/generic/tclPkg.c index 3ff7755..bbc9d2c 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -101,7 +101,7 @@ static int PkgRequireCoreFinal(void *data[], Tcl_Interp *interp, int result); static int PkgRequireCoreCleanup(void *data[], Tcl_Interp *interp, int result); static int PkgRequireCoreStep1(void *data[], Tcl_Interp *interp, int result); static int PkgRequireCoreStep2(void *data[], Tcl_Interp *interp, int result); -static int TclNRPkgRequireProc(void *clientData, Tcl_Interp *interp, int reqc, Tcl_Obj *const reqv[]); +static int TclNRPkgRequireProc(void *clientData, Tcl_Interp *interp, Tcl_Size reqc, Tcl_Obj *const reqv[]); static int SelectPackage(void *data[], Tcl_Interp *interp, int result); static int SelectPackageFinal(void *data[], Tcl_Interp *interp, int result); static int TclNRPackageObjCmdCleanup(void *data[], Tcl_Interp *interp, int result); @@ -436,7 +436,7 @@ Tcl_PkgRequireProc( args.name = name; args.clientDataPtr = clientDataPtr; - return Tcl_NRCallObjProc(interp, + return Tcl_NRCallObjProc2(interp, TclNRPkgRequireProc, (void *) &args, reqc, reqv); } @@ -444,7 +444,7 @@ static int TclNRPkgRequireProc( void *clientData, Tcl_Interp *interp, - int reqc, + Tcl_Size reqc, Tcl_Obj *const reqv[]) { RequireProcArgs *args = (RequireProcArgs *)clientData; @@ -1055,17 +1055,17 @@ int Tcl_PackageObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRPackageObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRPackageObjCmd, clientData, objc, objv); } int TclNRPackageObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const pkgOptions[] = { diff --git a/generic/tclProc.c b/generic/tclProc.c index d12394c..4170ce6 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -34,19 +34,21 @@ typedef struct { static void DupLambdaInternalRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr); static void FreeLambdaInternalRep(Tcl_Obj *objPtr); -static int InitArgsAndLocals(Tcl_Interp *interp, int skip); +static int InitArgsAndLocals(Tcl_Interp *interp, size_t skip); static void InitResolvedLocals(Tcl_Interp *interp, ByteCode *codePtr, Var *defPtr, Namespace *nsPtr); static void InitLocalCache(Proc *procPtr); static void ProcBodyDup(Tcl_Obj *srcPtr, Tcl_Obj *dupPtr); static void ProcBodyFree(Tcl_Obj *objPtr); -static int ProcWrongNumArgs(Tcl_Interp *interp, int skip); +static int ProcWrongNumArgs(Tcl_Interp *interp, size_t skip); static void MakeProcError(Tcl_Interp *interp, Tcl_Obj *procNameObj); static void MakeLambdaError(Tcl_Interp *interp, Tcl_Obj *procNameObj); static int SetLambdaFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); +static Tcl_ObjCmdProc2 NRInterpProc2; + static Tcl_NRPostProc ApplyNR2; static Tcl_NRPostProc InterpProcNR2; @@ -150,7 +152,7 @@ static const Tcl_ObjType lambdaType = { *---------------------------------------------------------------------- */ -#undef TclObjInterpProc +#undef TclObjInterpProc2 int Tcl_ProcObjCmd( TCL_UNUSED(void *), @@ -208,7 +210,7 @@ Tcl_ProcObjCmd( } cmd = TclNRCreateCommandInNs(interp, simpleName, (Tcl_Namespace *) nsPtr, - TclObjInterpProc, TclNRInterpProc, procPtr, TclProcDeleteProc); + TclObjInterpProc2, NRInterpProc2, procPtr, TclProcDeleteProc); /* * Now initialize the new procedure's cmdPtr field. This will be used @@ -890,17 +892,17 @@ int Tcl_UplevelObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRUplevelObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRUplevelObjCmd, clientData, objc, objv); } int TclNRUplevelObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { @@ -1055,7 +1057,7 @@ TclIsProc( cmdPtr = (Command *) origCmd; } if (cmdPtr->deleteProc == TclProcDeleteProc) { - return (Proc *)cmdPtr->objClientData; + return (Proc *)cmdPtr->objClientData2; } return NULL; } @@ -1063,7 +1065,7 @@ TclIsProc( static int ProcWrongNumArgs( Tcl_Interp *interp, - int skip) + size_t skip) { CallFrame *framePtr = ((Interp *)interp)->varFramePtr; Proc *procPtr = framePtr->procPtr; @@ -1341,7 +1343,7 @@ static int InitArgsAndLocals( Tcl_Interp *interp,/* Interpreter in which procedure was * invoked. */ - int skip) /* Number of initial arguments to be skipped, + size_t skip1) /* Number of initial arguments to be skipped, * i.e., words in the "command name". */ { CallFrame *framePtr = ((Interp *)interp)->varFramePtr; @@ -1350,6 +1352,7 @@ InitArgsAndLocals( Var *varPtr, *defPtr; int localCt = procPtr->numCompiledLocals, numArgs, argCt, i, imax; Tcl_Obj *const *argObjs; + int skip = skip1; ByteCodeGetInternalRep(procPtr->bodyPtr, &tclByteCodeType, codePtr); @@ -1582,7 +1585,7 @@ TclPushProcCallFrame( /* *---------------------------------------------------------------------- * - * TclObjInterpProc -- + * TclObjInterpProc2/NRInterpProc2 -- * * When a Tcl procedure gets invoked during bytecode evaluation, this * object-based routine gets invoked to interpret the procedure. @@ -1597,12 +1600,12 @@ TclPushProcCallFrame( */ int -TclObjInterpProc( +TclObjInterpProc2( void *clientData, /* Record describing procedure to be * interpreted. */ Tcl_Interp *interp,/* Interpreter in which procedure was * invoked. */ - int objc, /* Count of number of arguments to this + Tcl_Size objc, /* Count of number of arguments to this * procedure. */ Tcl_Obj *const objv[]) /* Argument value objects. */ { @@ -1610,16 +1613,16 @@ TclObjInterpProc( * Not used much in the core; external interface for iTcl */ - return Tcl_NRCallObjProc(interp, TclNRInterpProc, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, NRInterpProc2, clientData, objc, objv); } int -TclNRInterpProc( +NRInterpProc2( void *clientData, /* Record describing procedure to be * interpreted. */ Tcl_Interp *interp,/* Interpreter in which procedure was * invoked. */ - int objc, /* Count of number of arguments to this + Tcl_Size objc, /* Count of number of arguments to this * procedure. */ Tcl_Obj *const objv[]) /* Argument value objects. */ { @@ -1631,14 +1634,15 @@ TclNRInterpProc( } return TclNRInterpProcCore(interp, objv[0], 1, &MakeProcError); } - + +#ifndef TCL_NO_DEPRECATED static int -NRInterpProc2( - void *clientData, /* Record describing procedure to be +NRInterpProc( + void *clientData, /* Record describing procedure to be * interpreted. */ - Tcl_Interp *interp, /* Interpreter in which procedure was + Tcl_Interp *interp,/* Interpreter in which procedure was * invoked. */ - Tcl_Size objc, /* Count of number of arguments to this + int objc, /* Count of number of arguments to this * procedure. */ Tcl_Obj *const objv[]) /* Argument value objects. */ { @@ -1651,13 +1655,14 @@ NRInterpProc2( return TclNRInterpProcCore(interp, objv[0], 1, &MakeProcError); } -static int -ObjInterpProc2( +#undef TclObjInterpProc +int +TclObjInterpProc( void *clientData, /* Record describing procedure to be * interpreted. */ - Tcl_Interp *interp, /* Interpreter in which procedure was + Tcl_Interp *interp, /* Interpreter in which procedure was * invoked. */ - Tcl_Size objc, /* Count of number of arguments to this + int objc, /* Count of number of arguments to this * procedure. */ Tcl_Obj *const objv[]) /* Argument value objects. */ { @@ -1665,10 +1670,11 @@ ObjInterpProc2( * Not used much in the core; external interface for iTcl */ - return Tcl_NRCallObjProc2(interp, NRInterpProc2, clientData, objc, objv); + return Tcl_NRCallObjProc(interp, NRInterpProc, clientData, objc, objv); } +#endif /* TCL_NO_DEPRECATED */ + - /* *---------------------------------------------------------------------- * @@ -2058,7 +2064,7 @@ TclProcCompileProc( * * MakeProcError -- * - * Function called by TclObjInterpProc to create the stack information + * Function called by TclObjInterpProc2 to create the stack information * upon an error from a procedure. * * Results: @@ -2260,16 +2266,15 @@ TclUpdateReturnInfo( /* *---------------------------------------------------------------------- * - * TclGetObjInterpProc/TclGetObjInterpProc2 -- + * TclGetObjInterpProc2 -- * - * Returns a pointer to the TclObjInterpProc/ObjInterpProc2 functions; - * this is different from the value obtained from the TclObjInterpProc - * reference on systems like Windows where import and export versions - * of a function exported by a DLL exist. + * Returns a pointer to the TclObjInterpProc2 function; this is different + * from the value obtained from the TclObjInterpProc2 reference on systems + * like Windows where import and export versions of a function exported + * by a DLL exist. * * Results: - * Returns the internal address of the TclObjInterpProc/ObjInterpProc2 - * functions. + * Returns the internal address of the TclObjInterpProc2 function. * * Side effects: * None. @@ -2277,18 +2282,20 @@ TclUpdateReturnInfo( *---------------------------------------------------------------------- */ +Tcl_ObjCmdProc2 * +TclGetObjInterpProc2(void) +{ + return TclObjInterpProc2; +} + +#ifndef TCL_NO_DEPRECATED Tcl_ObjCmdProc * TclGetObjInterpProc(void) { return TclObjInterpProc; } +#endif /* TCL_NO_DEPRECATED */ -Tcl_ObjCmdProc2 * -TclGetObjInterpProc2(void) -{ - return ObjInterpProc2; -} - /* *---------------------------------------------------------------------- * @@ -2660,17 +2667,17 @@ int Tcl_ApplyObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRApplyObjCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRApplyObjCmd, clientData, objc, objv); } int TclNRApplyObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Proc *procPtr = NULL; @@ -2698,7 +2705,7 @@ TclNRApplyObjCmd( /* * Push a call frame for the lambda namespace. - * Note that TclObjInterpProc() will pop it. + * Note that TclObjInterpProc2() will pop it. */ result = TclGetNamespaceFromObj(interp, nsObjPtr, &nsPtr); @@ -2752,7 +2759,7 @@ ApplyNR2( * * MakeLambdaError -- * - * Function called by TclObjInterpProc to create the stack information + * Function called by TclObjInterpProc2 to create the stack information * upon an error from a lambda term. * * Results: diff --git a/generic/tclProcess.c b/generic/tclProcess.c index b621e31..453c5a5 100644 --- a/generic/tclProcess.c +++ b/generic/tclProcess.c @@ -51,10 +51,10 @@ static TclProcessWaitStatus WaitProcessStatus(Tcl_Pid pid, size_t resolvedPid, int options, int *codePtr, Tcl_Obj **msgPtr, Tcl_Obj **errorObjPtr); static Tcl_Obj * BuildProcessStatusObj(ProcessInfo *info); -static Tcl_ObjCmdProc ProcessListObjCmd; -static Tcl_ObjCmdProc ProcessStatusObjCmd; -static Tcl_ObjCmdProc ProcessPurgeObjCmd; -static Tcl_ObjCmdProc ProcessAutopurgeObjCmd; +static Tcl_ObjCmdProc2 ProcessListObjCmd; +static Tcl_ObjCmdProc2 ProcessStatusObjCmd; +static Tcl_ObjCmdProc2 ProcessPurgeObjCmd; +static Tcl_ObjCmdProc2 ProcessAutopurgeObjCmd; /* *---------------------------------------------------------------------- @@ -396,7 +396,7 @@ static int ProcessListObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *list; @@ -447,7 +447,7 @@ static int ProcessStatusObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *dict; @@ -594,7 +594,7 @@ static int ProcessPurgeObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_HashEntry *entry; @@ -692,7 +692,7 @@ static int ProcessAutopurgeObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { diff --git a/generic/tclResult.c b/generic/tclResult.c index c06a73a..ed0f106 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -807,7 +807,7 @@ TclProcessReturn( int TclMergeReturnOptions( Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects. */ Tcl_Obj **optionsPtrPtr, /* If not NULL, points to space for a (Tcl_Obj * *) where the pointer to the merged return diff --git a/generic/tclScan.c b/generic/tclScan.c index b7bd94a..56af7b2 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -588,7 +588,7 @@ int Tcl_ScanObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *format; diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 92632e8..168f835 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -74,7 +74,6 @@ #undef Tcl_UtfToUniCharDString #undef Tcl_UtfToUniChar #undef Tcl_UniCharLen -#undef TclObjInterpProc #if !defined(_WIN32) && !defined(__CYGWIN__) # undef Tcl_WinConvertError # define Tcl_WinConvertError 0 @@ -97,6 +96,13 @@ #define Tcl_GetByteArrayFromObj 0 #define TclUnusedStubEntry 0 +#ifdef TCL_NO_DEPRECATED +# define Tcl_CreateObjCommand 0 +# define Tcl_CreateObjTrace 0 +# define Tcl_NRCallObjProc 0 +# define Tcl_NRCreateCommand 0 +# define TclGetObjInterpProc 0 +#endif #if TCL_UTF_MAX < 4 static void uniCodePanic() { @@ -475,8 +481,8 @@ static const TclIntStubs tclIntStubs = { 0, /* 50 */ TclInterpInit, /* 51 */ 0, /* 52 */ - TclInvokeObjectCommand, /* 53 */ - TclInvokeStringCommand, /* 54 */ + 0, /* 53 */ + 0, /* 54 */ TclIsProc, /* 55 */ 0, /* 56 */ 0, /* 57 */ @@ -485,8 +491,8 @@ static const TclIntStubs tclIntStubs = { TclNeedSpace, /* 60 */ TclNewProcBodyObj, /* 61 */ TclObjCommandComplete, /* 62 */ - TclObjInterpProc, /* 63 */ - TclObjInvoke, /* 64 */ + 0, /* 63 */ + 0, /* 64 */ 0, /* 65 */ 0, /* 66 */ 0, /* 67 */ @@ -660,7 +666,7 @@ static const TclIntStubs tclIntStubs = { TclInitVarHashTable, /* 235 */ 0, /* 236 */ TclResetCancellation, /* 237 */ - TclNRInterpProc, /* 238 */ + 0, /* 238 */ TclNRInterpProcCore, /* 239 */ TclNRRunCallbacks, /* 240 */ TclNREvalObjEx, /* 241 */ diff --git a/generic/tclTest.c b/generic/tclTest.c index b35abe0..4e332a2 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -84,6 +84,17 @@ typedef struct TestAsyncHandler { /* Next is list of handlers. */ } TestAsyncHandler; +#if TCL_MAJOR_VERSION < 9 || !defined(TCL_NO_DEPRECATED) +# undef Tcl_CreateObjCommand2 +# define Tcl_CreateObjCommand2 Tcl_CreateObjCommand +# define Tcl_ObjCmdProc2 Tcl_ObjCmdProc +# undef Tcl_CreateObjTrace2 +# define Tcl_CreateObjTrace2 Tcl_CreateObjTrace +# define TclSizeT int +#else +# define TclSizeT ptrdiff_t +#endif + /* * Start of the socket driver state structure to acces field testFlags */ @@ -205,27 +216,26 @@ static int EncodingFromUtfProc(void *clientData, int *dstCharsPtr); static void ExitProcEven(void *clientData); static void ExitProcOdd(void *clientData); -static Tcl_ObjCmdProc GetTimesObjCmd; +static Tcl_ObjCmdProc2 GetTimesObjCmd; static Tcl_ResolveCompiledVarProc InterpCompiledVarResolver; static void MainLoop(void); static Tcl_CmdProc NoopCmd; -static Tcl_ObjCmdProc NoopObjCmd; +static Tcl_ObjCmdProc2 NoopObjCmd; static int ObjTraceProc(void *clientData, - Tcl_Interp *interp, int level, const char *command, - Tcl_Command commandToken, int objc, + Tcl_Interp *interp, TclSizeT level, const char *command, + Tcl_Command commandToken, TclSizeT objc, Tcl_Obj *const objv[]); static void ObjTraceDeleteProc(void *clientData); static void PrintParse(Tcl_Interp *interp, Tcl_Parse *parsePtr); static void SpecialFree(void *blockPtr); static int StaticInitProc(Tcl_Interp *interp); static Tcl_CmdProc TestasyncCmd; -static Tcl_ObjCmdProc TestbumpinterpepochObjCmd; -static Tcl_ObjCmdProc TestbytestringObjCmd; -static Tcl_ObjCmdProc TestsetbytearraylengthObjCmd; -static Tcl_ObjCmdProc TestpurebytesobjObjCmd; -static Tcl_ObjCmdProc TeststringbytesObjCmd; -static Tcl_ObjCmdProc2 Testcmdobj2ObjCmd; -static Tcl_ObjCmdProc TestcmdinfoObjCmd; +static Tcl_ObjCmdProc2 TestbumpinterpepochObjCmd; +static Tcl_ObjCmdProc2 TestbytestringObjCmd; +static Tcl_ObjCmdProc2 TestsetbytearraylengthObjCmd; +static Tcl_ObjCmdProc2 TestpurebytesobjObjCmd; +static Tcl_ObjCmdProc2 TeststringbytesObjCmd; +static Tcl_ObjCmdProc2 TestcmdinfoObjCmd; static Tcl_CmdProc TestcmdtokenCmd; static Tcl_CmdProc TestcmdtraceCmd; static Tcl_CmdProc TestconcatobjCmd; @@ -233,69 +243,69 @@ static Tcl_CmdProc TestcreatecommandCmd; static Tcl_CmdProc TestdcallCmd; static Tcl_CmdProc TestdelCmd; static Tcl_CmdProc TestdelassocdataCmd; -static Tcl_ObjCmdProc TestdoubledigitsObjCmd; +static Tcl_ObjCmdProc2 TestdoubledigitsObjCmd; static Tcl_CmdProc TestdstringCmd; -static Tcl_ObjCmdProc TestencodingObjCmd; -static Tcl_ObjCmdProc TestevalexObjCmd; -static Tcl_ObjCmdProc TestevalobjvObjCmd; -static Tcl_ObjCmdProc TesteventObjCmd; +static Tcl_ObjCmdProc2 TestencodingObjCmd; +static Tcl_ObjCmdProc2 TestevalexObjCmd; +static Tcl_ObjCmdProc2 TestevalobjvObjCmd; +static Tcl_ObjCmdProc2 TesteventObjCmd; static int TesteventProc(Tcl_Event *event, int flags); static int TesteventDeleteProc(Tcl_Event *event, void *clientData); static Tcl_CmdProc TestexithandlerCmd; static Tcl_CmdProc TestexprlongCmd; -static Tcl_ObjCmdProc TestexprlongobjCmd; +static Tcl_ObjCmdProc2 TestexprlongobjCmd; static Tcl_CmdProc TestexprdoubleCmd; -static Tcl_ObjCmdProc TestexprdoubleobjCmd; -static Tcl_ObjCmdProc TestexprparserObjCmd; +static Tcl_ObjCmdProc2 TestexprdoubleobjCmd; +static Tcl_ObjCmdProc2 TestexprparserObjCmd; static Tcl_CmdProc TestexprstringCmd; -static Tcl_ObjCmdProc TestfileCmd; -static Tcl_ObjCmdProc TestfilelinkCmd; +static Tcl_ObjCmdProc2 TestfileCmd; +static Tcl_ObjCmdProc2 TestfilelinkCmd; static Tcl_CmdProc TestfeventCmd; static Tcl_CmdProc TestgetassocdataCmd; static Tcl_CmdProc TestgetintCmd; static Tcl_CmdProc TestlongsizeCmd; static Tcl_CmdProc TestgetplatformCmd; -static Tcl_ObjCmdProc TestgetvarfullnameCmd; +static Tcl_ObjCmdProc2 TestgetvarfullnameCmd; static Tcl_CmdProc TestinterpdeleteCmd; static Tcl_CmdProc TestlinkCmd; -static Tcl_ObjCmdProc TestlinkarrayCmd; -static Tcl_ObjCmdProc TestlistrepCmd; -static Tcl_ObjCmdProc TestlocaleCmd; +static Tcl_ObjCmdProc2 TestlinkarrayCmd; +static Tcl_ObjCmdProc2 TestlistrepCmd; +static Tcl_ObjCmdProc2 TestlocaleCmd; static Tcl_CmdProc TestmainthreadCmd; static Tcl_CmdProc TestsetmainloopCmd; static Tcl_CmdProc TestexitmainloopCmd; static Tcl_CmdProc TestpanicCmd; -static Tcl_ObjCmdProc TestparseargsCmd; -static Tcl_ObjCmdProc TestparserObjCmd; -static Tcl_ObjCmdProc TestparsevarObjCmd; -static Tcl_ObjCmdProc TestparsevarnameObjCmd; -static Tcl_ObjCmdProc TestpreferstableObjCmd; -static Tcl_ObjCmdProc TestprintObjCmd; -static Tcl_ObjCmdProc TestregexpObjCmd; -static Tcl_ObjCmdProc TestreturnObjCmd; +static Tcl_ObjCmdProc2 TestparseargsCmd; +static Tcl_ObjCmdProc2 TestparserObjCmd; +static Tcl_ObjCmdProc2 TestparsevarObjCmd; +static Tcl_ObjCmdProc2 TestparsevarnameObjCmd; +static Tcl_ObjCmdProc2 TestpreferstableObjCmd; +static Tcl_ObjCmdProc2 TestprintObjCmd; +static Tcl_ObjCmdProc2 TestregexpObjCmd; +static Tcl_ObjCmdProc2 TestreturnObjCmd; static void TestregexpXflags(const char *string, size_t length, int *cflagsPtr, int *eflagsPtr); static Tcl_CmdProc TestsetassocdataCmd; static Tcl_CmdProc TestsetCmd; static Tcl_CmdProc Testset2Cmd; static Tcl_CmdProc TestseterrorcodeCmd; -static Tcl_ObjCmdProc TestsetobjerrorcodeCmd; +static Tcl_ObjCmdProc2 TestsetobjerrorcodeCmd; static Tcl_CmdProc TestsetplatformCmd; static Tcl_CmdProc TeststaticlibraryCmd; static Tcl_CmdProc TesttranslatefilenameCmd; static Tcl_CmdProc TestupvarCmd; static Tcl_ObjCmdProc2 TestWrongNumArgsObjCmd; -static Tcl_ObjCmdProc TestGetIndexFromObjStructObjCmd; +static Tcl_ObjCmdProc2 TestGetIndexFromObjStructObjCmd; static Tcl_CmdProc TestChannelCmd; static Tcl_CmdProc TestChannelEventCmd; static Tcl_CmdProc TestSocketCmd; -static Tcl_ObjCmdProc TestFilesystemObjCmd; -static Tcl_ObjCmdProc TestSimpleFilesystemObjCmd; +static Tcl_ObjCmdProc2 TestFilesystemObjCmd; +static Tcl_ObjCmdProc2 TestSimpleFilesystemObjCmd; static void TestReport(const char *cmd, Tcl_Obj *arg1, Tcl_Obj *arg2); -static Tcl_ObjCmdProc TestgetencpathObjCmd; -static Tcl_ObjCmdProc TestsetencpathObjCmd; +static Tcl_ObjCmdProc2 TestgetencpathObjCmd; +static Tcl_ObjCmdProc2 TestsetencpathObjCmd; static Tcl_Obj * TestReportGetNativePath(Tcl_Obj *pathPtr); static Tcl_FSStatProc TestReportStat; static Tcl_FSAccessProc TestReportAccess; @@ -328,23 +338,23 @@ static Tcl_FSListVolumesProc SimpleListVolumes; static Tcl_FSPathInFilesystemProc SimplePathInFilesystem; static Tcl_Obj * SimpleRedirect(Tcl_Obj *pathPtr); static Tcl_FSMatchInDirectoryProc SimpleMatchInDirectory; -static Tcl_ObjCmdProc TestUtfNextCmd; -static Tcl_ObjCmdProc TestUtfPrevCmd; -static Tcl_ObjCmdProc TestNumUtfCharsCmd; -static Tcl_ObjCmdProc TestFindFirstCmd; -static Tcl_ObjCmdProc TestFindLastCmd; -static Tcl_ObjCmdProc TestHashSystemHashCmd; -static Tcl_ObjCmdProc TestGetIntForIndexCmd; -static Tcl_ObjCmdProc TestLutilCmd; +static Tcl_ObjCmdProc2 TestUtfNextCmd; +static Tcl_ObjCmdProc2 TestUtfPrevCmd; +static Tcl_ObjCmdProc2 TestNumUtfCharsCmd; +static Tcl_ObjCmdProc2 TestFindFirstCmd; +static Tcl_ObjCmdProc2 TestFindLastCmd; +static Tcl_ObjCmdProc2 TestHashSystemHashCmd; +static Tcl_ObjCmdProc2 TestGetIntForIndexCmd; +static Tcl_ObjCmdProc2 TestLutilCmd; static Tcl_NRPostProc NREUnwind_callback; -static Tcl_ObjCmdProc TestNREUnwind; -static Tcl_ObjCmdProc TestNRELevels; -static Tcl_ObjCmdProc TestInterpResolverCmd; +static Tcl_ObjCmdProc2 TestNREUnwind; +static Tcl_ObjCmdProc2 TestNRELevels; +static Tcl_ObjCmdProc2 TestInterpResolverCmd; #if defined(HAVE_CPUID) && !defined(MAC_OSX_TCL) -static Tcl_ObjCmdProc TestcpuidCmd; +static Tcl_ObjCmdProc2 TestcpuidCmd; #endif -static Tcl_ObjCmdProc TestApplyLambdaObjCmd; +static Tcl_ObjCmdProc2 TestApplyLambdaObjCmd; static const Tcl_Filesystem testReportingFilesystem = { "reporting", @@ -546,14 +556,13 @@ Tcltest_Init( } if (Tcl_GetCommandInfo(interp, "::tcl::build-info", &info)) { -#if TCL_MAJOR_VERSION > 8 - if (info.isNativeObjectProc == 2) { - Tcl_CreateObjCommand2(interp, "::tcl::test::build-info", - info.objProc2, (void *)version, NULL); - } else -#endif +#if TCL_MAJOR_VERSION > 8 && defined(TCL_NO_DEPRECATED) + Tcl_CreateObjCommand2(interp, "::tcl::test::build-info", + info.objProc2, (void *)version, NULL); +#else Tcl_CreateObjCommand(interp, "::tcl::test::build-info", info.objProc, (void *)version, NULL); +#endif } if (Tcl_PkgProvideEx(interp, "tcl::test", TCL_PATCH_LEVEL, NULL) == TCL_ERROR) { return TCL_ERROR; @@ -563,23 +572,23 @@ Tcltest_Init( * Create additional commands and math functions for testing Tcl. */ - Tcl_CreateObjCommand(interp, "gettimes", GetTimesObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "gettimes", GetTimesObjCmd, NULL, NULL); Tcl_CreateCommand(interp, "noop", NoopCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "noop", NoopObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testpurebytesobj", TestpurebytesobjObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testsetbytearraylength", TestsetbytearraylengthObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testbytestring", TestbytestringObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "teststringbytes", TeststringbytesObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "noop", NoopObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "testpurebytesobj", TestpurebytesobjObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "testsetbytearraylength", TestsetbytearraylengthObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "testbytestring", TestbytestringObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "teststringbytes", TeststringbytesObjCmd, NULL, NULL); Tcl_CreateObjCommand2(interp, "testwrongnumargs", TestWrongNumArgsObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testfilesystem", TestFilesystemObjCmd, + Tcl_CreateObjCommand2(interp, "testfilesystem", TestFilesystemObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testsimplefilesystem", TestSimpleFilesystemObjCmd, + Tcl_CreateObjCommand2(interp, "testsimplefilesystem", TestSimpleFilesystemObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testgetindexfromobjstruct", + Tcl_CreateObjCommand2(interp, "testgetindexfromobjstruct", TestGetIndexFromObjStructObjCmd, NULL, NULL); Tcl_CreateCommand(interp, "testasync", TestasyncCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testbumpinterpepoch", + Tcl_CreateObjCommand2(interp, "testbumpinterpepoch", TestbumpinterpepochObjCmd, NULL, NULL); Tcl_CreateCommand(interp, "testchannel", TestChannelCmd, NULL, NULL); @@ -587,8 +596,6 @@ Tcltest_Init( NULL, NULL); Tcl_CreateCommand(interp, "testcmdtoken", TestcmdtokenCmd, NULL, NULL); - Tcl_CreateObjCommand2(interp, "testcmdobj2", Testcmdobj2ObjCmd, - NULL, NULL); Tcl_CreateObjCommand(interp, "testcmdinfo", TestcmdinfoObjCmd, NULL, NULL); Tcl_CreateCommand(interp, "testcmdtrace", TestcmdtraceCmd, @@ -601,40 +608,40 @@ Tcltest_Init( Tcl_CreateCommand(interp, "testdel", TestdelCmd, NULL, NULL); Tcl_CreateCommand(interp, "testdelassocdata", TestdelassocdataCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testdoubledigits", TestdoubledigitsObjCmd, + Tcl_CreateObjCommand2(interp, "testdoubledigits", TestdoubledigitsObjCmd, NULL, NULL); Tcl_DStringInit(&dstring); Tcl_CreateCommand(interp, "testdstring", TestdstringCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testencoding", TestencodingObjCmd, NULL, + Tcl_CreateObjCommand2(interp, "testencoding", TestencodingObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testevalex", TestevalexObjCmd, + Tcl_CreateObjCommand2(interp, "testevalex", TestevalexObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testevalobjv", TestevalobjvObjCmd, + Tcl_CreateObjCommand2(interp, "testevalobjv", TestevalobjvObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testevent", TesteventObjCmd, + Tcl_CreateObjCommand2(interp, "testevent", TesteventObjCmd, NULL, NULL); Tcl_CreateCommand(interp, "testexithandler", TestexithandlerCmd, NULL, NULL); Tcl_CreateCommand(interp, "testexprlong", TestexprlongCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testexprlongobj", TestexprlongobjCmd, + Tcl_CreateObjCommand2(interp, "testexprlongobj", TestexprlongobjCmd, NULL, NULL); Tcl_CreateCommand(interp, "testexprdouble", TestexprdoubleCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testexprdoubleobj", TestexprdoubleobjCmd, + Tcl_CreateObjCommand2(interp, "testexprdoubleobj", TestexprdoubleobjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testexprparser", TestexprparserObjCmd, + Tcl_CreateObjCommand2(interp, "testexprparser", TestexprparserObjCmd, NULL, NULL); Tcl_CreateCommand(interp, "testexprstring", TestexprstringCmd, NULL, NULL); Tcl_CreateCommand(interp, "testfevent", TestfeventCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testfilelink", TestfilelinkCmd, + Tcl_CreateObjCommand2(interp, "testfilelink", TestfilelinkCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testfile", TestfileCmd, + Tcl_CreateObjCommand2(interp, "testfile", TestfileCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testhashsystemhash", + Tcl_CreateObjCommand2(interp, "testhashsystemhash", TestHashSystemHashCmd, NULL, NULL); Tcl_CreateCommand(interp, "testgetassocdata", TestgetassocdataCmd, NULL, NULL); @@ -644,30 +651,30 @@ Tcltest_Init( NULL, NULL); Tcl_CreateCommand(interp, "testgetplatform", TestgetplatformCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testgetvarfullname", + Tcl_CreateObjCommand2(interp, "testgetvarfullname", TestgetvarfullnameCmd, NULL, NULL); Tcl_CreateCommand(interp, "testinterpdelete", TestinterpdeleteCmd, NULL, NULL); Tcl_CreateCommand(interp, "testlink", TestlinkCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testlinkarray", TestlinkarrayCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testlistrep", TestlistrepCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testlocale", TestlocaleCmd, NULL, + Tcl_CreateObjCommand2(interp, "testlinkarray", TestlinkarrayCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "testlistrep", TestlistrepCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "testlocale", TestlocaleCmd, NULL, NULL); Tcl_CreateCommand(interp, "testpanic", TestpanicCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testparseargs", TestparseargsCmd,NULL,NULL); - Tcl_CreateObjCommand(interp, "testparser", TestparserObjCmd, + Tcl_CreateObjCommand2(interp, "testparseargs", TestparseargsCmd,NULL,NULL); + Tcl_CreateObjCommand2(interp, "testparser", TestparserObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testparsevar", TestparsevarObjCmd, + Tcl_CreateObjCommand2(interp, "testparsevar", TestparsevarObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testparsevarname", TestparsevarnameObjCmd, + Tcl_CreateObjCommand2(interp, "testparsevarname", TestparsevarnameObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testpreferstable", TestpreferstableObjCmd, + Tcl_CreateObjCommand2(interp, "testpreferstable", TestpreferstableObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testprint", TestprintObjCmd, + Tcl_CreateObjCommand2(interp, "testprint", TestprintObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testregexp", TestregexpObjCmd, + Tcl_CreateObjCommand2(interp, "testregexp", TestregexpObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testreturn", TestreturnObjCmd, + Tcl_CreateObjCommand2(interp, "testreturn", TestreturnObjCmd, NULL, NULL); Tcl_CreateCommand(interp, "testservicemode", TestServiceModeCmd, NULL, NULL); @@ -681,19 +688,19 @@ Tcltest_Init( INT2PTR(TCL_LEAVE_ERR_MSG), NULL); Tcl_CreateCommand(interp, "testseterrorcode", TestseterrorcodeCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testsetobjerrorcode", + Tcl_CreateObjCommand2(interp, "testsetobjerrorcode", TestsetobjerrorcodeCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testutfnext", + Tcl_CreateObjCommand2(interp, "testutfnext", TestUtfNextCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testutfprev", + Tcl_CreateObjCommand2(interp, "testutfprev", TestUtfPrevCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testnumutfchars", + Tcl_CreateObjCommand2(interp, "testnumutfchars", TestNumUtfCharsCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testfindfirst", + Tcl_CreateObjCommand2(interp, "testfindfirst", TestFindFirstCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testfindlast", + Tcl_CreateObjCommand2(interp, "testfindlast", TestFindLastCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testgetintforindex", + Tcl_CreateObjCommand2(interp, "testgetintforindex", TestGetIntForIndexCmd, NULL, NULL); Tcl_CreateCommand(interp, "testsetplatform", TestsetplatformCmd, NULL, NULL); @@ -711,22 +718,22 @@ Tcltest_Init( Tcl_CreateCommand(interp, "testexitmainloop", TestexitmainloopCmd, NULL, NULL); #if defined(HAVE_CPUID) && !defined(MAC_OSX_TCL) - Tcl_CreateObjCommand(interp, "testcpuid", TestcpuidCmd, + Tcl_CreateObjCommand2(interp, "testcpuid", TestcpuidCmd, NULL, NULL); #endif - Tcl_CreateObjCommand(interp, "testnreunwind", TestNREUnwind, + Tcl_CreateObjCommand2(interp, "testnreunwind", TestNREUnwind, NULL, NULL); - Tcl_CreateObjCommand(interp, "testnrelevels", TestNRELevels, + Tcl_CreateObjCommand2(interp, "testnrelevels", TestNRELevels, NULL, NULL); - Tcl_CreateObjCommand(interp, "testinterpresolver", TestInterpResolverCmd, + Tcl_CreateObjCommand2(interp, "testinterpresolver", TestInterpResolverCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testgetencpath", TestgetencpathObjCmd, + Tcl_CreateObjCommand2(interp, "testgetencpath", TestgetencpathObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testsetencpath", TestsetencpathObjCmd, + Tcl_CreateObjCommand2(interp, "testsetencpath", TestsetencpathObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testapplylambda", TestApplyLambdaObjCmd, + Tcl_CreateObjCommand2(interp, "testapplylambda", TestApplyLambdaObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testlutil", TestLutilCmd, + Tcl_CreateObjCommand2(interp, "testlutil", TestLutilCmd, NULL, NULL); if (TclObjTest_Init(interp) != TCL_OK) { @@ -810,14 +817,13 @@ Tcltest_SafeInit( return TCL_ERROR; } if (Tcl_GetCommandInfo(interp, "::tcl::build-info", &info)) { -#if TCL_MAJOR_VERSION > 8 - if (info.isNativeObjectProc == 2) { - Tcl_CreateObjCommand2(interp, "::tcl::test::build-info", - info.objProc2, (void *)version, NULL); - } else -#endif - Tcl_CreateObjCommand(interp, "::tcl::test::build-info", +#if TCL_MAJOR_VERSION > 8 && defined(TCL_NO_DEPRECATED) + Tcl_CreateObjCommand2(interp, "::tcl::test::build-info", + info.objProc2, (void *)version, NULL); +#else + Tcl_CreateObjCommand2(interp, "::tcl::test::build-info", info.objProc, (void *)version, NULL); +#endif } if (Tcl_PkgProvideEx(interp, "tcl::test", TCL_PATCH_LEVEL, NULL) == TCL_ERROR) { return TCL_ERROR; @@ -1048,7 +1054,7 @@ static int TestbumpinterpepochObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *)interp; @@ -1064,40 +1070,6 @@ TestbumpinterpepochObjCmd( /* *---------------------------------------------------------------------- * - * Testcmdobj2 -- - * - * Mock up to test the Tcl_CreateCommandObj2 functionality - * - * Results: - * Standard Tcl result. - * - * Side effects: - * Sets interpreter result to number of arguments, first arg, last arg. - * - *---------------------------------------------------------------------- - */ - -static int -Testcmdobj2ObjCmd( - TCL_UNUSED(void *), - Tcl_Interp *interp, /* Current interpreter. */ - Tcl_Size objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ -{ - Tcl_Obj *resultObj; - resultObj = Tcl_NewListObj(0, NULL); - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewWideIntObj(objc)); - if (objc > 1) { - Tcl_ListObjAppendElement(interp, resultObj, objv[1]); - Tcl_ListObjAppendElement(interp, resultObj, objv[objc-1]); - } - Tcl_SetObjResult(interp, resultObj); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * * TestcmdinfoObjCmd -- * * This procedure implements the "testcmdinfo" command. It is used to @@ -1117,19 +1089,17 @@ static int TestcmdinfoObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const subcmds[] = { - "call", "call2", "create", "delete", "get", "modify", NULL + "create", "delete", "get", "modify", NULL }; enum options { - CMDINFO_CALL, CMDINFO_CALL2, CMDINFO_CREATE, + CMDINFO_CREATE, CMDINFO_DELETE, CMDINFO_GET, CMDINFO_MODIFY } idx; Tcl_CmdInfo info; - Tcl_Obj **cmdObjv; - Tcl_Size cmdObjc; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "command arg"); @@ -1140,29 +1110,6 @@ TestcmdinfoObjCmd( return TCL_ERROR; } switch (idx) { - case CMDINFO_CALL: - case CMDINFO_CALL2: - if (Tcl_ListObjGetElements(interp, objv[2], &cmdObjc, &cmdObjv) != TCL_OK) { - return TCL_ERROR; - } - if (cmdObjc == 0) { - Tcl_AppendResult(interp, "No command name given", NULL); - return TCL_ERROR; - } - if (Tcl_GetCommandInfo(interp, Tcl_GetString(cmdObjv[0]), &info) == 0) { - return TCL_ERROR; - } - if (idx == CMDINFO_CALL) { - /* - * Note when calling through the old 32-bit API, it is the caller's - * responsibility to check that number of arguments is <= INT_MAX. - * We do not do that here just so we can test what happens if the - * caller mistakenly passes more arguments. - */ - return info.objProc(info.objClientData, interp, cmdObjc, cmdObjv); - } else { - return info.objProc2(info.objClientData2, interp, cmdObjc, cmdObjv); - } case CMDINFO_CREATE: Tcl_CreateCommand(interp, Tcl_GetString(objv[2]), @@ -1216,8 +1163,8 @@ TestcmdinfoObjCmd( case CMDINFO_MODIFY: info.proc = CmdProc2; info.clientData = (void *) "new_command_data"; - info.objProc = NULL; - info.objClientData = NULL; + info.objProc2 = NULL; + info.objClientData2 = NULL; info.deleteProc = CmdDelProc2; info.deleteData = (void *) "new_delete_data"; if (Tcl_SetCommandInfo(interp, Tcl_GetString(objv[2]), &info) == 0) { @@ -1463,7 +1410,7 @@ TestcmdtraceCmd( static int deleteCalled; deleteCalled = 0; - cmdTrace = Tcl_CreateObjTrace(interp, 50000, + cmdTrace = Tcl_CreateObjTrace2(interp, 50000, TCL_ALLOW_INLINE_COMPILATION, ObjTraceProc, &deleteCalled, ObjTraceDeleteProc); result = Tcl_EvalEx(interp, argv[2], TCL_INDEX_NONE, 0); @@ -1546,10 +1493,10 @@ static int ObjTraceProc( TCL_UNUSED(void *), Tcl_Interp *interp, /* Tcl interpreter */ - TCL_UNUSED(int) /*level*/, + TCL_UNUSED(TclSizeT) /*level*/, const char *command, TCL_UNUSED(Tcl_Command), - TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(TclSizeT) /*objc*/, Tcl_Obj *const objv[]) /* Argument objects. */ { const char *word = Tcl_GetString(objv[0]); @@ -1869,7 +1816,7 @@ static int TestdoubledigitsObjCmd( TCL_UNUSED(void *), Tcl_Interp* interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + TclSizeT objc, /* Parameter count */ Tcl_Obj* const objv[]) /* Parameter vector */ { static const char *options[] = { @@ -2318,7 +2265,7 @@ static int TestencodingObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Encoding encoding; @@ -2503,7 +2450,7 @@ static int TestevalexObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int flags; @@ -2549,7 +2496,7 @@ static int TestevalobjvObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int evalGlobal; @@ -2598,7 +2545,7 @@ static int TesteventObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + TclSizeT objc, /* Parameter count */ Tcl_Obj *const objv[]) /* Parameter vector */ { static const char *const subcommands[] = { /* Possible subcommands */ @@ -2896,7 +2843,7 @@ static int TestexprlongobjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument objects. */ { long exprResult; @@ -2982,7 +2929,7 @@ static int TestexprdoubleobjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument objects. */ { double exprResult; @@ -3056,7 +3003,7 @@ static int TestfilelinkCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { Tcl_Obj *contents; @@ -3726,7 +3673,7 @@ static int TestlinkarrayCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *LinkOption[] = { @@ -3745,7 +3692,8 @@ TestlinkarrayCmd( TCL_LINK_FLOAT, TCL_LINK_DOUBLE, TCL_LINK_STRING, TCL_LINK_CHARS, TCL_LINK_BINARY }; - int typeIndex, readonly, i, size; + int typeIndex, readonly, size; + TclSizeT i; Tcl_Size length; char *name, *arg; Tcl_WideInt addr; @@ -3845,7 +3793,7 @@ static int TestlistrepCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { /* Subcommands supported by this command */ @@ -4001,7 +3949,7 @@ static int TestlocaleCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { int index; @@ -4087,7 +4035,7 @@ static int TestparserObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { const char *script; @@ -4144,7 +4092,7 @@ static int TestexprparserObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { const char *script; @@ -4293,7 +4241,7 @@ static int TestparsevarObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { const char *value, *name, *termPtr; @@ -4334,7 +4282,7 @@ static int TestparsevarnameObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { const char *script; @@ -4398,7 +4346,7 @@ static int TestpreferstableObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(TclSizeT) /*objc*/, TCL_UNUSED(Tcl_Obj *const *) /*objv*/) { Interp *iPtr = (Interp *) interp; @@ -4428,7 +4376,7 @@ static int TestprintObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { Tcl_WideInt argv1 = 0; @@ -4469,10 +4417,11 @@ static int TestregexpObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int i, indices, match, about; + int indices, match, about; + TclSizeT i; Tcl_Size stringLength, ii; int hasxflags, cflags, eflags; Tcl_RegExp regExpr; @@ -4541,7 +4490,7 @@ TestregexpObjCmd( } endOfForLoop: - if (objc - i < hasxflags + 2 - about) { + if (objc + about < hasxflags + 2 + i) { Tcl_WrongNumArgs(interp, 1, objv, "?-switch ...? exp string ?matchVar? ?subMatchVar ...?"); return TCL_ERROR; @@ -4793,7 +4742,7 @@ static int TestreturnObjCmd( TCL_UNUSED(void *), TCL_UNUSED(Tcl_Interp *), - TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(TclSizeT) /*objc*/, TCL_UNUSED(Tcl_Obj *const *) /*objv*/) { return TCL_RETURN; @@ -5117,7 +5066,7 @@ static int TestsetobjerrorcodeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { Tcl_SetObjErrorCode(interp, Tcl_ConcatObj(objc - 1, objv + 1)); @@ -5236,12 +5185,13 @@ static int TestfileCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int argc, /* Number of arguments. */ + TclSizeT argc, /* Number of arguments. */ Tcl_Obj *const argv[]) /* The argument objects. */ { - int force, i, j, result; + int force, i, result; Tcl_Obj *error = NULL; const char *subcmd; + TclSizeT j; if (argc < 3) { return TCL_ERROR; @@ -5318,7 +5268,7 @@ static int TestgetvarfullnameCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { const char *name, *arg; @@ -5392,7 +5342,7 @@ static int GetTimesObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* The current interpreter. */ - TCL_UNUSED(int) /*cobjc*/, + TCL_UNUSED(TclSizeT) /*cobjc*/, TCL_UNUSED(Tcl_Obj *const *) /*cobjv*/) { Interp *iPtr = (Interp *) interp; @@ -5598,7 +5548,7 @@ static int NoopObjCmd( TCL_UNUSED(void *), TCL_UNUSED(Tcl_Interp *), - TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(TclSizeT) /*objc*/, TCL_UNUSED(Tcl_Obj *const *) /*objv*/) { return TCL_OK; @@ -5623,7 +5573,7 @@ static int TeststringbytesObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { Tcl_Size n; @@ -5663,7 +5613,7 @@ static int TestpurebytesobjObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { Tcl_Obj *objPtr; @@ -5710,7 +5660,7 @@ static int TestsetbytearraylengthObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { int n; @@ -5759,7 +5709,7 @@ static int TestbytestringObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { struct { @@ -6855,7 +6805,7 @@ static int TestWrongNumArgsObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - Tcl_Size objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size i, length; @@ -6907,7 +6857,7 @@ static int TestGetIndexFromObjStructObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *const ary[] = { @@ -6969,7 +6919,7 @@ static int TestFilesystemObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { int res, boolVal; @@ -7340,7 +7290,7 @@ static int TestSimpleFilesystemObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { int res, boolVal; @@ -7502,7 +7452,7 @@ static int TestUtfNextCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { Tcl_Size numBytes; @@ -7563,7 +7513,7 @@ static int TestUtfPrevCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { Tcl_Size numBytes, offset; @@ -7603,7 +7553,7 @@ static int TestNumUtfCharsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { if (objc > 1) { @@ -7632,7 +7582,7 @@ static int TestFindFirstCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { if (objc > 1) { @@ -7654,7 +7604,7 @@ static int TestFindLastCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { if (objc > 1) { @@ -7672,7 +7622,7 @@ static int TestGetIntForIndexCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { Tcl_Size result; @@ -7724,7 +7674,7 @@ static int TestcpuidCmd( TCL_UNUSED(void *), Tcl_Interp* interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + TclSizeT objc, /* Parameter count */ Tcl_Obj *const * objv) /* Parameter vector */ { int status, index, i; @@ -7760,7 +7710,7 @@ static int TestHashSystemHashCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { static const Tcl_HashKeyType hkType = { @@ -7905,7 +7855,7 @@ static int TestNREUnwind( TCL_UNUSED(void *), Tcl_Interp *interp, - TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(TclSizeT) /*objc*/, TCL_UNUSED(Tcl_Obj *const *) /*objv*/) { /* @@ -7923,7 +7873,7 @@ static int TestNRELevels( TCL_UNUSED(void *), Tcl_Interp *interp, - TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(TclSizeT) /*objc*/, TCL_UNUSED(Tcl_Obj *const *) /*objv*/) { Interp *iPtr = (Interp *) interp; @@ -8270,7 +8220,7 @@ static int TestgetencpathObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { if (objc != 1) { @@ -8303,7 +8253,7 @@ static int TestsetencpathObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { if (objc != 2) { @@ -8337,7 +8287,7 @@ static int TestparseargsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Arguments. */ { static int foo = 0; @@ -8576,7 +8526,7 @@ static int TestInterpResolverCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { static const char *const table[] = { @@ -8638,7 +8588,7 @@ TestInterpResolverCmd( int TestApplyLambdaObjCmd ( TCL_UNUSED(void*), Tcl_Interp *interp, /* Current interpreter. */ - TCL_UNUSED(int), /* objc. */ + TCL_UNUSED(TclSizeT), /* objc. */ TCL_UNUSED(Tcl_Obj *const *)) /* objv. */ { Tcl_Obj *lambdaObjs[2]; @@ -8716,7 +8666,7 @@ static int TestLutilCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + TclSizeT objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Arguments. */ { Tcl_Size nL1, nL2; diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index e801a2d..5edbd7c 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -35,15 +35,15 @@ static int CheckIfVarUnset(Tcl_Interp *interp, Tcl_Obj **varPtr, Tcl_Size varIn static int GetVariableIndex(Tcl_Interp *interp, Tcl_Obj *obj, Tcl_Size *indexPtr); static void SetVarToObj(Tcl_Obj **varPtr, Tcl_Size varIndex, Tcl_Obj *objPtr); -static Tcl_ObjCmdProc TestbignumobjCmd; -static Tcl_ObjCmdProc TestbooleanobjCmd; -static Tcl_ObjCmdProc TestdoubleobjCmd; -static Tcl_ObjCmdProc TestindexobjCmd; -static Tcl_ObjCmdProc TestintobjCmd; -static Tcl_ObjCmdProc TestlistobjCmd; -static Tcl_ObjCmdProc TestobjCmd; -static Tcl_ObjCmdProc TeststringobjCmd; -static Tcl_ObjCmdProc TestbigdataCmd; +static Tcl_ObjCmdProc2 TestbignumobjCmd; +static Tcl_ObjCmdProc2 TestbooleanobjCmd; +static Tcl_ObjCmdProc2 TestdoubleobjCmd; +static Tcl_ObjCmdProc2 TestindexobjCmd; +static Tcl_ObjCmdProc2 TestintobjCmd; +static Tcl_ObjCmdProc2 TestlistobjCmd; +static Tcl_ObjCmdProc2 TestobjCmd; +static Tcl_ObjCmdProc2 TeststringobjCmd; +static Tcl_ObjCmdProc2 TestbigdataCmd; #define VARPTR_KEY "TCLOBJTEST_VARPTR" #define NUMBER_OF_OBJECT_VARS 20 @@ -104,22 +104,22 @@ TclObjTest_Init( varPtr[i] = NULL; } - Tcl_CreateObjCommand(interp, "testbignumobj", TestbignumobjCmd, + Tcl_CreateObjCommand2(interp, "testbignumobj", TestbignumobjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testbooleanobj", TestbooleanobjCmd, + Tcl_CreateObjCommand2(interp, "testbooleanobj", TestbooleanobjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testdoubleobj", TestdoubleobjCmd, + Tcl_CreateObjCommand2(interp, "testdoubleobj", TestdoubleobjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testintobj", TestintobjCmd, + Tcl_CreateObjCommand2(interp, "testintobj", TestintobjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testindexobj", TestindexobjCmd, + Tcl_CreateObjCommand2(interp, "testindexobj", TestindexobjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testlistobj", TestlistobjCmd, + Tcl_CreateObjCommand2(interp, "testlistobj", TestlistobjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testobj", TestobjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "teststringobj", TeststringobjCmd, + Tcl_CreateObjCommand2(interp, "testobj", TestobjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "teststringobj", TeststringobjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testbigdata", TestbigdataCmd, + Tcl_CreateObjCommand2(interp, "testbigdata", TestbigdataCmd, NULL, NULL); return TCL_OK; } @@ -146,7 +146,7 @@ static int TestbignumobjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Argument count */ + Tcl_Size objc, /* Argument count */ Tcl_Obj *const objv[]) /* Argument vector */ { const char *const subcmds[] = { @@ -162,7 +162,7 @@ TestbignumobjCmd( mp_int bignumValue; Tcl_Obj **varPtr; - if (objc < 3) { + if (objc + 1 < 4) { Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } @@ -345,7 +345,7 @@ static int TestbooleanobjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size varIndex; @@ -353,7 +353,7 @@ TestbooleanobjCmd( const char *subCmd; Tcl_Obj **varPtr; - if (objc < 3) { + if (objc + 1 < 4) { wrongNumArgs: Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?"); return TCL_ERROR; @@ -445,7 +445,7 @@ static int TestdoubleobjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size varIndex; @@ -453,7 +453,7 @@ TestdoubleobjCmd( const char *subCmd; Tcl_Obj **varPtr; - if (objc < 3) { + if (objc + 1 < 4) { wrongNumArgs: Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?"); return TCL_ERROR; @@ -561,10 +561,11 @@ static int TestindexobjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int allowAbbrev, index, setError, i, result; + int allowAbbrev, index, setError, result; + Tcl_Size i; Tcl_Size index2; const char **argv; static const char *const tablePtr[] = {"a", "b", "check", NULL}; @@ -601,7 +602,7 @@ TestindexobjCmd( return result; } - if (objc < 5) { + if (objc + 1 < 6) { Tcl_AppendToObj(Tcl_GetObjResult(interp), "wrong # args", -1); return TCL_ERROR; } @@ -651,7 +652,7 @@ static int TestintobjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size varIndex; @@ -662,7 +663,7 @@ TestintobjCmd( const char *subCmd; Tcl_Obj **varPtr; - if (objc < 3) { + if (objc + 1 < 4) { wrongNumArgs: Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?"); return TCL_ERROR; @@ -879,7 +880,7 @@ static int TestlistobjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Tcl interpreter */ - int objc, /* Number of arguments */ + Tcl_Size objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* Argument objects */ { /* Subcommands supported by this command */ @@ -905,7 +906,7 @@ TestlistobjCmd( Tcl_Obj **varPtr; Tcl_Size i, len; - if (objc < 3) { + if (objc + 1 < 4) { Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg...?"); return TCL_ERROR; } @@ -1029,7 +1030,7 @@ static int TestobjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size varIndex, destIndex; @@ -1050,7 +1051,7 @@ TestobjCmd( TESTOBJ_INVALIDATESTRINGREP, TESTOBJ_REFCOUNT, TESTOBJ_TYPE, } cmdIndex; - if (objc < 2) { + if (objc + 1 < 3) { wrongNumArgs: Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?"); return TCL_ERROR; @@ -1250,12 +1251,12 @@ static int TeststringobjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_UniChar *unicode; - Tcl_Size size, varIndex; - int option, i; + Tcl_Size size, varIndex, i; + int option; Tcl_Size length; #define MAX_STRINGS 11 const char *string, *strings[MAX_STRINGS+1]; @@ -1267,7 +1268,7 @@ TeststringobjCmd( "appendself2", "newunicode", NULL }; - if (objc < 3) { + if (objc + 1 < 4) { wrongNumArgs: Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?"); return TCL_ERROR; @@ -1547,7 +1548,7 @@ static int TestbigdataCmd ( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const subcmds[] = { diff --git a/generic/tclTestProcBodyObj.c b/generic/tclTestProcBodyObj.c index 381ff02..5ce3274 100644 --- a/generic/tclTestProcBodyObj.c +++ b/generic/tclTestProcBodyObj.c @@ -37,7 +37,7 @@ static const char checkCommand[] = "check"; typedef struct { const char *cmdName; /* command name */ - Tcl_ObjCmdProc *proc; /* command proc */ + Tcl_ObjCmdProc2 *proc; /* command proc */ int exportIt; /* if 1, export the command */ } CmdTable; @@ -45,8 +45,8 @@ typedef struct { * Declarations for functions defined in this file. */ -static Tcl_ObjCmdProc ProcBodyTestProcObjCmd; -static Tcl_ObjCmdProc ProcBodyTestCheckObjCmd; +static Tcl_ObjCmdProc2 ProcBodyTestProcObjCmd; +static Tcl_ObjCmdProc2 ProcBodyTestCheckObjCmd; static int ProcBodyTestInitInternal(Tcl_Interp *interp, int isSafe); static int RegisterCommand(Tcl_Interp* interp, const char *namesp, const CmdTable *cmdTablePtr); @@ -152,7 +152,7 @@ RegisterCommand( } snprintf(buf, sizeof(buf), "%s::%s", namesp, cmdTablePtr->cmdName); - Tcl_CreateObjCommand(interp, buf, cmdTablePtr->proc, 0, 0); + Tcl_CreateObjCommand2(interp, buf, cmdTablePtr->proc, 0, 0); return TCL_OK; } @@ -228,7 +228,7 @@ static int ProcBodyTestProcObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* the current interpreter */ - int objc, /* argument count */ + Tcl_Size objc, /* argument count */ Tcl_Obj *const objv[]) /* arguments */ { const char *fullName; @@ -261,7 +261,7 @@ ProcBodyTestProcObjCmd( * If a procedure, cmdPtr->objClientData is TclIsProc(cmdPtr). */ - if (cmdPtr->objClientData != TclIsProc(cmdPtr)) { + if (cmdPtr->objClientData2 != TclIsProc(cmdPtr)) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "command \"", fullName, "\" is not a Tcl procedure", NULL); return TCL_ERROR; @@ -271,7 +271,7 @@ ProcBodyTestProcObjCmd( * it is a Tcl procedure: the client data is the Proc structure */ - procPtr = (Proc *) cmdPtr->objClientData; + procPtr = (Proc *) cmdPtr->objClientData2; if (procPtr == NULL) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "procedure \"", fullName, "\" does not have a Proc struct!", NULL); @@ -327,7 +327,7 @@ static int ProcBodyTestCheckObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* the current interpreter */ - int objc, /* argument count */ + Tcl_Size objc, /* argument count */ Tcl_Obj *const objv[]) /* arguments */ { const char *version; diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c index c87a7ba..022eee5 100644 --- a/generic/tclThreadTest.c +++ b/generic/tclThreadTest.c @@ -119,7 +119,7 @@ static char *errorProcString; TCL_DECLARE_MUTEX(threadMutex) -static Tcl_ObjCmdProc ThreadObjCmd; +static Tcl_ObjCmdProc2 ThreadObjCmd; static int ThreadCreate(Tcl_Interp *interp, const char *script, int joinable); static int ThreadList(Tcl_Interp *interp); @@ -169,7 +169,7 @@ TclThread_Init( } Tcl_MutexUnlock(&threadMutex); - Tcl_CreateObjCommand(interp, "testthread", ThreadObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "testthread", ThreadObjCmd, NULL, NULL); return TCL_OK; } @@ -205,7 +205,7 @@ static int ThreadObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); @@ -220,7 +220,7 @@ ThreadObjCmd( THREAD_WAIT, THREAD_ERRORPROC } option; - if (objc < 2) { + if (objc + 1 < 3) { Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } @@ -245,7 +245,8 @@ ThreadObjCmd( case THREAD_CANCEL: { Tcl_WideInt id; const char *result; - int flags, arg; + int flags; + Tcl_Size arg; if ((objc < 3) || (objc > 5)) { Tcl_WrongNumArgs(interp, 2, objv, "?-unwind? id ?result?"); diff --git a/generic/tclTimer.c b/generic/tclTimer.c index 0d17fa5..f0bc5fa 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -780,7 +780,7 @@ int Tcl_AfterObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_WideInt ms = 0; /* Number of milliseconds to wait */ diff --git a/generic/tclTrace.c b/generic/tclTrace.c index a527fcc..fe9e4fb 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -52,7 +52,7 @@ typedef struct { * invoked step trace */ int curFlags; /* Trace flags for the current command */ int curCode; /* Return code for the current command */ - size_t refCount; /* Used to ensure this structure is not + Tcl_Size refCount; /* Used to ensure this structure is not * deleted too early. Keeps track of how many * pieces of code have a pointer to this * structure. */ @@ -192,7 +192,7 @@ int Tcl_TraceObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { #ifndef TCL_REMOVE_OBSOLETE_TRACES @@ -2135,6 +2135,7 @@ TraceVarProc( *---------------------------------------------------------------------- */ +#ifndef TCL_NO_DEPRECATED typedef struct { Tcl_CmdObjTraceProc *proc; Tcl_CmdObjTraceDeleteProc *delProc; @@ -2185,6 +2186,7 @@ Tcl_CreateObjTrace( (proc ? traceWrapperProc : NULL), info, traceWrapperDelProc); } +#endif /* TCL_NO_DEPRECATED */ Tcl_Trace Tcl_CreateObjTrace2( diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 07b497b..a229fba 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -103,10 +103,10 @@ static void ClearHash(Tcl_HashTable *tablePtr); static void FreeProcessGlobalValue(void *clientData); static void FreeThreadHash(void *clientData); static int GetEndOffsetFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, - Tcl_WideInt endValue, Tcl_WideInt *indexPtr); + Tcl_Size endValue, Tcl_WideInt *indexPtr); static Tcl_HashTable * GetThreadHash(Tcl_ThreadDataKey *keyPtr); static int GetWideForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr, - Tcl_WideInt endValue, Tcl_WideInt *widePtr); + Tcl_Size endValue, Tcl_WideInt *widePtr); static int FindElement(Tcl_Interp *interp, const char *string, Tcl_Size stringLength, const char *typeStr, const char *typeCode, const char **elementPtr, @@ -3353,12 +3353,13 @@ GetWideForIndex( * NULL, then no error message is left after * errors. */ Tcl_Obj *objPtr, /* Points to the value to be parsed */ - Tcl_WideInt endValue, /* The value to be stored at *widePtr if + Tcl_Size endValue1, /* The value to be stored at *widePtr if * objPtr holds "end". * NOTE: this value may be TCL_INDEX_NONE. */ Tcl_WideInt *widePtr) /* Location filled in with a wide integer * representing an index. */ { + size_t endValue = endValue1; int numType; void *cd; int code = Tcl_GetNumberFromObj(NULL, objPtr, &cd, &numType); @@ -3423,23 +3424,23 @@ Tcl_GetIntForIndex( * errors. */ Tcl_Obj *objPtr, /* Points to an object containing either "end" * or an integer. */ - Tcl_Size endValue, /* The value corresponding to the "end" index */ + Tcl_Size endValue1, /* The value corresponding to the "end" index */ Tcl_Size *indexPtr) /* Location filled in with an integer * representing an index. May be NULL.*/ { Tcl_WideInt wide; + size_t endValue = endValue1; if (GetWideForIndex(interp, objPtr, endValue, &wide) == TCL_ERROR) { return TCL_ERROR; } if (indexPtr != NULL) { - /* Note: check against TCL_SIZE_MAX needed for 32-bit builds */ - if (wide >= 0 && wide <= TCL_SIZE_MAX) { - *indexPtr = (Tcl_Size)wide; - } else if (wide > TCL_SIZE_MAX) { - *indexPtr = TCL_SIZE_MAX; - } else { + if ((wide < 0) && (endValue < (size_t)TCL_INDEX_END)) { *indexPtr = TCL_INDEX_NONE; + } else if ((Tcl_WideUInt)wide > (size_t)TCL_INDEX_END && (endValue < (size_t)TCL_INDEX_END)) { + *indexPtr = TCL_INDEX_END; + } else { + *indexPtr = (Tcl_Size) wide; } } return TCL_OK; @@ -3461,8 +3462,7 @@ Tcl_GetIntForIndex( * -2: Index "end-1" * -1: Index "end" * 0: Index "0" - * WIDE_MAX-1: Index "end+n", for any n > 1. Distinguish from end+1 for - * commands like lset. + * WIDE_MAX-1: Index "end+n", for any n > 1 * WIDE_MAX: Index "end+1" * * Results: @@ -3478,7 +3478,7 @@ static int GetEndOffsetFromObj( Tcl_Interp *interp, Tcl_Obj *objPtr, /* Pointer to the object to parse */ - Tcl_WideInt endValue, /* The value to be stored at "widePtr" if + Tcl_Size endValue1, /* The value to be stored at "widePtr" if * "objPtr" holds "end". */ Tcl_WideInt *widePtr) /* Location filled in with an integer * representing an index. */ @@ -3486,6 +3486,7 @@ GetEndOffsetFromObj( Tcl_ObjInternalRep *irPtr; Tcl_WideInt offset = -1; /* Offset in the "end-offset" expression - 1 */ void *cd; + size_t endValue = endValue1; while ((irPtr = TclFetchInternalRep(objPtr, &endOffsetType.objType)) == NULL) { Tcl_ObjInternalRep ir; @@ -3679,26 +3680,15 @@ GetEndOffsetFromObj( offset = irPtr->wideValue; if (offset == WIDE_MAX) { - /* - * Encodes end+1. This is distinguished from end+n as noted above - * NOTE: this may wrap around if the caller passes (as lset does) - * listLen-1 as endValue and and listLen is 0. The -1 will be - * interpreted as FF...FF and adding 1 will result in 0 which - * is what we want. 2's complements shenanigans but it is what - * it is ... - */ *widePtr = endValue + 1; } else if (offset == WIDE_MIN) { - /* -1 - position before first */ *widePtr = -1; } else if (offset < 0) { - /* end-(n-1) - Different signs, sum cannot overflow */ + /* Different signs, sum cannot overflow */ *widePtr = endValue + offset + 1; } else if (offset < WIDE_MAX) { - /* 0:WIDE_MAX-1 - plain old index. */ *widePtr = offset; } else { - /* Huh, what case remains here? */ *widePtr = WIDE_MAX; } return TCL_OK; @@ -3723,26 +3713,19 @@ GetEndOffsetFromObj( *---------------------------------------------------------------------- * * TclIndexEncode -- - * IMPORTANT: function only encodes indices in the range that fits within - * an "int" type. Do NOT change this as the byte code compiler and engine - * which call this function cannot handle wider index types. Indices - * outside the range will result in the function returning an error. * * Parse objPtr to determine if it is an index value. Two cases * are possible. The value objPtr might be parsed as an absolute - * index value in the Tcl_Size range. Note that this includes + * index value in the C signed int range. Note that this includes * index values that are integers as presented and it includes index - * arithmetic expressions. - * - * The largest string supported in Tcl 8 has byte length TCL_SIZE_MAX. - * This means the largest supported character length is also TCL_SIZE_MAX, - * and the index of the last character in a string of length TCL_SIZE_MAX - * is TCL_SIZE_MAX-1. Thus the absolute index values that can be + * arithmetic expressions. The absolute index values that can be * directly meaningful as an index into either a list or a string are - * integer values in the range 0 to TCL_SIZE_MAX - 1. - * - * This function however can only handle integer indices in the range - * 0 : INT_MAX-1. + * those integer values >= TCL_INDEX_START (0) + * and < INT_MAX. + * The largest string supported in Tcl 8 has bytelength INT_MAX. + * This means the largest supported character length is also INT_MAX, + * and the index of the last character in a string of length INT_MAX + * is INT_MAX-1. * * Any absolute index value parsed outside that range is encoded * using the before and after values passed in by the @@ -3767,9 +3750,12 @@ GetEndOffsetFromObj( * if the tokens "end-0x7FFFFFFF" or "end+-0x80000000" are parsed, * they can be encoded with the before value. * + * These details will require re-examination whenever string and + * list length limits are increased, but that will likely also + * mean a revised routine capable of returning Tcl_WideInt values. + * * Returns: - * TCL_OK if parsing succeeded, and TCL_ERROR if it failed or the - * index does not fit in an int type. + * TCL_OK if parsing succeeded, and TCL_ERROR if it failed. * * Side effects: * When TCL_OK is returned, the encoded index value is written @@ -3782,138 +3768,53 @@ int TclIndexEncode( Tcl_Interp *interp, /* For error reporting, may be NULL */ Tcl_Obj *objPtr, /* Index value to parse */ - int before, /* Value to return for index before beginning */ - int after, /* Value to return for index after end */ + Tcl_Size before1, /* Value to return for index before beginning */ + Tcl_Size after1, /* Value to return for index after end */ int *indexPtr) /* Where to write the encoded answer, not NULL */ { Tcl_WideInt wide; int idx; - const Tcl_WideInt ENDVALUE = 2 * (Tcl_WideInt) INT_MAX; - - assert(ENDVALUE < WIDE_MAX); - if (TCL_OK != GetWideForIndex(interp, objPtr, ENDVALUE, &wide)) { - return TCL_ERROR; - } - /* - * We passed 2*INT_MAX as the "end value" to GetWideForIndex. The computed - * index will in one of the following ranges that need to be distinguished - * for encoding purposes in the following code. - * (1) 0:INT_MAX when - * (a) objPtr was a pure non-negative numeric value in that range - * (b) objPtr was a numeric computation M+/-N with a result in that range - * (c) objPtr was of the form end-N where N was in range INT_MAX:2*INT_MAX - * (2) INT_MAX+1:2*INT_MAX when - * (a,b) as above - * (c) objPtr was of the form end-N where N was in range 0:INT_MAX-1 - * (3) 2*INT_MAX:WIDE_MAX when - * (a,b) as above - * (c) objPtr was of the form end+N - * (4) (2*INT_MAX)-TCL_SIZE_MAX : -1 when - * (a,b) as above - * (c) objPtr was of the form end-N where N was in the range 0:TCL_SIZE_MAX - * (5) WIDE_MIN:(2*INT_MAX)-TCL_SIZE_MAX - * (a,b) as above - * (c) objPtr was of the form end-N where N was > TCL_SIZE_MAX - * - * For all cases (b) and (c), the internal representation of objPtr - * will be shimmered to endOffsetType. That allows us to distinguish between - * (for example) 1a (encodable) and 1c (not encodable) though the computed - * index value is the same. - * - * Further note, the values TCL_SIZE_MAX < N < WIDE_MAX come into play - * only in the 32-bit builds as TCL_SIZE_MAX == WIDE_MAX for 64-bits. - */ - - const Tcl_ObjInternalRep *irPtr = - TclFetchInternalRep(objPtr, &endOffsetType.objType); - - if (irPtr && irPtr->wideValue >= 0) { - /* - * "int[+-]int" syntax, works the same here as "int". - * Note same does not hold for negative integers. - * Distinguishes 1b and 1c where wide will be in 0:INT_MAX for - * both but irPtr->wideValue will be negative for 1c. - */ - irPtr = NULL; - } - - if (irPtr == NULL) { - /* objPtr can be treated as a purely numeric value. */ - - /* - * On 64-bit systems, indices in the range INT_MAX:TCL_SIZE_MAX are - * valid indices but are not in the encodable range. Thus an - * error is raised. On 32-bit systems, indices in that range indicate - * the position after the end and so do not raise an error. - */ - if ((sizeof(int) != sizeof(size_t)) && - (wide > INT_MAX) && (wide < WIDE_MAX-1)) { - /* 2(a,b) on 64-bit systems*/ - goto rangeerror; + size_t before = before1; + size_t after = after1; + + if (TCL_OK == GetWideForIndex(interp, objPtr, (unsigned)TCL_INDEX_END , &wide)) { + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &endOffsetType.objType); + if (irPtr && irPtr->wideValue >= 0) { + /* "int[+-]int" syntax, works the same here as "int" */ + irPtr = NULL; } - if (wide > INT_MAX) { - /* - * 3(a,b) on 64-bit systems and 2(a,b), 3(a,b) on 32-bit systems - * Because of the check above, this case holds for indices - * greater than INT_MAX on 32-bit systems and > TCL_SIZE_MAX - * on 64-bit systems. Always maps to the element after the end. - */ - idx = after; - } else if (wide < 0) { - /* 4(a,b) (32-bit systems), 5(a,b) - before the beginning */ - idx = before; - } else { - /* 1(a,b) Encodable range */ - idx = (int)wide; - } - } else { - /* objPtr is not purely numeric (end etc.) */ - /* - * On 64-bit systems, indices in the range end-LIST_MAX:end-INT_MAX - * are valid indices (with max size strings/lists) but are not in - * the encodable range. Thus an error is raised. On 32-bit systems, - * indices in that range indicate the position before the beginning - * and so do not raise an error. + * We parsed an end+offset index value. + * wide holds the offset value in the range WIDE_MIN...WIDE_MAX. */ - if ((sizeof(int) != sizeof(size_t)) && - (wide > (ENDVALUE - LIST_MAX)) && (wide <= INT_MAX)) { - /* 1(c), 4(a,b) on 64-bit systems */ - goto rangeerror; - } - if (wide > ENDVALUE) { + if ((irPtr ? ((wide < INT_MIN) && ((Tcl_Size)-wide <= LIST_MAX)) + : ((wide > INT_MAX) && ((Tcl_Size)wide <= LIST_MAX))) && (sizeof(int) != sizeof(Tcl_Size))) { + if (interp) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "index \"%s\" out of range", + TclGetString(objPtr))); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX" + "OUTOFRANGE", NULL); + } + return TCL_ERROR; + } else if (wide > (unsigned)(irPtr ? TCL_INDEX_END : INT_MAX)) { /* - * 2(c) (32-bit systems), 3(c) - * All end+positive or end-negative expressions + * All end+postive or end-negative expressions * always indicate "after the end". - * Note we will not reach here for a pure numeric value in this - * range because irPtr will be NULL in that case. */ idx = after; - } else if (wide <= INT_MAX) { - /* 1(c) (32-bit systems), 4(c) (32-bit systems), 5(c) */ + } else if (wide <= (irPtr ? INT_MAX : -1)) { + /* These indices always indicate "before the beginning" */ idx = before; } else { - /* 2(c) Encodable end-positive (or end+negative) */ + /* Encoded end-positive (or end+negative) are offset */ idx = (int)wide; } + } else { + return TCL_ERROR; } *indexPtr = idx; return TCL_OK; - -rangeerror: - if (interp) { - Tcl_SetObjResult( - interp, - Tcl_ObjPrintf("index \"%s\" out of range", TclGetString(objPtr))); - Tcl_SetErrorCode(interp, - "TCL", - "VALUE", - "INDEX" - "OUTOFRANGE", - NULL); - } - return TCL_ERROR; } /* @@ -3934,14 +3835,14 @@ rangeerror: Tcl_Size TclIndexDecode( int encoded, /* Value to decode */ - Tcl_Size endValue) /* Meaning of "end" to use, > TCL_INDEX_END */ + Tcl_Size endValue1) /* Meaning of "end" to use, > TCL_INDEX_END */ { - if (encoded > TCL_INDEX_END) { + size_t endValue = endValue1; + if (encoded > (int)TCL_INDEX_END) { return encoded; } - endValue += encoded - TCL_INDEX_END; - if (endValue >= 0) { - return endValue; + if (endValue >= (size_t)TCL_INDEX_END - encoded) { + return endValue + encoded - TCL_INDEX_END; } return TCL_INDEX_NONE; } @@ -4606,7 +4507,7 @@ TclReToGlob( invalidGlob: if (interp != NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(msg, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(msg, TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "RE2GLOB", code, NULL); } Tcl_DStringFree(dsPtr); diff --git a/generic/tclVar.c b/generic/tclVar.c index 550d7a6..202e81b 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -185,7 +185,7 @@ static void ArrayPopulateSearch(Tcl_Interp *interp, static void ArrayDoneSearch(Interp *iPtr, Var *varPtr, ArraySearch *searchPtr); static Tcl_NRPostProc ArrayForLoopCallback; -static Tcl_ObjCmdProc ArrayForNRCmd; +static Tcl_ObjCmdProc2 ArrayForNRCmd; static void DeleteSearches(Interp *iPtr, Var *arrayVarPtr); static void DeleteArray(Interp *iPtr, Tcl_Obj *arrayNamePtr, Var *varPtr, int flags, int index); @@ -209,7 +209,7 @@ static void UnsetVarStruct(Var *varPtr, Var *arrayPtr, * TIP #508: [array default] */ -static Tcl_ObjCmdProc ArrayDefaultCmd; +static Tcl_ObjCmdProc2 ArrayDefaultCmd; static void DeleteArrayVar(Var *arrayPtr); static void SetArrayDefault(Var *arrayPtr, Tcl_Obj *defaultObj); @@ -1479,7 +1479,7 @@ int Tcl_SetObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp,/* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *varValueObj; @@ -2694,10 +2694,11 @@ int Tcl_UnsetObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - int i, flags = TCL_LEAVE_ERR_MSG; + Tcl_Size i; + int flags = TCL_LEAVE_ERR_MSG; const char *name; if (objc == 1) { @@ -2761,13 +2762,13 @@ int Tcl_AppendObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Var *varPtr, *arrayPtr; Tcl_Obj *varValuePtr = NULL; /* Initialized to avoid compiler warning. */ - int i; + Tcl_Size i; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "varName ?value ...?"); @@ -2826,7 +2827,7 @@ int Tcl_LappendObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *varValuePtr, *newValuePtr; @@ -3032,17 +3033,17 @@ static int ArrayForObjCmd( void *clientData, Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, ArrayForNRCmd, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, ArrayForNRCmd, clientData, objc, objv); } static int ArrayForNRCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *varListObj, *arrayNameObj, *scriptObj; @@ -3273,7 +3274,7 @@ static int ArrayStartSearchCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Var *varPtr; @@ -3368,7 +3369,7 @@ static int ArrayAnyMoreCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *) interp; @@ -3446,7 +3447,7 @@ static int ArrayNextElementCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Var *varPtr; @@ -3526,7 +3527,7 @@ static int ArrayDoneSearchCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *) interp; @@ -3586,7 +3587,7 @@ static int ArrayExistsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *)interp; @@ -3626,7 +3627,7 @@ static int ArrayGetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Var *varPtr, *varPtr2; @@ -3786,7 +3787,7 @@ static int ArrayNamesCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { static const char *const options[] = { @@ -3953,7 +3954,7 @@ static int ArraySetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *arrayNameObj; @@ -4134,7 +4135,7 @@ static int ArraySizeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Var *varPtr; @@ -4193,7 +4194,7 @@ static int ArrayStatsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Var *varPtr; @@ -4247,7 +4248,7 @@ static int ArrayUnsetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Var *varPtr, *varPtr2, *protectedVarPtr; @@ -4815,14 +4816,15 @@ int Tcl_GlobalObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; Tcl_Obj *objPtr, *tailPtr; const char *varName; const char *tail; - int result, i; + int result; + Tcl_Size i; /* * If we are not executing inside a Tcl procedure, just return. @@ -4919,14 +4921,15 @@ int Tcl_VariableObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; const char *varName, *tail, *cp; Var *varPtr, *arrayPtr; Tcl_Obj *varValuePtr; - int i, result; + Tcl_Size i; + int result; Tcl_Obj *varNamePtr, *tailPtr; for (i=1 ; i<objc ; i+=2) { @@ -5052,7 +5055,7 @@ int Tcl_UpvarObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { CallFrame *framePtr; @@ -5868,7 +5871,7 @@ int TclInfoVarsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -6059,7 +6062,7 @@ int TclInfoGlobalsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *varName, *pattern; @@ -6152,7 +6155,7 @@ int TclInfoLocalsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -6459,7 +6462,7 @@ static int ArrayDefaultCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const options[] = { diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 48e7415..f6ba715 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -2218,7 +2218,7 @@ static int ZipFSMountObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *mountPoint = NULL, *zipFile = NULL, *password = NULL; @@ -2275,7 +2275,7 @@ static int ZipFSMountBufferObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { const char *mountPoint; /* Mount point path. */ @@ -2330,7 +2330,7 @@ static int ZipFSRootObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(Tcl_Size) /*objc*/, TCL_UNUSED(Tcl_Obj *const *)) /*objv*/ { Tcl_SetObjResult(interp, Tcl_NewStringObj(ZIPFS_VOLUME, -1)); @@ -2357,7 +2357,7 @@ static int ZipFSUnmountObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc != 2) { @@ -2388,7 +2388,7 @@ static int ZipFSMkKeyObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Size len, i = 0; @@ -3465,7 +3465,7 @@ static int ZipFSMkZipObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *stripPrefix, *password; @@ -3490,7 +3490,7 @@ static int ZipFSLMkZipObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *password; @@ -3531,7 +3531,7 @@ static int ZipFSMkImgObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *originFile, *stripPrefix, *password; @@ -3558,7 +3558,7 @@ static int ZipFSLMkImgObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *originFile, *password; @@ -3600,7 +3600,7 @@ static int ZipFSCanonicalObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { char *mntpoint = NULL; @@ -3656,7 +3656,7 @@ static int ZipFSExistsObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { char *filename; @@ -3709,7 +3709,7 @@ static int ZipFSInfoObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { char *filename; @@ -3759,7 +3759,7 @@ static int ZipFSListObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { char *pattern = NULL; @@ -3958,7 +3958,7 @@ static int ZipFSTclLibraryObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(Tcl_Size) /*objc*/, TCL_UNUSED(Tcl_Obj *const *)) /*objv*/ { if (!Tcl_IsSafe(interp)) { @@ -5681,7 +5681,7 @@ TclZipfs_Init( Tcl_GetEnsembleMappingDict(NULL, ensemble, &mapObj); Tcl_DictObjPut(NULL, mapObj, Tcl_NewStringObj("find", -1), Tcl_NewStringObj("::tcl::zipfs::find", -1)); - Tcl_CreateObjCommand(interp, "::tcl::zipfs::tcl_library_init", + Tcl_CreateObjCommand2(interp, "::tcl::zipfs::tcl_library_init", ZipFSTclLibraryObjCmd, NULL, NULL); Tcl_PkgProvide(interp, "tcl::zipfs", "2.0"); } diff --git a/generic/tclZlib.c b/generic/tclZlib.c index e083243..d2f5db1 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -171,11 +171,11 @@ static Tcl_DriverInputProc ZlibTransformInput; static Tcl_DriverOutputProc ZlibTransformOutput; static Tcl_DriverSetOptionProc ZlibTransformSetOption; static Tcl_DriverWatchProc ZlibTransformWatch; -static Tcl_ObjCmdProc ZlibCmd; -static Tcl_ObjCmdProc ZlibStreamCmd; -static Tcl_ObjCmdProc ZlibStreamAddCmd; -static Tcl_ObjCmdProc ZlibStreamHeaderCmd; -static Tcl_ObjCmdProc ZlibStreamPutCmd; +static Tcl_ObjCmdProc2 ZlibCmd; +static Tcl_ObjCmdProc2 ZlibStreamCmd; +static Tcl_ObjCmdProc2 ZlibStreamAddCmd; +static Tcl_ObjCmdProc2 ZlibStreamHeaderCmd; +static Tcl_ObjCmdProc2 ZlibStreamPutCmd; static void ConvertError(Tcl_Interp *interp, int code, uLong adler); @@ -185,7 +185,7 @@ static inline int Deflate(z_streamp strm, void *bufferPtr, static void ExtractHeader(gz_header *headerPtr, Tcl_Obj *dictObj); static int GenerateHeader(Tcl_Interp *interp, Tcl_Obj *dictObj, GzipHeader *headerPtr, int *extraSizePtr); -static int ZlibPushSubcmd(Tcl_Interp *interp, int objc, +static int ZlibPushSubcmd(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); static int ResultDecompress(ZlibChannelData *cd, char *buf, int toRead, int flush, int *errorCodePtr); @@ -194,7 +194,7 @@ static Tcl_Channel ZlibStackChannelTransform(Tcl_Interp *interp, Tcl_Channel channel, Tcl_Obj *gzipHeaderDictPtr, Tcl_Obj *compDictObj); static void ZlibStreamCleanup(ZlibStreamHandle *zshPtr); -static int ZlibStreamSubcmd(Tcl_Interp *interp, int objc, +static int ZlibStreamSubcmd(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); static inline void ZlibTransformEventTimerKill(ZlibChannelData *cd); static void ZlibTransformTimerRun(void *clientData); @@ -860,7 +860,7 @@ Tcl_ZlibStreamInit( * Create the command. */ - zshPtr->cmd = Tcl_CreateObjCommand(interp, Tcl_DStringValue(&cmdname), + zshPtr->cmd = Tcl_CreateObjCommand2(interp, Tcl_DStringValue(&cmdname), ZlibStreamCmd, zshPtr, ZlibStreamCmdDelete); Tcl_DStringFree(&cmdname); if (zshPtr->cmd == NULL) { @@ -1986,14 +1986,12 @@ static int ZlibCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { - int i, option, level = -1; - size_t buffersize = 0; - Tcl_Size dlen = 0; - unsigned int start; - Tcl_WideInt wideLen; + int option, level = -1; + Tcl_Size i, dlen = 0, buffersize = 0; + Tcl_WideInt wideLen, start; Byte *data; Tcl_Obj *headerDictObj; const char *extraInfoStr = NULL; @@ -2027,8 +2025,8 @@ ZlibCmd( if (data == NULL) { return TCL_ERROR; } - if (objc>3 && Tcl_GetIntFromObj(interp, objv[3], - (int *) &start) != TCL_OK) { + if (objc>3 && Tcl_GetWideIntFromObj(interp, objv[3], + &start) != TCL_OK) { return TCL_ERROR; } if (objc < 4) { @@ -2266,7 +2264,7 @@ ZlibCmd( static int ZlibStreamSubcmd( Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { static const char *const stream_formats[] = { @@ -2277,7 +2275,8 @@ ZlibStreamSubcmd( FMT_COMPRESS, FMT_DECOMPRESS, FMT_DEFLATE, FMT_GUNZIP, FMT_GZIP, FMT_INFLATE } fmt; - int i, format, mode = 0, option, level; + Tcl_Size i; + int format, mode = 0, option, level; enum objIndices { OPT_COMPRESSION_DICTIONARY = 0, OPT_GZIP_HEADER = 1, @@ -2426,7 +2425,7 @@ ZlibStreamSubcmd( static int ZlibPushSubcmd( Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { static const char *const stream_formats[] = { @@ -2438,7 +2437,7 @@ ZlibPushSubcmd( FMT_INFLATE } fmt; Tcl_Channel chan; - int chanMode, format, mode = 0, level, i; + int chanMode, format, mode = 0, level; static const char *const pushCompressOptions[] = { "-dictionary", "-header", "-level", NULL }; @@ -2449,7 +2448,7 @@ ZlibPushSubcmd( enum pushOptionsEnum {poDictionary, poHeader, poLevel, poLimit} option; Tcl_Obj *headerObj = NULL, *compDictObj = NULL; int limit = DEFAULT_BUFFER_SIZE; - Tcl_Size dummy; + Tcl_Size i, dummy; if (objc < 4) { Tcl_WrongNumArgs(interp, 2, objv, "mode channel ?options...?"); @@ -2605,7 +2604,7 @@ static int ZlibStreamCmd( void *cd, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_ZlibStream zstream = (Tcl_ZlibStream)cd; @@ -2731,11 +2730,12 @@ static int ZlibStreamAddCmd( void *cd, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_ZlibStream zstream = (Tcl_ZlibStream)cd; - int code, buffersize = -1, flush = -1, i; + int code, buffersize = -1, flush = -1; + Tcl_Size i; Tcl_Obj *obj, *compDictObj = NULL; static const char *const add_options[] = { "-buffer", "-dictionary", "-finalize", "-flush", "-fullflush", NULL @@ -2858,11 +2858,12 @@ static int ZlibStreamPutCmd( void *cd, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_ZlibStream zstream = (Tcl_ZlibStream)cd; - int flush = -1, i; + int flush = -1; + Tcl_Size i; Tcl_Obj *compDictObj = NULL; static const char *const put_options[] = { "-dictionary", "-finalize", "-flush", "-fullflush", NULL @@ -2949,7 +2950,7 @@ static int ZlibStreamHeaderCmd( void *cd, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { ZlibStreamHandle *zshPtr = (ZlibStreamHandle *)cd; @@ -3985,7 +3986,7 @@ TclZlibInit( * Create the public scripted interface to this file's functionality. */ - Tcl_CreateObjCommand(interp, "zlib", ZlibCmd, 0, 0); + Tcl_CreateObjCommand2(interp, "zlib", ZlibCmd, 0, 0); /* * Store the underlying configuration information. diff --git a/library/init.tcl b/library/init.tcl index 52ae079..5b24df6 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -19,7 +19,7 @@ if {[info commands package] == ""} { error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" } -package require -exact tcl 9.0a4 +package require -exact tcl 9.1a0 # Compute the auto path to use in this interpreter. # The values on the path come from several locations: diff --git a/macosx/tclMacOSXBundle.c b/macosx/tclMacOSXBundle.c index 5388238..ee96f44 100644 --- a/macosx/tclMacOSXBundle.c +++ b/macosx/tclMacOSXBundle.c @@ -248,7 +248,7 @@ Tcl_MacOSXOpenVersionedBundleResources( */ CFURLGetFileSystemRepresentation(libURL, TRUE, - (unsigned char *) libraryPath, maxPathLen); + (unsigned char *) libraryPath, (CFIndex)maxPathLen); CFRelease(libURL); } if (versionedBundleRef) { diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c index a30c8fb..e5cbfb1 100644 --- a/macosx/tclMacOSXFCmd.c +++ b/macosx/tclMacOSXFCmd.c @@ -715,7 +715,7 @@ UpdateStringOfOSType( /* dstWrotePtr */ &written, /* dstCharsPtr */ NULL); Tcl_FreeEncoding(encoding); - (void)Tcl_InitStringRep(objPtr, NULL, written); + (void)Tcl_InitStringRep(objPtr, NULL, (size_t)written); } /* diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c index 7bf0fb3..3f9108e 100644 --- a/macosx/tclMacOSXNotify.c +++ b/macosx/tclMacOSXNotify.c @@ -1820,7 +1820,7 @@ TclUnixWaitForFile( while (1) { if (timeout > 0) { blockTime.tv_sec = abortTime.sec - now.sec; - blockTime.tv_usec = abortTime.usec - now.usec; + blockTime.tv_usec = (int)(abortTime.usec - now.usec); if (blockTime.tv_usec < 0) { blockTime.tv_sec -= 1; blockTime.tv_usec += 1000000; @@ -2119,7 +2119,7 @@ NotifierThreadProc( */ if (FD_ISSET(receivePipe, &readableMask)) { - i = read(receivePipe, buf, 1); + i = (int)read(receivePipe, buf, 1); if ((i == 0) || ((i == 1) && (buf[0] == 'q'))) { /* diff --git a/tests/cmdInfo.test b/tests/cmdInfo.test index 37b8a0b..d172226 100644 --- a/tests/cmdInfo.test +++ b/tests/cmdInfo.test @@ -36,7 +36,7 @@ test cmdinfo-1.3 {command procedure and clientData} {testcmdinfo} { testcmdinfo create x1 testcmdinfo modify x1 testcmdinfo get x1 -} {CmdProc2 new_command_data CmdDelProc2 new_delete_data :: stringProc} +} {CmdProc2 new_command_data CmdDelProc2 new_delete_data :: nativeObjectProc2} test cmdinfo-1.4 {command procedure and clientData} {testcmdinfo} { testcmdinfo create x1 testcmdinfo modify x1 diff --git a/tests/indexObj.test b/tests/indexObj.test index 4c01210..b2cb912 100644 --- a/tests/indexObj.test +++ b/tests/indexObj.test @@ -19,7 +19,6 @@ catch [list package require -exact tcl::test [info patchlevel]] testConstraint testindexobj [llength [info commands testindexobj]] testConstraint testgetintforindex [llength [info commands testgetintforindex]] testConstraint testparseargs [llength [info commands testparseargs]] -testConstraint has64BitLengths [expr {$tcl_platform(pointerSize) == 8}] test indexObj-1.1 {exact match} testindexobj { testindexobj 1 1 xyz abc def xyz alm @@ -185,7 +184,7 @@ test indexObj-8.4 {Tcl_GetIntForIndex INT_MAX} testgetintforindex { } 2147483647 test indexObj-8.5 {Tcl_GetIntForIndex INT_MAX+1} testgetintforindex { testgetintforindex 2147483648 0 -} [expr {[testConstraint has64BitLengths] ? 2147483648 : 2147483647}] +} 2147483648 test indexObj-8.6 {Tcl_GetIntForIndex end-1} testgetintforindex { testgetintforindex end-1 2147483646 } 2147483645 @@ -200,16 +199,16 @@ test indexObj-8.9 {Tcl_GetIntForIndex end} testgetintforindex { } 2147483647 test indexObj-8.10 {Tcl_GetIntForIndex end-1} testgetintforindex { testgetintforindex end-1 -1 -} -1 +} -2 test indexObj-8.11 {Tcl_GetIntForIndex end-1} testgetintforindex { testgetintforindex end-1 -2 -} -1 +} -3 test indexObj-8.12 {Tcl_GetIntForIndex end} testgetintforindex { testgetintforindex end -1 } -1 test indexObj-8.13 {Tcl_GetIntForIndex end} testgetintforindex { testgetintforindex end -2 -} -1 +} -2 test indexObj-8.14 {Tcl_GetIntForIndex end+1} testgetintforindex { testgetintforindex end+1 -1 } 0 diff --git a/tests/lseq.test b/tests/lseq.test index 6bf89eb..af438c6 100644 --- a/tests/lseq.test +++ b/tests/lseq.test @@ -559,7 +559,7 @@ test lseq-4.12 {bug lseq} -constraints has64BitLengths -body { llength [lseq 0x100000000] } -result {4294967296} -test lseq-4.13 {bug lseq} -constraints has64BitLengths -body { +test lseq-4.13 {bug lseq} -constraints knownBug -body { set l [lseq 0x7fffffffffffffff] list \ [llength $l] \ diff --git a/tools/tsdPerf.c b/tools/tsdPerf.c index 0bcc11b..881ff1d 100644 --- a/tools/tsdPerf.c +++ b/tools/tsdPerf.c @@ -10,7 +10,7 @@ typedef struct { static int -tsdPerfSetObjCmd(void *cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { +tsdPerfSetObjCmd(void *cdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const *objv) { TsdPerf *perf = Tcl_GetThreadData(&key, sizeof(TsdPerf)); Tcl_WideInt i; @@ -29,7 +29,7 @@ tsdPerfSetObjCmd(void *cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv } static int -tsdPerfGetObjCmd(void *cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { +tsdPerfGetObjCmd(void *cdata, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const *objv) { TsdPerf *perf = Tcl_GetThreadData(&key, sizeof(TsdPerf)); @@ -40,12 +40,12 @@ tsdPerfGetObjCmd(void *cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv int Tsdperf_Init(Tcl_Interp *interp) { - if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { + if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) { return TCL_ERROR; } - Tcl_CreateObjCommand(interp, "tsdPerfSet", tsdPerfSetObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "tsdPerfGet", tsdPerfGetObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "tsdPerfSet", tsdPerfSetObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "tsdPerfGet", tsdPerfGetObjCmd, NULL, NULL); return TCL_OK; } diff --git a/unix/configure b/unix/configure index 4c54fbe..b8da11a 100755 --- a/unix/configure +++ b/unix/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for tcl 9.0. +# Generated by GNU Autoconf 2.71 for tcl 9.1. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tcl' PACKAGE_TARNAME='tcl' -PACKAGE_VERSION='9.0' -PACKAGE_STRING='tcl 9.0' +PACKAGE_VERSION='9.1' +PACKAGE_STRING='tcl 9.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1372,7 +1372,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 tcl 9.0 to adapt to many kinds of systems. +\`configure' configures tcl 9.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1434,7 +1434,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tcl 9.0:";; + short | recursive ) echo "Configuration of tcl 9.1:";; esac cat <<\_ACEOF @@ -1551,7 +1551,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tcl configure 9.0 +tcl configure 9.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2019,7 +2019,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 tcl $as_me 9.0, which was +It was created by tcl $as_me 9.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2681,10 +2681,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -TCL_VERSION=9.0 +TCL_VERSION=9.1 TCL_MAJOR_VERSION=9 -TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="a4" +TCL_MINOR_VERSION=1 +TCL_PATCH_LEVEL="a0" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} @@ -11823,7 +11823,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 tcl $as_me 9.0, which was +This file was extended by tcl $as_me 9.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11882,7 +11882,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -tcl config.status 9.0 +tcl config.status 9.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/unix/configure.ac b/unix/configure.ac index 238e47a..bcef7d4 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. -AC_INIT([tcl],[9.0]) +AC_INIT([tcl],[9.1]) AC_PREREQ([2.69]) dnl This is only used when included from macosx/configure.ac @@ -23,10 +23,10 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ #endif /* _TCLCONFIG */]) ]) -TCL_VERSION=9.0 +TCL_VERSION=9.1 TCL_MAJOR_VERSION=9 -TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="a4" +TCL_MINOR_VERSION=1 +TCL_PATCH_LEVEL="a0" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/unix/dltest/Makefile.in b/unix/dltest/Makefile.in index e8dce2f..05d9ebb 100644 --- a/unix/dltest/Makefile.in +++ b/unix/dltest/Makefile.in @@ -27,13 +27,13 @@ CC_SWITCHES = $(CFLAGS) -I${SRC_DIR}/../../generic -DTCL_MEM_DEBUG \ all: embtest tcl9pkga${SHLIB_SUFFIX} tcl9pkgb${SHLIB_SUFFIX} tcl9pkgc${SHLIB_SUFFIX} \ tcl9pkgd${SHLIB_SUFFIX} tcl9pkge${SHLIB_SUFFIX} tcl9pkgt${SHLIB_SUFFIX} tcl9pkgua${SHLIB_SUFFIX} \ - tcl9pkgooa${SHLIB_SUFFIX} pkga${SHLIB_SUFFIX} pkgb${SHLIB_SUFFIX} pkgc${SHLIB_SUFFIX} pkgt${SHLIB_SUFFIX} + tcl9pkgooa${SHLIB_SUFFIX} @if test -n "$(DLTEST_SUFFIX)"; then $(MAKE) dltest_suffix; fi @touch ../dltest.marker dltest_suffix: tcl9pkga${DLTEST_SUFFIX} tcl9pkgb${DLTEST_SUFFIX} tcl9pkgc${DLTEST_SUFFIX} \ tcl9pkgd${DLTEST_SUFFIX} tcl9pkge${DLTEST_SUFFIX} tcl9pkgt${DLTEST_SUFFIX} tcl9pkgua${DLTEST_SUFFIX} \ - tcl9pkgooa${DLTEST_SUFFIX} pkga${DLTEST_SUFFIX} pkgb${DLTEST_SUFFIX} pkgc${DLTEST_SUFFIX} pkgt${DLTEST_SUFFIX} + tcl9pkgooa${DLTEST_SUFFIX} @touch ../dltest.marker embtest.o: $(SRC_DIR)/embtest.c @@ -54,18 +54,6 @@ pkgc.o: $(SRC_DIR)/pkgc.c pkgt.o: $(SRC_DIR)/pkgt.c $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgt.c -tcl8pkga.o: $(SRC_DIR)/pkga.c - $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(SRC_DIR)/pkga.c - -tcl8pkgb.o: $(SRC_DIR)/pkgb.c - $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(SRC_DIR)/pkgb.c - -tcl8pkgc.o: $(SRC_DIR)/pkgc.c - $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(SRC_DIR)/pkgc.c - -tcl8pkgt.o: $(SRC_DIR)/pkgt.c - $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(SRC_DIR)/pkgt.c - pkgd.o: $(SRC_DIR)/pkgd.c $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgd.c @@ -96,18 +84,6 @@ tcl9pkgc${SHLIB_SUFFIX}: pkgc.o tcl9pkgt${SHLIB_SUFFIX}: pkgt.o ${SHLIB_LD} -o $@ pkgt.o ${SHLIB_LD_LIBS} -pkga${SHLIB_SUFFIX}: tcl8pkga.o - ${SHLIB_LD} -o $@ tcl8pkga.o ${SHLIB_LD_LIBS} - -pkgb${SHLIB_SUFFIX}: tcl8pkgb.o - ${SHLIB_LD} -o $@ tcl8pkgb.o ${SHLIB_LD_LIBS} - -pkgc${SHLIB_SUFFIX}: tcl8pkgc.o - ${SHLIB_LD} -o $@ tcl8pkgc.o ${SHLIB_LD_LIBS} - -pkgt${SHLIB_SUFFIX}: tcl8pkgt.o - ${SHLIB_LD} -o $@ tcl8pkgt.o ${SHLIB_LD_LIBS} - tcl9pkgd${SHLIB_SUFFIX}: pkgd.o ${SHLIB_LD} -o $@ pkgd.o ${SHLIB_LD_LIBS} @@ -135,18 +111,6 @@ tcl9pkgc${DLTEST_SUFFIX}: pkgc.o tcl9pkgt${DLTEST_SUFFIX}: pkgt.o ${DLTEST_LD} -o $@ pkgt.o ${SHLIB_LD_LIBS} -pkga${DLTEST_SUFFIX}: tcl8pkga.o - ${DLTEST_LD} -o $@ tcl8pkga.o ${SHLIB_LD_LIBS} - -pkgb${DLTEST_SUFFIX}: tcl8pkgb.o - ${DLTEST_LD} -o $@ tcl8pkgb.o ${SHLIB_LD_LIBS} - -pkgc${DLTEST_SUFFIX}: tcl8pkgc.o - ${DLTEST_LD} -o $@ tcl8pkgc.o ${SHLIB_LD_LIBS} - -pkgt${DLTEST_SUFFIX}: tcl8pkgt.o - ${DLTEST_LD} -o $@ tcl8pkgt.o ${SHLIB_LD_LIBS} - tcl9pkgd${DLTEST_SUFFIX}: pkgd.o ${DLTEST_LD} -o $@ pkgd.o ${SHLIB_LD_LIBS} diff --git a/unix/dltest/pkga.c b/unix/dltest/pkga.c index be0a492..7c45f90 100644 --- a/unix/dltest/pkga.c +++ b/unix/dltest/pkga.c @@ -35,7 +35,7 @@ static int Pkga_EqObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int result; @@ -80,7 +80,7 @@ static int Pkga_QuoteObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ { (void)dummy; @@ -124,8 +124,8 @@ Pkga_Init( if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkga_eq", Pkga_EqObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "pkga_quote", Pkga_QuoteObjCmd, NULL, + Tcl_CreateObjCommand2(interp, "pkga_eq", Pkga_EqObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "pkga_quote", Pkga_QuoteObjCmd, NULL, NULL); return TCL_OK; } diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c index 9e834ea..2907ec2 100644 --- a/unix/dltest/pkgb.c +++ b/unix/dltest/pkgb.c @@ -38,7 +38,7 @@ static int Pkgb_SubObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int first, second; @@ -80,7 +80,7 @@ static int Pkgb_UnsafeObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { (void)dummy; @@ -94,7 +94,7 @@ static int Pkgb_DemoObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_WideInt numChars; @@ -144,9 +144,9 @@ Pkgb_Init( if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "pkgb_demo", Pkgb_DemoObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "pkgb_demo", Pkgb_DemoObjCmd, NULL, NULL); return TCL_OK; } @@ -181,6 +181,6 @@ Pkgb_SafeInit( if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL); return TCL_OK; } diff --git a/unix/dltest/pkgc.c b/unix/dltest/pkgc.c index 582d457..b089a65 100644 --- a/unix/dltest/pkgc.c +++ b/unix/dltest/pkgc.c @@ -35,7 +35,7 @@ static int Pkgc_SubObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int first, second; @@ -74,7 +74,7 @@ static int Pkgc_UnsafeObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { (void)dummy; @@ -116,8 +116,8 @@ Pkgc_Init( if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "pkgc_unsafe", Pkgc_UnsafeObjCmd, NULL, + Tcl_CreateObjCommand2(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "pkgc_unsafe", Pkgc_UnsafeObjCmd, NULL, NULL); return TCL_OK; } @@ -153,6 +153,6 @@ Pkgc_SafeInit( if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL); return TCL_OK; } diff --git a/unix/dltest/pkgd.c b/unix/dltest/pkgd.c index 52ba968..8ceafcd 100644 --- a/unix/dltest/pkgd.c +++ b/unix/dltest/pkgd.c @@ -35,7 +35,7 @@ static int Pkgd_SubObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int first, second; @@ -74,7 +74,7 @@ static int Pkgd_UnsafeObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { (void)dummy; @@ -116,8 +116,8 @@ Pkgd_Init( if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "pkgd_unsafe", Pkgd_UnsafeObjCmd, NULL, + Tcl_CreateObjCommand2(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "pkgd_unsafe", Pkgd_UnsafeObjCmd, NULL, NULL); return TCL_OK; } @@ -153,6 +153,6 @@ Pkgd_SafeInit( if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL); return TCL_OK; } diff --git a/unix/dltest/pkgooa.c b/unix/dltest/pkgooa.c index 444bb81..b413692 100644 --- a/unix/dltest/pkgooa.c +++ b/unix/dltest/pkgooa.c @@ -35,7 +35,7 @@ static int Pkgooa_StubsOKObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { (void)dummy; @@ -160,6 +160,6 @@ Pkgooa_Init( if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgooa_stubsok", Pkgooa_StubsOKObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "pkgooa_stubsok", Pkgooa_StubsOKObjCmd, NULL, NULL); return TCL_OK; } diff --git a/unix/dltest/pkgua.c b/unix/dltest/pkgua.c index 92d3cc9..96367f6 100644 --- a/unix/dltest/pkgua.c +++ b/unix/dltest/pkgua.c @@ -122,7 +122,7 @@ static int PkguaEqObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int result; @@ -167,7 +167,7 @@ static int PkguaQuoteObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ { (void)dummy; @@ -225,10 +225,10 @@ Pkgua_Init( cmdTokens = PkguaInterpToTokens(interp); cmdTokens[0] = - Tcl_CreateObjCommand(interp, "pkgua_eq", PkguaEqObjCmd, &cmdTokens[0], + Tcl_CreateObjCommand2(interp, "pkgua_eq", PkguaEqObjCmd, &cmdTokens[0], CommandDeleted); cmdTokens[1] = - Tcl_CreateObjCommand(interp, "pkgua_quote", PkguaQuoteObjCmd, + Tcl_CreateObjCommand2(interp, "pkgua_quote", PkguaQuoteObjCmd, &cmdTokens[1], CommandDeleted); return TCL_OK; } diff --git a/unix/tcl.spec b/unix/tcl.spec index f2d4bd5..b9ff9c5 100644 --- a/unix/tcl.spec +++ b/unix/tcl.spec @@ -4,7 +4,7 @@ Name: tcl Summary: Tcl scripting language development environment -Version: 9.0a4 +Version: 9.1a0 Release: 2 License: BSD Group: Development/Languages diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 402e04f..6ac7635 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -484,7 +484,7 @@ AtForkChild(void) * * TclpNotifierData -- * - * This function returns a ClientData pointer to be associated + * This function returns a pointer to be associated * with a Tcl_AsyncHandler. * * Results: diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index 9923ba8..aa0156b 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -1253,7 +1253,7 @@ int Tcl_PidObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { Tcl_Channel chan; diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c index 0f73b57..a4de187 100644 --- a/unix/tclUnixTest.c +++ b/unix/tclUnixTest.c @@ -62,13 +62,13 @@ static const char *gotsig = "0"; * Forward declarations of functions defined later in this file: */ -static Tcl_ObjCmdProc TestalarmCmd; -static Tcl_ObjCmdProc TestchmodCmd; -static Tcl_ObjCmdProc TestfilehandlerCmd; -static Tcl_ObjCmdProc TestfilewaitCmd; -static Tcl_ObjCmdProc TestfindexecutableCmd; -static Tcl_ObjCmdProc TestforkCmd; -static Tcl_ObjCmdProc TestgotsigCmd; +static Tcl_ObjCmdProc2 TestalarmCmd; +static Tcl_ObjCmdProc2 TestchmodCmd; +static Tcl_ObjCmdProc2 TestfilehandlerCmd; +static Tcl_ObjCmdProc2 TestfilewaitCmd; +static Tcl_ObjCmdProc2 TestfindexecutableCmd; +static Tcl_ObjCmdProc2 TestforkCmd; +static Tcl_ObjCmdProc2 TestgotsigCmd; static Tcl_FileProc TestFileHandlerProc; static void AlarmHandler(int signum); @@ -93,19 +93,19 @@ int TclplatformtestInit( Tcl_Interp *interp) /* Interpreter to add commands to. */ { - Tcl_CreateObjCommand(interp, "testchmod", TestchmodCmd, + Tcl_CreateObjCommand2(interp, "testchmod", TestchmodCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testfilehandler", TestfilehandlerCmd, + Tcl_CreateObjCommand2(interp, "testfilehandler", TestfilehandlerCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testfilewait", TestfilewaitCmd, + Tcl_CreateObjCommand2(interp, "testfilewait", TestfilewaitCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testfindexecutable", TestfindexecutableCmd, + Tcl_CreateObjCommand2(interp, "testfindexecutable", TestfindexecutableCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testfork", TestforkCmd, + Tcl_CreateObjCommand2(interp, "testfork", TestforkCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testalarm", TestalarmCmd, + Tcl_CreateObjCommand2(interp, "testalarm", TestalarmCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testgotsig", TestgotsigCmd, + Tcl_CreateObjCommand2(interp, "testgotsig", TestgotsigCmd, NULL, NULL); return TCL_OK; } @@ -131,7 +131,7 @@ static int TestfilehandlerCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { Pipe *pipePtr; @@ -152,7 +152,7 @@ TestfilehandlerCmd( initialized = 1; } - if (objc < 2) { + if (objc + 1 < 3) { Tcl_WrongNumArgs(interp, 1, objv, "option ..."); return TCL_ERROR; } @@ -345,7 +345,7 @@ static int TestfilewaitCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { int mask, result, timeout; @@ -413,7 +413,7 @@ static int TestfindexecutableCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { Tcl_Obj *saveName; @@ -455,7 +455,7 @@ static int TestforkCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { pid_t pid; @@ -501,7 +501,7 @@ static int TestalarmCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { #ifdef SA_RESTART @@ -579,7 +579,7 @@ static int TestgotsigCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(Tcl_Size) /*objc*/, TCL_UNUSED(Tcl_Obj *const *)) { Tcl_AppendResult(interp, gotsig, NULL); @@ -610,12 +610,13 @@ static int TestchmodCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { - int i, mode; + Tcl_Size i; + int mode; - if (objc < 2) { + if (objc + 1 < 3) { Tcl_WrongNumArgs(interp, 1, objv, "mode file ?file ...?"); return TCL_ERROR; } diff --git a/unix/tclXtTest.c b/unix/tclXtTest.c index 09b16c5..a150ae0 100644 --- a/unix/tclXtTest.c +++ b/unix/tclXtTest.c @@ -15,7 +15,7 @@ #include <X11/Intrinsic.h> #include "tcl.h" -static Tcl_ObjCmdProc TesteventloopCmd; +static Tcl_ObjCmdProc2 TesteventloopCmd; /* * Functions defined in tclXtNotify.c for use by users of the Xt Notifier: @@ -52,7 +52,7 @@ Tclxttest_Init( } XtToolkitInitialize(); InitNotifier(); - Tcl_CreateObjCommand(interp, "testeventloop", TesteventloopCmd, + Tcl_CreateObjCommand2(interp, "testeventloop", TesteventloopCmd, NULL, NULL); return TCL_OK; } @@ -79,14 +79,14 @@ static int TesteventloopCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static int *framePtr = NULL;/* Pointer to integer on stack frame of * innermost invocation of the "wait" * subcommand. */ - if (objc < 2) { + if (objc + 1 < 3) { Tcl_WrongNumArgs(interp, 1, objv, "option ..."); return TCL_ERROR; } diff --git a/win/Makefile.in b/win/Makefile.in index 1c74b4f..98fb7ce 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -150,10 +150,8 @@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_DLL_FILE = @TCL_DLL_FILE@ TCL_LIB_FILE = @TCL_LIB_FILE@ DDE_DLL_FILE = tcl9dde$(DDEVER)${DLLSUFFIX} -DDE_DLL_FILE8 = tcldde$(DDEVER)${DLLSUFFIX} DDE_LIB_FILE = @LIBPREFIX@tcldde$(DDEVER)${DLLSUFFIX}${LIBSUFFIX} REG_DLL_FILE = tcl9registry$(REGVER)${DLLSUFFIX} -REG_DLL_FILE8 = tclregistry$(REGVER)${DLLSUFFIX} REG_LIB_FILE = @LIBPREFIX@tclregistry$(REGVER)${DLLSUFFIX}${LIBSUFFIX} TEST_DLL_FILE = tcltest$(VER)${DLLSUFFIX} TEST_EXE_FILE = tcltest${EXESUFFIX} @@ -519,7 +517,7 @@ tcltest: binaries $(TEST_EXE_FILE) $(TEST_DLL_FILE) $(CAT32) tcltest.cmd binaries: $(TCL_STUB_LIB_FILE) @LIBRARIES@ winextensions ${TCL_ZIP_FILE} $(TCLSH) -winextensions: ${DDE_DLL_FILE} ${REG_DLL_FILE} ${DDE_DLL_FILE8} ${REG_DLL_FILE8} +winextensions: ${DDE_DLL_FILE} ${REG_DLL_FILE} libraries: @@ -593,14 +591,6 @@ ${REG_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${REG_OBJS} @MAKE_DLL@ ${REG_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS) $(COPY) tclsh.exe.manifest ${REG_DLL_FILE}.manifest -${DDE_DLL_FILE8}: ${TCL_STUB_LIB_FILE} tcl8WinDde.$(OBJEXT) - @MAKE_DLL@ tcl8WinDde.$(OBJEXT) $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS) - $(COPY) tclsh.exe.manifest ${DDE_DLL_FILE8}.manifest - -${REG_DLL_FILE8}: ${TCL_STUB_LIB_FILE} tcl8WinReg.$(OBJEXT) - @MAKE_DLL@ -DTCL_MAJOR_VERSION=8 tcl8WinReg.$(OBJEXT) $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS) - $(COPY) tclsh.exe.manifest ${REG_DLL_FILE8}.manifest - ${TEST_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS} @$(RM) ${TEST_DLL_FILE} ${TEST_LIB_FILE} @MAKE_DLL@ ${TCLTEST_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS) @@ -860,10 +850,6 @@ install-binaries: binaries $(COPY) $(ROOT_DIR)/library/dde/pkgIndex.tcl \ "$(LIB_INSTALL_DIR)/dde${DDEDOTVER}"; \ fi - @if [ -f $(DDE_DLL_FILE8) ]; then \ - echo Installing $(DDE_DLL_FILE8); \ - $(COPY) $(DDE_DLL_FILE8) "$(LIB_INSTALL_DIR)/dde${DDEDOTVER}"; \ - fi @if [ -f $(DDE_LIB_FILE) ]; then \ echo Installing $(DDE_LIB_FILE); \ $(COPY) $(DDE_LIB_FILE) "$(LIB_INSTALL_DIR)/dde${DDEDOTVER}"; \ @@ -874,10 +860,6 @@ install-binaries: binaries $(COPY) $(ROOT_DIR)/library/registry/pkgIndex.tcl \ "$(LIB_INSTALL_DIR)/registry${REGDOTVER}"; \ fi - @if [ -f $(REG_DLL_FILE8) ]; then \ - echo Installing $(REG_DLL_FILE8); \ - $(COPY) $(REG_DLL_FILE8) "$(LIB_INSTALL_DIR)/registry${REGDOTVER}"; \ - fi @if [ -f $(REG_LIB_FILE) ]; then \ echo Installing $(REG_LIB_FILE); \ $(COPY) $(REG_LIB_FILE) "$(LIB_INSTALL_DIR)/registry${REGDOTVER}"; \ @@ -1,4 +1,4 @@ -Tcl 9.0 for Windows +Tcl 9.1 for Windows 1. Introduction --------------- @@ -16,7 +16,7 @@ The information in this file is maintained on the web at: In order to compile Tcl for Windows, you need the following: - Tcl 9.0 Source Distribution (plus any patches) + Tcl 9.1 Source Distribution (plus any patches) and diff --git a/win/configure b/win/configure index d47fc6cb..e6a0f8f 100755 --- a/win/configure +++ b/win/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for tcl 9.0. +# Generated by GNU Autoconf 2.71 for tcl 9.1. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tcl' PACKAGE_TARNAME='tcl' -PACKAGE_VERSION='9.0' -PACKAGE_STRING='tcl 9.0' +PACKAGE_VERSION='9.1' +PACKAGE_STRING='tcl 9.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1371,7 +1371,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 tcl 9.0 to adapt to many kinds of systems. +\`configure' configures tcl 9.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1433,7 +1433,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tcl 9.0:";; + short | recursive ) echo "Configuration of tcl 9.1:";; esac cat <<\_ACEOF @@ -1530,7 +1530,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tcl configure 9.0 +tcl configure 9.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1734,7 +1734,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 tcl $as_me 9.0, which was +It was created by tcl $as_me 9.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2399,10 +2399,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TCL_VERSION=9.0 +TCL_VERSION=9.1 TCL_MAJOR_VERSION=9 -TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="a4" +TCL_MINOR_VERSION=1 +TCL_PATCH_LEVEL="a0" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 @@ -6498,7 +6498,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 tcl $as_me 9.0, which was +This file was extended by tcl $as_me 9.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6553,7 +6553,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -tcl config.status 9.0 +tcl config.status 9.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/win/configure.ac b/win/configure.ac index c6ff202..1f39910 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -3,7 +3,7 @@ # generate the file "configure", which is run during Tcl installation # to configure the system for the local environment. -AC_INIT([tcl],[9.0]) +AC_INIT([tcl],[9.1]) AC_CONFIG_SRCDIR([../generic/tcl.h]) AC_PREREQ([2.69]) @@ -12,10 +12,10 @@ AC_PREREQ([2.69]) # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TCL_VERSION=9.0 +TCL_VERSION=9.1 TCL_MAJOR_VERSION=9 -TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="a4" +TCL_MINOR_VERSION=1 +TCL_PATCH_LEVEL="a0" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 @@ -1009,13 +1009,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ #------------------------------------------------------------------------ AC_DEFUN([SC_WITH_TCL], [ - if test -d ../../tcl9.0$1/win; then - TCL_BIN_DEFAULT=../../tcl9.0$1/win + if test -d ../../tcl9.1$1/win; then + TCL_BIN_DEFAULT=../../tcl9.1$1/win else - TCL_BIN_DEFAULT=../../tcl9.0/win + TCL_BIN_DEFAULT=../../tcl9.1/win fi - AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 9.0 binaries from DIR], + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 9.1 binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`) if test ! -d $TCL_BIN_DIR; then AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c index de4f8f2..53e587c 100644 --- a/win/tclWinNotify.c +++ b/win/tclWinNotify.c @@ -425,7 +425,7 @@ NotifierProc( * * TclpNotifierData -- * - * This function returns a ClientData pointer to be associated + * This function returns a void pointer to be associated * with a Tcl_AsyncHandler. * * Results: diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index d9cee73..677d589 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -2738,7 +2738,7 @@ int Tcl_PidObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { Tcl_Channel chan; diff --git a/win/tclWinTest.c b/win/tclWinTest.c index 29bdfe4..e554ffa 100644 --- a/win/tclWinTest.c +++ b/win/tclWinTest.c @@ -36,13 +36,13 @@ * Forward declarations of functions defined later in this file: */ -static Tcl_ObjCmdProc TesteventloopCmd; -static Tcl_ObjCmdProc TestvolumetypeCmd; -static Tcl_ObjCmdProc TestwinclockCmd; -static Tcl_ObjCmdProc TestwinsleepCmd; -static Tcl_ObjCmdProc TestExceptionCmd; +static Tcl_ObjCmdProc2 TesteventloopCmd; +static Tcl_ObjCmdProc2 TestvolumetypeCmd; +static Tcl_ObjCmdProc2 TestwinclockCmd; +static Tcl_ObjCmdProc2 TestwinsleepCmd; +static Tcl_ObjCmdProc2 TestExceptionCmd; static int TestplatformChmod(const char *nativePath, int pmode); -static Tcl_ObjCmdProc TestchmodCmd; +static Tcl_ObjCmdProc2 TestchmodCmd; /* *---------------------------------------------------------------------- @@ -69,13 +69,13 @@ TclplatformtestInit( * Add commands for platform specific tests for Windows here. */ - Tcl_CreateObjCommand(interp, "testchmod", TestchmodCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testeventloop", TesteventloopCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testvolumetype", TestvolumetypeCmd, + Tcl_CreateObjCommand2(interp, "testchmod", TestchmodCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "testeventloop", TesteventloopCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "testvolumetype", TestvolumetypeCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testwinclock", TestwinclockCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testwinsleep", TestwinsleepCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testexcept", TestExceptionCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "testwinclock", TestwinclockCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "testwinsleep", TestwinsleepCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "testexcept", TestExceptionCmd, NULL, NULL); return TCL_OK; } @@ -101,14 +101,14 @@ static int TesteventloopCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static int *framePtr = NULL;/* Pointer to integer on stack frame of * innermost invocation of the "wait" * subcommand. */ - if (objc < 2) { + if (objc + 1 < 3) { Tcl_WrongNumArgs(interp, 1, objv, "option ..."); return TCL_ERROR; } @@ -177,7 +177,7 @@ static int TestvolumetypeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { #define VOL_BUF_SIZE 32 @@ -243,7 +243,7 @@ static int TestwinclockCmd( TCL_UNUSED(void *), Tcl_Interp* interp, /* Tcl interpreter */ - int objc, /* Argument count */ + Tcl_Size objc, /* Argument count */ Tcl_Obj *const objv[]) /* Argument vector */ { static const FILETIME posixEpoch = { 0xD53E8000, 0x019DB1DE }; @@ -292,7 +292,7 @@ static int TestwinsleepCmd( TCL_UNUSED(void *), Tcl_Interp* interp, /* Tcl interpreter */ - int objc, /* Parameter count */ + Tcl_Size objc, /* Parameter count */ Tcl_Obj *const * objv) /* Parameter vector */ { int ms; @@ -335,7 +335,7 @@ static int TestExceptionCmd( TCL_UNUSED(void *), Tcl_Interp* interp, /* Tcl interpreter */ - int objc, /* Argument count */ + Tcl_Size objc, /* Argument count */ Tcl_Obj *const objv[]) /* Argument vector */ { static const char *const cmds[] = { @@ -639,12 +639,13 @@ static int TestchmodCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Parameter count */ + Tcl_Size objc, /* Parameter count */ Tcl_Obj *const * objv) /* Parameter vector */ { - int i, mode; + Tcl_Size i; + int mode; - if (objc < 2) { + if (objc + 1 < 3) { Tcl_WrongNumArgs(interp, 1, objv, "mode file ?file ...?"); return TCL_ERROR; } |