From 39956f875b4912769d0e660e52054bbdb8670e1c Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 13:45:00 +0000 Subject: More deployment of TCL_UNUSED. (Travis appears happy with it). --- generic/tclAssembly.c | 13 ++--- generic/tclBasic.c | 138 +++++++++++++++++--------------------------------- 2 files changed, 50 insertions(+), 101 deletions(-) diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 88f3e29..4491d9b 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -787,7 +787,7 @@ Tcl_AssembleObjCmd( int TclNRAssembleObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -796,7 +796,6 @@ TclNRAssembleObjCmd( Tcl_Obj* backtrace; /* Object where extra error information is * constructed. */ - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "bytecodeList"); return TCL_ERROR; @@ -961,8 +960,7 @@ TclCompileAssembleCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr; /* Token in the input script */ @@ -970,7 +968,6 @@ TclCompileAssembleCmd( int numCommands = envPtr->numCommands; int offset = envPtr->codeNext - envPtr->codeStart; int depth = envPtr->currStackDepth; - (void)cmdPtr; /* * Make sure that the command has a single arg that is a simple word. */ @@ -4314,11 +4311,9 @@ AddBasicBlockRangeToErrorInfo( static void DupAssembleCodeInternalRep( - Tcl_Obj *srcPtr, - Tcl_Obj *copyPtr) + TCL_UNUSED(Tcl_Obj *), + TCL_UNUSED(Tcl_Obj *)) { - (void)srcPtr; - (void)copyPtr; return; } 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); -- cgit v0.12 From d38d34e93774eb6c4b854721d8273280033bdc34 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 13:55:07 +0000 Subject: Untangle some MEM_DEBUG ifdeffery. --- generic/tclBinary.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index d269fbe..f0fc866 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -352,6 +352,7 @@ Tcl_NewByteArrayObj( *---------------------------------------------------------------------- */ +#ifdef TCL_MEM_DEBUG Tcl_Obj * Tcl_DbNewByteArrayObj( const unsigned char *bytes, /* The array of bytes used to initialize the @@ -363,18 +364,25 @@ Tcl_DbNewByteArrayObj( int line) /* Line number in the source file; used for * debugging. */ { -#ifdef TCL_MEM_DEBUG Tcl_Obj *objPtr; TclDbNewObj(objPtr, file, line); Tcl_SetByteArrayObj(objPtr, bytes, length); return objPtr; +} #else /* if not TCL_MEM_DEBUG */ - (void)file; - (void)line; +Tcl_Obj * +Tcl_DbNewByteArrayObj( + const unsigned char *bytes, /* The array of bytes used to initialize the + * new object. */ + int length, /* Length of the array of bytes, which must be + * >= 0. */ + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) +{ return Tcl_NewByteArrayObj(bytes, length); -#endif /* TCL_MEM_DEBUG */ } +#endif /* TCL_MEM_DEBUG */ /* *--------------------------------------------------------------------------- @@ -549,7 +557,7 @@ Tcl_SetByteArrayLength( static int SetByteArrayFromAny( - Tcl_Interp *dummy, /* Not used. */ + TCL_UNUSED(Tcl_Interp *), Tcl_Obj *objPtr) /* The object to convert to type ByteArray. */ { size_t length; @@ -559,7 +567,6 @@ SetByteArrayFromAny( Tcl_UniChar ch = 0; ByteArray *byteArrayPtr; Tcl_ObjIntRep ir; - (void)dummy; if (TclHasIntRep(objPtr, &properByteArrayType)) { return TCL_OK; @@ -893,7 +900,7 @@ TclInitBinaryCmd( static int BinaryFormatCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -915,7 +922,6 @@ BinaryFormatCmd( const char *errorString; const char *errorValue, *str; int offset, size, length; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?"); @@ -1399,7 +1405,7 @@ BinaryFormatCmd( int BinaryScanCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1422,7 +1428,6 @@ BinaryScanCmd( Tcl_Obj *valuePtr, *elementPtr; Tcl_HashTable numberCacheHash; Tcl_HashTable *numberCachePtr; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, @@ -2467,7 +2472,7 @@ DeleteScanNumberCache( static int BinaryEncodeHex( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -2476,7 +2481,6 @@ BinaryEncodeHex( unsigned char *data = NULL; unsigned char *cursor = NULL; int offset = 0, count = 0; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "data"); @@ -2512,7 +2516,7 @@ BinaryEncodeHex( static int BinaryDecodeHex( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -2523,7 +2527,6 @@ BinaryDecodeHex( int i, index, value, size, count = 0, cut = 0, strict = 0; enum {OPT_STRICT }; static const char *const optStrings[] = { "-strict", NULL }; - (void)dummy; if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?options? data"); @@ -2632,7 +2635,7 @@ BinaryDecodeHex( static int BinaryEncode64( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -2645,7 +2648,6 @@ BinaryEncode64( int offset, i, index, size, outindex = 0, count = 0; enum { OPT_MAXLEN, OPT_WRAPCHAR }; static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL }; - (void)dummy; if (objc < 2 || objc % 2 != 0) { Tcl_WrongNumArgs(interp, 1, objv, @@ -2739,7 +2741,7 @@ BinaryEncode64( static int BinaryEncodeUu( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -2753,7 +2755,6 @@ BinaryEncodeUu( int wrapcharlen = sizeof(SingleNewline); enum { OPT_MAXLEN, OPT_WRAPCHAR }; static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL }; - (void)dummy; if (objc < 2 || objc % 2 != 0) { Tcl_WrongNumArgs(interp, 1, objv, @@ -2857,7 +2858,7 @@ BinaryEncodeUu( static int BinaryDecodeUu( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -2869,7 +2870,6 @@ BinaryDecodeUu( unsigned char c; enum { OPT_STRICT }; static const char *const optStrings[] = { "-strict", NULL }; - (void)dummy; if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?options? data"); @@ -3021,7 +3021,7 @@ BinaryDecodeUu( static int BinaryDecode64( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3034,7 +3034,6 @@ BinaryDecode64( int i, index, size, cut = 0, count = 0; enum { OPT_STRICT }; static const char *const optStrings[] = { "-strict", NULL }; - (void)dummy; if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?options? data"); -- cgit v0.12 From 62a2883b434252f5cc7647055f762baf2ad11a1a Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 14:41:02 +0000 Subject: More TCL_UNUSED deployment. --- generic/tclCkalloc.c | 78 ++++++++++++++++------------------------------------ 1 file changed, 23 insertions(+), 55 deletions(-) diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index 8746241..c1ff631 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -814,7 +814,7 @@ MemoryCmd( ClientData clientData, Tcl_Interp *interp, int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Obj values of arguments. */ + Tcl_Obj *const objv[]) /* Obj values of arguments. */ { const char *fileName; FILE *fileP; @@ -987,10 +987,10 @@ static int CheckmemCmd(ClientData clientData, static int CheckmemCmd( - ClientData clientData, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interpreter for evaluation. */ int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Obj values of arguments. */ + Tcl_Obj *const objv[]) /* Obj values of arguments. */ { if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "fileName"); @@ -1052,9 +1052,7 @@ char * Tcl_Alloc( unsigned int size) { - char *result; - - result = TclpAlloc(size); + char *result = TclpAlloc(size); /* * Most systems will not alloc(0), instead bumping it to one so that NULL @@ -1078,9 +1076,7 @@ Tcl_DbCkalloc( const char *file, int line) { - char *result; - - result = (char *) TclpAlloc(size); + char *result = TclpAlloc(size); if ((result == NULL) && size) { fflush(stdout); @@ -1104,24 +1100,16 @@ char * Tcl_AttemptAlloc( unsigned int size) { - char *result; - - result = TclpAlloc(size); - return result; + return TclpAlloc(size); } char * Tcl_AttemptDbCkalloc( unsigned int size, - const char *file, - int line) + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - char *result; - (void)file; - (void)line; - - result = (char *) TclpAlloc(size); - return result; + return TclpAlloc(size); } /* @@ -1140,9 +1128,7 @@ Tcl_Realloc( char *ptr, unsigned int size) { - char *result; - - result = TclpRealloc(ptr, size); + char *result = TclpRealloc(ptr, size); if ((result == NULL) && size) { Tcl_Panic("unable to realloc %u bytes", size); @@ -1157,9 +1143,7 @@ Tcl_DbCkrealloc( const char *file, int line) { - char *result; - - result = (char *) TclpRealloc(ptr, size); + char *result = TclpRealloc(ptr, size); if ((result == NULL) && size) { fflush(stdout); @@ -1184,25 +1168,17 @@ Tcl_AttemptRealloc( char *ptr, unsigned int size) { - char *result; - - result = TclpRealloc(ptr, size); - return result; + return TclpRealloc(ptr, size); } char * Tcl_AttemptDbCkrealloc( char *ptr, unsigned int size, - const char *file, - int line) + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - char *result; - (void)file; - (void)line; - - result = (char *) TclpRealloc(ptr, size); - return result; + return TclpRealloc(ptr, size); } /* @@ -1227,11 +1203,9 @@ Tcl_Free( void Tcl_DbCkfree( char *ptr, - const char *file, - int line) + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - (void)file; - (void)line; TclpFree(ptr); } @@ -1248,35 +1222,29 @@ Tcl_DbCkfree( /* ARGSUSED */ void Tcl_InitMemory( - Tcl_Interp *interp) + TCL_UNUSED(Tcl_Interp *) /*interp*/) { - (void)interp; } int Tcl_DumpActiveMemory( - const char *fileName) + TCL_UNUSED(const char *) /*fileName*/) { - (void)fileName; return TCL_OK; } void Tcl_ValidateAllMemory( - const char *file, - int line) + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - (void)file; - (void)line; } int TclDumpMemoryInfo( - ClientData clientData, - int flags) + TCL_UNUSED(ClientData), + TCL_UNUSED(int) /*flags*/) { - (void)clientData; - (void)flags; return 1; } -- cgit v0.12 From c0a030fa0b8c99268c3610c1f8c62d457b086fcc Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 16:42:07 +0000 Subject: More TCL_UNUSED deployment --- generic/tclClock.c | 15 ++-- generic/tclCmdAH.c | 205 ++++++++++++++++++----------------------------------- 2 files changed, 73 insertions(+), 147 deletions(-) diff --git a/generic/tclClock.c b/generic/tclClock.c index 0aa1527..baaa568 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -1645,14 +1645,13 @@ WeekdayOnOrBefore( int ClockGetenvObjCmd( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { const char *varName; const char *varValue; - (void)clientData; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1731,7 +1730,7 @@ ThreadSafeLocalTime( int ClockClicksObjCmd( - ClientData clientData, /* Client data is unused */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Tcl interpreter */ int objc, /* Parameter count */ Tcl_Obj *const *objv) /* Parameter values */ @@ -1745,7 +1744,6 @@ ClockClicksObjCmd( int index = CLICKS_NATIVE; Tcl_Time now; Tcl_WideInt clicks = 0; - (void)clientData; switch (objc) { case 1: @@ -1802,13 +1800,12 @@ ClockClicksObjCmd( int ClockMillisecondsObjCmd( - ClientData clientData, /* Client data is unused */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Tcl interpreter */ int objc, /* Parameter count */ Tcl_Obj *const *objv) /* Parameter values */ { Tcl_Time now; - (void)clientData; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); @@ -1840,12 +1837,11 @@ ClockMillisecondsObjCmd( int ClockMicrosecondsObjCmd( - ClientData clientData, /* Client data is unused */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Tcl interpreter */ int objc, /* Parameter count */ Tcl_Obj *const *objv) /* Parameter values */ { - (void)clientData; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); return TCL_ERROR; @@ -1992,13 +1988,12 @@ ClockParseformatargsObjCmd( int ClockSecondsObjCmd( - ClientData clientData, /* Client data is unused */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Tcl interpreter */ int objc, /* Parameter count */ Tcl_Obj *const *objv) /* Parameter values */ { Tcl_Time now; - (void)clientData; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index f2db757..bd65f04 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -45,21 +45,11 @@ struct ForeachState { static int CheckAccess(Tcl_Interp *interp, Tcl_Obj *pathPtr, int mode); -static int EncodingConvertfromObjCmd(ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static int EncodingConverttoObjCmd(ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static int EncodingDirsObjCmd(ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static int EncodingNamesObjCmd(ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static int EncodingSystemObjCmd(ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); +static Tcl_ObjCmdProc EncodingConvertfromObjCmd; +static Tcl_ObjCmdProc EncodingConverttoObjCmd; +static Tcl_ObjCmdProc EncodingDirsObjCmd; +static Tcl_ObjCmdProc EncodingNamesObjCmd; +static Tcl_ObjCmdProc EncodingSystemObjCmd; static inline int ForeachAssignments(Tcl_Interp *interp, struct ForeachState *statePtr); static inline void ForeachCleanup(Tcl_Interp *interp, @@ -130,13 +120,11 @@ static Tcl_ObjCmdProc PathTypeCmd; /* ARGSUSED */ int Tcl_BreakObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - (void)dummy; - if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); return TCL_ERROR; @@ -165,7 +153,7 @@ Tcl_BreakObjCmd( /* ARGSUSED */ int Tcl_CaseObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -175,7 +163,6 @@ Tcl_CaseObjCmd( const char *stringPtr, *arg; Tcl_Obj *const *caseObjv; Tcl_Obj *armPtr; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, @@ -302,17 +289,17 @@ Tcl_CaseObjCmd( /* ARGSUSED */ int Tcl_CatchObjCmd( - ClientData dummy, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRCatchObjCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, TclNRCatchObjCmd, clientData, objc, objv); } int TclNRCatchObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -320,7 +307,6 @@ TclNRCatchObjCmd( Tcl_Obj *varNamePtr = NULL; Tcl_Obj *optionVarNamePtr = NULL; Interp *iPtr = (Interp *) interp; - (void)dummy; if ((objc < 2) || (objc > 4)) { Tcl_WrongNumArgs(interp, 1, objv, @@ -409,14 +395,13 @@ CatchObjCmdCallback( /* ARGSUSED */ int Tcl_CdObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *dir; int result; - (void)dummy; if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?dirName?"); @@ -466,13 +451,11 @@ Tcl_CdObjCmd( /* ARGSUSED */ int Tcl_ConcatObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - (void)dummy; - if (objc >= 2) { Tcl_SetObjResult(interp, Tcl_ConcatObj(objc-1, objv+1)); } @@ -503,13 +486,11 @@ Tcl_ConcatObjCmd( /* ARGSUSED */ int Tcl_ContinueObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - (void)dummy; - if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); return TCL_ERROR; @@ -565,7 +546,7 @@ TclInitEncodingCmd( int EncodingConvertfromObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -575,7 +556,6 @@ EncodingConvertfromObjCmd( Tcl_Encoding encoding; /* Encoding to use */ int length; /* Length of the byte array being converted */ const char *bytesPtr; /* Pointer to the first byte of the array */ - (void)dummy; if (objc == 2) { encoding = Tcl_GetEncoding(interp, NULL); @@ -628,7 +608,7 @@ EncodingConvertfromObjCmd( int EncodingConverttoObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -638,7 +618,6 @@ EncodingConverttoObjCmd( Tcl_Encoding encoding; /* Encoding to use */ int length; /* Length of the string being converted */ const char *stringPtr; /* Pointer to the first byte of the string */ - (void)dummy; /* TODO - ADJUST OBJ INDICES WHEN ENSEMBLIFYING THIS */ @@ -693,13 +672,12 @@ EncodingConverttoObjCmd( int EncodingDirsObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *dirListObj; - (void)dummy; if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?dirList?"); @@ -738,13 +716,11 @@ EncodingDirsObjCmd( int EncodingNamesObjCmd( - ClientData dummy, /* Not used. */ - Tcl_Interp* interp, /* Tcl interpreter */ - int objc, /* Number of command line args */ - Tcl_Obj* const objv[]) /* Vector of command line args */ + TCL_UNUSED(ClientData), + Tcl_Interp* interp, /* Tcl interpreter */ + int objc, /* Number of command line args */ + Tcl_Obj* const objv[]) /* Vector of command line args */ { - (void)dummy; - if (objc > 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); return TCL_ERROR; @@ -771,13 +747,11 @@ EncodingNamesObjCmd( int EncodingSystemObjCmd( - ClientData dummy, /* Not used. */ - Tcl_Interp* interp, /* Tcl interpreter */ - int objc, /* Number of command line args */ - Tcl_Obj* const objv[]) /* Vector of command line args */ + TCL_UNUSED(ClientData), + Tcl_Interp* interp, /* Tcl interpreter */ + int objc, /* Number of command line args */ + Tcl_Obj* const objv[]) /* Vector of command line args */ { - (void)dummy; - if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?encoding?"); return TCL_ERROR; @@ -811,13 +785,12 @@ EncodingSystemObjCmd( /* ARGSUSED */ int Tcl_ErrorObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *options, *optName; - (void)dummy; if ((objc < 2) || (objc > 4)) { Tcl_WrongNumArgs(interp, 1, objv, "message ?errorInfo? ?errorCode?"); @@ -862,12 +835,10 @@ Tcl_ErrorObjCmd( /* ARGSUSED */ static int EvalCmdErrMsg( - ClientData dummy[], + TCL_UNUSED(ClientData *), Tcl_Interp *interp, int result) { - (void)dummy; - if (result == TCL_ERROR) { Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( "\n (\"eval\" body line %d)", Tcl_GetErrorLine(interp))); @@ -877,17 +848,17 @@ EvalCmdErrMsg( int Tcl_EvalObjCmd( - ClientData dummy, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNREvalObjCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, TclNREvalObjCmd, clientData, objc, objv); } int TclNREvalObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -896,7 +867,6 @@ TclNREvalObjCmd( Interp *iPtr = (Interp *) interp; CmdFrame *invoker = NULL; int word = 0; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "arg ?arg ...?"); @@ -948,13 +918,12 @@ TclNREvalObjCmd( /* ARGSUSED */ int Tcl_ExitObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_WideInt value; - (void)dummy; if ((objc != 1) && (objc != 2)) { Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?"); @@ -998,23 +967,22 @@ Tcl_ExitObjCmd( /* ARGSUSED */ int Tcl_ExprObjCmd( - ClientData dummy, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRExprObjCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, TclNRExprObjCmd, clientData, objc, objv); } int TclNRExprObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *resultPtr, *objPtr; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "arg ?arg ...?"); @@ -1145,14 +1113,13 @@ TclInitFileCmd( static int FileAttrAccessTimeCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; struct utimbuf tval; - (void)dummy; if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "name ?time?"); @@ -1228,14 +1195,13 @@ FileAttrAccessTimeCmd( static int FileAttrModifyTimeCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; struct utimbuf tval; - (void)dummy; if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "name ?time?"); @@ -1308,13 +1274,12 @@ FileAttrModifyTimeCmd( static int FileAttrLinkStatCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "name varName"); @@ -1345,13 +1310,12 @@ FileAttrLinkStatCmd( static int FileAttrStatCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "name varName"); @@ -1382,13 +1346,12 @@ FileAttrStatCmd( static int FileAttrTypeCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1421,13 +1384,12 @@ FileAttrTypeCmd( static int FileAttrSizeCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1459,14 +1421,13 @@ FileAttrSizeCmd( static int FileAttrIsDirectoryCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; int value = 0; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1498,13 +1459,11 @@ FileAttrIsDirectoryCmd( static int FileAttrIsExecutableCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - (void)dummy; - if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); return TCL_ERROR; @@ -1531,13 +1490,11 @@ FileAttrIsExecutableCmd( static int FileAttrIsExistingCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - (void)dummy; - if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); return TCL_ERROR; @@ -1564,14 +1521,13 @@ FileAttrIsExistingCmd( static int FileAttrIsFileCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_StatBuf buf; int value = 0; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1603,7 +1559,7 @@ FileAttrIsFileCmd( static int FileAttrIsOwnedCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1615,7 +1571,6 @@ FileAttrIsOwnedCmd( Tcl_StatBuf buf; #endif int value = 0; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1651,13 +1606,11 @@ FileAttrIsOwnedCmd( static int FileAttrIsReadableCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - (void)dummy; - if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); return TCL_ERROR; @@ -1684,13 +1637,11 @@ FileAttrIsReadableCmd( static int FileAttrIsWritableCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - (void)dummy; - if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); return TCL_ERROR; @@ -1717,13 +1668,12 @@ FileAttrIsWritableCmd( static int PathDirNameCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1757,13 +1707,12 @@ PathDirNameCmd( static int PathExtensionCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1797,13 +1746,12 @@ PathExtensionCmd( static int PathRootNameCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1837,13 +1785,12 @@ PathRootNameCmd( static int PathTailCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *dirPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1877,13 +1824,12 @@ PathTailCmd( static int PathFilesystemCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *fsInfo; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1919,13 +1865,11 @@ PathFilesystemCmd( static int PathJoinCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - (void)dummy; - if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "name ?name ...?"); return TCL_ERROR; @@ -1953,13 +1897,12 @@ PathJoinCmd( static int PathNativeNameCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_DString ds; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1991,13 +1934,12 @@ PathNativeNameCmd( static int PathNormalizeCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *fileName; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -2030,13 +1972,12 @@ PathNormalizeCmd( static int PathSplitCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *res; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -2074,13 +2015,12 @@ PathSplitCmd( static int PathTypeCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *typeName; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -2123,13 +2063,11 @@ PathTypeCmd( static int FilesystemSeparatorCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - (void)dummy; - if (objc < 1 || objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?name?"); return TCL_ERROR; @@ -2180,13 +2118,11 @@ FilesystemSeparatorCmd( static int FilesystemVolumesCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - (void)dummy; - if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); return TCL_ERROR; @@ -2443,24 +2379,23 @@ GetTypeFromMode( /* ARGSUSED */ int Tcl_ForObjCmd( - ClientData dummy, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRForObjCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, TclNRForObjCmd, clientData, objc, objv); } int TclNRForObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; ForIterData *iterPtr; - (void)dummy; if (objc != 5) { Tcl_WrongNumArgs(interp, 1, objv, "start test next command"); @@ -2639,44 +2574,41 @@ ForPostNextCallback( /* ARGSUSED */ int Tcl_ForeachObjCmd( - ClientData dummy, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRForeachCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, TclNRForeachCmd, clientData, objc, objv); } int TclNRForeachCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - (void)dummy; - return EachloopCmd(interp, TCL_EACH_KEEP_NONE, objc, objv); } int Tcl_LmapObjCmd( - ClientData dummy, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRLmapCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, TclNRLmapCmd, clientData, objc, objv); } int TclNRLmapCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - (void)dummy; return EachloopCmd(interp, TCL_EACH_COLLECT, objc, objv); } @@ -2960,13 +2892,12 @@ ForeachCleanup( /* ARGSUSED */ int Tcl_FormatObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *resultPtr; /* Where result is stored finally. */ - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?"); -- cgit v0.12 From e84e229fd592f843fc93e20306666034c740cee1 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 18:02:25 +0000 Subject: More TCL_UNUSED(). --- generic/tclCmdIL.c | 182 +++++++++++++-------------------------- generic/tclCmdMZ.c | 147 ++++++++++++-------------------- generic/tclCompCmds.c | 141 +++++++++--------------------- generic/tclCompCmdsGR.c | 144 ++++++++----------------------- generic/tclCompCmdsSZ.c | 222 +++++++++++++----------------------------------- generic/tclCompile.c | 17 ++-- 6 files changed, 254 insertions(+), 599 deletions(-) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 08948ea..f74368a 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -99,49 +99,28 @@ typedef struct { static int DictionaryCompare(const char *left, const char *right); static Tcl_NRPostProc IfConditionCallback; -static int InfoArgsCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoBodyCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoCmdCountCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoCommandsCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoCompleteCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoDefaultCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); +static Tcl_ObjCmdProc InfoArgsCmd; +static Tcl_ObjCmdProc InfoBodyCmd; +static Tcl_ObjCmdProc InfoCmdCountCmd; +static Tcl_ObjCmdProc InfoCommandsCmd; +static Tcl_ObjCmdProc InfoCompleteCmd; +static Tcl_ObjCmdProc InfoDefaultCmd; /* TIP #348 - New 'info' subcommand 'errorstack' */ -static int InfoErrorStackCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); +static Tcl_ObjCmdProc InfoErrorStackCmd; /* TIP #280 - New 'info' subcommand 'frame' */ -static int InfoFrameCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoFunctionsCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoHostnameCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoLevelCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoLibraryCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoLoadedCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoNameOfExecutableCmd(ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static int InfoPatchLevelCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoProcsCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoScriptCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoSharedlibCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoCmdTypeCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int InfoTclVersionCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); +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 SortElement * MergeLists(SortElement *leftPtr, SortElement *rightPtr, SortInfo *infoPtr); static int SortCompare(SortElement *firstPtr, SortElement *second, @@ -206,23 +185,22 @@ static const EnsembleImplMap defaultInfoMap[] = { int Tcl_IfObjCmd( - ClientData dummy, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRIfObjCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, TclNRIfObjCmd, clientData, objc, objv); } int TclNRIfObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *boolObj; - (void)dummy; if (objc <= 1) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -390,13 +368,12 @@ IfConditionCallback( int Tcl_IncrObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *newValuePtr, *incrPtr; - (void)dummy; if ((objc != 2) && (objc != 3)) { Tcl_WrongNumArgs(interp, 1, objv, "varName ?increment?"); @@ -472,7 +449,7 @@ TclInitInfoCmd( static int InfoArgsCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -482,7 +459,6 @@ InfoArgsCmd( Proc *procPtr; CompiledLocal *localPtr; Tcl_Obj *listObjPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "procname"); @@ -536,7 +512,7 @@ InfoArgsCmd( static int InfoBodyCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -545,7 +521,6 @@ InfoBodyCmd( const char *name, *bytes; Proc *procPtr; int numBytes; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "procname"); @@ -598,13 +573,12 @@ InfoBodyCmd( static int InfoCmdCountCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; - (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); @@ -641,7 +615,7 @@ InfoCmdCountCmd( static int InfoCommandsCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -657,7 +631,6 @@ InfoCommandsCmd( int specificNsInPattern = 0;/* Init. to avoid compiler warning. */ Tcl_Command cmd; int i; - (void)dummy; /* * Get the pattern and find the "effective namespace" in which to list @@ -919,13 +892,11 @@ InfoCommandsCmd( static int InfoCompleteCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - (void)dummy; - if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "command"); return TCL_ERROR; @@ -958,7 +929,7 @@ InfoCompleteCmd( static int InfoDefaultCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -968,7 +939,6 @@ InfoDefaultCmd( Proc *procPtr; CompiledLocal *localPtr; Tcl_Obj *valueObjPtr; - (void)dummy; if (objc != 4) { Tcl_WrongNumArgs(interp, 1, objv, "procname arg varname"); @@ -1041,14 +1011,13 @@ InfoDefaultCmd( static int InfoErrorStackCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Interp *target; Interp *iPtr; - (void)dummy; if ((objc != 1) && (objc != 2)) { Tcl_WrongNumArgs(interp, 1, objv, "?interp?"); @@ -1091,14 +1060,13 @@ InfoErrorStackCmd( int TclInfoExistsCmd( - 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 *varName; Var *varPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "varName"); @@ -1137,7 +1105,7 @@ TclInfoExistsCmd( static int InfoFrameCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1147,7 +1115,6 @@ InfoFrameCmd( CmdFrame *framePtr, **cmdFramePtrPtr = &iPtr->cmdFramePtr; CoroutineData *corPtr = iPtr->execEnvPtr->corPtr; int topLevel = 0; - (void)dummy; if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?number?"); @@ -1478,14 +1445,13 @@ TclInfoFrame( static int InfoFunctionsCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *script; int code; - (void)dummy; if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?pattern?"); @@ -1544,13 +1510,12 @@ InfoFunctionsCmd( static int InfoHostnameCmd( - 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; - (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); @@ -1591,13 +1556,12 @@ InfoHostnameCmd( static int InfoLevelCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; - (void)dummy; if (objc == 1) { /* Just "info level" */ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(iPtr->varFramePtr->level)); @@ -1666,13 +1630,12 @@ InfoLevelCmd( static int InfoLibraryCmd( - 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 *libDirName; - (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); @@ -1714,13 +1677,12 @@ InfoLibraryCmd( static int InfoLoadedCmd( - 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 *interpName, *packageName; - (void)dummy; if (objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?interp? ?packageName?"); @@ -1763,13 +1725,11 @@ InfoLoadedCmd( static int InfoNameOfExecutableCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - (void)dummy; - if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); return TCL_ERROR; @@ -1801,13 +1761,12 @@ InfoNameOfExecutableCmd( static int InfoPatchLevelCmd( - 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 *patchlevel; - (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); @@ -1849,7 +1808,7 @@ InfoPatchLevelCmd( static int InfoProcsCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1866,7 +1825,6 @@ InfoProcsCmd( Tcl_HashEntry *entryPtr; Tcl_HashSearch search; Command *cmdPtr, *realCmdPtr; - (void)dummy; /* * Get the pattern and find the "effective namespace" in which to list @@ -2037,13 +1995,12 @@ InfoProcsCmd( static int InfoScriptCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; - (void)dummy; if ((objc != 1) && (objc != 2)) { Tcl_WrongNumArgs(interp, 1, objv, "?filename?"); @@ -2086,13 +2043,11 @@ InfoScriptCmd( static int InfoSharedlibCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - (void)dummy; - if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); return TCL_ERROR; @@ -2126,13 +2081,12 @@ InfoSharedlibCmd( static int InfoTclVersionCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *version; - (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); @@ -2170,13 +2124,12 @@ InfoTclVersionCmd( static int InfoCmdTypeCmd( - 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; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "commandName"); @@ -2222,14 +2175,13 @@ InfoCmdTypeCmd( int Tcl_JoinObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { int length, listLen; Tcl_Obj *resObjPtr = NULL, *joinObjPtr, **elemPtrs; - (void)dummy; if ((objc < 2) || (objc > 3)) { Tcl_WrongNumArgs(interp, 1, objv, "list ?joinString?"); @@ -2308,7 +2260,7 @@ Tcl_JoinObjCmd( int Tcl_LassignObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -2317,7 +2269,6 @@ Tcl_LassignObjCmd( Tcl_Obj **listObjv; /* The contents of the list. */ int listObjc; /* The length of the list. */ int code = TCL_OK; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "list ?varName ...?"); @@ -2383,13 +2334,12 @@ Tcl_LassignObjCmd( int Tcl_LindexObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *elemPtr; /* Pointer to the element being extracted. */ - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "list ?index ...?"); @@ -2442,14 +2392,13 @@ Tcl_LindexObjCmd( int Tcl_LinsertObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *listPtr; int index, len, result; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "list index ?element ...?"); @@ -2525,13 +2474,12 @@ Tcl_LinsertObjCmd( int Tcl_ListObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { - (void)dummy; /* * If there are no list elements, the result is an empty object. * Otherwise set the interpreter's result object to be a list object. @@ -2562,14 +2510,13 @@ Tcl_ListObjCmd( int Tcl_LlengthObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int listLen, result; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "list"); @@ -2609,7 +2556,7 @@ Tcl_LlengthObjCmd( int Tcl_LpopObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) @@ -2618,7 +2565,6 @@ Tcl_LpopObjCmd( int listLen, result; Tcl_Obj *elemPtr, *stored; Tcl_Obj *listPtr, **elemPtrs; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "listvar ?index?"); @@ -2703,14 +2649,13 @@ Tcl_LpopObjCmd( int Tcl_LrangeObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int listLen, first, last, result; - (void)dummy; if (objc != 4) { Tcl_WrongNumArgs(interp, 1, objv, "list first last"); @@ -2772,7 +2717,7 @@ LremoveIndexCompare( int Tcl_LremoveObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -2780,7 +2725,6 @@ Tcl_LremoveObjCmd( int i, idxc; int listLen, *idxv, prevIdx, first, num; Tcl_Obj *listObj; - (void)dummy; /* * Parse the arguments. @@ -2892,7 +2836,7 @@ Tcl_LremoveObjCmd( int Tcl_LrepeatObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) @@ -2900,7 +2844,6 @@ Tcl_LrepeatObjCmd( { int elementCount, i, totalElems; Tcl_Obj *listPtr, **dataArray = NULL; - (void)dummy; /* * Check arguments for legality: @@ -3002,14 +2945,13 @@ Tcl_LrepeatObjCmd( int Tcl_LreplaceObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *listPtr; int first, last, listLen, numToDelete, result; - (void)dummy; if (objc < 4) { Tcl_WrongNumArgs(interp, 1, objv, @@ -3104,14 +3046,13 @@ Tcl_LreplaceObjCmd( int Tcl_LreverseObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ { Tcl_Obj **elemv; int elemc, i, j; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "list"); @@ -3184,7 +3125,7 @@ Tcl_LreverseObjCmd( int Tcl_LsearchObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ @@ -3221,7 +3162,6 @@ Tcl_LsearchObjCmd( EXACT, GLOB, REGEXP, SORTED }; enum modes mode; - (void)dummy; mode = GLOB; dataType = ASCII; @@ -3937,14 +3877,13 @@ Tcl_LsearchObjCmd( int Tcl_LsetObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ { Tcl_Obj *listPtr; /* Pointer to the list being altered. */ Tcl_Obj *finalValuePtr; /* Value finally assigned to the variable. */ - (void)dummy; /* * Check parameter count. @@ -4023,7 +3962,7 @@ Tcl_LsetObjCmd( int Tcl_LsortObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ @@ -4053,7 +3992,6 @@ Tcl_LsortObjCmd( LSORT_INCREASING, LSORT_INDEX, LSORT_INDICES, LSORT_INTEGER, LSORT_NOCASE, LSORT_REAL, LSORT_STRIDE, LSORT_UNIQUE }; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "?-option value ...? list"); diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 136eecb..2f5d399 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -82,13 +82,12 @@ const char tclDefaultTrimSet[] = int Tcl_PwdObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *retVal; - (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); @@ -123,7 +122,7 @@ Tcl_PwdObjCmd( int Tcl_RegexpObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -143,7 +142,6 @@ Tcl_RegexpObjCmd( REGEXP_EXPANDED,REGEXP_LINE, REGEXP_LINESTOP,REGEXP_LINEANCHOR, REGEXP_NOCASE, REGEXP_START, REGEXP_LAST }; - (void)dummy; indices = 0; about = 0; @@ -484,7 +482,7 @@ Tcl_RegexpObjCmd( int Tcl_RegsubObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -506,7 +504,6 @@ Tcl_RegsubObjCmd( REGSUB_LINESTOP, REGSUB_LINEANCHOR, REGSUB_NOCASE, REGSUB_START, REGSUB_LAST }; - (void)dummy; cflags = TCL_REG_ADVANCED; all = 0; @@ -1005,13 +1002,12 @@ Tcl_RegsubObjCmd( int Tcl_RenameObjCmd( - 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 *oldName, *newName; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "oldName newName"); @@ -1042,7 +1038,7 @@ Tcl_RenameObjCmd( int Tcl_ReturnObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1057,7 +1053,6 @@ Tcl_ReturnObjCmd( int explicitResult = (0 == (objc % 2)); int numOptionWords = objc - 1 - explicitResult; - (void)dummy; if (TCL_ERROR == TclMergeReturnOptions(interp, numOptionWords, objv+1, &returnOpts, &code, &level)) { @@ -1090,17 +1085,17 @@ Tcl_ReturnObjCmd( int Tcl_SourceObjCmd( - ClientData dummy, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRSourceObjCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, TclNRSourceObjCmd, clientData, objc, objv); } int TclNRSourceObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1110,7 +1105,6 @@ TclNRSourceObjCmd( int result; void **pkgFiles = NULL; void *names = NULL; - (void)dummy; if (objc < 2 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, "?-encoding name? fileName"); @@ -1175,7 +1169,7 @@ TclNRSourceObjCmd( int Tcl_SplitObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1187,7 +1181,6 @@ Tcl_SplitObjCmd( const char *end; int splitCharLen, stringLen; Tcl_Obj *listPtr, *objPtr; - (void)dummy; if (objc == 2) { splitChars = " \n\t\r"; @@ -1324,13 +1317,12 @@ Tcl_SplitObjCmd( static int StringFirstCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int start = 0; - (void)dummy; if (objc < 3 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, @@ -1370,13 +1362,12 @@ StringFirstCmd( static int StringLastCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int last = INT_MAX - 1; - (void)dummy; if (objc < 3 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, @@ -1416,13 +1407,12 @@ StringLastCmd( static int StringIndexCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int length, index; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "string charIndex"); @@ -1487,7 +1477,7 @@ StringIndexCmd( static int StringInsertCmd( - ClientData dummy, /* Not used */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter */ int objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* Argument objects */ @@ -1495,7 +1485,6 @@ StringInsertCmd( int length; /* String length */ int index; /* Insert index */ Tcl_Obj *outObj; /* Output object */ - (void)dummy; if (objc != 4) { Tcl_WrongNumArgs(interp, 1, objv, "string index insertString"); @@ -1545,7 +1534,7 @@ StringInsertCmd( static int StringIsCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1579,7 +1568,6 @@ StringIsCmd( enum isOptions { OPT_STRICT, OPT_FAILIDX }; - (void)dummy; if (objc < 3 || objc > 6) { Tcl_WrongNumArgs(interp, 1, objv, @@ -1985,7 +1973,7 @@ UniCharIsHexDigit( static int StringMapCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1995,7 +1983,6 @@ StringMapCmd( Tcl_Obj **mapElemv, *sourceObj, *resultPtr; Tcl_UniChar *ustring1, *ustring2, *p, *end; int (*strCmpFn)(const Tcl_UniChar*, const Tcl_UniChar*, unsigned long); - (void)dummy; if (objc < 3 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, "?-nocase? charMap string"); @@ -2257,13 +2244,12 @@ StringMapCmd( static int StringMatchCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int nocase = 0; - (void)dummy; if (objc < 3 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, "?-nocase? pattern string"); @@ -2310,13 +2296,12 @@ StringMatchCmd( static int StringRangeCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int length, first, last; - (void)dummy; if (objc != 4) { Tcl_WrongNumArgs(interp, 1, objv, "string first last"); @@ -2367,14 +2352,13 @@ StringRangeCmd( static int StringReptCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int count; Tcl_Obj *resultPtr; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "string count"); @@ -2424,13 +2408,12 @@ StringReptCmd( static int StringRplcCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int first, last, length, end; - (void)dummy; if (objc < 4 || objc > 5) { Tcl_WrongNumArgs(interp, 1, objv, "string first last ?string?"); @@ -2501,13 +2484,11 @@ StringRplcCmd( static int StringRevCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - (void)dummy; - if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "string"); return TCL_ERROR; @@ -2538,7 +2519,7 @@ StringRevCmd( static int StringStartCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -2546,7 +2527,6 @@ StringStartCmd( Tcl_UniChar ch = 0; const char *p, *string; int cur, index, length, numChars; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "string index"); @@ -2600,7 +2580,7 @@ StringStartCmd( static int StringEndCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -2608,7 +2588,6 @@ StringEndCmd( Tcl_UniChar ch = 0; const char *p, *end, *string; int cur, index, length, numChars; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "string index"); @@ -2663,7 +2642,7 @@ StringEndCmd( static int StringEqualCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -2676,7 +2655,6 @@ StringEqualCmd( const char *string2; int length, i, match, nocase = 0, reqlength = -1; - (void)dummy; if (objc < 3 || objc > 6) { str_cmp_args: @@ -2739,7 +2717,7 @@ StringEqualCmd( static int StringCmpCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -2751,7 +2729,6 @@ StringCmpCmd( */ int match, nocase, reqlength, status; - (void)dummy; status = TclStringCmpOpts(interp, objc, objv, &nocase, &reqlength); if (status != TCL_OK) { @@ -2828,13 +2805,12 @@ TclStringCmpOpts( static int StringCatCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *objResultPtr; - (void)dummy; if (objc < 2) { /* @@ -2874,13 +2850,12 @@ StringCatCmd( */ static int StringBytesCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int length; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "string"); @@ -2912,13 +2887,11 @@ StringBytesCmd( static int StringLenCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - (void)dummy; - if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "string"); return TCL_ERROR; @@ -2948,7 +2921,7 @@ StringLenCmd( static int StringLowerCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -2956,7 +2929,6 @@ StringLowerCmd( int length1, length2; const char *string1; char *string2; - (void)dummy; if (objc < 2 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?"); @@ -3034,7 +3006,7 @@ StringLowerCmd( static int StringUpperCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -3042,7 +3014,6 @@ StringUpperCmd( int length1, length2; const char *string1; char *string2; - (void)dummy; if (objc < 2 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?"); @@ -3120,7 +3091,7 @@ StringUpperCmd( static int StringTitleCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -3128,7 +3099,6 @@ StringTitleCmd( int length1, length2; const char *string1; char *string2; - (void)dummy; if (objc < 2 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?"); @@ -3206,14 +3176,13 @@ StringTitleCmd( static int StringTrimCmd( - 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 *string1, *string2; int triml, trimr, length1, length2; - (void)dummy; if (objc == 3) { string2 = TclGetStringFromObj(objv[2], &length2); @@ -3254,14 +3223,13 @@ StringTrimCmd( static int StringTrimLCmd( - 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 *string1, *string2; int trim, length1, length2; - (void)dummy; if (objc == 3) { string2 = TclGetStringFromObj(objv[2], &length2); @@ -3301,14 +3269,13 @@ StringTrimLCmd( static int StringTrimRCmd( - 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 *string1, *string2; int trim, length1, length2; - (void)dummy; if (objc == 3) { string2 = TclGetStringFromObj(objv[2], &length2); @@ -3445,23 +3412,22 @@ TclSubstOptions( int Tcl_SubstObjCmd( - ClientData dummy, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRSubstObjCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, TclNRSubstObjCmd, clientData, objc, objv); } int TclNRSubstObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int flags; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, @@ -3494,16 +3460,16 @@ TclNRSubstObjCmd( int Tcl_SwitchObjCmd( - ClientData dummy, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRSwitchObjCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, TclNRSwitchObjCmd, clientData, objc, objv); } int TclNRSwitchObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -3536,7 +3502,6 @@ TclNRSwitchObjCmd( }; typedef int (*strCmpFn_t)(const char *, const char *); strCmpFn_t strCmpFn = TclUtfCmp; - (void)dummy; mode = OPT_EXACT; foundmode = 0; @@ -4028,14 +3993,13 @@ SwitchPostProc( /* ARGSUSED */ int Tcl_ThrowObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *options; int len; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "type message"); @@ -4091,7 +4055,7 @@ Tcl_ThrowObjCmd( int Tcl_TimeObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -4106,7 +4070,6 @@ Tcl_TimeObjCmd( #else Tcl_WideInt start, stop; #endif - (void)dummy; if (objc == 2) { count = 1; @@ -4190,7 +4153,7 @@ Tcl_TimeObjCmd( int Tcl_TimeRateObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -4225,7 +4188,6 @@ Tcl_TimeRateObjCmd( }; NRE_callback *rootPtr; ByteCode *codePtr = NULL; - (void)dummy; for (i = 1; i < objc - 1; i++) { int index; @@ -4734,17 +4696,17 @@ Tcl_TimeRateObjCmd( int Tcl_TryObjCmd( - ClientData dummy, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRTryObjCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, TclNRTryObjCmd, clientData, objc, objv); } int TclNRTryObjCmd( - ClientData clientData, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -4757,7 +4719,6 @@ TclNRTryObjCmd( enum Handlers { TryFinally, TryOn, TryTrap }; - (void)clientData; /* * Parse the arguments. The handlers are passed to subsequent callbacks as @@ -4948,7 +4909,7 @@ TryPostBody( int result) { Tcl_Obj *resultObj, *options, *handlersObj, *finallyObj, *cmdObj, **objv; - int i, dummy, code, objc; + int i, code, objc; int numHandlers = 0; handlersObj = (Tcl_Obj *)data[0]; @@ -4999,8 +4960,9 @@ TryPostBody( Tcl_ListObjGetElements(NULL, handlersObj, &numHandlers, &handlers); for (i=0 ; i 0) { + Tcl_ListObjLength(NULL, info[3], &numElems); + if (numElems> 0) { Tcl_Obj *varName; Tcl_ListObjIndex(NULL, info[3], 0, &varName); @@ -5073,7 +5035,7 @@ TryPostBody( goto handlerFailed; } Tcl_DecrRefCount(resultObj); - if (dummy > 1) { + if (numElems> 1) { Tcl_ListObjIndex(NULL, info[3], 1, &varName); if (Tcl_ObjSetVar2(interp, varName, NULL, options, TCL_LEAVE_ERR_MSG) == NULL) { @@ -5311,23 +5273,22 @@ TryPostFinal( int Tcl_WhileObjCmd( - ClientData dummy, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return Tcl_NRCallObjProc(interp, TclNRWhileObjCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, TclNRWhileObjCmd, clientData, objc, objv); } int TclNRWhileObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { ForIterData *iterPtr; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "test command"); diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 35501d2..e38be07 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -21,28 +21,16 @@ * Prototypes for procedures defined later in this file: */ -static ClientData DupDictUpdateInfo(ClientData clientData); -static void FreeDictUpdateInfo(ClientData clientData); -static void PrintDictUpdateInfo(ClientData clientData, - Tcl_Obj *appendObj, ByteCode *codePtr, - unsigned int pcOffset); -static void DisassembleDictUpdateInfo(ClientData clientData, - Tcl_Obj *dictObj, ByteCode *codePtr, - unsigned int pcOffset); -static ClientData DupForeachInfo(ClientData clientData); -static void FreeForeachInfo(ClientData clientData); -static void PrintForeachInfo(ClientData clientData, - Tcl_Obj *appendObj, ByteCode *codePtr, - unsigned int pcOffset); -static void DisassembleForeachInfo(ClientData clientData, - Tcl_Obj *dictObj, ByteCode *codePtr, - unsigned int pcOffset); -static void PrintNewForeachInfo(ClientData clientData, - Tcl_Obj *appendObj, ByteCode *codePtr, - unsigned int pcOffset); -static void DisassembleNewForeachInfo(ClientData clientData, - Tcl_Obj *dictObj, ByteCode *codePtr, - unsigned int pcOffset); +static AuxDataDupProc DupDictUpdateInfo; +static AuxDataFreeProc FreeDictUpdateInfo; +static AuxDataPrintProc PrintDictUpdateInfo; +static AuxDataPrintProc DisassembleDictUpdateInfo; +static AuxDataDupProc DupForeachInfo; +static AuxDataFreeProc FreeForeachInfo; +static AuxDataPrintProc PrintForeachInfo; +static AuxDataPrintProc DisassembleForeachInfo; +static AuxDataPrintProc PrintNewForeachInfo; +static AuxDataPrintProc DisassembleNewForeachInfo; static int CompileEachloopCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, CompileEnv *envPtr, int collect); @@ -260,14 +248,12 @@ TclCompileArrayExistsCmd( Tcl_Interp *interp, /* Used for looking up stuff. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; int isScalar, localIndex; - (void)cmdPtr; if (parsePtr->numWords != 2) { return TCL_ERROR; @@ -523,17 +509,14 @@ TclCompileArrayUnsetCmd( int TclCompileBreakCmd( - Tcl_Interp *dummy, /* Used for error reporting. */ + TCL_UNUSED(Tcl_Interp *), Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { ExceptionRange *rangePtr; ExceptionAux *auxPtr; - (void)dummy; - (void)cmdPtr; if (parsePtr->numWords != 1) { return TCL_ERROR; @@ -586,8 +569,7 @@ TclCompileCatchCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { JumpFixup jumpFixup; @@ -595,7 +577,6 @@ TclCompileCatchCmd( int resultIndex, optsIndex, range, dropScript = 0; DefineLineInformation; /* TIP #280 */ int depth = TclGetStackDepth(envPtr); - (void)cmdPtr; /* * If syntax does not match what we expect for [catch], do not compile. @@ -769,16 +750,13 @@ TclCompileCatchCmd( int TclCompileClockClicksCmd( - Tcl_Interp* dummy, /* Tcl interpreter */ + TCL_UNUSED(Tcl_Interp *), Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token* tokenPtr; - (void)dummy; - (void)cmdPtr; switch (parsePtr->numWords) { case 1: @@ -835,15 +813,13 @@ TclCompileClockClicksCmd( int TclCompileClockReadingCmd( - Tcl_Interp* dummy, /* Tcl interpreter */ + TCL_UNUSED(Tcl_Interp *), Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ Command *cmdPtr, /* Points to defintion of command being * compiled. */ CompileEnv *envPtr) /* Holds resulting instructions. */ { - (void)dummy; - if (parsePtr->numWords != 1) { return TCL_ERROR; } @@ -876,15 +852,13 @@ TclCompileConcatCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Obj *objPtr, *listObj; Tcl_Token *tokenPtr; int i; - (void)cmdPtr; /* TODO: Consider compiling expansion case. */ if (parsePtr->numWords == 1) { @@ -961,17 +935,14 @@ TclCompileConcatCmd( int TclCompileContinueCmd( - Tcl_Interp *dummy, /* Used for error reporting. */ + TCL_UNUSED(Tcl_Interp *), Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { ExceptionRange *rangePtr; ExceptionAux *auxPtr; - (void)dummy; - (void)cmdPtr; /* * There should be no argument after the "continue". @@ -1029,15 +1000,13 @@ TclCompileDictSetCmd( Tcl_Interp *interp, /* Used for looking up stuff. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr; int i, dictVarIndex; DefineLineInformation; /* TIP #280 */ Tcl_Token *varTokenPtr; - (void)cmdPtr; /* * There must be at least one argument after the command. @@ -1156,14 +1125,12 @@ TclCompileDictGetCmd( Tcl_Interp *interp, /* Used for looking up stuff. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr; int i; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* * There must be at least two arguments after the command (the single-arg @@ -1194,14 +1161,12 @@ TclCompileDictGetWithDefaultCmd( Tcl_Interp *interp, /* Used for looking up stuff. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr; int i; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* * There must be at least three arguments after the command. @@ -1227,14 +1192,12 @@ TclCompileDictExistsCmd( Tcl_Interp *interp, /* Used for looking up stuff. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr; int i; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* * There must be at least two arguments after the command (the single-arg @@ -2325,13 +2288,11 @@ static void PrintDictUpdateInfo( ClientData clientData, Tcl_Obj *appendObj, - ByteCode *codePtr, - unsigned int pcOffset) + TCL_UNUSED(ByteCode *), + TCL_UNUSED(unsigned int)) { DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData; int i; - (void)codePtr; - (void)pcOffset; for (i=0 ; ilength ; i++) { if (i) { @@ -2345,14 +2306,12 @@ static void DisassembleDictUpdateInfo( ClientData clientData, Tcl_Obj *dictObj, - ByteCode *codePtr, - unsigned int pcOffset) + TCL_UNUSED(ByteCode *), + TCL_UNUSED(unsigned int)) { DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData; int i; Tcl_Obj *variables = Tcl_NewObj(); - (void)codePtr; - (void)pcOffset; for (i=0 ; ilength ; i++) { Tcl_ListObjAppendElement(NULL, variables, @@ -2385,8 +2344,7 @@ TclCompileErrorCmd( Tcl_Interp *interp, /* Used for context. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { /* @@ -2395,7 +2353,6 @@ TclCompileErrorCmd( Tcl_Token *tokenPtr; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; if (parsePtr->numWords < 2 || parsePtr->numWords > 4) { return TCL_ERROR; @@ -2460,12 +2417,10 @@ TclCompileExprCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *firstWordPtr; - (void)cmdPtr; if (parsePtr->numWords == 1) { return TCL_ERROR; @@ -2506,8 +2461,7 @@ TclCompileForCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *startTokenPtr, *testTokenPtr, *nextTokenPtr, *bodyTokenPtr; @@ -2515,7 +2469,6 @@ TclCompileForCmd( int bodyCodeOffset, nextCodeOffset, jumpDist; int bodyRange, nextRange; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; if (parsePtr->numWords != 5) { return TCL_ERROR; @@ -2718,8 +2671,7 @@ CompileEachloopCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr, /* Holds resulting instructions. */ int collect) /* Select collecting or accumulating mode * (TCL_EACH_*) */ @@ -2734,7 +2686,6 @@ CompileEachloopCmd( int numWords, numLists, i, j, code = TCL_OK; Tcl_Obj *varListObj = NULL; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* * If the foreach command isn't in a procedure, don't compile it inline: @@ -3017,14 +2968,12 @@ static void PrintForeachInfo( ClientData clientData, Tcl_Obj *appendObj, - ByteCode *codePtr, - unsigned int pcOffset) + TCL_UNUSED(ByteCode *), + TCL_UNUSED(unsigned int)) { ForeachInfo *infoPtr = (ForeachInfo *)clientData; ForeachVarList *varsPtr; int i, j; - (void)codePtr; - (void)pcOffset; Tcl_AppendToObj(appendObj, "data=[", -1); @@ -3059,14 +3008,12 @@ static void PrintNewForeachInfo( ClientData clientData, Tcl_Obj *appendObj, - ByteCode *codePtr, - unsigned int pcOffset) + TCL_UNUSED(ByteCode *), + TCL_UNUSED(unsigned int)) { ForeachInfo *infoPtr = (ForeachInfo *)clientData; ForeachVarList *varsPtr; int i, j; - (void)codePtr; - (void)pcOffset; Tcl_AppendPrintfToObj(appendObj, "jumpOffset=%+d, vars=", infoPtr->loopCtTemp); @@ -3091,15 +3038,13 @@ static void DisassembleForeachInfo( ClientData clientData, Tcl_Obj *dictObj, - ByteCode *codePtr, - unsigned int pcOffset) + TCL_UNUSED(ByteCode *), + TCL_UNUSED(unsigned int)) { ForeachInfo *infoPtr = (ForeachInfo *)clientData; ForeachVarList *varsPtr; int i, j; Tcl_Obj *objPtr, *innerPtr; - (void)codePtr; - (void)pcOffset; /* * Data stores. @@ -3140,15 +3085,13 @@ static void DisassembleNewForeachInfo( ClientData clientData, Tcl_Obj *dictObj, - ByteCode *codePtr, - unsigned int pcOffset) + TCL_UNUSED(ByteCode *), + TCL_UNUSED(unsigned int)) { ForeachInfo *infoPtr = (ForeachInfo *)clientData; ForeachVarList *varsPtr; int i, j; Tcl_Obj *objPtr, *innerPtr; - (void)codePtr; - (void)pcOffset; /* * Jump offset. @@ -3198,8 +3141,7 @@ TclCompileFormatCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ @@ -3207,7 +3149,6 @@ TclCompileFormatCmd( Tcl_Obj **objv, *formatObj, *tmpObj; const char *bytes, *start; int i, j, len; - (void)cmdPtr; /* * Don't handle any guaranteed-error cases. diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c index 513aa7d..59eebae 100644 --- a/generic/tclCompCmdsGR.c +++ b/generic/tclCompCmdsGR.c @@ -86,14 +86,12 @@ TclCompileGlobalCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *varTokenPtr; int localIndex, numWords, i; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* TODO: Consider support for compiling expanded args. */ numWords = parsePtr->numWords; @@ -169,8 +167,7 @@ TclCompileIfCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { JumpFixupArray jumpFalseFixupArray; @@ -189,7 +186,6 @@ TclCompileIfCmd( int boolVal; /* Value of static condition. */ int compileScripts = 1; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* * Only compile the "if" command if all arguments are simple words, in @@ -473,14 +469,12 @@ TclCompileIncrCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *varTokenPtr, *incrTokenPtr; int isScalar, localIndex, haveImmValue, immValue; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; if ((parsePtr->numWords != 2) && (parsePtr->numWords != 3)) { return TCL_ERROR; @@ -643,15 +637,12 @@ TclCompileInfoCommandsCmd( int TclCompileInfoCoroutineCmd( - Tcl_Interp *dummy, /* Used for error reporting. */ + TCL_UNUSED(Tcl_Interp *), Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { - (void)dummy; - (void)cmdPtr; /* * Only compile [info coroutine] without arguments. */ @@ -673,14 +664,12 @@ TclCompileInfoExistsCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr; int isScalar, localIndex; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; if (parsePtr->numWords != 2) { return TCL_ERROR; @@ -723,11 +712,9 @@ TclCompileInfoLevelCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { - (void)cmdPtr; /* * Only compile [info level] without arguments or with a single argument. */ @@ -759,13 +746,11 @@ TclCompileInfoObjectClassCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); - (void)cmdPtr; if (parsePtr->numWords != 2) { return TCL_ERROR; @@ -780,13 +765,11 @@ TclCompileInfoObjectIsACmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); - (void)cmdPtr; /* * We only handle [info object isa object ]. The first three @@ -817,13 +800,11 @@ TclCompileInfoObjectNamespaceCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); - (void)cmdPtr; if (parsePtr->numWords != 2) { return TCL_ERROR; @@ -856,14 +837,12 @@ TclCompileLappendCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *varTokenPtr, *valueTokenPtr; int isScalar, localIndex, numWords, i; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* TODO: Consider support for compiling expanded args. */ numWords = parsePtr->numWords; @@ -973,14 +952,12 @@ TclCompileLassignCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr; int isScalar, localIndex, numWords, idx; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; numWords = parsePtr->numWords; @@ -1078,14 +1055,12 @@ TclCompileLindexCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *idxTokenPtr, *valTokenPtr; int i, idx, numWords = parsePtr->numWords; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* * Quit if too few args. @@ -1170,15 +1145,13 @@ TclCompileListCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *valueTokenPtr; int i, numWords, concat, build; Tcl_Obj *listObj, *objPtr; - (void)cmdPtr; if (parsePtr->numWords == 1) { /* @@ -1285,13 +1258,11 @@ TclCompileLlengthCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *varTokenPtr; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; if (parsePtr->numWords != 2) { return TCL_ERROR; @@ -1319,14 +1290,12 @@ TclCompileLrangeCmd( Tcl_Interp *interp, /* Tcl interpreter for context. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the * command. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds the resulting instructions. */ { Tcl_Token *tokenPtr, *listTokenPtr; DefineLineInformation; /* TIP #280 */ int idx1, idx2; - (void)cmdPtr; if (parsePtr->numWords != 4) { return TCL_ERROR; @@ -1381,14 +1350,12 @@ TclCompileLinsertCmd( Tcl_Interp *interp, /* Tcl interpreter for context. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the * command. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds the resulting instructions. */ { Tcl_Token *tokenPtr, *listTokenPtr; DefineLineInformation; /* TIP #280 */ int idx, i; - (void)cmdPtr; if (parsePtr->numWords < 3) { return TCL_ERROR; @@ -1485,15 +1452,13 @@ TclCompileLreplaceCmd( Tcl_Interp *interp, /* Tcl interpreter for context. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the * command. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds the resulting instructions. */ { Tcl_Token *tokenPtr, *listTokenPtr; DefineLineInformation; /* TIP #280 */ int idx1, idx2, i; int emptyPrefix=1, suffixStart = 0; - (void)cmdPtr; if (parsePtr->numWords < 4) { return TCL_ERROR; @@ -1650,8 +1615,7 @@ TclCompileLsetCmd( Tcl_Interp *interp, /* Tcl interpreter for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the * command. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds the resulting instructions. */ { int tempDepth; /* Depth used for emitting one part of the @@ -1662,7 +1626,6 @@ TclCompileLsetCmd( int isScalar; /* Flag == 1 if scalar, 0 if array. */ int i; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* * Check argument count. @@ -1795,15 +1758,12 @@ TclCompileLsetCmd( int TclCompileNamespaceCurrentCmd( - Tcl_Interp *dummy, /* Used for error reporting. */ + TCL_UNUSED(Tcl_Interp *), Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { - (void)dummy; - (void)cmdPtr; /* * Only compile [namespace current] without arguments. */ @@ -1825,13 +1785,11 @@ TclCompileNamespaceCodeCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; if (parsePtr->numWords != 2) { return TCL_ERROR; @@ -1876,13 +1834,11 @@ TclCompileNamespaceOriginCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; if (parsePtr->numWords != 2) { return TCL_ERROR; @@ -1899,14 +1855,12 @@ TclCompileNamespaceQualifiersCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); DefineLineInformation; /* TIP #280 */ int off; - (void)cmdPtr; if (parsePtr->numWords != 2) { return TCL_ERROR; @@ -1936,14 +1890,12 @@ TclCompileNamespaceTailCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); DefineLineInformation; /* TIP #280 */ JumpFixup jumpFixup; - (void)cmdPtr; if (parsePtr->numWords != 2) { return TCL_ERROR; @@ -1974,14 +1926,12 @@ TclCompileNamespaceUpvarCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr; int localIndex, numWords, i; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; if (envPtr->procPtr == NULL) { return TCL_ERROR; @@ -2036,14 +1986,12 @@ TclCompileNamespaceWhichCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr, *opt; int idx; - (void)cmdPtr; if (parsePtr->numWords < 2 || parsePtr->numWords > 3) { return TCL_ERROR; @@ -2101,8 +2049,7 @@ TclCompileRegexpCmd( Tcl_Interp *interp, /* Tcl interpreter for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the * command. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds the resulting instructions. */ { Tcl_Token *varTokenPtr; /* Pointer to the Tcl_Token representing the @@ -2110,7 +2057,6 @@ TclCompileRegexpCmd( int i, len, nocase, exact, sawLast, simple; const char *str; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* * We are only interested in compiling simple regexp cases. Currently @@ -2267,8 +2213,7 @@ TclCompileRegsubCmd( Tcl_Interp *interp, /* Tcl interpreter for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the * command. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds the resulting instructions. */ { /* @@ -2297,7 +2242,6 @@ TclCompileRegsubCmd( Tcl_DString pattern; const char *bytes; int len, exact, quantified, result = TCL_ERROR; - (void)cmdPtr; if (parsePtr->numWords < 5 || parsePtr->numWords > 6) { return TCL_ERROR; @@ -2443,8 +2387,7 @@ TclCompileReturnCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { /* @@ -2458,7 +2401,6 @@ TclCompileReturnCmd( Tcl_Obj *returnOpts, **objv; Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr); DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* * Check for special case which can always be compiled: @@ -2696,15 +2638,13 @@ TclCompileUpvarCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr; int localIndex, numWords, i; DefineLineInformation; /* TIP #280 */ Tcl_Obj *objPtr; - (void)cmdPtr; if (envPtr->procPtr == NULL) { return TCL_ERROR; @@ -2804,14 +2744,12 @@ TclCompileVariableCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *varTokenPtr, *valueTokenPtr; int localIndex, numWords, i; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; numWords = parsePtr->numWords; if (numWords < 2) { @@ -2887,7 +2825,7 @@ TclCompileVariableCmd( static int IndexTailVarIfKnown( - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), Tcl_Token *varTokenPtr, /* Token representing the variable name */ CompileEnv *envPtr) /* Holds resulting instructions. */ { @@ -2896,7 +2834,6 @@ IndexTailVarIfKnown( int len, n = varTokenPtr->numComponents; Tcl_Token *lastTokenPtr; int full, localIndex; - (void)dummy; /* * Determine if the tail is (a) known at compile time, and (b) not an @@ -2980,14 +2917,12 @@ TclCompileObjectNextCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = parsePtr->tokenPtr; int i; - (void)cmdPtr; if (parsePtr->numWords > 255) { return TCL_ERROR; @@ -3006,14 +2941,12 @@ TclCompileObjectNextToCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = parsePtr->tokenPtr; int i; - (void)cmdPtr; if (parsePtr->numWords < 2 || parsePtr->numWords > 255) { return TCL_ERROR; @@ -3029,15 +2962,12 @@ TclCompileObjectNextToCmd( int TclCompileObjectSelfCmd( - Tcl_Interp *dummy, /* Used for error reporting. */ + TCL_UNUSED(Tcl_Interp *), Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { - (void)dummy; - (void)cmdPtr; /* * We only handle [self] and [self object] (which is the same operation). * These are the only very common operations on [self] for which diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index ac8ca48..34f0fab 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -23,14 +23,10 @@ * Prototypes for procedures defined later in this file: */ -static ClientData DupJumptableInfo(ClientData clientData); -static void FreeJumptableInfo(ClientData clientData); -static void PrintJumptableInfo(ClientData clientData, - Tcl_Obj *appendObj, ByteCode *codePtr, - unsigned int pcOffset); -static void DisassembleJumptableInfo(ClientData clientData, - Tcl_Obj *dictObj, ByteCode *codePtr, - unsigned int pcOffset); +static AuxDataDupProc DupJumptableInfo; +static AuxDataFreeProc FreeJumptableInfo; +static AuxDataPrintProc PrintJumptableInfo; +static AuxDataPrintProc DisassembleJumptableInfo; static int CompileAssociativeBinaryOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, const char *identity, int instruction, CompileEnv *envPtr); @@ -130,14 +126,12 @@ TclCompileSetCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *varTokenPtr, *valueTokenPtr; int isAssignment, isScalar, localIndex, numWords; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; numWords = parsePtr->numWords; if ((numWords != 2) && (numWords != 3)) { @@ -225,15 +219,13 @@ TclCompileStringCatCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { int i, numWords = parsePtr->numWords, numArgs; Tcl_Token *wordTokenPtr; Tcl_Obj *obj, *folded; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* Trivial case, no arg */ @@ -298,13 +290,11 @@ TclCompileStringCmpCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - (void)cmdPtr; /* * We don't support any flags; the bytecode isn't that sophisticated. @@ -331,13 +321,11 @@ TclCompileStringEqualCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - (void)cmdPtr; /* * We don't support any flags; the bytecode isn't that sophisticated. @@ -364,13 +352,11 @@ TclCompileStringFirstCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - (void)cmdPtr; /* * We don't support any flags; the bytecode isn't that sophisticated. @@ -397,13 +383,11 @@ TclCompileStringLastCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - (void)cmdPtr; /* * We don't support any flags; the bytecode isn't that sophisticated. @@ -430,13 +414,11 @@ TclCompileStringIndexCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - (void)cmdPtr; if (parsePtr->numWords != 3) { return TCL_ERROR; @@ -459,14 +441,12 @@ TclCompileStringInsertCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr; DefineLineInformation; /* TIP #280 */ int idx; - (void)cmdPtr; if (parsePtr->numWords != 4) { return TCL_ERROR; @@ -886,14 +866,12 @@ TclCompileStringLenCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; Tcl_Obj *objPtr; - (void)cmdPtr; if (parsePtr->numWords != 2) { return TCL_ERROR; @@ -990,14 +968,12 @@ TclCompileStringRangeCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *stringTokenPtr, *fromTokenPtr, *toTokenPtr; int idx1, idx2; - (void)cmdPtr; if (parsePtr->numWords != 4) { return TCL_ERROR; @@ -1067,14 +1043,12 @@ TclCompileStringReplaceCmd( Tcl_Interp *interp, /* Tcl interpreter for context. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the * command. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds the resulting instructions. */ { Tcl_Token *tokenPtr, *valueTokenPtr; DefineLineInformation; /* TIP #280 */ int first, last; - (void)cmdPtr; if (parsePtr->numWords < 4 || parsePtr->numWords > 5) { return TCL_ERROR; @@ -1267,13 +1241,11 @@ TclCompileStringTrimLCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - (void)cmdPtr; if (parsePtr->numWords != 2 && parsePtr->numWords != 3) { return TCL_ERROR; @@ -1296,13 +1268,11 @@ TclCompileStringTrimRCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - (void)cmdPtr; if (parsePtr->numWords != 2 && parsePtr->numWords != 3) { return TCL_ERROR; @@ -1325,13 +1295,11 @@ TclCompileStringTrimCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - (void)cmdPtr; if (parsePtr->numWords != 2 && parsePtr->numWords != 3) { return TCL_ERROR; @@ -1475,8 +1443,7 @@ TclCompileSubstCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { int numArgs = parsePtr->numWords - 1; @@ -1486,7 +1453,6 @@ TclCompileSubstCmd( Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr); int code = TCL_ERROR; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; if (numArgs == 0) { return TCL_ERROR; @@ -1809,8 +1775,7 @@ TclCompileSwitchCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr; /* Pointer to tokens in command. */ @@ -1831,7 +1796,6 @@ TclCompileSwitchCmd( int result = TCL_ERROR; DefineLineInformation; /* TIP #280 */ int *clNext = envPtr->clNext; - (void)cmdPtr; /* * Only handle the following versions: @@ -2613,7 +2577,7 @@ static void PrintJumptableInfo( ClientData clientData, Tcl_Obj *appendObj, - ByteCode *codePtr, + TCL_UNUSED(ByteCode *), unsigned int pcOffset) { JumptableInfo *jtPtr = (JumptableInfo *)clientData; @@ -2621,7 +2585,6 @@ PrintJumptableInfo( Tcl_HashSearch search; const char *keyPtr; int offset, i = 0; - (void)codePtr; hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search); for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) { @@ -2643,8 +2606,8 @@ static void DisassembleJumptableInfo( ClientData clientData, Tcl_Obj *dictObj, - ByteCode *codePtr, - unsigned int pcOffset) + TCL_UNUSED(ByteCode *), + TCL_UNUSED(unsigned int)) { JumptableInfo *jtPtr = (JumptableInfo *)clientData; Tcl_Obj *mapping = Tcl_NewObj(); @@ -2652,8 +2615,6 @@ DisassembleJumptableInfo( Tcl_HashSearch search; const char *keyPtr; int offset; - (void)codePtr; - (void)pcOffset; hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search); for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) { @@ -2688,14 +2649,12 @@ TclCompileTailcallCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = parsePtr->tokenPtr; int i; - (void)cmdPtr; if (parsePtr->numWords < 2 || parsePtr->numWords > 256 || envPtr->procPtr == NULL) { @@ -2736,8 +2695,7 @@ TclCompileThrowCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ @@ -2745,7 +2703,6 @@ TclCompileThrowCmd( Tcl_Token *codeToken, *msgToken; Tcl_Obj *objPtr; int codeKnown, codeIsList, codeIsValid, len; - (void)cmdPtr; if (numWords != 3) { return TCL_ERROR; @@ -2841,8 +2798,7 @@ TclCompileTryCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { int numWords = parsePtr->numWords, numHandlers, result = TCL_ERROR; @@ -2851,7 +2807,6 @@ TclCompileTryCmd( Tcl_Obj **matchClauses = NULL; int *matchCodes=NULL, *resultVarIndices=NULL, *optionVarIndices=NULL; int i; - (void)cmdPtr; if (numWords < 2) { return TCL_ERROR; @@ -3652,14 +3607,12 @@ TclCompileUnsetCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *varTokenPtr; int isScalar, localIndex, flags = 1, i, varCount = 0, haveFlags = 0; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; /* TODO: Consider support for compiling expanded args. */ @@ -3791,8 +3744,7 @@ TclCompileWhileCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *testTokenPtr, *bodyTokenPtr; @@ -3802,7 +3754,6 @@ TclCompileWhileCmd( * infinite loop. */ Tcl_Obj *boolObj; DefineLineInformation; /* TIP #280 */ - (void)cmdPtr; if (parsePtr->numWords != 3) { return TCL_ERROR; @@ -3970,12 +3921,9 @@ TclCompileYieldCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { - (void)cmdPtr; - if (parsePtr->numWords < 1 || parsePtr->numWords > 2) { return TCL_ERROR; } @@ -4015,14 +3963,12 @@ TclCompileYieldToCmd( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); int i; - (void)cmdPtr; if (parsePtr->numWords < 2) { return TCL_ERROR; @@ -4266,11 +4212,9 @@ int TclCompileInvertOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileUnaryOpCmd(interp, parsePtr, INST_BITNOT, envPtr); } @@ -4278,11 +4222,9 @@ int TclCompileNotOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileUnaryOpCmd(interp, parsePtr, INST_LNOT, envPtr); } @@ -4290,11 +4232,9 @@ int TclCompileAddOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_ADD, envPtr); } @@ -4303,11 +4243,9 @@ int TclCompileMulOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileAssociativeBinaryOpCmd(interp, parsePtr, "1", INST_MULT, envPtr); } @@ -4316,11 +4254,9 @@ int TclCompileAndOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileAssociativeBinaryOpCmd(interp, parsePtr, "-1", INST_BITAND, envPtr); } @@ -4329,11 +4265,9 @@ int TclCompileOrOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_BITOR, envPtr); } @@ -4342,11 +4276,9 @@ int TclCompileXorOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_BITXOR, envPtr); } @@ -4355,8 +4287,7 @@ int TclCompilePowOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { /* @@ -4367,7 +4298,6 @@ TclCompilePowOpCmd( Tcl_Token *tokenPtr = parsePtr->tokenPtr; DefineLineInformation; /* TIP #280 */ int words; - (void)cmdPtr; for (words=1 ; wordsnumWords ; words++) { tokenPtr = TokenAfter(tokenPtr); @@ -4387,11 +4317,9 @@ int TclCompileLshiftOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LSHIFT, envPtr); } @@ -4399,11 +4327,9 @@ int TclCompileRshiftOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_RSHIFT, envPtr); } @@ -4411,11 +4337,9 @@ int TclCompileModOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_MOD, envPtr); } @@ -4423,11 +4347,9 @@ int TclCompileNeqOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_NEQ, envPtr); } @@ -4435,11 +4357,9 @@ int TclCompileStrneqOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_STR_NEQ, envPtr); } @@ -4447,11 +4367,9 @@ int TclCompileInOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LIST_IN, envPtr); } @@ -4459,11 +4377,9 @@ int TclCompileNiOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LIST_NOT_IN, envPtr); } @@ -4472,11 +4388,9 @@ int TclCompileLessOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileComparisonOpCmd(interp, parsePtr, INST_LT, envPtr); } @@ -4484,11 +4398,9 @@ int TclCompileLeqOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileComparisonOpCmd(interp, parsePtr, INST_LE, envPtr); } @@ -4496,11 +4408,9 @@ int TclCompileGreaterOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileComparisonOpCmd(interp, parsePtr, INST_GT, envPtr); } @@ -4508,11 +4418,9 @@ int TclCompileGeqOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileComparisonOpCmd(interp, parsePtr, INST_GE, envPtr); } @@ -4520,11 +4428,9 @@ int TclCompileEqOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileComparisonOpCmd(interp, parsePtr, INST_EQ, envPtr); } @@ -4532,11 +4438,9 @@ int TclCompileStreqOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileComparisonOpCmd(interp, parsePtr, INST_STR_EQ, envPtr); } @@ -4544,11 +4448,9 @@ int TclCompileStrLtOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileComparisonOpCmd(interp, parsePtr, INST_STR_LT, envPtr); } @@ -4556,11 +4458,9 @@ int TclCompileStrLeOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileComparisonOpCmd(interp, parsePtr, INST_STR_LE, envPtr); } @@ -4568,11 +4468,9 @@ int TclCompileStrGtOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileComparisonOpCmd(interp, parsePtr, INST_STR_GT, envPtr); } @@ -4580,11 +4478,9 @@ int TclCompileStrGeOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { - (void)cmdPtr; return CompileComparisonOpCmd(interp, parsePtr, INST_STR_GE, envPtr); } @@ -4592,14 +4488,12 @@ int TclCompileMinusOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { Tcl_Token *tokenPtr = parsePtr->tokenPtr; DefineLineInformation; /* TIP #280 */ int words; - (void)cmdPtr; /* TODO: Consider support for compiling expanded args. */ if (parsePtr->numWords == 1) { @@ -4639,14 +4533,12 @@ int TclCompileDivOpCmd( Tcl_Interp *interp, Tcl_Parse *parsePtr, - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) { Tcl_Token *tokenPtr = parsePtr->tokenPtr; DefineLineInformation; /* TIP #280 */ int words; - (void)cmdPtr; /* TODO: Consider support for compiling expanded args. */ if (parsePtr->numWords == 1) { diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 7ed24ae..5d4555e 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -697,8 +697,7 @@ static void EnterCmdStartData(CompileEnv *envPtr, static void FreeByteCodeInternalRep(Tcl_Obj *objPtr); static void FreeSubstCodeInternalRep(Tcl_Obj *objPtr); static int GetCmdLocEncodingSize(CompileEnv *envPtr); -static int IsCompactibleCompileEnv(Tcl_Interp *interp, - CompileEnv *envPtr); +static int IsCompactibleCompileEnv(CompileEnv *envPtr); static void PreventCycle(Tcl_Obj *objPtr, CompileEnv *envPtr); #ifdef TCL_COMPILE_STATS static void RecordByteCodeStats(ByteCode *codePtr); @@ -851,7 +850,7 @@ TclSetByteCodeFromAny( if (Tcl_GetMaster(interp) == NULL && !Tcl_LimitTypeEnabled(interp, TCL_LIMIT_COMMANDS|TCL_LIMIT_TIME) - && IsCompactibleCompileEnv(interp, &compEnv)) { + && IsCompactibleCompileEnv(&compEnv)) { TclFreeCompileEnv(&compEnv); iPtr->compiledProcPtr = procPtr; TclInitCompileEnv(interp, &compEnv, stringPtr, length, @@ -962,11 +961,9 @@ SetByteCodeFromAny( static void DupByteCodeInternalRep( - Tcl_Obj *srcPtr, /* Object with internal rep to copy. */ - Tcl_Obj *copyPtr) /* Object with internal rep to set. */ + TCL_UNUSED(Tcl_Obj *) /*srcPtr*/, + TCL_UNUSED(Tcl_Obj *) /*copyPtr*/) { - (void)srcPtr; - (void)copyPtr; return; } @@ -1176,12 +1173,10 @@ CleanupByteCode( static int IsCompactibleCompileEnv( - Tcl_Interp *dummy, CompileEnv *envPtr) { unsigned char *pc; int size; - (void)dummy; /* * Special: procedures in the '::tcl' namespace (or its children) are @@ -2740,13 +2735,11 @@ TclCompileNoOp( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Parse *parsePtr, /* Points to a parse structure for the command * created by Tcl_ParseCommand. */ - Command *cmdPtr, /* Points to defintion of command being - * compiled. */ + TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { Tcl_Token *tokenPtr; int i; - (void)cmdPtr; tokenPtr = parsePtr->tokenPtr; for (i = 1; i < parsePtr->numWords; i++) { -- cgit v0.12 From 3db7dab605a517136ec1ab8f425bf66e81f7a68d Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 18:31:49 +0000 Subject: more of the same --- generic/tclConfig.c | 16 ++--- generic/tclDate.c | 3 +- generic/tclDictObj.c | 172 ++++++++++++++++++++------------------------------- 3 files changed, 74 insertions(+), 117 deletions(-) diff --git a/generic/tclConfig.c b/generic/tclConfig.c index e7e521a..3bdcd38 100644 --- a/generic/tclConfig.c +++ b/generic/tclConfig.c @@ -41,13 +41,10 @@ typedef struct QCCD { * Static functions in this file: */ -static int QueryConfigObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, - struct Tcl_Obj *const *objv); -static void QueryConfigDelete(ClientData clientData); +static Tcl_ObjCmdProc QueryConfigObjCmd; +static Tcl_CmdDeleteProc QueryConfigDelete; +static Tcl_InterpDeleteProc ConfigDictDeleteProc; static Tcl_Obj * GetConfigDict(Tcl_Interp *interp); -static void ConfigDictDeleteProc(ClientData clientData, - Tcl_Interp *interp); /* *---------------------------------------------------------------------- @@ -392,12 +389,9 @@ GetConfigDict( static void ConfigDictDeleteProc( ClientData clientData, /* Pointer to Tcl_Obj. */ - Tcl_Interp *dummy) /* Interpreter being deleted. */ + TCL_UNUSED(Tcl_Interp *)) { - Tcl_Obj *pDB = (Tcl_Obj *)clientData; - (void)dummy; - - Tcl_DecrRefCount(pDB); + Tcl_DecrRefCount((Tcl_Obj *)clientData); } /* diff --git a/generic/tclDate.c b/generic/tclDate.c index d31badd..341dd0f 100644 --- a/generic/tclDate.c +++ b/generic/tclDate.c @@ -2744,7 +2744,7 @@ TclDatelex( int TclClockOldscanObjCmd( - void *dummy, /* Unused */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Tcl interpreter */ int objc, /* Count of paraneters */ Tcl_Obj *const *objv) /* Parameters */ @@ -2754,7 +2754,6 @@ TclClockOldscanObjCmd( DateInfo dateInfo; DateInfo* info = &dateInfo; int status; - (void)dummy; if (objc != 5) { Tcl_WrongNumArgs(interp, 1, objv, diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index 88a7876..f63d60d 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -23,62 +23,44 @@ struct Dict; * Prototypes for functions defined later in this file: */ -static void DeleteDict(struct Dict *dict); -static int DictAppendCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictCreateCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictExistsCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictFilterCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictGetCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictGetDefCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictIncrCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictInfoCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictKeysCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictLappendCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictMergeCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictRemoveCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictReplaceCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictSetCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictSizeCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictUnsetCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictUpdateCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictValuesCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static int DictWithCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); -static void DupDictInternalRep(Tcl_Obj *srcPtr, Tcl_Obj *copyPtr); -static void FreeDictInternalRep(Tcl_Obj *dictPtr); -static void InvalidateDictChain(Tcl_Obj *dictObj); -static int SetDictFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); -static void UpdateStringOfDict(Tcl_Obj *dictPtr); -static Tcl_HashEntry * AllocChainEntry(Tcl_HashTable *tablePtr,void *keyPtr); -static inline void InitChainTable(struct Dict *dict); -static inline void DeleteChainTable(struct Dict *dict); -static inline Tcl_HashEntry *CreateChainEntry(struct Dict *dict, - Tcl_Obj *keyPtr, int *newPtr); -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_NRPostProc DictForLoopCallback; -static Tcl_NRPostProc DictMapLoopCallback; +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_DupInternalRepProc DupDictInternalRep; +static Tcl_FreeInternalRepProc FreeDictInternalRep; +static void InvalidateDictChain(Tcl_Obj *dictObj); +static Tcl_SetFromAnyProc SetDictFromAny; +static Tcl_UpdateStringProc UpdateStringOfDict; +static Tcl_AllocHashEntryProc AllocChainEntry; +static inline void InitChainTable(struct Dict *dict); +static inline void DeleteChainTable(struct Dict *dict); +static inline Tcl_HashEntry * CreateChainEntry(struct Dict *dict, + Tcl_Obj *keyPtr, int *newPtr); +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_NRPostProc DictForLoopCallback; +static Tcl_NRPostProc DictMapLoopCallback; /* * Table of dict subcommand names and implementations. @@ -240,12 +222,11 @@ typedef struct { static Tcl_HashEntry * AllocChainEntry( - Tcl_HashTable *tablePtr, + TCL_UNUSED(Tcl_HashTable *), void *keyPtr) { Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr; ChainEntry *cPtr; - (void)tablePtr; cPtr = (ChainEntry *)ckalloc(sizeof(ChainEntry)); cPtr->entry.key.objPtr = objPtr; @@ -1462,12 +1443,12 @@ Tcl_NewDictObj(void) *---------------------------------------------------------------------- */ +#ifdef TCL_MEM_DEBUG Tcl_Obj * Tcl_DbNewDictObj( const char *file, int line) { -#ifdef TCL_MEM_DEBUG Tcl_Obj *dictPtr; Dict *dict; @@ -1480,12 +1461,16 @@ Tcl_DbNewDictObj( dict->refCount = 1; DictSetIntRep(dictPtr, dict); return dictPtr; +} #else /* !TCL_MEM_DEBUG */ - (void)file; - (void)line; +Tcl_Obj * +Tcl_DbNewDictObj( + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) +{ return Tcl_NewDictObj(); -#endif } +#endif /***** START OF FUNCTIONS IMPLEMENTING TCL COMMANDS *****/ @@ -1509,14 +1494,13 @@ Tcl_DbNewDictObj( static int DictCreateCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *dictObj; int i; - (void)dummy; /* * Must have an even number of arguments; note that number of preceding @@ -1560,14 +1544,13 @@ DictCreateCmd( static int DictGetCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr = NULL; int result; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...?"); @@ -1654,7 +1637,7 @@ DictGetCmd( static int DictGetDefCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1662,7 +1645,6 @@ DictGetDefCmd( Tcl_Obj *dictPtr, *keyPtr, *valuePtr, *defaultPtr; Tcl_Obj *const *keyPath; int numKeys; - (void)dummy; if (objc < 4) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...? key default"); @@ -1720,14 +1702,13 @@ DictGetDefCmd( static int DictReplaceCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr; int i; - (void)dummy; if ((objc < 2) || (objc & 1)) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key value ...?"); @@ -1769,14 +1750,13 @@ DictReplaceCmd( static int DictRemoveCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr; int i; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...?"); @@ -1818,7 +1798,7 @@ DictRemoveCmd( static int DictMergeCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1827,7 +1807,6 @@ DictMergeCmd( int allocatedDict = 0; int i, done; Tcl_DictSearch search; - (void)dummy; if (objc == 1) { /* @@ -1906,14 +1885,13 @@ DictMergeCmd( static int DictKeysCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *listPtr; const char *pattern = NULL; - (void)dummy; if (objc!=2 && objc!=3) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?pattern?"); @@ -1986,7 +1964,7 @@ DictKeysCmd( static int DictValuesCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1995,7 +1973,6 @@ DictValuesCmd( Tcl_DictSearch search; int done; const char *pattern; - (void)dummy; if (objc!=2 && objc!=3) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?pattern?"); @@ -2047,13 +2024,12 @@ DictValuesCmd( static int DictSizeCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { int result, size; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary"); @@ -2086,13 +2062,12 @@ DictSizeCmd( static int DictExistsCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary key ?key ...?"); @@ -2129,14 +2104,13 @@ DictExistsCmd( static int DictInfoCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Dict *dict; char *statsStr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary"); @@ -2174,14 +2148,13 @@ DictInfoCmd( static int DictIncrCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { int code = TCL_OK; Tcl_Obj *dictPtr, *valuePtr = NULL; - (void)dummy; if (objc < 3 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?increment?"); @@ -2295,14 +2268,13 @@ DictIncrCmd( static int DictLappendCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr, *resultPtr; int i, allocatedDict = 0, allocatedValue = 0; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?"); @@ -2383,14 +2355,13 @@ DictLappendCmd( static int DictAppendCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr, *resultPtr; int allocatedDict = 0; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?"); @@ -2486,7 +2457,7 @@ DictAppendCmd( static int DictForNRCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -2496,7 +2467,6 @@ DictForNRCmd( Tcl_Obj **varv, *keyObj, *valueObj; Tcl_DictSearch *searchPtr; int varc, done; - (void)dummy; if (objc != 4) { Tcl_WrongNumArgs(interp, 1, objv, @@ -2682,7 +2652,7 @@ DictForLoopCallback( static int DictMapNRCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -2691,7 +2661,6 @@ DictMapNRCmd( Tcl_Obj **varv, *keyObj, *valueObj; DictMapStorage *storagePtr; int varc, done; - (void)dummy; if (objc != 4) { Tcl_WrongNumArgs(interp, 1, objv, @@ -2895,14 +2864,13 @@ DictMapLoopCallback( static int DictSetCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *resultPtr; int result, allocatedDict = 0; - (void)dummy; if (objc < 4) { Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?key ...? value"); @@ -2956,14 +2924,13 @@ DictSetCmd( static int DictUnsetCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *resultPtr; int result, allocatedDict = 0; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?key ...?"); @@ -3016,7 +2983,7 @@ DictUnsetCmd( static int DictFilterCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -3033,7 +3000,6 @@ DictFilterCmd( Tcl_DictSearch search; int index, varc, done, result, satisfied; const char *pattern; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary filterType ?arg ...?"); @@ -3302,7 +3268,7 @@ DictFilterCmd( static int DictUpdateCmd( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -3310,7 +3276,6 @@ DictUpdateCmd( Interp *iPtr = (Interp *) interp; Tcl_Obj *dictPtr, *objPtr; int i, dummy; - (void)clientData; if (objc < 5 || !(objc & 1)) { Tcl_WrongNumArgs(interp, 1, objv, @@ -3461,14 +3426,13 @@ FinalizeDictUpdate( static int DictWithCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Interp *iPtr = (Interp *) interp; Tcl_Obj *dictPtr, *keysPtr, *pathPtr; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "dictVarName ?key ...? script"); -- cgit v0.12 From e870d650fdbd1f2a1e76764531a10e81f4509cea Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 19:29:59 +0000 Subject: more unused arguments --- generic/tclDisassemble.c | 9 +-- generic/tclEncoding.c | 185 +++++++++++++---------------------------------- 2 files changed, 53 insertions(+), 141 deletions(-) diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 83642f0..e30499f 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -21,8 +21,7 @@ * Prototypes for procedures defined later in this file: */ -static Tcl_Obj * DisassembleByteCodeAsDicts(Tcl_Interp *interp, - Tcl_Obj *objPtr); +static Tcl_Obj * DisassembleByteCodeAsDicts(Tcl_Obj *objPtr); static Tcl_Obj * DisassembleByteCodeObj(Tcl_Obj *objPtr); static int FormatInstruction(ByteCode *codePtr, const unsigned char *pc, Tcl_Obj *bufferObj); @@ -131,7 +130,7 @@ GetLocationInformation( void TclPrintByteCodeObj( - Tcl_Interp *interp, /* Used only for getting location info. */ + TCL_UNUSED(Tcl_Interp *), /* Stuck with this in internal stubs */ Tcl_Obj *objPtr) /* The bytecode object to disassemble. */ { Tcl_Obj *bufPtr = DisassembleByteCodeObj(objPtr); @@ -950,7 +949,6 @@ PrintSourceToObj( static Tcl_Obj * DisassembleByteCodeAsDicts( - Tcl_Interp *dummy, /* Not used. */ Tcl_Obj *objPtr) /* The bytecode-holding value to take apart */ { ByteCode *codePtr; @@ -959,7 +957,6 @@ DisassembleByteCodeAsDicts( unsigned char *pc, *opnd, *codeOffPtr, *codeLenPtr, *srcOffPtr, *srcLenPtr; int codeOffset, codeLength, sourceOffset, sourceLength; int i, val, line; - (void)dummy; ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr); @@ -1622,7 +1619,7 @@ Tcl_DisassembleObjCmd( } if (clientData) { Tcl_SetObjResult(interp, - DisassembleByteCodeAsDicts(interp, codeObjPtr)); + DisassembleByteCodeAsDicts(codeObjPtr)); } else { Tcl_SetObjResult(interp, DisassembleByteCodeObj(codeObjPtr)); diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index c888962..b02be21 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -195,85 +195,41 @@ static unsigned short emptyPage[256]; * Functions used only in this module. */ -static int BinaryProc(ClientData clientData, - const char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr); -static void DupEncodingIntRep(Tcl_Obj *srcPtr, Tcl_Obj *dupPtr); -static void EscapeFreeProc(ClientData clientData); -static int EscapeFromUtfProc(ClientData clientData, - const char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr); -static int EscapeToUtfProc(ClientData clientData, - const char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr); -static void FillEncodingFileMap(void); -static void FreeEncoding(Tcl_Encoding encoding); -static void FreeEncodingIntRep(Tcl_Obj *objPtr); -static Encoding * GetTableEncoding(EscapeEncodingData *dataPtr, - int state); -static Tcl_Encoding LoadEncodingFile(Tcl_Interp *interp, const char *name); -static Tcl_Encoding LoadTableEncoding(const char *name, int type, - Tcl_Channel chan); -static Tcl_Encoding LoadEscapeEncoding(const char *name, Tcl_Channel chan); -static Tcl_Channel OpenEncodingFileChannel(Tcl_Interp *interp, - const char *name); -static void TableFreeProc(ClientData clientData); -static int TableFromUtfProc(ClientData clientData, - const char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr); -static int TableToUtfProc(ClientData clientData, const char *src, - int srcLen, int flags, Tcl_EncodingState *statePtr, - char *dst, int dstLen, int *srcReadPtr, - int *dstWrotePtr, int *dstCharsPtr); -static size_t unilen(const char *src); -static int Utf16ToUtfProc(ClientData clientData, - const char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr); -static int UtfToUtf16Proc(ClientData clientData, - const char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr); -static int UtfToUcs2Proc(ClientData clientData, - const char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr); -static int UtfToUtfProc(ClientData clientData, - const char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr, int pureNullMode); -static int UtfIntToUtfExtProc(ClientData clientData, - const char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr); -static int UtfExtToUtfIntProc(ClientData clientData, - const char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr); -static int Iso88591FromUtfProc(ClientData clientData, - const char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr); -static int Iso88591ToUtfProc(ClientData clientData, - const char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, - int dstLen, int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr); +static Tcl_EncodingConvertProc BinaryProc; +static Tcl_DupInternalRepProc DupEncodingIntRep; +static Tcl_EncodingFreeProc EscapeFreeProc; +static Tcl_EncodingConvertProc EscapeFromUtfProc; +static Tcl_EncodingConvertProc EscapeToUtfProc; +static void FillEncodingFileMap(void); +static void FreeEncoding(Tcl_Encoding encoding); +static Tcl_FreeInternalRepProc FreeEncodingIntRep; +static Encoding * GetTableEncoding(EscapeEncodingData *dataPtr, + int state); +static Tcl_Encoding LoadEncodingFile(Tcl_Interp *interp, + const char *name); +static Tcl_Encoding LoadTableEncoding(const char *name, int type, + Tcl_Channel chan); +static Tcl_Encoding LoadEscapeEncoding(const char *name, + Tcl_Channel chan); +static Tcl_Channel OpenEncodingFileChannel(Tcl_Interp *interp, + const char *name); +static Tcl_EncodingFreeProc TableFreeProc; +static Tcl_EncodingConvertProc TableFromUtfProc; +static Tcl_EncodingConvertProc TableToUtfProc; +static size_t unilen(const char *src); +static Tcl_EncodingConvertProc Utf16ToUtfProc; +static Tcl_EncodingConvertProc UtfToUtf16Proc; +static Tcl_EncodingConvertProc UtfToUcs2Proc; +static int UtfToUtfProc(ClientData clientData, + const char *src, int srcLen, int flags, + Tcl_EncodingState *statePtr, char *dst, + int dstLen, int *srcReadPtr, + int *dstWrotePtr, int *dstCharsPtr, + int pureNullMode); +static Tcl_EncodingConvertProc UtfIntToUtfExtProc; +static Tcl_EncodingConvertProc UtfExtToUtfIntProc; +static Tcl_EncodingConvertProc Iso88591FromUtfProc; +static Tcl_EncodingConvertProc Iso88591ToUtfProc; /* * A Tcl_ObjType for holding a cached Tcl_Encoding in the twoPtrValue.ptr1 field @@ -1226,7 +1182,7 @@ Tcl_ExternalToUtfDString( int Tcl_ExternalToUtf( - Tcl_Interp *dummy, /* Interp for error return, if not NULL. */ + TCL_UNUSED(Tcl_Interp *), /* TODO: Re-examine this. */ Tcl_Encoding encoding, /* The encoding for the source string, or NULL * for the default system encoding. */ const char *src, /* Source string in specified encoding. */ @@ -1260,7 +1216,6 @@ Tcl_ExternalToUtf( int charLimited = (flags & TCL_ENCODING_CHAR_LIMIT) && dstCharsPtr; int maxChars = INT_MAX; Tcl_EncodingState state; - (void)dummy; if (encoding == NULL) { encoding = systemEncoding; @@ -1418,7 +1373,7 @@ Tcl_UtfToExternalDString( int Tcl_UtfToExternal( - Tcl_Interp *dummy, /* Interp for error return, if not NULL. */ + TCL_UNUSED(Tcl_Interp *), /* TODO: Re-examine this. */ Tcl_Encoding encoding, /* The encoding for the converted string, or * NULL for the default system encoding. */ const char *src, /* Source string in UTF-8. */ @@ -1449,7 +1404,6 @@ Tcl_UtfToExternal( const Encoding *encodingPtr; int result, srcRead, dstWrote, dstChars; Tcl_EncodingState state; - (void)dummy; if (encoding == NULL) { encoding = systemEncoding; @@ -2157,15 +2111,11 @@ LoadEscapeEncoding( static int BinaryProc( - ClientData clientData, /* Not used. */ + TCL_UNUSED(ClientData), const char *src, /* Source string (unknown encoding). */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ - Tcl_EncodingState *statePtr,/* Place for conversion routine to store state - * information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ + TCL_UNUSED(Tcl_EncodingState *), char *dst, /* Output buffer in which converted string is * stored. */ int dstLen, /* The maximum length of output buffer in @@ -2180,8 +2130,6 @@ BinaryProc( * output buffer. */ { int result; - (void)clientData; - (void)statePtr; result = TCL_OK; dstLen -= TCL_UTF_MAX - 1; @@ -2223,7 +2171,7 @@ BinaryProc( static int UtfIntToUtfExtProc( - ClientData clientData, /* Not used. */ + ClientData clientData, const char *src, /* Source string in UTF-8. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ @@ -2272,7 +2220,7 @@ UtfIntToUtfExtProc( static int UtfExtToUtfIntProc( - ClientData clientData, /* Not used. */ + ClientData clientData, const char *src, /* Source string in UTF-8. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ @@ -2321,7 +2269,7 @@ UtfExtToUtfIntProc( static int UtfToUtfProc( - ClientData clientData, /* Not used. */ + TCL_UNUSED(ClientData), const char *src, /* Source string in UTF-8. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ @@ -2353,7 +2301,6 @@ UtfToUtfProc( const char *dstStart, *dstEnd; int result, numChars, charLimit = INT_MAX; Tcl_UniChar *chPtr = (Tcl_UniChar *) statePtr; - (void)clientData; if (flags & TCL_ENCODING_START) { *statePtr = 0; @@ -2460,11 +2407,7 @@ Utf16ToUtfProc( const char *src, /* Source string in Unicode. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ - Tcl_EncodingState *statePtr,/* Place for conversion routine to store state - * information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ + TCL_UNUSED(Tcl_EncodingState *), char *dst, /* Output buffer in which converted string is * stored. */ int dstLen, /* The maximum length of output buffer in @@ -2485,7 +2428,6 @@ Utf16ToUtfProc( const char *dstEnd, *dstStart; int result, numChars, charLimit = INT_MAX; unsigned short ch; - (void)statePtr; if (flags & TCL_ENCODING_CHAR_LIMIT) { charLimit = *dstCharsPtr; @@ -2680,11 +2622,7 @@ UtfToUcs2Proc( const char *src, /* Source string in UTF-8. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ - Tcl_EncodingState *statePtr,/* Place for conversion routine to store state - * information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ + TCL_UNUSED(Tcl_EncodingState *), char *dst, /* Output buffer in which converted string is * stored. */ int dstLen, /* The maximum length of output buffer in @@ -2707,7 +2645,6 @@ UtfToUcs2Proc( int len; #endif Tcl_UniChar ch = 0; - (void)statePtr; srcStart = src; srcEnd = src + srcLen; @@ -2790,11 +2727,7 @@ TableToUtfProc( const char *src, /* Source string in specified encoding. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ - Tcl_EncodingState *statePtr,/* Place for conversion routine to store state - * information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ + TCL_UNUSED(Tcl_EncodingState *), char *dst, /* Output buffer in which converted string is * stored. */ int dstLen, /* The maximum length of output buffer in @@ -2818,7 +2751,6 @@ TableToUtfProc( const unsigned short *const *toUnicode; const unsigned short *pageZero; TableEncodingData *dataPtr = (TableEncodingData *)clientData; - (void)statePtr; if (flags & TCL_ENCODING_CHAR_LIMIT) { charLimit = *dstCharsPtr; @@ -2904,11 +2836,7 @@ TableFromUtfProc( const char *src, /* Source string in UTF-8. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ - Tcl_EncodingState *statePtr,/* Place for conversion routine to store state - * information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ + TCL_UNUSED(Tcl_EncodingState *), char *dst, /* Output buffer in which converted string is * stored. */ int dstLen, /* The maximum length of output buffer in @@ -2931,7 +2859,6 @@ TableFromUtfProc( int result, len, word, numChars; TableEncodingData *dataPtr = (TableEncodingData *)clientData; const unsigned short *const *fromUnicode; - (void)statePtr; result = TCL_OK; @@ -3026,15 +2953,11 @@ TableFromUtfProc( static int Iso88591ToUtfProc( - ClientData clientData, /* Ignored. */ + TCL_UNUSED(ClientData), const char *src, /* Source string in specified encoding. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ - Tcl_EncodingState *statePtr,/* Place for conversion routine to store state - * information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ + TCL_UNUSED(Tcl_EncodingState *), char *dst, /* Output buffer in which converted string is * stored. */ int dstLen, /* The maximum length of output buffer in @@ -3054,8 +2977,6 @@ Iso88591ToUtfProc( const char *srcStart, *srcEnd; const char *dstEnd, *dstStart; int result, numChars, charLimit = INT_MAX; - (void)clientData; - (void)statePtr; if (flags & TCL_ENCODING_CHAR_LIMIT) { charLimit = *dstCharsPtr; @@ -3112,15 +3033,11 @@ Iso88591ToUtfProc( static int Iso88591FromUtfProc( - ClientData clientData, /* Ignored. */ + TCL_UNUSED(ClientData), const char *src, /* Source string in UTF-8. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ - Tcl_EncodingState *statePtr,/* Place for conversion routine to store state - * information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ + TCL_UNUSED(Tcl_EncodingState *), char *dst, /* Output buffer in which converted string is * stored. */ int dstLen, /* The maximum length of output buffer in @@ -3141,8 +3058,6 @@ Iso88591FromUtfProc( const char *dstStart, *dstEnd; int result = TCL_OK, numChars; Tcl_UniChar ch = 0; - (void)clientData; - (void)statePtr; srcStart = src; srcEnd = src + srcLen; -- cgit v0.12 From 3f741fda0387c3b85fd1d5c3d0a1a4876f455386 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 19:58:14 +0000 Subject: (no comment) --- generic/tclEnsemble.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 654f33e..b9c71a0 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -151,7 +151,7 @@ NewNsObj( int TclNamespaceEnsembleCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -164,7 +164,6 @@ TclNamespaceEnsembleCmd( Tcl_Obj *listObj; const char *simpleName; int index, done; - (void)dummy; if (nsPtr == NULL || nsPtr->flags & NS_DYING) { if (!Tcl_InterpDeleted(interp)) { @@ -1988,11 +1987,10 @@ NsEnsembleImplementationCmdNR( int TclClearRootEnsemble( - ClientData dummy[], + TCL_UNUSED(ClientData *), Tcl_Interp *interp, int result) { - (void)dummy; TclResetRewriteEnsemble(interp, 1); return result; } @@ -2096,12 +2094,11 @@ TclResetRewriteEnsemble( static int FreeER( ClientData data[], - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), int result) { Tcl_Obj **tmp = (Tcl_Obj **) data[0]; Tcl_Obj **store = (Tcl_Obj **) data[1]; - (void)dummy; ckfree(store); ckfree(tmp); -- cgit v0.12 From e72ebf58a150fcbf041ed40495472805d08d8ce1 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 20:01:56 +0000 Subject: (no comment) --- generic/tclEnv.c | 3 +-- generic/tclEvent.c | 17 ++++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/generic/tclEnv.c b/generic/tclEnv.c index d7f8d5f..86df16d 100644 --- a/generic/tclEnv.c +++ b/generic/tclEnv.c @@ -579,7 +579,7 @@ TclGetEnv( /* ARGSUSED */ static char * EnvTraceProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interpreter whose "env" variable is being * modified. */ const char *name1, /* Better be "env". */ @@ -587,7 +587,6 @@ EnvTraceProc( * whole array is being deleted (UTF-8). */ int flags) /* Indicates what's happening. */ { - (void)dummy; /* * For array traces, let TclSetupEnv do all the work. */ diff --git a/generic/tclEvent.c b/generic/tclEvent.c index fbc2bf3..d9f868c 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -311,7 +311,7 @@ HandleBgErrors( int TclDefaultBgErrorHandlerObjCmd( - void *dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -320,7 +320,6 @@ TclDefaultBgErrorHandlerObjCmd( Tcl_Obj *tempObjv[2]; int result, code, level; Tcl_InterpState saved; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "msg options"); @@ -598,11 +597,10 @@ TclGetBgErrorHandler( static void BgErrorDeleteProc( void *clientData, /* Pointer to ErrAssocData structure. */ - Tcl_Interp *dummy) /* Interpreter being deleted. */ + TCL_UNUSED(Tcl_Interp *)) { ErrAssocData *assocPtr = (ErrAssocData *)clientData; BgError *errPtr; - (void)dummy; while (assocPtr->firstBgPtr != NULL) { errPtr = assocPtr->firstBgPtr; @@ -1401,14 +1399,13 @@ TclInThreadExit(void) /* ARGSUSED */ int Tcl_VwaitObjCmd( - void *dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int done, foundEvent; const char *nameString; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1466,14 +1463,13 @@ Tcl_VwaitObjCmd( /* ARGSUSED */ static char * VwaitVarProc( - void *clientData, /* Pointer to integer to set to 1. */ + void *clientData, /* Pointer to integer to set to 1. */ Tcl_Interp *interp, /* Interpreter containing variable. */ const char *name1, /* Name of variable. */ const char *name2, /* Second part of variable name. */ - int flags) /* Information about what happened. */ + TCL_UNUSED(int) /*flags*/) /* Information about what happened. */ { int *donePtr = (int *)clientData; - (void)flags; *donePtr = 1; Tcl_UntraceVar2(interp, name1, name2, TCL_TRACE_WRITES|TCL_TRACE_UNSETS, @@ -1501,7 +1497,7 @@ VwaitVarProc( /* ARGSUSED */ int Tcl_UpdateObjCmd( - void *dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1510,7 +1506,6 @@ Tcl_UpdateObjCmd( int flags = 0; /* Initialized to avoid compiler warning. */ static const char *const updateOptions[] = {"idletasks", NULL}; enum updateOptions {OPT_IDLETASKS}; - (void)dummy; if (objc == 1) { flags = TCL_ALL_EVENTS|TCL_DONT_WAIT; -- cgit v0.12 From 9bfe3724215a96c07d1f1067c75389798f54a8c5 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 20:15:24 +0000 Subject: more --- generic/tclExecute.c | 24 ++++++++++++++---------- generic/tclFCmd.c | 27 +++++++++------------------ generic/tclFileName.c | 13 ++++++++----- 3 files changed, 31 insertions(+), 33 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index e757230..169aece 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -798,6 +798,7 @@ ReleaseDictIterator( *---------------------------------------------------------------------- */ +#if defined(TCL_COMPILE_STATS) || defined(TCL_COMPILE_DEBUG) static void InitByteCodeExecution( Tcl_Interp *interp) /* Interpreter for which the Tcl variable @@ -810,12 +811,19 @@ InitByteCodeExecution( Tcl_Panic("InitByteCodeExecution: can't create link for tcl_traceExec variable"); } #endif -#ifndef TCL_COMPILE_STATS - (void)interp; -#else +#ifdef TCL_COMPILE_STATS Tcl_CreateObjCommand(interp, "evalstats", EvalStatsCmd, NULL, NULL); #endif /* TCL_COMPILE_STATS */ } + +#else + +static void +InitByteCodeExecution( + TCL_UNUSED(Tcl_Interp *)) +{ +} +#endif /* *---------------------------------------------------------------------- @@ -1358,13 +1366,11 @@ Tcl_ExprObj( static int CopyCallback( ClientData data[], - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), int result) { Tcl_Obj **resultPtrPtr = (Tcl_Obj **)data[0]; Tcl_Obj *resultPtr = (Tcl_Obj *)data[1]; - (void)dummy; - (void)dummy; if (result == TCL_OK) { *resultPtrPtr = resultPtr; @@ -1555,11 +1561,9 @@ CompileExprObj( static void DupExprCodeInternalRep( - Tcl_Obj *srcPtr, - Tcl_Obj *copyPtr) + TCL_UNUSED(Tcl_Obj *), + TCL_UNUSED(Tcl_Obj *)) { - (void)srcPtr; - (void)copyPtr; return; } diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index bfb5b36..3babd43 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -47,13 +47,12 @@ static int FileForceOption(Tcl_Interp *interp, int TclFileRenameCmd( - ClientData dummy, /* Unused */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interp for error reporting or recursive * calls in the case of a tricky rename. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */ { - (void)dummy; return FileCopyRename(interp, objc, objv, 0); } @@ -77,13 +76,12 @@ TclFileRenameCmd( int TclFileCopyCmd( - ClientData dummy, /* Unused */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Used for error reporting or recursive calls * in the case of a tricky copy. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */ { - (void)dummy; return FileCopyRename(interp, objc, objv, 1); } @@ -216,7 +214,7 @@ FileCopyRename( int TclFileMakeDirsCmd( - ClientData dummy, /* Unused */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Used for error reporting. */ int objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */ @@ -226,7 +224,6 @@ TclFileMakeDirsCmd( Tcl_Obj *split = NULL; Tcl_Obj *target = NULL; Tcl_StatBuf statBuf; - (void)dummy; result = TCL_OK; for (i = 1; i < objc; i++) { @@ -341,7 +338,7 @@ TclFileMakeDirsCmd( int TclFileDeleteCmd( - ClientData dummy, /* Unused */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Used for error reporting */ int objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */ @@ -349,7 +346,6 @@ TclFileDeleteCmd( int i, force, result; Tcl_Obj *errfile; Tcl_Obj *errorBuffer = NULL; - (void)dummy; i = FileForceOption(interp, objc - 1, objv + 1, &force); if (i < 0) { @@ -950,7 +946,7 @@ FileBasename( int TclFileAttrsCmd( - ClientData dummy, /* Unused */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* The interpreter for error reporting. */ int objc, /* Number of command line arguments. */ Tcl_Obj *const objv[]) /* The command line objects. */ @@ -961,7 +957,6 @@ TclFileAttrsCmd( Tcl_Obj *objStrings = NULL; int numObjStrings = -1; Tcl_Obj *filePtr; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "name ?-option value ...?"); @@ -1167,14 +1162,13 @@ TclFileAttrsCmd( int TclFileLinkCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *contents; int index; - (void)dummy; if (objc < 2 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, "?-linktype? linkname ?target?"); @@ -1319,13 +1313,12 @@ TclFileLinkCmd( int TclFileReadLinkCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *contents; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "name"); @@ -1371,7 +1364,7 @@ TclFileReadLinkCmd( int TclFileTemporaryCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1385,7 +1378,6 @@ TclFileTemporaryCmd( /* Pieces of template. Each piece is NULL if * it is omitted. The platform temporary file * engine might ignore some pieces. */ - (void)dummy; if (objc < 1 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?nameVar? ?template?"); @@ -1531,7 +1523,7 @@ TclFileTemporaryCmd( int TclFileTempDirCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1542,7 +1534,6 @@ TclFileTempDirCmd( /* Pieces of template. Each piece is NULL if * it is omitted. The platform temporary file * engine might ignore some pieces. */ - (void)dummy; if (objc < 1 || objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?template?"); diff --git a/generic/tclFileName.c b/generic/tclFileName.c index ee2321d..a069ff1 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -1220,7 +1220,7 @@ DoTildeSubst( /* ARGSUSED */ int Tcl_GlobObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1241,7 +1241,6 @@ Tcl_GlobObjCmd( }; enum pathDirOptions {PATH_NONE = -1 , PATH_GENERAL = 0, PATH_DIR = 1}; Tcl_GlobTypeData *globTypes = NULL; - (void)dummy; globFlags = 0; join = 0; @@ -2634,21 +2633,25 @@ Tcl_GetBlocksFromStat( #endif } +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE unsigned Tcl_GetBlockSizeFromStat( const Tcl_StatBuf *statPtr) { -#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE return statPtr->st_blksize; +} #else - (void)statPtr; +unsigned +Tcl_GetBlockSizeFromStat( + TCL_UNUSED(const Tcl_StatBuf *)) +{ /* * Not a great guess, but will do... */ return GUESSED_BLOCK_SIZE; -#endif } +#endif /* * Local Variables: -- cgit v0.12 From b88a8f3dd92fcd8d7af61da8e6f9b56964ae0c3d Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 20:23:01 +0000 Subject: more --- generic/tclHash.c | 23 +++++++---------------- generic/tclHistory.c | 3 +-- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/generic/tclHash.c b/generic/tclHash.c index 10e3027..e48c816 100644 --- a/generic/tclHash.c +++ b/generic/tclHash.c @@ -798,13 +798,12 @@ HashArrayKey( static Tcl_HashEntry * AllocStringEntry( - Tcl_HashTable *tablePtr, /* Hash table. */ + TCL_UNUSED(Tcl_HashTable *), void *keyPtr) /* Key to store in the hash table entry. */ { const char *string = (const char *) keyPtr; Tcl_HashEntry *hPtr; size_t size, allocsize; - (void)tablePtr; allocsize = size = strlen(string) + 1; if (size < sizeof(hPtr->key)) { @@ -864,13 +863,12 @@ CompareStringKeys( static TCL_HASH_TYPE HashStringKey( - Tcl_HashTable *tablePtr, /* Hash table. */ + TCL_UNUSED(Tcl_HashTable *), void *keyPtr) /* Key from which to compute hash value. */ { const char *string = (const char *)keyPtr; TCL_HASH_TYPE result; char c; - (void)tablePtr; /* * I tried a zillion different hash functions and asked many other people @@ -932,11 +930,9 @@ HashStringKey( /* ARGSUSED */ static Tcl_HashEntry * BogusFind( - Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */ - const char *key) /* Key to use to find matching entry. */ + TCL_UNUSED(Tcl_HashTable *), + TCL_UNUSED(const char *)) { - (void)tablePtr; - (void)key; Tcl_Panic("called %s on deleted table", "Tcl_FindHashEntry"); return NULL; } @@ -961,15 +957,10 @@ BogusFind( /* ARGSUSED */ static Tcl_HashEntry * BogusCreate( - Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */ - const char *key, /* Key to use to find or create matching - * entry. */ - int *newPtr) /* Store info here telling whether a new entry - * was created. */ + TCL_UNUSED(Tcl_HashTable *), + TCL_UNUSED(const char *), + TCL_UNUSED(int *)) { - (void)tablePtr; - (void)key; - (void)newPtr; Tcl_Panic("called %s on deleted table", "Tcl_CreateHashEntry"); return NULL; } diff --git a/generic/tclHistory.c b/generic/tclHistory.c index 5408432..3a52a20 100644 --- a/generic/tclHistory.c +++ b/generic/tclHistory.c @@ -211,10 +211,9 @@ Tcl_RecordAndEvalObj( static void DeleteHistoryObjs( ClientData clientData, - Tcl_Interp *dummy) + TCL_UNUSED(Tcl_Interp *)) { HistoryObjs *histObjsPtr = (HistoryObjs *)clientData; - (void)dummy; TclDecrRefCount(histObjsPtr->historyObj); TclDecrRefCount(histObjsPtr->addObj); -- cgit v0.12 From 2cd124a28ea369d484197163cccb49acedc5e288 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 20:32:47 +0000 Subject: Remove SetIndexFromAny(), a useless routine that can only be reached via unsupported shenanigans. --- generic/tclIndexObj.c | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index 30c33f1..ba02453 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -22,7 +22,6 @@ static int GetIndexFromObjList(Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Obj *tableObjPtr, const char *msg, int flags, int *indexPtr); -static int SetIndexFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static void UpdateStringOfIndex(Tcl_Obj *objPtr); static void DupIndex(Tcl_Obj *srcPtr, Tcl_Obj *dupPtr); static void FreeIndex(Tcl_Obj *objPtr); @@ -48,7 +47,7 @@ static const Tcl_ObjType indexType = { FreeIndex, /* freeIntRepProc */ DupIndex, /* dupIntRepProc */ UpdateStringOfIndex, /* updateStringProc */ - SetIndexFromAny /* setFromAnyProc */ + NULL /* setFromAnyProc */ }; /* @@ -397,39 +396,6 @@ Tcl_GetIndexFromObjStruct( /* *---------------------------------------------------------------------- * - * SetIndexFromAny -- - * - * This function is called to convert a Tcl object to index internal - * form. However, this doesn't make sense (need to have a table of - * keywords in order to do the conversion) so the function always - * generates an error. - * - * Results: - * The return value is always TCL_ERROR, and an error message is left in - * interp's result if interp isn't NULL. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -SetIndexFromAny( - Tcl_Interp *interp, /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr) /* The object to convert. */ -{ - if (interp) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "can't convert value to index except via Tcl_GetIndexFromObj API", - -1)); - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * * UpdateStringOfIndex -- * * This function is called to convert a Tcl object from index internal -- cgit v0.12 From d599e21dbc8d6e121ada72b9f664f9f5ca05227c Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 20:46:51 +0000 Subject: more unused arguments --- generic/tclIndexObj.c | 9 +++------ generic/tclInterp.c | 22 ++++++++-------------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index c1440dd..5aa4d42 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -540,7 +540,7 @@ TclInitPrefixCmd( static int PrefixMatchObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -556,7 +556,6 @@ PrefixMatchObjCmd( enum matchOptions { PRFMATCH_ERROR, PRFMATCH_EXACT, PRFMATCH_MESSAGE }; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "?options? table string"); @@ -665,7 +664,7 @@ PrefixMatchObjCmd( static int PrefixAllObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -673,7 +672,6 @@ PrefixAllObjCmd( int tableObjc, result, t, length, elemLength; const char *string, *elemString; Tcl_Obj **tableObjv, *resultPtr; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "table string"); @@ -723,7 +721,7 @@ PrefixAllObjCmd( static int PrefixLongestObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -731,7 +729,6 @@ PrefixLongestObjCmd( int tableObjc, result, i, t, length, elemLength, resultLength; const char *string, *elemString, *resultString; Tcl_Obj **tableObjv; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "table string"); diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 0d53476..5b0cd62 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -222,15 +222,12 @@ static int AliasDelete(Tcl_Interp *interp, static int AliasDescribe(Tcl_Interp *interp, Tcl_Interp *slaveInterp, Tcl_Obj *objPtr); static int AliasList(Tcl_Interp *interp, Tcl_Interp *slaveInterp); -static int AliasNRCmd(ClientData dummy, - Tcl_Interp *currentInterp, int objc, - Tcl_Obj *const objv[]); -static void AliasObjCmdDeleteProc(ClientData clientData); +static Tcl_ObjCmdProc AliasNRCmd; +static Tcl_CmdDeleteProc AliasObjCmdDeleteProc; static Tcl_Interp * GetInterp(Tcl_Interp *interp, Tcl_Obj *pathPtr); static Tcl_Interp * GetInterp2(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static void InterpInfoDeleteProc(ClientData clientData, - Tcl_Interp *interp); +static Tcl_InterpDeleteProc InterpInfoDeleteProc; static int SlaveBgerror(Tcl_Interp *interp, Tcl_Interp *slaveInterp, int objc, Tcl_Obj *const objv[]); @@ -254,7 +251,7 @@ static int SlaveInvokeHidden(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int SlaveMarkTrusted(Tcl_Interp *interp, Tcl_Interp *slaveInterp); -static void SlaveObjCmdDeleteProc(ClientData clientData); +static Tcl_CmdDeleteProc SlaveObjCmdDeleteProc; static int SlaveRecursionLimit(Tcl_Interp *interp, Tcl_Interp *slaveInterp, int objc, Tcl_Obj *const objv[]); @@ -525,7 +522,7 @@ TclInterpInit( static void InterpInfoDeleteProc( - ClientData dummy, /* Ignored. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp) /* Interp being deleted. All commands for * slave interps should already be deleted. */ { @@ -533,7 +530,6 @@ InterpInfoDeleteProc( Slave *slavePtr; Master *masterPtr; Target *targetPtr; - (void)dummy; interpInfoPtr = (InterpInfo *) ((Interp *) interp)->interpInfo; @@ -605,7 +601,7 @@ InterpInfoDeleteProc( /* ARGSUSED */ int Tcl_InterpObjCmd( - ClientData clientData, /* Unused. */ + ClientData clientData, Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -615,7 +611,7 @@ Tcl_InterpObjCmd( static int NRInterpCmd( - ClientData dummy, /* Unused. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -639,7 +635,6 @@ NRInterpCmd( OPT_INVOKEHID, OPT_LIMIT, OPT_MARKTRUSTED,OPT_RECLIMIT, OPT_SLAVES, OPT_SHARE, OPT_TARGET, OPT_TRANSFER }; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "cmd ?arg ...?"); @@ -4239,11 +4234,10 @@ DeleteScriptLimitCallback( static void CallScriptLimitCallback( ClientData clientData, - Tcl_Interp *dummy) /* Interpreter which failed the limit */ + TCL_UNUSED(Tcl_Interp *)) { ScriptLimitCallback *limitCBPtr = (ScriptLimitCallback *)clientData; int code; - (void)dummy; if (Tcl_InterpDeleted(limitCBPtr->interp)) { return; -- cgit v0.12 From a619fad748e59645edddc28028b34018cb9b3035 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 20:57:28 +0000 Subject: more --- generic/tclIO.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index 3eca7cc..edb0f1e 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -201,7 +201,7 @@ static int FlushChannel(Tcl_Interp *interp, Channel *chanPtr, int calledFromAsyncFlush); static int TclGetsObjBinary(Tcl_Channel chan, Tcl_Obj *objPtr); static Tcl_Encoding GetBinaryEncoding(void); -static void FreeBinaryEncoding(ClientData clientData); +static Tcl_ExitProc FreeBinaryEncoding; static Tcl_HashTable * GetChannelTable(Tcl_Interp *interp); static int GetInput(Channel *chanPtr); static void PeekAhead(Channel *chanPtr, char **dstEndPtr, @@ -1515,12 +1515,11 @@ TclGetChannelFromObj( * channel was opened? Will contain an ORed * combination of TCL_READABLE and * TCL_WRITABLE, if non-NULL. */ - int flags) + TCL_UNUSED(int) /*flags*/) { ChannelState *statePtr; ResolvedChanName *resPtr = NULL; Tcl_Channel chan; - (void)flags; if (interp == NULL) { return TCL_ERROR; @@ -5228,10 +5227,9 @@ TclGetsObjBinary( static void FreeBinaryEncoding( - ClientData dummy) /* Not used */ + TCL_UNUSED(ClientData)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if (tsdPtr->binaryEncoding != NULL) { Tcl_FreeEncoding(tsdPtr->binaryEncoding); @@ -8930,20 +8928,19 @@ CreateScriptRecord( void TclChannelEventScriptInvoker( ClientData clientData, /* The script+interp record. */ - int mask) /* Not used. */ + TCL_UNUSED(int) /*mask*/) { - Tcl_Interp *interp; /* Interpreter in which to eval the script. */ - Channel *chanPtr; /* The channel for which this handler is - * registered. */ - EventScriptRecord *esPtr; /* The event script + interpreter to eval it + EventScriptRecord *esPtr = (EventScriptRecord *)clientData; + /* The event script + interpreter to eval it * in. */ + Channel *chanPtr = esPtr->chanPtr; + /* The channel for which this handler is + * registered. */ + Tcl_Interp *interp = esPtr->interp; + /* Interpreter in which to eval the script. */ + int mask = esPtr->mask; int result; /* Result of call to eval script. */ - esPtr = (EventScriptRecord *)clientData; - chanPtr = esPtr->chanPtr; - mask = esPtr->mask; - interp = esPtr->interp; - /* * We must preserve the interpreter so we can report errors on it later. * Note that we do not need to preserve the channel because that is done @@ -8994,7 +8991,7 @@ TclChannelEventScriptInvoker( /* ARGSUSED */ int Tcl_FileEventObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interpreter in which the channel for which * to create the handler is found. */ int objc, /* Number of arguments. */ @@ -9008,7 +9005,6 @@ Tcl_FileEventObjCmd( int mask; static const char *const modeOptions[] = {"readable", "writable", NULL}; static const int maskArray[] = {TCL_READABLE, TCL_WRITABLE}; - (void)dummy; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 1, objv, "channelId event ?script?"); -- cgit v0.12 From 81e31a16d82ff906b74f9b726637a3f146b77a4d Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 Mar 2020 21:22:28 +0000 Subject: More unused arguments through the IO code. --- generic/tclIOCmd.c | 80 ++++++++++++++++++--------------------------------- generic/tclIORChan.c | 23 ++++++--------- generic/tclIORTrans.c | 15 ++++------ generic/tclIOUtil.c | 21 ++++---------- 4 files changed, 47 insertions(+), 92 deletions(-) diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 70206be..916936b 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -36,18 +36,14 @@ static Tcl_ThreadDataKey dataKey; * Static functions for this file: */ -static void FinalizeIOCmdTSD(ClientData clientData); -static Tcl_TcpAcceptProc AcceptCallbackProc; -static int ChanPendingObjCmd(ClientData unused, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static int ChanTruncateObjCmd(ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static void RegisterTcpServerInterpCleanup(Tcl_Interp *interp, - AcceptCallback *acceptCallbackPtr); -static void TcpAcceptCallbacksDeleteProc(ClientData clientData, - Tcl_Interp *interp); +static Tcl_ExitProc FinalizeIOCmdTSD; +static Tcl_TcpAcceptProc AcceptCallbackProc; +static Tcl_ObjCmdProc ChanPendingObjCmd; +static Tcl_ObjCmdProc ChanTruncateObjCmd; +static void RegisterTcpServerInterpCleanup( + Tcl_Interp *interp, + AcceptCallback *acceptCallbackPtr); +static Tcl_InterpDeleteProc TcpAcceptCallbacksDeleteProc; static void TcpServerCloseProc(ClientData callbackData); static void UnregisterTcpServerInterpCleanupProc( Tcl_Interp *interp, @@ -71,10 +67,9 @@ static void UnregisterTcpServerInterpCleanupProc( static void FinalizeIOCmdTSD( - ClientData dummy) /* Not used. */ + TCL_UNUSED(ClientData)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if (tsdPtr->stdoutObjPtr != NULL) { Tcl_DecrRefCount(tsdPtr->stdoutObjPtr); @@ -103,7 +98,7 @@ FinalizeIOCmdTSD( /* ARGSUSED */ int Tcl_PutsObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -114,7 +109,6 @@ Tcl_PutsObjCmd( int newline; /* Add a newline at end? */ int result; /* Result of puts operation. */ int mode; /* Mode in which channel is opened. */ - (void)dummy; switch (objc) { case 2: /* [puts $x] */ @@ -231,7 +225,7 @@ Tcl_PutsObjCmd( /* ARGSUSED */ int Tcl_FlushObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -239,7 +233,6 @@ Tcl_FlushObjCmd( Tcl_Obj *chanObjPtr; Tcl_Channel chan; /* The channel to flush on. */ int mode; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "channelId"); @@ -297,7 +290,7 @@ Tcl_FlushObjCmd( /* ARGSUSED */ int Tcl_GetsObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -307,7 +300,6 @@ Tcl_GetsObjCmd( int mode; /* Mode in which channel is opened. */ Tcl_Obj *linePtr, *chanObjPtr; int code = TCL_OK; - (void)dummy; if ((objc != 2) && (objc != 3)) { Tcl_WrongNumArgs(interp, 1, objv, "channelId ?varName?"); @@ -383,7 +375,7 @@ Tcl_GetsObjCmd( /* ARGSUSED */ int Tcl_ReadObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -394,7 +386,6 @@ Tcl_ReadObjCmd( int charactersRead; /* How many characters were read? */ int mode; /* Mode in which channel is opened. */ Tcl_Obj *resultPtr, *chanObjPtr; - (void)dummy; if ((objc != 2) && (objc != 3)) { Interp *iPtr; @@ -528,7 +519,7 @@ Tcl_ReadObjCmd( /* ARGSUSED */ int Tcl_SeekObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -542,7 +533,6 @@ Tcl_SeekObjCmd( "start", "current", "end", NULL }; static const int modeArray[] = {SEEK_SET, SEEK_CUR, SEEK_END}; - (void)dummy; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 1, objv, "channelId offset ?origin?"); @@ -605,7 +595,7 @@ Tcl_SeekObjCmd( /* ARGSUSED */ int Tcl_TellObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -613,7 +603,6 @@ Tcl_TellObjCmd( Tcl_Channel chan; /* The channel to tell on. */ Tcl_WideInt newLoc; int code; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "channelId"); @@ -669,7 +658,7 @@ Tcl_TellObjCmd( /* ARGSUSED */ int Tcl_CloseObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -679,7 +668,6 @@ Tcl_CloseObjCmd( "read", "write", NULL }; static const int dirArray[] = {TCL_CLOSE_READ, TCL_CLOSE_WRITE}; - (void)dummy; if ((objc != 2) && (objc != 3)) { Tcl_WrongNumArgs(interp, 1, objv, "channelId ?direction?"); @@ -779,7 +767,7 @@ Tcl_CloseObjCmd( /* ARGSUSED */ int Tcl_FconfigureObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -787,7 +775,6 @@ Tcl_FconfigureObjCmd( const char *optionName, *valueName; Tcl_Channel chan; /* The channel to set a mode on. */ int i; /* Iterate over arg-value pairs. */ - (void)dummy; if ((objc < 2) || (((objc % 2) == 1) && (objc != 3))) { Tcl_WrongNumArgs(interp, 1, objv, "channelId ?-option value ...?"); @@ -856,13 +843,12 @@ Tcl_FconfigureObjCmd( /* ARGSUSED */ int Tcl_EofObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "channelId"); @@ -897,7 +883,7 @@ Tcl_EofObjCmd( /* ARGSUSED */ int Tcl_ExecObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -915,7 +901,6 @@ Tcl_ExecObjCmd( enum options { EXEC_IGNORESTDERR, EXEC_KEEPNEWLINE, EXEC_LAST }; - (void)dummy; /* * Check for any leading option arguments. @@ -1066,14 +1051,13 @@ Tcl_ExecObjCmd( /* ARGSUSED */ int Tcl_FblockedObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; int mode; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "channelId"); @@ -1114,7 +1098,7 @@ Tcl_FblockedObjCmd( /* ARGSUSED */ int Tcl_OpenObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1122,7 +1106,6 @@ Tcl_OpenObjCmd( int pipeline, prot; const char *modeString, *what; Tcl_Channel chan; - (void)dummy; if ((objc < 2) || (objc > 4)) { Tcl_WrongNumArgs(interp, 1, objv, "fileName ?access? ?permissions?"); @@ -1241,12 +1224,11 @@ static void TcpAcceptCallbacksDeleteProc( ClientData clientData, /* Data which was passed when the assocdata * was registered. */ - Tcl_Interp *dummy) /* Interpreter being deleted - not used. */ + TCL_UNUSED(Tcl_Interp *)) { Tcl_HashTable *hTblPtr = (Tcl_HashTable *)clientData; Tcl_HashEntry *hPtr; Tcl_HashSearch hSearch; - (void)dummy; for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); hPtr != NULL; hPtr = Tcl_NextHashEntry(&hSearch)) { @@ -1492,7 +1474,7 @@ TcpServerCloseProc( int Tcl_SocketObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1511,7 +1493,6 @@ Tcl_SocketObjCmd( const char *host, *port, *myaddr = NULL; Tcl_Obj *script = NULL; Tcl_Channel chan; - (void)dummy; if (TclpHasSockets(interp) != TCL_OK) { return TCL_ERROR; @@ -1735,7 +1716,7 @@ Tcl_SocketObjCmd( int Tcl_FcopyObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1746,7 +1727,6 @@ Tcl_FcopyObjCmd( Tcl_Obj *cmdPtr; static const char *const switches[] = { "-size", "-command", NULL }; enum { FcopySize, FcopyCommand }; - (void)dummy; if ((objc < 3) || (objc > 7) || (objc == 4) || (objc == 6)) { Tcl_WrongNumArgs(interp, 1, objv, @@ -1832,7 +1812,7 @@ Tcl_FcopyObjCmd( /* ARGSUSED */ static int ChanPendingObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1841,7 +1821,6 @@ ChanPendingObjCmd( int index, mode; static const char *const options[] = {"input", "output", NULL}; enum options {PENDING_INPUT, PENDING_OUTPUT}; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "mode channelId"); @@ -1895,14 +1874,13 @@ ChanPendingObjCmd( static int ChanTruncateObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; Tcl_WideInt length; - (void)dummy; if ((objc < 2) || (objc > 3)) { Tcl_WrongNumArgs(interp, 1, objv, "channelId ?length?"); @@ -1969,7 +1947,7 @@ ChanTruncateObjCmd( static int ChanPipeObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1977,7 +1955,6 @@ ChanPipeObjCmd( Tcl_Channel rchan, wchan; const char *channelNames[2]; Tcl_Obj *resultPtr; - (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, ""); @@ -2021,12 +1998,11 @@ ChanPipeObjCmd( int TclChannelNamesCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - (void)dummy; if (objc < 1 || objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?pattern?"); return TCL_ERROR; diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 42d1e8a..8a5675a 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -425,7 +425,7 @@ static void SrcExitProc(ClientData clientData); static void ForwardSetObjError(ForwardParam *p, Tcl_Obj *objPtr); static ReflectedChannelMap * GetThreadReflectedChannelMap(void); -static void DeleteThreadReflectedChannelMap(ClientData clientData); +static Tcl_ExitProc DeleteThreadReflectedChannelMap; #endif /* TCL_THREADS */ @@ -452,8 +452,7 @@ static int InvokeTclMethod(ReflectedChannel *rcPtr, Tcl_Obj *argTwoObj, Tcl_Obj **resultObjPtr); static ReflectedChannelMap * GetReflectedChannelMap(Tcl_Interp *interp); -static void DeleteReflectedChannelMap(ClientData clientData, - Tcl_Interp *interp); +static Tcl_InterpDeleteProc DeleteReflectedChannelMap; static int ErrnoReturn(ReflectedChannel *rcPtr, Tcl_Obj *resObj); static void MarkDead(ReflectedChannel *rcPtr); @@ -498,7 +497,7 @@ static const char *msg_dstlost = "-code 1 -level 0 -errorcode NONE -errorinfo int TclChanCreateObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -524,7 +523,6 @@ TclChanCreateObjCmd( * this interp. */ Tcl_HashEntry *hPtr; /* Entry in the above map */ int isNew; /* Placeholder. */ - (void)dummy; /* * Syntax: chan create MODE CMDPREFIX @@ -780,7 +778,7 @@ typedef struct { static int ReflectEventRun( Tcl_Event *ev, - int flags) + TCL_UNUSED(int) /*flags*/) { /* OWNER thread * @@ -790,7 +788,6 @@ ReflectEventRun( */ ReflectEvent *e = (ReflectEvent *) ev; - (void)flags; Tcl_NotifyChannel(e->rcPtr->chan, e->events); return 1; @@ -819,7 +816,7 @@ ReflectEventDelete( int TclChanPostEventObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -848,7 +845,6 @@ TclChanPostEventObjCmd( ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in * this interp. */ Tcl_HashEntry *hPtr; /* Entry in the above map */ - (void)dummy; /* * Number of arguments... @@ -2519,8 +2515,7 @@ GetReflectedChannelMap( if (rcmPtr == NULL) { rcmPtr = (ReflectedChannelMap *)ckalloc(sizeof(ReflectedChannelMap)); Tcl_InitHashTable(&rcmPtr->map, TCL_STRING_KEYS); - Tcl_SetAssocData(interp, RCMKEY, - (Tcl_InterpDeleteProc *) DeleteReflectedChannelMap, rcmPtr); + Tcl_SetAssocData(interp, RCMKEY, DeleteReflectedChannelMap, rcmPtr); } return rcmPtr; } @@ -2746,14 +2741,13 @@ GetThreadReflectedChannelMap(void) static void DeleteThreadReflectedChannelMap( - ClientData dummy) /* The per-thread data structure. */ + TCL_UNUSED(ClientData)) { Tcl_HashSearch hSearch; /* Search variable. */ Tcl_HashEntry *hPtr; /* Search variable. */ Tcl_ThreadId self = Tcl_GetCurrentThread(); ReflectedChannelMap *rcmPtr; /* The map */ ForwardingResult *resultPtr; - (void)dummy; /* * The origin thread for one or more reflected channels is gone. @@ -2971,7 +2965,7 @@ ForwardOpToHandlerThread( static int ForwardProc( Tcl_Event *evGPtr, - int mask) + TCL_UNUSED(int) /* mask */) { /* * HANDLER thread. @@ -3000,7 +2994,6 @@ ForwardProc( ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in * this interp. */ Tcl_HashEntry *hPtr; /* Entry in the above map */ - (void)mask; /* * Ignore the event if no one is waiting for its result anymore. diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index 82fce33..9a82cdb 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -503,7 +503,7 @@ static int TransformLimit(ReflectedTransform *rtPtr, int TclChanPushObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -530,7 +530,6 @@ TclChanPushObjCmd( * in this interp. */ Tcl_HashEntry *hPtr; /* Entry in the above map */ int isNew; /* Placeholder. */ - (void)dummy; /* * Syntax: chan push CHANNEL CMDPREFIX @@ -749,7 +748,7 @@ TclChanPushObjCmd( int TclChanPopObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -767,7 +766,6 @@ TclChanPopObjCmd( const char *chanId; /* Tcl level channel handle */ Tcl_Channel chan; /* Channel associated to the handle */ int mode; /* Channel r/w mode */ - (void)dummy; /* * Number of arguments... @@ -1755,7 +1753,7 @@ static ReflectedTransform * NewReflectedTransform( Tcl_Interp *interp, Tcl_Obj *cmdpfxObj, - int mode, + TCL_UNUSED(int) /*mode*/, Tcl_Obj *handleObj, Tcl_Channel parentChan) { @@ -1763,7 +1761,6 @@ NewReflectedTransform( int listc; Tcl_Obj **listv; int i; - (void)mode; rtPtr = (ReflectedTransform *)ckalloc(sizeof(ReflectedTransform)); @@ -2311,14 +2308,13 @@ GetThreadReflectedTransformMap(void) static void DeleteThreadReflectedTransformMap( - ClientData dummy) /* The per-thread data structure. */ + TCL_UNUSED(ClientData)) { Tcl_HashSearch hSearch; /* Search variable. */ Tcl_HashEntry *hPtr; /* Search variable. */ Tcl_ThreadId self = Tcl_GetCurrentThread(); ReflectedTransformMap *rtmPtr; /* The map */ ForwardingResult *resultPtr; - (void)dummy; /* * The origin thread for one or more reflected channels is gone. @@ -2506,7 +2502,7 @@ ForwardOpToOwnerThread( static int ForwardProc( Tcl_Event *evGPtr, - int mask) + TCL_UNUSED(int) /*mask*/) { /* * Notes regarding access to the referenced data. @@ -2531,7 +2527,6 @@ ForwardProc( /* Map of reflected channels with handlers in * this interp. */ Tcl_HashEntry *hPtr; /* Entry in the above map */ - (void)mask; /* * Ignore the event if no one is waiting for its result anymore. diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 6179637..4a79962 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -1228,15 +1228,12 @@ FsAddMountsToGlobResult( void Tcl_FSMountsChanged( - const Tcl_Filesystem *fsPtr) -{ + TCL_UNUSED(const Tcl_Filesystem *) /*fsPtr*/) /* * fsPtr is currently unused. In the future it might invalidate files for * a particular filesystem, or take some other more advanced action. */ - - (void)fsPtr; - +{ /* * Increment the filesystem epoch to invalidate every existing cached * internal representation. @@ -2314,11 +2311,9 @@ Tcl_FSUtime( static const char *const * NativeFileAttrStrings( - Tcl_Obj *pathPtr, - Tcl_Obj **objPtrRef) + TCL_UNUSED(Tcl_Obj *), + TCL_UNUSED(Tcl_Obj **)) { - (void)pathPtr; - (void)objPtrRef; return tclpFileAttrStrings; } @@ -3020,14 +3015,11 @@ Tcl_FSLoadFile( Tcl_LoadHandle *handlePtr, /* A place to store the token for the loaded * object. Can be passed to * (*unloadProcPtr)() to unload the file. */ - Tcl_FSUnloadFileProc **unloadProcPtr) - /* A place to store a pointer to the function - * that unloads the object. */ + TCL_UNUSED(Tcl_FSUnloadFileProc **)) { const char *symbols[3]; void *procPtrs[2]; int res; - (void)unloadProcPtr; symbols[0] = sym1; symbols[1] = sym2; @@ -4686,10 +4678,9 @@ Tcl_FSPathSeparator( static Tcl_Obj * NativeFilesystemSeparator( - Tcl_Obj *pathPtr) + TCL_UNUSED(Tcl_Obj *) /*pathPtr*/) { const char *separator = NULL; /* lint */ - (void)pathPtr; switch (tclPlatform) { case TCL_PLATFORM_UNIX: -- cgit v0.12