summaryrefslogtreecommitdiffstats
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
parent81e31a16d82ff906b74f9b726637a3f146b77a4d (diff)
downloadtcl-fa6d9198c094233c80a546ae164d9773fd2d6bf4.zip
tcl-fa6d9198c094233c80a546ae164d9773fd2d6bf4.tar.gz
tcl-fa6d9198c094233c80a546ae164d9773fd2d6bf4.tar.bz2
more
-rw-r--r--generic/tclLink.c12
-rw-r--r--generic/tclListObj.c8
-rw-r--r--generic/tclLoad.c9
-rw-r--r--generic/tclMain.c3
-rw-r--r--generic/tclNamesp.c163
5 files changed, 66 insertions, 129 deletions
diff --git a/generic/tclLink.c b/generic/tclLink.c
index 9ed7f51..23a0ebe 100644
--- a/generic/tclLink.c
+++ b/generic/tclLink.c
@@ -628,12 +628,11 @@ IsSpecial(
static int
SetInvalidRealFromAny(
- Tcl_Interp *dummy,
+ TCL_UNUSED(Tcl_Interp *),
Tcl_Obj *objPtr)
{
const char *str;
const char *endPtr;
- (void)dummy;
str = TclGetString(objPtr);
if ((objPtr->length == 1) && (str[0] == '.')) {
@@ -746,8 +745,11 @@ static char *
LinkTraceProc(
ClientData clientData, /* Contains information about the link. */
Tcl_Interp *interp, /* Interpreter containing Tcl variable. */
- const char *name1, /* First part of variable name. */
- const char *name2, /* Second part of variable name. */
+ TCL_UNUSED(const char *) /*name1*/,
+ TCL_UNUSED(const char *) /*name2*/,
+ /* Links can only be made to global variables,
+ * so we can find them with need to resolve
+ * caller-supplied name in caller context. */
int flags) /* Miscellaneous additional information. */
{
Link *linkPtr = (Link *)clientData;
@@ -763,8 +765,6 @@ LinkTraceProc(
int objc;
Tcl_Obj **objv;
int i;
- (void)name1;
- (void)name2;
/*
* If the variable is being unset, then just re-create it (with a trace)
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index 5de2eac..2877796 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -336,13 +336,9 @@ Tcl_Obj *
Tcl_DbNewListObj(
int objc, /* Count of objects referenced by objv. */
Tcl_Obj *const objv[], /* An array of pointers to Tcl objects. */
- const char *file, /* The name of the source file calling this
- * function; used for debugging. */
- int line) /* Line number in the source file; used for
- * debugging. */
+ TCL_UNUSED(const char *) /*file*/,
+ TCL_UNUSED(int) /*line*/)
{
- (void)file;
- (void)line;
return Tcl_NewListObj(objc, objv);
}
#endif /* TCL_MEM_DEBUG */
diff --git a/generic/tclLoad.c b/generic/tclLoad.c
index d690902..738f65b 100644
--- a/generic/tclLoad.c
+++ b/generic/tclLoad.c
@@ -115,7 +115,7 @@ static void LoadCleanupProc(ClientData clientData,
int
Tcl_LoadObjCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -140,7 +140,6 @@ Tcl_LoadObjCmd(
enum options {
LOAD_GLOBAL, LOAD_LAZY, LOAD_LAST
};
- (void)dummy;
while (objc > 2) {
if (TclGetString(objv[1])[0] != '-') {
@@ -543,7 +542,7 @@ Tcl_LoadObjCmd(
int
Tcl_UnloadObjCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -563,7 +562,6 @@ Tcl_UnloadObjCmd(
enum options {
UNLOAD_NOCOMPLAIN, UNLOAD_KEEPLIB, UNLOAD_LAST
};
- (void)dummy;
for (i = 1; i < objc; i++) {
if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
@@ -1154,10 +1152,9 @@ static void
LoadCleanupProc(
ClientData clientData, /* Pointer to first InterpPackage structure
* for interp. */
- Tcl_Interp *dummy) /* Interpreter that is being deleted. */
+ TCL_UNUSED(Tcl_Interp *))
{
InterpPackage *ipPtr, *nextPtr;
- (void)dummy;
ipPtr = (InterpPackage *)clientData;
while (ipPtr != NULL) {
diff --git a/generic/tclMain.c b/generic/tclMain.c
index b882afc..faa0d31 100644
--- a/generic/tclMain.c
+++ b/generic/tclMain.c
@@ -735,14 +735,13 @@ TclFullFinalizationRequested(void)
static void
StdinProc(
ClientData clientData, /* The state of interactive cmd line */
- int mask) /* Not used. */
+ TCL_UNUSED(int) /*mask*/)
{
int code, length;
InteractiveState *isPtr = (InteractiveState *)clientData;
Tcl_Channel chan = isPtr->input;
Tcl_Obj *commandPtr = isPtr->commandPtr;
Tcl_Interp *interp = isPtr->interp;
- (void)mask;
if (Tcl_IsShared(commandPtr)) {
Tcl_DecrRefCount(commandPtr);
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: