summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2020-03-06 23:44:14 (GMT)
committerdgp <dgp@users.sourceforge.net>2020-03-06 23:44:14 (GMT)
commitfa6d9198c094233c80a546ae164d9773fd2d6bf4 (patch)
tree0e13268936f234d7aecb55060c25758dba925595 /generic/tclNamesp.c
parent81e31a16d82ff906b74f9b726637a3f146b77a4d (diff)
downloadtcl-fa6d9198c094233c80a546ae164d9773fd2d6bf4.zip
tcl-fa6d9198c094233c80a546ae164d9773fd2d6bf4.tar.gz
tcl-fa6d9198c094233c80a546ae164d9773fd2d6bf4.tar.bz2
more
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c163
1 files changed, 54 insertions, 109 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 14cea8b..c39c48b 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -92,47 +92,27 @@ static int GetNamespaceFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, Tcl_Namespace **nsPtrPtr);
static int InvokeImportedNRCmd(ClientData clientData,
Tcl_Interp *interp,int objc,Tcl_Obj *const objv[]);
-static int NamespaceChildrenCmd(ClientData dummy,
- Tcl_Interp *interp,int objc,Tcl_Obj *const objv[]);
-static int NamespaceCodeCmd(ClientData dummy, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int NamespaceCurrentCmd(ClientData dummy,
- Tcl_Interp *interp,int objc,Tcl_Obj *const objv[]);
-static int NamespaceDeleteCmd(ClientData dummy,Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int NamespaceEvalCmd(ClientData dummy, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int NRNamespaceEvalCmd(ClientData dummy,
- Tcl_Interp *interp,int objc,Tcl_Obj *const objv[]);
-static int NamespaceExistsCmd(ClientData dummy,Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int NamespaceExportCmd(ClientData dummy,Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int NamespaceForgetCmd(ClientData dummy,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;
static void NamespaceFree(Namespace *nsPtr);
-static int NamespaceImportCmd(ClientData dummy,Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int NamespaceInscopeCmd(ClientData dummy,
- Tcl_Interp *interp,int objc,Tcl_Obj *const objv[]);
-static int NRNamespaceInscopeCmd(ClientData dummy,
- Tcl_Interp *interp,int objc,Tcl_Obj *const objv[]);
-static int NamespaceOriginCmd(ClientData dummy,Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int NamespaceParentCmd(ClientData dummy,Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int NamespacePathCmd(ClientData dummy, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int NamespaceQualifiersCmd(ClientData dummy,
- Tcl_Interp *interp,int objc,Tcl_Obj *const objv[]);
-static int NamespaceTailCmd(ClientData dummy, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int NamespaceUpvarCmd(ClientData dummy, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int NamespaceUnknownCmd(ClientData dummy,
- Tcl_Interp *interp,int objc,Tcl_Obj *const objv[]);
-static int NamespaceWhichCmd(ClientData dummy, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
+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 int SetNsNameFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
static void UnlinkNsPath(Namespace *nsPtr);
@@ -514,16 +494,12 @@ TclPopStackFrame(
static char *
EstablishErrorCodeTraces(
- ClientData dummy,
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp,
- const char *name1,
- const char *name2,
- int flags)
+ TCL_UNUSED(const char *) /*name1*/,
+ TCL_UNUSED(const char *) /*name2*/,
+ TCL_UNUSED(int) /*flags*/)
{
- (void)dummy;
- (void)name1;
- (void)name2;
- (void)flags;
Tcl_TraceVar2(interp, "errorCode", NULL, TCL_GLOBAL_ONLY|TCL_TRACE_READS,
ErrorCodeRead, NULL);
Tcl_TraceVar2(interp, "errorCode", NULL, TCL_GLOBAL_ONLY|TCL_TRACE_UNSETS,
@@ -550,17 +526,13 @@ EstablishErrorCodeTraces(
static char *
ErrorCodeRead(
- ClientData dummy,
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp,
- const char *name1,
- const char *name2,
- int flags)
+ TCL_UNUSED(const char *) /*name1*/,
+ TCL_UNUSED(const char *) /*name2*/,
+ TCL_UNUSED(int) /*flags*/)
{
Interp *iPtr = (Interp *) interp;
- (void)dummy;
- (void)name1;
- (void)name2;
- (void)flags;
if (Tcl_InterpDeleted(interp) || !(iPtr->flags & ERR_LEGACY_COPY)) {
return NULL;
@@ -596,17 +568,12 @@ ErrorCodeRead(
static char *
EstablishErrorInfoTraces(
- ClientData dummy,
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp,
- const char *name1,
- const char *name2,
- int flags)
+ TCL_UNUSED(const char *) /*name1*/,
+ TCL_UNUSED(const char *) /*name2*/,
+ TCL_UNUSED(int) /*flags*/)
{
- (void)dummy;
- (void)name1;
- (void)name2;
- (void)flags;
-
Tcl_TraceVar2(interp, "errorInfo", NULL, TCL_GLOBAL_ONLY|TCL_TRACE_READS,
ErrorInfoRead, NULL);
Tcl_TraceVar2(interp, "errorInfo", NULL, TCL_GLOBAL_ONLY|TCL_TRACE_UNSETS,
@@ -633,17 +600,13 @@ EstablishErrorInfoTraces(
static char *
ErrorInfoRead(
- ClientData dummy,
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp,
- const char *name1,
- const char *name2,
- int flags)
+ TCL_UNUSED(const char *) /*name1*/,
+ TCL_UNUSED(const char *) /*name2*/,
+ TCL_UNUSED(int) /*flags*/)
{
Interp *iPtr = (Interp *) interp;
- (void)dummy;
- (void)name1;
- (void)name2;
- (void)flags;
if (Tcl_InterpDeleted(interp) || !(iPtr->flags & ERR_LEGACY_COPY)) {
return NULL;
@@ -3015,7 +2978,7 @@ TclInitNamespaceCmd(
static int
NamespaceChildrenCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -3028,7 +2991,6 @@ NamespaceChildrenCmd(
Tcl_HashEntry *entryPtr;
Tcl_HashSearch search;
Tcl_Obj *listPtr, *elemPtr;
- (void)dummy;
/*
* Get a pointer to the specified namespace, or the current namespace.
@@ -3145,7 +3107,7 @@ NamespaceChildrenCmd(
static int
NamespaceCodeCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -3154,7 +3116,6 @@ NamespaceCodeCmd(
Tcl_Obj *listPtr, *objPtr;
const char *arg;
int length;
- (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arg");
@@ -3227,13 +3188,12 @@ NamespaceCodeCmd(
static int
NamespaceCurrentCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Namespace *currNsPtr;
- (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -3291,7 +3251,7 @@ NamespaceCurrentCmd(
static int
NamespaceDeleteCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -3299,7 +3259,6 @@ NamespaceDeleteCmd(
Tcl_Namespace *namespacePtr;
const char *name;
int i;
- (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?name name...?");
@@ -3380,7 +3339,7 @@ NamespaceEvalCmd(
static int
NRNamespaceEvalCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -3392,7 +3351,6 @@ NRNamespaceEvalCmd(
CallFrame *framePtr, **framePtrPtr;
Tcl_Obj *objPtr;
int result;
- (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name arg ?arg...?");
@@ -3513,13 +3471,12 @@ NsEval_Callback(
static int
NamespaceExistsCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Namespace *namespacePtr;
- (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -3569,13 +3526,12 @@ NamespaceExistsCmd(
static int
NamespaceExportCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
int firstArg, i;
- (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?-clear? ?pattern pattern...?");
@@ -3651,14 +3607,13 @@ NamespaceExportCmd(
static int
NamespaceForgetCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *pattern;
int i, result;
- (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?pattern pattern...?");
@@ -3717,7 +3672,7 @@ NamespaceForgetCmd(
static int
NamespaceImportCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -3726,7 +3681,6 @@ NamespaceImportCmd(
const char *string, *pattern;
int i, result;
int firstArg;
- (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?-force? ?pattern pattern...?");
@@ -3833,7 +3787,7 @@ NamespaceInscopeCmd(
static int
NRNamespaceInscopeCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -3842,7 +3796,6 @@ NRNamespaceInscopeCmd(
CallFrame *framePtr, **framePtrPtr;
int i;
Tcl_Obj *cmdObjPtr;
- (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name arg ?arg...?");
@@ -3931,14 +3884,13 @@ NRNamespaceInscopeCmd(
static int
NamespaceOriginCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Command command, origCommand;
Tcl_Obj *resultPtr;
- (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -3993,13 +3945,12 @@ NamespaceOriginCmd(
static int
NamespaceParentCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Namespace *nsPtr;
- (void)dummy;
if (objc == 1) {
nsPtr = TclGetCurrentNamespace(interp);
@@ -4052,7 +4003,7 @@ NamespaceParentCmd(
static int
NamespacePathCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -4061,7 +4012,6 @@ NamespacePathCmd(
int i, nsObjc, result = TCL_ERROR;
Tcl_Obj **nsObjv;
Tcl_Namespace **namespaceList = NULL;
- (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?pathList?");
@@ -4278,14 +4228,13 @@ TclInvalidateNsPath(
static int
NamespaceQualifiersCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *name, *p;
int length;
- (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
@@ -4347,7 +4296,7 @@ NamespaceQualifiersCmd(
static int
NamespaceUnknownCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -4355,7 +4304,6 @@ NamespaceUnknownCmd(
Tcl_Namespace *currNsPtr;
Tcl_Obj *resultPtr;
int rc;
- (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?script?");
@@ -4535,13 +4483,12 @@ Tcl_SetNamespaceUnknownHandler(
static int
NamespaceTailCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *name, *p;
- (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
@@ -4594,7 +4541,7 @@ NamespaceTailCmd(
static int
NamespaceUpvarCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -4603,7 +4550,6 @@ NamespaceUpvarCmd(
Tcl_Namespace *nsPtr, *savedNsPtr;
Var *otherPtr, *arrayPtr;
const char *myName;
- (void)dummy;
if (objc < 2 || (objc & 1)) {
Tcl_WrongNumArgs(interp, 1, objv, "ns ?otherVar myVar ...?");
@@ -4669,7 +4615,7 @@ NamespaceUpvarCmd(
static int
NamespaceWhichCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -4679,7 +4625,6 @@ NamespaceWhichCmd(
};
int lookupType = 0;
Tcl_Obj *resultPtr;
- (void)dummy;
if (objc < 2 || objc > 3) {
badArgs: