summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-10-06 09:21:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-10-06 09:21:10 (GMT)
commitdefed3ccfb86cc203dac761230b36ea1c039aa1f (patch)
treea187af2d9b1d189a6853ac7e1e6d66fddad1d0fe
parenta2630a8d1de1d2f03d766b26be2c036bf267cbe9 (diff)
parent07279b85ab489decd93b6f3bddeec091b8b43869 (diff)
downloadtcl-defed3ccfb86cc203dac761230b36ea1c039aa1f.zip
tcl-defed3ccfb86cc203dac761230b36ea1c039aa1f.tar.gz
tcl-defed3ccfb86cc203dac761230b36ea1c039aa1f.tar.bz2
Make TclInvokeObjectCommand/TclInvokeStringCommand static functions. They are not needed/useful for extensions
-rw-r--r--generic/tclBasic.c32
-rw-r--r--generic/tclInt.decls22
-rw-r--r--generic/tclIntDecls.h20
-rw-r--r--generic/tclStubInit.c4
-rw-r--r--tests/basic.test4
5 files changed, 41 insertions, 41 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 714bb6f..f46c2bf 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -184,6 +184,7 @@ static Tcl_NRPostProc DTraceCmdReturn;
#else
# define DTraceCmdReturn NULL
#endif /* USE_DTRACE */
+static Tcl_ObjCmdProc InvokeStringCommand;
static Tcl_ObjCmdProc ExprAbsFunc;
static Tcl_ObjCmdProc ExprBinaryFunc;
static Tcl_ObjCmdProc ExprBoolFunc;
@@ -212,6 +213,7 @@ static void MathFuncWrongNumArgs(Tcl_Interp *interp, int expected,
static Tcl_NRPostProc NRCoroutineCallerCallback;
static Tcl_NRPostProc NRCoroutineExitCallback;
static Tcl_NRPostProc NRCommand;
+static Tcl_CmdProc InvokeObjectCommand;
static void ProcessUnexpectedResult(Tcl_Interp *interp,
int returnCode);
@@ -1068,10 +1070,10 @@ Tcl_CreateInterp(void)
* 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
+ * 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.
+ * Tcl_CmdProc, set the Tcl_CmdProc to InvokeObjectCommand.
*/
for (cmdInfoPtr = builtInCmds; cmdInfoPtr->name != NULL; cmdInfoPtr++) {
@@ -1090,7 +1092,7 @@ 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;
@@ -2479,7 +2481,7 @@ Tcl_ExposeCommand(
* 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
+ * (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.
*
@@ -2621,7 +2623,7 @@ Tcl_CreateCommand(
cmdPtr->refCount = 1;
cmdPtr->cmdEpoch = 0;
cmdPtr->compileProc = NULL;
- cmdPtr->objProc = TclInvokeStringCommand;
+ cmdPtr->objProc = InvokeStringCommand;
cmdPtr->objClientData = cmdPtr;
cmdPtr->proc = proc;
cmdPtr->clientData = clientData;
@@ -2910,7 +2912,7 @@ TclCreateObjCommandInNs(
cmdPtr->compileProc = NULL;
cmdPtr->objProc = proc;
cmdPtr->objClientData = clientData;
- cmdPtr->proc = TclInvokeObjectCommand;
+ cmdPtr->proc = InvokeObjectCommand;
cmdPtr->clientData = cmdPtr;
cmdPtr->deleteProc = deleteProc;
cmdPtr->deleteData = clientData;
@@ -2951,7 +2953,7 @@ TclCreateObjCommandInNs(
/*
*----------------------------------------------------------------------
*
- * TclInvokeStringCommand --
+ * InvokeStringCommand --
*
* "Wrapper" Tcl_ObjCmdProc used to call an existing string-based
* Tcl_CmdProc if no object-based function exists for a command. A
@@ -2964,13 +2966,13 @@ 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. */
@@ -2999,7 +3001,7 @@ 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
@@ -3012,13 +3014,13 @@ TclInvokeStringCommand(
*
* Side effects:
* Besides those side effects of the called Tcl_ObjCmdProc,
- * TclInvokeObjectCommand allocates and frees storage.
+ * 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. */
@@ -3375,7 +3377,7 @@ Tcl_SetCommandInfoFromToken(
cmdPtr->proc = infoPtr->proc;
cmdPtr->clientData = infoPtr->clientData;
if (infoPtr->objProc == NULL) {
- cmdPtr->objProc = TclInvokeStringCommand;
+ cmdPtr->objProc = InvokeStringCommand;
cmdPtr->objClientData = cmdPtr;
cmdPtr->nreProc = NULL;
} else {
@@ -3487,7 +3489,7 @@ Tcl_GetCommandInfoFromToken(
cmdPtr = (Command *) cmd;
infoPtr->isNativeObjectProc =
- (cmdPtr->objProc != TclInvokeStringCommand);
+ (cmdPtr->objProc != InvokeStringCommand);
infoPtr->objProc = cmdPtr->objProc;
infoPtr->objClientData = cmdPtr->objClientData;
infoPtr->proc = cmdPtr->proc;
@@ -8588,7 +8590,7 @@ 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_ObjCmdProc 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
* command.
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index f539532..36c6159 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,
+# Tcl_Size argc, const char **argv)
+#}
+#declare 54 {
+# int TclInvokeStringCommand(void *clientData, Tcl_Interp *interp,
+# Tcl_Size objc, Tcl_Obj *const objv[])
+#}
declare 55 {
Proc *TclIsProc(Command *cmdPtr)
}
@@ -162,6 +163,11 @@ declare 61 {
declare 62 {
int TclObjCommandComplete(Tcl_Obj *cmdPtr)
}
+# Removed in 9.0:
+#declare 63 {
+# int TclObjInterpProc(void *clientData, Tcl_Interp *interp,
+# Tcl_Size objc, Tcl_Obj *const objv[])
+#}
declare 64 {
int TclObjInvoke(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[],
int flags)
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h
index afc429d..40b02d6 100644
--- a/generic/tclIntDecls.h
+++ b/generic/tclIntDecls.h
@@ -144,14 +144,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 */
@@ -641,8 +635,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);
@@ -943,10 +937,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 */
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index f361345..4ed0651 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -458,8 +458,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 */
diff --git a/tests/basic.test b/tests/basic.test
index c90d80e..067f9b0 100644
--- a/tests/basic.test
+++ b/tests/basic.test
@@ -242,10 +242,10 @@ test basic-15.2 {Tcl_CreateObjCommand, Bug 0e4d88b650} -setup {
}
-test basic-16.1 {TclInvokeStringCommand} {emptyTest} {
+test basic-16.1 {InvokeStringCommand} {emptyTest} {
} {}
-test basic-17.1 {TclInvokeObjCommand} {emptyTest} {
+test basic-17.1 {InvokeObjCommand} {emptyTest} {
} {}
test basic-18.1 {TclRenameCommand, name of existing cmd can have namespace qualifiers} {