summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2020-03-06 13:45:00 (GMT)
committerdgp <dgp@users.sourceforge.net>2020-03-06 13:45:00 (GMT)
commit39956f875b4912769d0e660e52054bbdb8670e1c (patch)
tree443e49c8ac055c02744005923897273c88117d9d /generic/tclBasic.c
parent02ceb3f3a43bd0d5c7e4fe00b99c1f4cc67919a3 (diff)
downloadtcl-39956f875b4912769d0e660e52054bbdb8670e1c.zip
tcl-39956f875b4912769d0e660e52054bbdb8670e1c.tar.gz
tcl-39956f875b4912769d0e660e52054bbdb8670e1c.tar.bz2
More deployment of TCL_UNUSED. (Travis appears happy with it).
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c138
1 files changed, 46 insertions, 92 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index c02cf6a..f7f4f19 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -1374,12 +1374,10 @@ static int
BadEnsembleSubcommand(
ClientData clientData,
Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const objv[])
+ TCL_UNUSED(int) /*objc*/,
+ TCL_UNUSED(Tcl_Obj *const *) /* objv */)
{
const UnsafeEnsembleInfo *infoPtr = (const UnsafeEnsembleInfo *)clientData;
- (void)objc;
- (void)objv;
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"not allowed to invoke subcommand %s of %s",
@@ -3319,13 +3317,12 @@ Tcl_GetCommandInfoFromToken(
const char *
Tcl_GetCommandName(
- Tcl_Interp *dummy, /* Not used. */
+ TCL_UNUSED(Tcl_Interp *),
Tcl_Command command) /* Token for command returned by a previous
* call to Tcl_CreateCommand. The command must
* not have been deleted. */
{
Command *cmdPtr = (Command *) command;
- (void)dummy;
if ((cmdPtr == NULL) || (cmdPtr->hPtr == NULL)) {
/*
@@ -3768,12 +3765,11 @@ CallCommandTraces(
static int
CancelEvalProc(
ClientData clientData, /* Interp to cancel the script in progress. */
- Tcl_Interp *dummy, /* Not used. */
+ TCL_UNUSED(Tcl_Interp *),
int code) /* Current return code from command. */
{
CancelInfo *cancelInfo = (CancelInfo *)clientData;
Interp *iPtr;
- (void)dummy;
if (cancelInfo != NULL) {
Tcl_MutexLock(&cancelLock);
@@ -4616,7 +4612,7 @@ static int
EvalObjvCore(
ClientData data[],
Tcl_Interp *interp,
- int result)
+ TCL_UNUSED(int) /*result*/)
{
Command *cmdPtr = NULL, *preCmdPtr = (Command *)data[0];
int flags = PTR2INT(data[1]);
@@ -4625,7 +4621,6 @@ EvalObjvCore(
Interp *iPtr = (Interp *) interp;
Namespace *lookupNsPtr = NULL;
int enterTracesDone = 0;
- (void)result;
/*
* Push records for task to be done on return, in INVERSE order. First, if
@@ -4777,14 +4772,13 @@ static int
Dispatch(
ClientData data[],
Tcl_Interp *interp,
- int result)
+ TCL_UNUSED(int) /*result*/)
{
Tcl_ObjCmdProc *objProc = (Tcl_ObjCmdProc *)data[0];
ClientData clientData = data[1];
int objc = PTR2INT(data[2]);
Tcl_Obj **objv = (Tcl_Obj **)data[3];
Interp *iPtr = (Interp *) interp;
- (void)result;
#ifdef USE_DTRACE
if (TCL_DTRACE_CMD_ARGS_ENABLED()) {
@@ -7037,7 +7031,7 @@ TclObjInvoke(
int
TclNRInvoke(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -7047,7 +7041,6 @@ TclNRInvoke(
const char *cmdName; /* Name of the command from objv[0]. */
Tcl_HashEntry *hPtr = NULL;
Command *cmdPtr;
- (void)dummy;
cmdName = TclGetString(objv[0]);
hTblPtr = iPtr->hiddenCmdTablePtr;
@@ -7081,12 +7074,11 @@ TclNRInvoke(
static int
NRPostInvoke(
- ClientData dummy[], /* Not used. */
+ TCL_UNUSED(ClientData *),
Tcl_Interp *interp,
int result)
{
Interp *iPtr = (Interp *)interp;
- (void)dummy;
iPtr->numLevels--;
return result;
@@ -7522,7 +7514,7 @@ Tcl_GetVersion(
static int
ExprCeilFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -7531,7 +7523,6 @@ ExprCeilFunc(
int code;
double d;
mp_int big;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7563,7 +7554,7 @@ ExprCeilFunc(
static int
ExprFloorFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -7572,7 +7563,6 @@ ExprFloorFunc(
int code;
double d;
mp_int big;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7604,7 +7594,7 @@ ExprFloorFunc(
static int
ExprIsqrtFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter list. */
@@ -7616,7 +7606,6 @@ ExprIsqrtFunc(
mp_int big;
int exact = 0; /* Flag ==1 if the argument can be represented
* in a double as an exact integer. */
- (void)dummy;
/*
* Check syntax.
@@ -7711,7 +7700,7 @@ ExprIsqrtFunc(
static int
ExprSqrtFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -7720,7 +7709,6 @@ ExprSqrtFunc(
int code;
double d;
mp_int big;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7880,7 +7868,7 @@ ExprBinaryFunc(
static int
ExprAbsFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -7889,7 +7877,6 @@ ExprAbsFunc(
ClientData ptr;
int type;
mp_int big;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7980,14 +7967,13 @@ ExprAbsFunc(
static int
ExprBoolFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
int value;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8002,14 +7988,13 @@ ExprBoolFunc(
static int
ExprDoubleFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
double dResult;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8030,7 +8015,7 @@ ExprDoubleFunc(
static int
ExprIntFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -8039,7 +8024,6 @@ ExprIntFunc(
double d;
int type;
ClientData ptr;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8087,14 +8071,13 @@ ExprIntFunc(
static int
ExprWideFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
Tcl_WideInt wResult;
- (void)dummy;
if (ExprIntFunc(NULL, interp, objc, objv) != TCL_OK) {
return TCL_ERROR;
@@ -8109,7 +8092,7 @@ ExprWideFunc(
*/
static int
ExprMaxMinFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -8120,7 +8103,6 @@ ExprMaxMinFunc(
double d;
int type, i;
ClientData ptr;
- (void)dummy;
if (objc < 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8150,31 +8132,29 @@ ExprMaxMinFunc(
static int
ExprMaxFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
- (void)dummy;
return ExprMaxMinFunc(NULL, interp, objc, objv, MP_GT);
}
static int
ExprMinFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
- (void)dummy;
return ExprMaxMinFunc(NULL, interp, objc, objv, MP_LT);
}
static int
ExprRandFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -8185,7 +8165,6 @@ ExprRandFunc(
long tmp; /* Algorithm assumes at least 32 bits. Only
* long guarantees that. See below. */
Tcl_Obj *oResult;
- (void)dummy;
if (objc != 1) {
MathFuncWrongNumArgs(interp, 1, objc, objv);
@@ -8268,7 +8247,7 @@ ExprRandFunc(
static int
ExprRoundFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -8277,7 +8256,6 @@ ExprRoundFunc(
double d;
ClientData ptr;
int type;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8348,15 +8326,14 @@ ExprRoundFunc(
static int
ExprSrandFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Parameter vector. */
{
Interp *iPtr = (Interp *) interp;
- Tcl_WideInt w = 0; /* Initialized to avoid compiler warning. */
- (void)dummy;
+ Tcl_WideInt w = 0; /* Initialized to avoid compiler warning. */
/*
* Convert argument and use it to reset the seed.
@@ -8538,7 +8515,7 @@ ClassifyDouble(
static int
ExprIsFiniteFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -8547,7 +8524,6 @@ ExprIsFiniteFunc(
double d;
ClientData ptr;
int type, result = 0;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8570,7 +8546,7 @@ ExprIsFiniteFunc(
static int
ExprIsInfinityFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -8579,7 +8555,6 @@ ExprIsInfinityFunc(
double d;
ClientData ptr;
int type, result = 0;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8601,7 +8576,7 @@ ExprIsInfinityFunc(
static int
ExprIsNaNFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -8610,7 +8585,6 @@ ExprIsNaNFunc(
double d;
ClientData ptr;
int type, result = 1;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8632,7 +8606,7 @@ ExprIsNaNFunc(
static int
ExprIsNormalFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -8641,7 +8615,6 @@ ExprIsNormalFunc(
double d;
ClientData ptr;
int type, result = 0;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8663,7 +8636,7 @@ ExprIsNormalFunc(
static int
ExprIsSubnormalFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -8672,7 +8645,6 @@ ExprIsSubnormalFunc(
double d;
ClientData ptr;
int type, result = 0;
- (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8694,7 +8666,7 @@ ExprIsSubnormalFunc(
static int
ExprIsUnorderedFunc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -8703,7 +8675,6 @@ ExprIsUnorderedFunc(
double d;
ClientData ptr;
int type, result = 0;
- (void)dummy;
if (objc != 3) {
MathFuncWrongNumArgs(interp, 3, objc, objv);
@@ -8736,7 +8707,7 @@ ExprIsUnorderedFunc(
static int
FloatClassifyObjCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -8746,7 +8717,6 @@ FloatClassifyObjCmd(
Tcl_Obj *objPtr;
ClientData ptr;
int type;
- (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "floatValue");
@@ -8846,14 +8816,11 @@ MathFuncWrongNumArgs(
static int
DTraceObjCmd(
- ClientData dummy, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
+ TCL_UNUSED(ClientData),
+ TCL_UNUSED(Tcl_Interp *),
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- (void)dummy;
- (void)interp;
-
if (TCL_DTRACE_TCL_PROBE_ENABLED()) {
char *a[10];
int i = 0;
@@ -9233,13 +9200,12 @@ TclSetTailcall(
int
TclNRTailcallObjCmd(
- ClientData dummy,
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Interp *iPtr = (Interp *) interp;
- (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?command? ?arg ...?");
@@ -9339,11 +9305,10 @@ TclNRTailcallEval(
int
TclNRReleaseValues(
ClientData data[],
- Tcl_Interp *dummy,
+ TCL_UNUSED(Tcl_Interp *),
int result)
{
int i = 0;
- (void)dummy;
while (i < 4) {
if (data[i]) {
@@ -9428,7 +9393,7 @@ TclNRYieldObjCmd(
int
TclNRYieldToObjCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -9436,7 +9401,6 @@ TclNRYieldToObjCmd(
CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;
Tcl_Obj *listPtr, *nsObjPtr;
Tcl_Namespace *nsPtr = TclGetCurrentNamespace(interp);
- (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "command ?arg ...?");
@@ -9483,9 +9447,8 @@ static int
RewindCoroutineCallback(
ClientData data[],
Tcl_Interp *interp,
- int result)
+ TCL_UNUSED(int) /*result*/)
{
- (void)result;
return Tcl_RestoreInterpState(interp, (Tcl_InterpState)data[0]);
}
@@ -9635,13 +9598,12 @@ int
TclNRCoroutineActivateCallback(
ClientData data[],
Tcl_Interp *interp,
- int result)
+ TCL_UNUSED(int) /*result*/)
{
CoroutineData *corPtr = (CoroutineData *)data[0];
int type = PTR2INT(data[1]);
int numLevels, unused;
int *stackLevel = &unused;
- (void)result;
if (!corPtr->stackLevel) {
/*
@@ -9715,12 +9677,11 @@ static int
TclNREvalList(
ClientData data[],
Tcl_Interp *interp,
- int result)
+ TCL_UNUSED(int) /*result*/)
{
int objc;
Tcl_Obj **objv;
Tcl_Obj *listPtr = (Tcl_Obj *)data[0];
- (void)result;
Tcl_IncrRefCount(listPtr);
@@ -9742,14 +9703,13 @@ TclNREvalList(
static int
CoroTypeObjCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Command *cmdPtr;
CoroutineData *corPtr;
- (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "coroName");
@@ -9833,14 +9793,13 @@ GetCoroutineFromObj(
static int
TclNRCoroInjectObjCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
CoroutineData *corPtr;
ExecEnv *savedEEPtr = iPtr->execEnvPtr;
- (void)dummy;
/*
* Usage more or less like tailcall:
@@ -9879,7 +9838,7 @@ TclNRCoroInjectObjCmd(
static int
TclNRCoroProbeObjCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -9888,7 +9847,6 @@ TclNRCoroProbeObjCmd(
ExecEnv *savedEEPtr = iPtr->execEnvPtr;
int numLevels, unused;
int *stackLevel = &unused;
- (void)dummy;
/*
* Usage more or less like tailcall:
@@ -9979,7 +9937,7 @@ static int
InjectHandler(
ClientData data[],
Tcl_Interp *interp,
- int result)
+ TCL_UNUSED(int) /*result*/)
{
CoroutineData *corPtr = (CoroutineData *)data[0];
Tcl_Obj *listPtr = (Tcl_Obj *)data[1];
@@ -9987,7 +9945,6 @@ InjectHandler(
ClientData isProbe = data[3];
int objc;
Tcl_Obj **objv;
- (void)result;
if (!isProbe) {
/*
@@ -10074,14 +10031,13 @@ InjectHandlerPostCall(
static int
NRInjectObjCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
CoroutineData *corPtr;
ExecEnv *savedEEPtr = iPtr->execEnvPtr;
- (void)dummy;
/*
* Usage more or less like tailcall:
@@ -10184,7 +10140,7 @@ TclNRInterpCoroutine(
int
TclNRCoroutineObjCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -10195,7 +10151,6 @@ TclNRCoroutineObjCmd(
Namespace *nsPtr, *altNsPtr, *cxtNsPtr,
*inNsPtr = (Namespace *)TclGetCurrentNamespace(interp);
Namespace *lookupNsPtr = iPtr->varFramePtr->nsPtr;
- (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name cmd ?arg ...?");
@@ -10318,13 +10273,12 @@ TclNRCoroutineObjCmd(
int
TclInfoCoroutineCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;
- (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);