diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 8af5ac7451c..1cf457458a5 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -22,7 +22,6 @@ jobs: matrix: cfgopt: - "" - - "CHECKS=nodep" - "OPTS=static" - "OPTS=symbols" - "OPTS=symbols STATS=compdbg,memdbg" @@ -65,7 +64,6 @@ jobs: matrix: cfgopt: - "" - - "CFLAGS=-DTCL_NO_DEPRECATED=1" - "--disable-shared" - "--enable-symbols" - "--enable-symbols=mem" diff --git a/README.md b/README.md index 1ec9c96179e..3d63997b9ac 100644 --- a/README.md +++ b/README.md @@ -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) +
+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 98fd2fe75d7..a491f1a217c 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 1f8c32bfd9f..758f3aaeee6 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) @@ -555,9 +555,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 */ #if TCL_MAJOR_VERSION > 8 typedef int (Tcl_CmdObjTraceProc2) (void *clientData, Tcl_Interp *interp, Tcl_Size level, const char *command, Tcl_Command commandInfo, Tcl_Size objc, @@ -585,8 +587,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 */ #if TCL_MAJOR_VERSION > 8 typedef int (Tcl_ObjCmdProc2) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, struct Tcl_Obj *const *objv); @@ -835,8 +839,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; @@ -2320,17 +2329,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 f3f8144918b..2bdef0a3104 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 3ceb427bdb7..385d64c74f2 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::". */ - 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,18 +5199,18 @@ TclEvalEx( { Interp *iPtr = (Interp *) interp; const char *p, *next; - const int minObjs = 20; + const unsigned int minObjs = 20; Tcl_Obj **objv, **objvSpace; int *expand; Tcl_Size *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 @@ -5316,8 +5348,8 @@ TclEvalEx( Tcl_Size wordLine = line; const char *wordStart = parsePtr->commandStart; Tcl_Size *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. @@ -5336,8 +5368,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. @@ -5387,21 +5417,11 @@ TclEvalEx( expandRequested = 1; expand[objectsUsed] = 1; - additionalObjsCount = (numElements ? numElements : 1); - + objectsNeeded += (numElements ? numElements : 1); } else { expand[objectsUsed] = 0; - additionalObjsCount = 1; - } - - /* 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++; } - objectsNeeded += additionalObjsCount; if (wordCLNext) { TclContinuationsEnterDerived(objv[objectsUsed], @@ -5719,11 +5739,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; @@ -5787,10 +5808,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; @@ -5835,14 +5856,14 @@ void TclArgumentBCEnter( Tcl_Interp *interp, Tcl_Obj *objv[], - int objc, + Tcl_Size objc, void *codePtr, CmdFrame *cfPtr, Tcl_Size cmd, Tcl_Size pc) { ExtCmdLoc *eclPtr; - int word; + Tcl_Size word; ECL *ePtr; CFWordBC *lastPtr = NULL; Interp *iPtr = (Interp *) interp; @@ -6377,10 +6398,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)); @@ -6426,7 +6447,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); @@ -6451,7 +6472,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); @@ -6476,7 +6497,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); @@ -6633,7 +6654,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. */ @@ -6677,7 +6698,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: @@ -6689,20 +6710,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; @@ -6788,7 +6809,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); @@ -6902,10 +6923,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; } @@ -7033,7 +7054,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; @@ -7073,7 +7094,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; @@ -7112,7 +7133,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; @@ -7208,7 +7229,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; @@ -7219,7 +7240,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; @@ -7273,7 +7294,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; @@ -7337,7 +7358,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; @@ -7387,7 +7408,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; @@ -7495,7 +7516,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; @@ -7516,7 +7537,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; @@ -7543,7 +7564,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; @@ -7599,7 +7620,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; @@ -7620,13 +7641,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) { @@ -7660,7 +7682,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); @@ -7671,7 +7693,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); @@ -7682,7 +7704,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; @@ -7775,7 +7797,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; @@ -7854,7 +7876,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; @@ -8043,7 +8065,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; @@ -8074,7 +8096,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; @@ -8104,7 +8126,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; @@ -8134,7 +8156,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; @@ -8164,7 +8186,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; @@ -8194,7 +8216,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; @@ -8235,7 +8257,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; @@ -8343,7 +8365,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()) { @@ -8486,9 +8508,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[]) @@ -8500,26 +8522,24 @@ 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, Tcl_Size objc, Tcl_Obj *const objv[]) @@ -8538,6 +8558,7 @@ Tcl_NRCallObjProc2( INT2PTR(objc), objv); return TclNRRunCallbacks(interp, TCL_OK, rootPtr); } +#endif /* TCL_NO_DEPRECATED */ /* *---------------------------------------------------------------------- @@ -8553,45 +8574,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. */ @@ -8605,24 +8624,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. */ @@ -8631,10 +8652,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; } @@ -8643,8 +8664,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) { @@ -8652,7 +8673,7 @@ TclNRCreateCommandInNs( TclCreateObjCommandInNs(interp, cmdName, nsPtr, proc, clientData, deleteProc); - cmdPtr->nreProc = nreProc; + cmdPtr->nreProc2 = nreProc; return (Tcl_Command) cmdPtr; } @@ -8810,7 +8831,7 @@ int TclNRTailcallObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *) interp; @@ -8822,7 +8843,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; } @@ -8852,7 +8873,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); @@ -8972,7 +8993,7 @@ int TclNRYieldObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CoroutineData *corPtr = iPtr->execEnvPtr->corPtr; @@ -8984,7 +9005,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; } @@ -9003,7 +9024,7 @@ int TclNRYieldToObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CoroutineData *corPtr = iPtr->execEnvPtr->corPtr; @@ -9017,14 +9038,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; @@ -9037,7 +9058,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); /* @@ -9259,7 +9280,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; @@ -9330,7 +9351,7 @@ static int CoroTypeObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Command *cmdPtr; @@ -9346,9 +9367,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; @@ -9359,9 +9380,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; } @@ -9372,14 +9393,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; } @@ -9407,20 +9428,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; @@ -9442,7 +9463,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; } @@ -9465,7 +9486,7 @@ static int TclNRCoroProbeObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CoroutineData *corPtr; @@ -9656,7 +9677,7 @@ static int NRInjectObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CoroutineData *corPtr; @@ -9679,7 +9700,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; } @@ -9701,7 +9722,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; @@ -9733,7 +9754,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; } @@ -9765,7 +9786,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; @@ -9899,7 +9920,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 9c32cd769c1..df2bf912f65 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 @@ -834,14 +834,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 @@ -1347,14 +1347,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 @@ -1766,14 +1766,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; @@ -2431,7 +2431,7 @@ static int BinaryEncodeHex( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *resultObj = NULL; @@ -2479,14 +2479,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 }; @@ -2604,16 +2604,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; + Tcl_WideInt 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, outindex = 0, purewrap = 1; + Tcl_Size offset, size, count = 0; enum { OPT_MAXLEN, OPT_WRAPCHAR }; static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL }; @@ -2629,7 +2629,7 @@ BinaryEncode64( } switch (index) { case OPT_MAXLEN: - if (TclGetSizeIntFromObj(interp, objv[i + 1], &maxlen) != TCL_OK) { + if (Tcl_GetWideIntFromObj(interp, objv[i + 1], &maxlen) != TCL_OK) { return TCL_ERROR; } if (maxlen < 0) { @@ -2730,17 +2730,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 }; @@ -2882,14 +2881,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 }; @@ -3056,7 +3055,7 @@ static int BinaryDecode64( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *resultObj = NULL; @@ -3064,8 +3063,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 324755d318c..4e12a44cc32 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -800,7 +800,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; @@ -972,7 +972,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) { @@ -1006,8 +1006,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 5d3caa12cb2..8eed166f293 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::". 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 0245eede856..42965636b73 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -47,12 +47,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, @@ -63,7 +63,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; @@ -73,31 +73,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; /* *---------------------------------------------------------------------- @@ -124,7 +124,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) { @@ -155,17 +155,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; @@ -202,7 +202,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; @@ -260,7 +260,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; @@ -318,7 +318,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) { @@ -352,7 +352,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) { @@ -519,7 +519,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 */ @@ -619,7 +619,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 */ @@ -717,7 +717,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; @@ -761,7 +761,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) { @@ -789,7 +789,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) { @@ -820,7 +820,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) { @@ -857,7 +857,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; @@ -919,17 +919,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; @@ -988,7 +988,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; @@ -1035,17 +1035,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; @@ -1183,7 +1183,7 @@ static int FileAttrAccessTimeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1265,7 +1265,7 @@ static int FileAttrModifyTimeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1344,7 +1344,7 @@ static int FileAttrLinkStatCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1384,7 +1384,7 @@ static int FileAttrStatCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1424,7 +1424,7 @@ static int FileAttrTypeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1462,7 +1462,7 @@ static int FileAttrSizeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1499,7 +1499,7 @@ static int FileAttrIsDirectoryCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1537,7 +1537,7 @@ static int FileAttrIsExecutableCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc != 2) { @@ -1568,7 +1568,7 @@ static int FileAttrIsExistingCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc != 2) { @@ -1599,7 +1599,7 @@ static int FileAttrIsFileCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; @@ -1637,7 +1637,7 @@ static int FileAttrIsOwnedCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { #ifdef __CYGWIN__ @@ -1684,7 +1684,7 @@ static int FileAttrIsReadableCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc != 2) { @@ -1715,7 +1715,7 @@ static int FileAttrIsWritableCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc != 2) { @@ -1746,7 +1746,7 @@ static int PathDirNameCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirPtr; @@ -1785,7 +1785,7 @@ static int PathExtensionCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirPtr; @@ -1824,7 +1824,7 @@ static int PathRootNameCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirPtr; @@ -1863,7 +1863,7 @@ static int PathTailCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirPtr; @@ -1902,7 +1902,7 @@ static int PathFilesystemCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *fsInfo; @@ -1943,7 +1943,7 @@ static int PathJoinCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc < 2) { @@ -1975,7 +1975,7 @@ static int PathNativeNameCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_DString ds; @@ -2012,7 +2012,7 @@ static int PathNormalizeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *fileName; @@ -2050,7 +2050,7 @@ static int PathSplitCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *res; @@ -2093,7 +2093,7 @@ static int PathTypeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *typeName; @@ -2141,7 +2141,7 @@ static int FilesystemSeparatorCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc < 1 || objc > 2) { @@ -2196,7 +2196,7 @@ static int FilesystemVolumesCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (objc != 1) { @@ -2491,17 +2491,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; @@ -2685,17 +2685,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); @@ -2705,17 +2705,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); @@ -2727,7 +2727,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; @@ -3044,7 +3044,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 8e070404cd5..4a88560ff40 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -119,28 +119,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, @@ -207,17 +207,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; @@ -249,9 +249,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; @@ -390,7 +390,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; @@ -471,7 +471,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; @@ -534,7 +534,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; @@ -595,7 +595,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; @@ -637,7 +637,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; @@ -914,7 +914,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) { @@ -951,7 +951,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; @@ -2301,7 +2301,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; @@ -2389,7 +2389,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. */ @@ -2447,7 +2447,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; @@ -2540,7 +2540,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. */ { @@ -2576,7 +2576,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. */ { @@ -2625,7 +2625,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. */ { @@ -2745,7 +2745,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. */ { @@ -2827,7 +2827,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; @@ -2958,7 +2958,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. */ { @@ -3073,7 +3073,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; @@ -3175,7 +3175,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; @@ -3278,7 +3278,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; @@ -4167,7 +4167,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; @@ -4179,7 +4179,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); @@ -4446,7 +4447,7 @@ int Tcl_LsetObjCmd( TCL_UNUSED(ClientData), 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. */ @@ -4539,7 +4540,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; @@ -5058,7 +5059,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. */ diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 116d4533a02..bc00ddf34de 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; @@ -1459,7 +1459,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 */ @@ -1516,13 +1516,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; @@ -1951,7 +1951,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; @@ -2227,7 +2227,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; @@ -2279,7 +2279,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; @@ -2329,7 +2329,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; @@ -2385,7 +2385,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; @@ -2462,7 +2462,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) { @@ -2495,7 +2495,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; @@ -2566,7 +2566,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; @@ -2628,7 +2628,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. */ { /* @@ -2638,8 +2638,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: @@ -2704,7 +2704,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. */ { /* @@ -2730,13 +2730,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; @@ -2794,7 +2793,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; @@ -2839,7 +2838,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) { @@ -2873,7 +2872,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; @@ -2958,7 +2957,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; @@ -3043,7 +3042,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; @@ -3128,7 +3127,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; @@ -3175,7 +3174,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; @@ -3222,7 +3221,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; @@ -3365,17 +3364,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; @@ -3413,20 +3412,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; @@ -3956,7 +3956,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; @@ -4018,7 +4018,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; @@ -4116,14 +4116,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; @@ -4150,7 +4151,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, @@ -4166,7 +4167,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) { @@ -4181,7 +4182,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? " @@ -4662,22 +4663,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 }; @@ -4711,14 +4712,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)); @@ -4731,7 +4732,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)); @@ -4749,7 +4750,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\"", @@ -5240,17 +5241,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 f86de84ff0b..bc56ee9453c 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 fcabd379aa5..c67475e0a33 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 161ea628ce4..f646c31d0de 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 8f58ca8cf42..5e1f17b4dca 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 52bdf4cfa75..aeddacf5a18 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 caab6cce0b8..7d71a87d344 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, @@ -2181,7 +2185,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 */ @@ -3901,6 +3905,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 @@ -4252,7 +4261,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 64d666f5cdc..7db80cd34c1 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; static Tcl_ObjTypeLengthProc DictAsListLength; @@ -1524,11 +1524,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 @@ -1574,7 +1574,7 @@ static int DictGetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr = NULL; @@ -1667,7 +1667,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; @@ -1732,11 +1732,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 ...?"); @@ -1780,11 +1780,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 ...?"); @@ -1828,12 +1828,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) { @@ -1915,7 +1915,7 @@ static int DictKeysCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *listPtr; @@ -1994,7 +1994,7 @@ static int DictValuesCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *valuePtr = NULL, *listPtr; @@ -2054,7 +2054,7 @@ static int DictSizeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int result; @@ -2093,7 +2093,7 @@ static int DictExistsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr; @@ -2135,7 +2135,7 @@ static int DictInfoCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Dict *dict; @@ -2179,7 +2179,7 @@ static int DictIncrCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int code = TCL_OK; @@ -2300,11 +2300,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 ...?"); @@ -2387,7 +2388,7 @@ static int DictAppendCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr, *resultPtr; @@ -2489,7 +2490,7 @@ static int DictForNRCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Interp *iPtr = (Interp *) interp; @@ -2685,7 +2686,7 @@ static int DictMapNRCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Interp *iPtr = (Interp *) interp; @@ -2898,7 +2899,7 @@ static int DictSetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *resultPtr; @@ -2958,7 +2959,7 @@ static int DictUnsetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *resultPtr; @@ -3017,7 +3018,7 @@ static int DictFilterCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Interp *iPtr = (Interp *) interp; @@ -3091,7 +3092,7 @@ DictFilterCmd( resultObj = Tcl_NewDictObj(); while (!done) { - int i; + Tcl_Size i; for (i=3 ; iobjProc != 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 196b615472a..9dc13f749fd 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; @@ -1487,11 +1487,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; @@ -1589,7 +1590,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++; @@ -1613,7 +1614,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++; @@ -1637,7 +1638,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++; @@ -1671,7 +1672,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++; @@ -1695,7 +1696,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, @@ -1813,7 +1814,7 @@ Tcl_VwaitObjCmd( if (result == TCL_OK) { if (extended) { - int k; + Tcl_Size k; Tcl_Obj *listObj, *keyObj; TclNewObj(listObj); @@ -1940,7 +1941,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 19bce64eb80..265ef8f546e 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -610,7 +610,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); @@ -753,7 +753,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 */ } @@ -1847,7 +1847,7 @@ ArgumentBCEnter( ByteCode *codePtr, TEBCdata *tdPtr, const unsigned char *pc, - int objc, + Tcl_Size objc, Tcl_Obj **objv) { Tcl_Size cmd; @@ -2827,12 +2827,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); @@ -4586,11 +4582,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); } @@ -9111,7 +9113,7 @@ IllegalExprOperandType( Tcl_Obj * TclGetSourceFromFrame( CmdFrame *cfPtr, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (cfPtr == NULL) { @@ -9535,7 +9537,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 ca4ff278a20..7c8fa2b3367 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 8a58459c578..0c859effc21 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 e282c9b1ad1..d4ac7580fce 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 dc5a67d77e5..aa284fc3f20 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 0c91428063f..28924d3682b 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -9172,7 +9172,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 37be1416dcb..76138109092 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. */ @@ -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 f313ab7a67f..2fc68c0ece3 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 */ @@ -824,7 +824,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 90e7195edc1..db6782be556 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 3134b665c8f..315a7e249d3 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 @@ const Tcl_ObjType tclIndexType = { 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 bc0285c1e5b..26f49974f2a 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) } @@ -607,10 +610,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 38d628a6e85..6c5f7229c84 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -1714,9 +1714,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. */ @@ -1793,8 +1793,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; @@ -1812,7 +1812,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; /* @@ -3109,31 +3109,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); @@ -3210,11 +3210,11 @@ MODULE_SCOPE void TclAdvanceContinuations(Tcl_Size *line, Tcl_Size **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, Tcl_Size cmd, Tcl_Size pc); MODULE_SCOPE void TclArgumentBCRelease(Tcl_Interp *interp, CmdFrame *cfPtr); @@ -3235,7 +3235,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); @@ -3250,7 +3250,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, @@ -3266,17 +3266,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, Tcl_Size *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, @@ -3318,7 +3318,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); @@ -3337,7 +3337,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); @@ -3350,12 +3350,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); @@ -3400,7 +3400,7 @@ MODULE_SCOPE Tcl_Command TclMakeEnsemble(Tcl_Interp *interp, const char *name, const EnsembleImplMap map[]); 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); @@ -3410,8 +3410,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); @@ -3531,7 +3541,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, @@ -3557,7 +3567,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); @@ -3620,28 +3630,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, @@ -3649,91 +3659,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; /* *---------------------------------------------------------------- @@ -3849,40 +3859,40 @@ MODULE_SCOPE CompileProc TclCompileBasicMin0ArgCmd; MODULE_SCOPE CompileProc TclCompileBasicMin1ArgCmd; MODULE_SCOPE CompileProc TclCompileBasicMin2ArgCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclInvertOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclInvertOpCmd; MODULE_SCOPE CompileProc TclCompileInvertOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNotOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNotOpCmd; MODULE_SCOPE CompileProc TclCompileNotOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclAddOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclAddOpCmd; MODULE_SCOPE CompileProc TclCompileAddOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclMulOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclMulOpCmd; MODULE_SCOPE CompileProc TclCompileMulOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclAndOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclAndOpCmd; MODULE_SCOPE CompileProc TclCompileAndOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclOrOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclOrOpCmd; MODULE_SCOPE CompileProc TclCompileOrOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclXorOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclXorOpCmd; MODULE_SCOPE CompileProc TclCompileXorOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclPowOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclPowOpCmd; MODULE_SCOPE CompileProc TclCompilePowOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclLshiftOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclLshiftOpCmd; MODULE_SCOPE CompileProc TclCompileLshiftOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclRshiftOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclRshiftOpCmd; MODULE_SCOPE CompileProc TclCompileRshiftOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclModOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclModOpCmd; MODULE_SCOPE CompileProc TclCompileModOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNeqOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNeqOpCmd; MODULE_SCOPE CompileProc TclCompileNeqOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclStrneqOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclStrneqOpCmd; MODULE_SCOPE CompileProc TclCompileStrneqOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclInOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclInOpCmd; MODULE_SCOPE CompileProc TclCompileInOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclNiOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclNiOpCmd; MODULE_SCOPE CompileProc TclCompileNiOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclMinusOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclMinusOpCmd; MODULE_SCOPE CompileProc TclCompileMinusOpCmd; -MODULE_SCOPE Tcl_ObjCmdProc TclDivOpCmd; +MODULE_SCOPE Tcl_ObjCmdProc2 TclDivOpCmd; MODULE_SCOPE CompileProc TclCompileDivOpCmd; MODULE_SCOPE CompileProc TclCompileLessOpCmd; MODULE_SCOPE CompileProc TclCompileLeqOpCmd; @@ -3992,14 +4002,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. @@ -4041,8 +4051,6 @@ MODULE_SCOPE Tcl_Obj * TclGetArrayDefault(Var *arrayPtr); MODULE_SCOPE int TclIndexEncode(Tcl_Interp *interp, Tcl_Obj *objPtr, int before, int 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 3dfb25256bb..da09fe77653 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 */ @@ -504,9 +497,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, @@ -642,8 +633,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); @@ -652,8 +643,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); @@ -827,7 +818,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 */ @@ -944,10 +935,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 */ @@ -961,10 +950,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 */ @@ -1223,8 +1210,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 \ @@ -1275,6 +1261,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 \ @@ -1290,10 +1280,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 6e08bd7e5ca..66a5eaa6e37 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, @@ -275,8 +275,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; /* @@ -497,7 +497,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); @@ -604,17 +604,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; @@ -710,7 +710,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 @@ -782,7 +783,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[] = { @@ -833,7 +835,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; } @@ -864,7 +866,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++) { @@ -942,7 +944,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 @@ -1163,7 +1165,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) { @@ -1432,8 +1434,8 @@ TclPreventAliasLoop( * create or rename the command. */ - if (cmdPtr->objProc != TclAliasObjCmd - && cmdPtr->objProc != TclLocalAliasObjCmd) { + if (cmdPtr->objProc2 != TclAliasObjCmd + && cmdPtr->objProc2 != TclLocalAliasObjCmd) { return TCL_OK; } @@ -1443,7 +1445,7 @@ TclPreventAliasLoop( * chain then we have a loop. */ - aliasPtr = (Alias *)cmdPtr->objClientData; + aliasPtr = (Alias *)cmdPtr->objClientData2; nextAliasPtr = aliasPtr; while (1) { Tcl_Obj *cmdNamePtr; @@ -1488,11 +1490,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; } } @@ -1522,7 +1524,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; @@ -1531,7 +1533,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; @@ -1552,11 +1555,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); } @@ -1823,7 +1826,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; @@ -1876,7 +1879,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 @@ -1967,7 +1970,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 @@ -2378,7 +2381,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) { @@ -2468,7 +2471,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); @@ -2553,17 +2556,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; @@ -2664,7 +2667,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 @@ -2813,7 +2816,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[] = { @@ -2884,7 +2887,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; @@ -2947,7 +2950,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; @@ -2991,7 +2994,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; @@ -3053,7 +3056,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; @@ -3138,7 +3141,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; @@ -4481,8 +4484,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[] = { @@ -4582,8 +4585,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; @@ -4669,8 +4671,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[] = { @@ -4787,8 +4789,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 0e59c7b8913..2ffee70c4b1 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 4d1be5c4f86..eda2d55bd4d 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 d9cabe68b08..117b78cf5c8 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; @@ -340,7 +340,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); @@ -354,14 +354,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); } @@ -402,20 +402,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); /* @@ -738,7 +738,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; @@ -1191,7 +1191,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); @@ -1730,7 +1730,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. */ @@ -1751,7 +1751,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) { @@ -2259,7 +2259,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]); @@ -2553,17 +2553,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, @@ -2574,17 +2574,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); @@ -2635,17 +2635,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; @@ -2657,7 +2657,7 @@ MyClassNRObjCmd( return TclOOObjectCmdCore(oPtr->selfCls->thisPtr, interp, objc, objv, 0, NULL); } - + /* * ---------------------------------------------------------------------- * @@ -2900,7 +2900,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); /* @@ -3015,13 +3015,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 2df34d0e796..8da6958ffa2 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 638947e3495..8d0f49ba87a 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 */ #if TCL_MAJOR_VERSION > 8 typedef int (Tcl_MethodCallProc2)(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext objectContext, Tcl_Size objc, Tcl_Obj *const *objv); @@ -81,6 +83,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 @@ -97,6 +100,7 @@ typedef struct { * data, or NULL if the type-specific data can * be copied directly. */ } Tcl_MethodType; +#endif /* TCL_NO_DEPRECATED */ #if TCL_MAJOR_VERSION > 8 typedef struct { diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c index e644a2f93cb..e7e71e1aee5 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); @@ -270,7 +270,7 @@ TclOO_Class_CreateNs( * Check we have the right number of (sensible) arguments. */ - if (objc + 1 < Tcl_ObjectContextSkippedArgs(context) + 3) { + if (objc < Tcl_ObjectContextSkippedArgs(context) + 2) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, "objectName namespaceName ?arg ...?"); return TCL_ERROR; @@ -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 76954833072..6e0ff1a9dd8 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -314,7 +314,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; @@ -372,11 +372,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 68c5b2b1ee9..818beba3979 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,14 +274,11 @@ extern const TclOOStubs *tclOOStubsPtr; /* !END!: Do not edit above this line. */ -#if TCL_MAJOR_VERSION < 9 - /* TIP #630 for 8.7 */ -# undef Tcl_MethodIsType2 -# define Tcl_MethodIsType2 Tcl_MethodIsType -# undef Tcl_NewInstanceMethod2 -# define Tcl_NewInstanceMethod2 Tcl_NewInstanceMethod -# undef Tcl_NewMethod2 -# define Tcl_NewMethod2 Tcl_NewMethod +#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 7a88ab73d32..0259c479912 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}} /* @@ -67,67 +67,67 @@ 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); -static Tcl_MethodCallProc ClassRPropsGet, ClassRPropsSet; -static Tcl_MethodCallProc ClassWPropsGet, ClassWPropsSet; + Tcl_Size objc, Tcl_Obj *const *objv); +static Tcl_MethodCallProc2 ClassRPropsGet, ClassRPropsSet; +static Tcl_MethodCallProc2 ClassWPropsGet, ClassWPropsSet; 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); -static Tcl_MethodCallProc ObjRPropsGet, ObjRPropsSet; -static Tcl_MethodCallProc ObjWPropsGet, ObjWPropsSet; + Tcl_Size objc, Tcl_Obj *const *objv); +static Tcl_MethodCallProc2 ObjRPropsGet, ObjRPropsSet; +static Tcl_MethodCallProc2 ObjWPropsGet, ObjWPropsSet; 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. @@ -752,7 +752,7 @@ int TclOOUnknownDefinition( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Namespace *nsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); @@ -893,7 +893,7 @@ InitDefineContext( Tcl_Interp *interp, Tcl_Namespace *namespacePtr, Object *oPtr, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { CallFrame *framePtr, **framePtrPtr = &framePtr; @@ -1082,7 +1082,7 @@ MagicDefinitionInvoke( Tcl_Interp *interp, Tcl_Namespace *nsPtr, int cmdIndex, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Obj *objPtr, *obj2Ptr, **objs; @@ -1150,7 +1150,7 @@ int TclOODefineObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Namespace *nsPtr; @@ -1226,7 +1226,7 @@ int TclOOObjDefObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Namespace *nsPtr; @@ -1295,7 +1295,7 @@ int TclOODefineSelfObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Tcl_Namespace *nsPtr; @@ -1366,7 +1366,7 @@ int TclOODefineObjSelfObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr; @@ -1400,7 +1400,7 @@ int TclOODefinePrivateObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int isInstancePrivate = (clientData != NULL); @@ -1473,7 +1473,7 @@ int TclOODefineClassObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr; @@ -1582,7 +1582,7 @@ int TclOODefineConstructorObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr; @@ -1651,7 +1651,7 @@ int TclOODefineDefnNsObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { static const char *kindList[] = { @@ -1736,12 +1736,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 ...?"); @@ -1793,7 +1793,7 @@ int TclOODefineDestructorObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr; @@ -1858,7 +1858,7 @@ int TclOODefineExportObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int isInstanceExport = (clientData != NULL); @@ -1866,7 +1866,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 ...?"); @@ -1954,7 +1955,7 @@ int TclOODefineForwardObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int isInstanceForward = (clientData != NULL); @@ -2018,7 +2019,7 @@ int TclOODefineMethodObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { /* @@ -2114,7 +2115,7 @@ int TclOODefineRenameMethodObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int isInstanceRenameMethod = (clientData != NULL); @@ -2171,7 +2172,7 @@ int TclOODefineUnexportObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { int isInstanceUnexport = (clientData != NULL); @@ -2179,7 +2180,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 ...?"); @@ -2373,7 +2375,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); @@ -2407,7 +2409,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); @@ -2453,7 +2455,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); @@ -2490,7 +2492,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); @@ -2559,7 +2561,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); @@ -2595,7 +2597,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); @@ -2727,7 +2729,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); @@ -2771,7 +2773,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); @@ -2842,7 +2844,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); @@ -2870,7 +2872,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); @@ -2910,7 +2912,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); @@ -2942,7 +2944,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); @@ -2996,7 +2998,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); @@ -3034,7 +3036,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); @@ -3099,10 +3101,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; @@ -3208,12 +3210,12 @@ ClassRPropsGet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); Tcl_Obj *resultObj, *propNameObj; - int i; + Tcl_Size i; if (Tcl_ObjectContextSkippedArgs(context) != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -3242,7 +3244,7 @@ ClassRPropsSet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -3278,12 +3280,12 @@ ObjRPropsGet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); Tcl_Obj *resultObj, *propNameObj; - int i; + Tcl_Size i; if (Tcl_ObjectContextSkippedArgs(context) != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -3307,7 +3309,7 @@ ObjRPropsSet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -3405,12 +3407,12 @@ ClassWPropsGet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); Tcl_Obj *resultObj, *propNameObj; - int i; + Tcl_Size i; if (Tcl_ObjectContextSkippedArgs(context) != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -3439,7 +3441,7 @@ ClassWPropsSet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); @@ -3475,12 +3477,12 @@ ObjWPropsGet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); Tcl_Obj *resultObj, *propNameObj; - int i; + Tcl_Size i; if (Tcl_ObjectContextSkippedArgs(context) != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -3504,7 +3506,7 @@ ObjWPropsSet( TCL_UNUSED(void *), Tcl_Interp *interp, Tcl_ObjectContext context, - int objc, + Tcl_Size objc, Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c index e71cddc2817..d204c918f5b 100644 --- a/generic/tclOOInfo.c +++ b/generic/tclOOInfo.c @@ -18,35 +18,35 @@ static inline Class * GetClassFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr); static void SortPropList(Tcl_Obj *list); -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 InfoObjectPropCmd; -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 InfoClassPropCmd; -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 InfoObjectPropCmd; +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 InfoClassPropCmd; +static Tcl_ObjCmdProc2 InfoClassSubsCmd; +static Tcl_ObjCmdProc2 InfoClassSupersCmd; +static Tcl_ObjCmdProc2 InfoClassVariablesCmd; /* * List of commands that are used to implement the [info object] subcommands. @@ -178,7 +178,7 @@ static int InfoObjectClassCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -235,7 +235,7 @@ static int InfoObjectDefnCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -309,7 +309,7 @@ static int InfoObjectFiltersCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Size i; @@ -348,7 +348,7 @@ static int InfoObjectForwardCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -405,7 +405,7 @@ static int InfoObjectIsACmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { static const char *const categories[] = { @@ -525,7 +525,7 @@ static int InfoObjectMethodsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Object *oPtr; @@ -556,7 +556,7 @@ InfoObjectMethodsCmd( return TCL_ERROR; } if (objc != 2) { - int i; + Tcl_Size i; for (i=2 ; iepoch++; 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 7b653cbd5ff..0ba5ce653e9 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 8d3ddd53bde..2fb16abddd9 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4559,7 +4559,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 3ff7755a7c6..bbc9d2cb553 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 85e5c6f01ba..670bfa900d9 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; Tcl_Size 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 b621e31c7ac..453c5a5d0a0 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 be8c2fd19e4..207c377f954 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 d3a803628a9..9ad7d8c52c0 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 83133f9457a..16fa2837504 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 @@ -92,6 +91,15 @@ #undef Tcl_GetByteArrayFromObj #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 + #define TclUtfCharComplete Tcl_UtfCharComplete #define TclUtfNext Tcl_UtfNext #define TclUtfPrev Tcl_UtfPrev @@ -458,8 +466,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 */ @@ -468,8 +476,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 */ @@ -643,7 +651,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 f90750bd12a..06ee5f3f7fa 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,24 +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_CmdObjTraceProc ObjTraceProc; +static Tcl_ObjCmdProc2 NoopObjCmd; +static int ObjTraceProc(void *clientData, + 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; @@ -230,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; @@ -325,24 +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 TestGetUniCharCmd; -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 TestGetUniCharCmd; +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", @@ -544,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; @@ -561,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); @@ -585,9 +596,7 @@ Tcltest_Init( NULL, NULL); Tcl_CreateCommand(interp, "testcmdtoken", TestcmdtokenCmd, NULL, NULL); - Tcl_CreateObjCommand2(interp, "testcmdobj2", Testcmdobj2ObjCmd, - NULL, NULL); - Tcl_CreateObjCommand(interp, "testcmdinfo", TestcmdinfoObjCmd, NULL, + Tcl_CreateObjCommand2(interp, "testcmdinfo", TestcmdinfoObjCmd, NULL, NULL); Tcl_CreateCommand(interp, "testcmdtrace", TestcmdtraceCmd, NULL, NULL); @@ -599,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); @@ -642,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); @@ -679,21 +688,21 @@ 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, "testgetunichar", + Tcl_CreateObjCommand2(interp, "testgetunichar", TestGetUniCharCmd, 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 +720,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) { @@ -814,14 +823,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; @@ -1052,7 +1060,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; @@ -1065,40 +1073,6 @@ TestbumpinterpepochObjCmd( return TCL_OK; } -/* - *---------------------------------------------------------------------- - * - * 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; -} - /* *---------------------------------------------------------------------- * @@ -1121,19 +1095,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"); @@ -1144,29 +1116,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]), CmdProc1, (void *)"original", CmdDelProc1); @@ -1215,8 +1164,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) { @@ -1462,7 +1411,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); @@ -1545,10 +1494,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]); @@ -1868,7 +1817,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[] = { @@ -2317,7 +2266,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; @@ -2502,7 +2451,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; @@ -2548,7 +2497,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; @@ -2597,7 +2546,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 */ @@ -2895,7 +2844,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; @@ -2981,7 +2930,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; @@ -3055,7 +3004,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; @@ -3725,7 +3674,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[] = { @@ -3744,7 +3693,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; @@ -3844,7 +3794,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 */ @@ -4000,7 +3950,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; @@ -4086,7 +4036,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; @@ -4143,7 +4093,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; @@ -4292,7 +4242,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; @@ -4333,7 +4283,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; @@ -4397,7 +4347,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; @@ -4427,7 +4377,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; @@ -4468,10 +4418,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; @@ -4540,7 +4491,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; @@ -4792,7 +4743,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; @@ -5116,7 +5067,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)); @@ -5235,12 +5186,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; @@ -5317,7 +5269,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; @@ -5391,7 +5343,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; @@ -5597,7 +5549,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; @@ -5622,7 +5574,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; @@ -5662,7 +5614,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; @@ -5709,7 +5661,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; @@ -5758,7 +5710,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 { @@ -6864,7 +6816,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; @@ -6916,7 +6868,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[] = { @@ -6978,7 +6930,7 @@ static int TestFilesystemObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { int res, boolVal; @@ -7349,7 +7301,7 @@ static int TestSimpleFilesystemObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { int res, boolVal; @@ -7511,7 +7463,7 @@ static int TestUtfNextCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { Tcl_Size numBytes; @@ -7572,7 +7524,7 @@ static int TestUtfPrevCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { Tcl_Size numBytes, offset; @@ -7612,7 +7564,7 @@ static int TestNumUtfCharsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { if (objc > 1) { @@ -7644,7 +7596,7 @@ static int TestGetUniCharCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter */ - int objc, /* Number of arguments */ + TclSizeT objc, Tcl_Obj *const objv[] /* Argument strings */ ) { @@ -7669,7 +7621,7 @@ static int TestFindFirstCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { if (objc > 1) { @@ -7691,7 +7643,7 @@ static int TestFindLastCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { if (objc > 1) { @@ -7709,7 +7661,7 @@ static int TestGetIntForIndexCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { Tcl_Size result; @@ -7760,7 +7712,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; @@ -7796,7 +7748,7 @@ static int TestHashSystemHashCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { static const Tcl_HashKeyType hkType = { @@ -7941,7 +7893,7 @@ static int TestNREUnwind( TCL_UNUSED(void *), Tcl_Interp *interp, - TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(TclSizeT) /*objc*/, TCL_UNUSED(Tcl_Obj *const *) /*objv*/) { /* @@ -7959,7 +7911,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; @@ -8306,7 +8258,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) { @@ -8339,7 +8291,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) { @@ -8373,7 +8325,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; @@ -8612,7 +8564,7 @@ static int TestInterpResolverCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + TclSizeT objc, Tcl_Obj *const objv[]) { static const char *const table[] = { @@ -8674,7 +8626,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]; @@ -8752,7 +8704,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/tclTestABSList.c b/generic/tclTestABSList.c index 227d1b6b77d..3af349c410e 100644 --- a/generic/tclTestABSList.c +++ b/generic/tclTestABSList.c @@ -920,7 +920,7 @@ static int lLStringObjCmd( void *clientData, Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj * const objv[]) { Tcl_Obj *lstringObj; @@ -1134,7 +1134,7 @@ DupLgenSeriesRep( Tcl_Obj * newLgenObj( Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj * const objv[]) { Tcl_WideInt length; @@ -1185,7 +1185,7 @@ static int lGenObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj * const objv[]) { Tcl_Obj *genObj = newLgenObj(interp, objc-1, &objv[1]); @@ -1204,7 +1204,7 @@ int Lgen_Init(Tcl_Interp *interp) { if (Tcl_InitStubs(interp, "8.7", 0) == NULL) { return TCL_ERROR; } - Tcl_CreateObjCommand(interp, "lgen", lGenObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "lgen", lGenObjCmd, NULL, NULL); Tcl_PkgProvide(interp, "lgen", "1.0"); return TCL_OK; } @@ -1247,8 +1247,8 @@ int Tcl_ABSListTest_Init(Tcl_Interp *interp) { if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) { return TCL_ERROR; } - Tcl_CreateObjCommand(interp, "lstring", lLStringObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "lgen", lGenObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "lstring", lLStringObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "lgen", lGenObjCmd, NULL, NULL); Tcl_PkgProvide(interp, "abstractlisttest", "1.0.0"); return TCL_OK; } diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index 682b41dea13..c80390392aa 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,23 +104,23 @@ 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); if (sizeof(Tcl_Size) == sizeof(Tcl_WideInt)) { - Tcl_CreateObjCommand(interp, "testbigdata", TestbigdataCmd, + Tcl_CreateObjCommand2(interp, "testbigdata", TestbigdataCmd, NULL, NULL); } return TCL_OK; @@ -148,7 +148,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[] = { @@ -347,7 +347,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; @@ -447,7 +447,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; @@ -563,10 +563,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}; @@ -653,7 +654,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; @@ -881,7 +882,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 */ @@ -1081,7 +1082,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; @@ -1311,12 +1312,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]; @@ -1608,7 +1609,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 381ff02fbbd..5ce32744b97 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 c87a7ba533b..884623569ed 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); @@ -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 b1a43a51664..20329902dc9 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 a527fcce670..fe9e4fb2959 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/tclVar.c b/generic/tclVar.c index 31312e18f12..946b06f06df 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); @@ -1481,7 +1481,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; @@ -2696,10 +2696,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) { @@ -2763,13 +2764,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 ...?"); @@ -2828,7 +2829,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; @@ -3034,17 +3035,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; @@ -3281,7 +3282,7 @@ static int ArrayStartSearchCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Var *varPtr; @@ -3376,7 +3377,7 @@ static int ArrayAnyMoreCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *) interp; @@ -3454,7 +3455,7 @@ static int ArrayNextElementCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Var *varPtr; @@ -3534,7 +3535,7 @@ static int ArrayDoneSearchCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *) interp; @@ -3594,7 +3595,7 @@ static int ArrayExistsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *)interp; @@ -3634,7 +3635,7 @@ static int ArrayGetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Var *varPtr, *varPtr2; @@ -3794,7 +3795,7 @@ static int ArrayNamesCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { static const char *const options[] = { @@ -3961,7 +3962,7 @@ static int ArraySetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Obj *arrayNameObj; @@ -4145,7 +4146,7 @@ static int ArraySizeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Var *varPtr; @@ -4204,7 +4205,7 @@ static int ArrayStatsCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Var *varPtr; @@ -4258,7 +4259,7 @@ static int ArrayUnsetCmd( TCL_UNUSED(void *), Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Var *varPtr, *varPtr2, *protectedVarPtr; @@ -4826,14 +4827,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. @@ -4930,14 +4932,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 ; icmd = 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 52ae079f019..5b24df6dac8 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 5388238d330..ee96f44b8c0 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 e4604dc8c76..4579beb0c1d 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 7bf0fb3ac5a..3f9108ec0dc 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/tools/tsdPerf.c b/tools/tsdPerf.c index 0bcc11bfef6..881ff1d9441 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 a47e33dd8e8..c58e07ef010 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='' @@ -1374,7 +1374,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]... @@ -1436,7 +1436,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 @@ -1553,7 +1553,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. @@ -2021,7 +2021,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 @@ -2683,10 +2683,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:-"@:"} @@ -11599,7 +11599,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 @@ -11658,7 +11658,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 633b568626c..b295cef03f5 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 06d0e30ddfc..e42b4e89b29 100644 --- a/unix/dltest/Makefile.in +++ b/unix/dltest/Makefile.in @@ -27,13 +27,13 @@ CC_SWITCHES = $(CFLAGS) -I${SRC_DIR}/../../generic \ 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 be0a49222f9..7c45f903151 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 be4c680077f..cb35b7c2387 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 582d4572010..b089a657ae2 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 e713b23be12..886c8f8c828 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 e0aa45c7ef4..9ad4ab8fbcf 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; @@ -143,6 +143,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 92d3cc924e5..96367f68c57 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 f2d4bd5ad75..b9ff9c5de89 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 402e04fe6a0..6ac7635efa0 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 4e8a75895ef..619739be537 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -1337,7 +1337,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 0f73b5713d5..6822dc5eecb 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; @@ -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,10 +610,11 @@ 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) { Tcl_WrongNumArgs(interp, 1, objv, "mode file ?file ...?"); diff --git a/unix/tclXtTest.c b/unix/tclXtTest.c index 09b16c51aad..ed6dd7a0b29 100644 --- a/unix/tclXtTest.c +++ b/unix/tclXtTest.c @@ -15,7 +15,7 @@ #include #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,7 +79,7 @@ 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 diff --git a/win/Makefile.in b/win/Makefile.in index b9a6d6f9e65..a8b89e9675d 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} @@ -520,7 +518,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: @@ -594,14 +592,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) @@ -865,10 +855,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}"; \ @@ -879,10 +865,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}"; \ diff --git a/win/README b/win/README index 9b001ba0ea0..f596c9b9f67 100644 --- a/win/README +++ b/win/README @@ -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 80d42d4c858..171068d20d3 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='' @@ -1365,7 +1365,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]... @@ -1427,7 +1427,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 @@ -1524,7 +1524,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. @@ -1728,7 +1728,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 @@ -2393,10 +2393,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 @@ -6443,7 +6443,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 @@ -6498,7 +6498,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 d9a94219941..d88b2807a0a 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 diff --git a/win/tcl.m4 b/win/tcl.m4 index 5daeb74b015..40f001406dd 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -983,13 +983,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/tclWinDde.c b/win/tclWinDde.c index 3377bfa7b57..29eb6d1be5a 100644 --- a/win/tclWinDde.c +++ b/win/tclWinDde.c @@ -114,7 +114,7 @@ static int MakeDdeConnection(Tcl_Interp *interp, const WCHAR *name, HCONV *ddeConvPtr); static void SetDdeError(Tcl_Interp *interp); static int DdeObjCmd(void *clientData, - Tcl_Interp *interp, int objc, + Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); #if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7) @@ -167,7 +167,7 @@ Dde_Init( return TCL_ERROR; } - Tcl_CreateObjCommand(interp, "dde", DdeObjCmd, NULL, NULL); + Tcl_CreateObjCommand2(interp, "dde", DdeObjCmd, NULL, NULL); Tcl_CreateExitHandler(DdeExitProc, NULL); return Tcl_PkgProvideEx(interp, TCL_DDE_PACKAGE_NAME, TCL_DDE_VERSION, NULL); } @@ -445,7 +445,7 @@ DdeSetServerName( Tcl_ExposeCommand(interp, "dde", "dde"); } - Tcl_CreateObjCommand(interp, "dde", DdeObjCmd, + Tcl_CreateObjCommand2(interp, "dde", DdeObjCmd, riPtr, DeleteProc); if (Tcl_IsSafe(interp)) { Tcl_HideCommand(interp, "dde", "dde"); @@ -1301,7 +1301,7 @@ static int DdeObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* The interp we are sending from */ - int objc, /* Number of arguments */ + Tcl_Size objc, /* Number of arguments */ Tcl_Obj *const *objv) /* The arguments */ { static const char *const ddeCommands[] = { @@ -1330,8 +1330,8 @@ DdeObjCmd( "-binary", NULL }; - int index, i, argIndex; - Tcl_Size length; + int index, argIndex; + Tcl_Size length, i; int flags = 0, result = TCL_OK, firstArg = 0; HSZ ddeService = NULL, ddeTopic = NULL, ddeItem = NULL, ddeCookie = NULL; HDDEDATA ddeData = NULL, ddeItemData = NULL, ddeReturn; diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c index de4f8f24962..53e587c0f32 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 d9cee73133f..677d5890790 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/tclWinReg.c b/win/tclWinReg.c index 1ccb105735c..90ba6ad78a5 100644 --- a/win/tclWinReg.c +++ b/win/tclWinReg.c @@ -118,7 +118,7 @@ static int ParseKeyName(Tcl_Interp *interp, char *name, static DWORD RecursiveDeleteKey(HKEY hStartKey, const WCHAR * pKeyName, REGSAM mode); static int RegistryObjCmd(void *clientData, - Tcl_Interp *interp, int objc, + Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); static int SetValue(Tcl_Interp *interp, Tcl_Obj *keyNameObj, Tcl_Obj *valueNameObj, Tcl_Obj *dataObj, @@ -176,7 +176,7 @@ Registry_Init( return TCL_ERROR; } - cmd = Tcl_CreateObjCommand(interp, "registry", RegistryObjCmd, + cmd = Tcl_CreateObjCommand2(interp, "registry", RegistryObjCmd, interp, DeleteCmd); Tcl_SetAssocData(interp, REGISTRY_ASSOC_KEY, NULL, cmd); return Tcl_PkgProvideEx(interp, "registry", "1.3.7", NULL); @@ -291,11 +291,11 @@ static int RegistryObjCmd( 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 values. */ { - int n = 1; - int index, argc; + Tcl_Size n = 1, argc; + int index; REGSAM mode = 0; const char *errString = NULL; diff --git a/win/tclWinTest.c b/win/tclWinTest.c index 29bdfe4d837..7c8a0a642e7 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,7 +101,7 @@ 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 @@ -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,10 +639,11 @@ 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) { Tcl_WrongNumArgs(interp, 1, objv, "mode file ?file ...?");