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