From a8870a4faede58af23c1054436fe9baa727cb3cf Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 9 Mar 2020 13:15:02 +0000 Subject: More --- generic/tclTimer.c | 18 ++++++------------ generic/tclTrace.c | 14 ++++---------- generic/tclUtil.c | 8 +++----- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/generic/tclTimer.c b/generic/tclTimer.c index 55466cc..db2c7d5 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -211,10 +211,9 @@ InitTimer(void) static void TimerExitProc( - ClientData dummy) /* Not used. */ + TCL_UNUSED(ClientData)) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); - (void)dummy; Tcl_DeleteEventSource(TimerSetupProc, TimerCheckProc, NULL); if (tsdPtr != NULL) { @@ -399,12 +398,11 @@ Tcl_DeleteTimerHandler( static void TimerSetupProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { Tcl_Time blockTime; ThreadSpecificData *tsdPtr = InitTimer(); - (void)dummy; if (((flags & TCL_IDLE_EVENTS) && tsdPtr->idleList) || ((flags & TCL_TIMER_EVENTS) && tsdPtr->timerPending)) { @@ -458,13 +456,12 @@ TimerSetupProc( static void TimerCheckProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { Tcl_Event *timerEvPtr; Tcl_Time blockTime; ThreadSpecificData *tsdPtr = InitTimer(); - (void)dummy; if ((flags & TCL_TIMER_EVENTS) && tsdPtr->firstTimerHandlerPtr) { /* @@ -521,7 +518,7 @@ TimerCheckProc( static int TimerHandlerEventProc( - Tcl_Event *evPtr, /* Event to service. */ + TCL_UNUSED(Tcl_Event *), int flags) /* Flags that indicate what events to handle, * such as TCL_FILE_EVENTS. */ { @@ -529,7 +526,6 @@ TimerHandlerEventProc( Tcl_Time time; int currentTimerId; ThreadSpecificData *tsdPtr = InitTimer(); - (void)evPtr; /* * Do nothing if timers aren't enabled. This leaves the event on the @@ -783,7 +779,7 @@ TclServiceIdle(void) /* ARGSUSED */ int Tcl_AfterObjCmd( - ClientData dummy, /* Unused */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -799,7 +795,6 @@ Tcl_AfterObjCmd( }; enum afterSubCmds {AFTER_CANCEL, AFTER_IDLE, AFTER_INFO}; ThreadSpecificData *tsdPtr = InitTimer(); - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); @@ -1258,11 +1253,10 @@ static void AfterCleanupProc( ClientData clientData, /* Points to AfterAssocData for the * interpreter. */ - Tcl_Interp *dummy) /* Interpreter that is being deleted. */ + TCL_UNUSED(Tcl_Interp *)) { AfterAssocData *assocPtr = (AfterAssocData *)clientData; AfterInfo *afterPtr; - (void)dummy; while (assocPtr->firstAfterPtr != NULL) { afterPtr = assocPtr->firstAfterPtr; diff --git a/generic/tclTrace.c b/generic/tclTrace.c index a7d0c72..5d69a49 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -184,7 +184,7 @@ typedef struct { /* ARGSUSED */ int Tcl_TraceObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -209,7 +209,6 @@ Tcl_TraceObjCmd( TRACE_OLD_VARIABLE, TRACE_OLD_VDELETE, TRACE_OLD_VINFO #endif }; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); @@ -1040,8 +1039,7 @@ ClientData Tcl_CommandTraceInfo( Tcl_Interp *interp, /* Interpreter containing command. */ const char *cmdName, /* Name of command. */ - int flags, /* OR-ed combo or TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY (can be 0). */ + TCL_UNUSED(int) /*flags*/, Tcl_CommandTraceProc *proc, /* Function assocated with trace. */ ClientData prevClientData) /* If non-NULL, gives last value returned by * this function, so this call will return the @@ -1050,7 +1048,6 @@ Tcl_CommandTraceInfo( { Command *cmdPtr; CommandTrace *tracePtr; - (void)flags; cmdPtr = (Command *) Tcl_FindCommand(interp, cmdName, NULL, TCL_LEAVE_ERR_MSG); @@ -1424,8 +1421,7 @@ TclCheckExecutionTraces( Tcl_Interp *interp, /* The current interpreter. */ const char *command, /* Pointer to beginning of the current command * string. */ - int numChars, /* The number of characters in 'command' which - * are part of the command string. */ + TCL_UNUSED(int) /*numChars*/, Command *cmdPtr, /* Points to command's Command struct. */ int code, /* The current result code. */ int traceFlags, /* Current tracing situation. */ @@ -1438,7 +1434,6 @@ TclCheckExecutionTraces( int curLevel; int traceCode = TCL_OK; Tcl_InterpState state = NULL; - (void)numChars; if (cmdPtr->tracePtr == NULL) { return traceCode; @@ -1765,7 +1760,7 @@ TraceExecutionProc( Tcl_Interp *interp, int level, const char *command, - Tcl_Command cmdInfo, + TCL_UNUSED(Tcl_Command), int objc, struct Tcl_Obj *const objv[]) { @@ -1775,7 +1770,6 @@ TraceExecutionProc( int flags = tcmdPtr->curFlags; int code = tcmdPtr->curCode; int traceCode = TCL_OK; - (void)cmdInfo; if (tcmdPtr->flags & TCL_TRACE_EXEC_IN_PROGRESS) { /* diff --git a/generic/tclUtil.c b/generic/tclUtil.c index b736d5d..7a05d95 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -2475,11 +2475,10 @@ TclByteArrayMatch( /* Pattern, which may contain special * characters. */ int ptnLen, /* Length of Pattern */ - int flags) + TCL_UNUSED(int) /*flags*/) { const unsigned char *stringEnd, *patternEnd; unsigned char p; - (void)flags; stringEnd = string + strLen; patternEnd = pattern + ptnLen; @@ -3264,7 +3263,7 @@ Tcl_DStringEndSublist( void Tcl_PrintDouble( - Tcl_Interp *dummy, /* Not used. */ + TCL_UNUSED(Tcl_Interp *), double value, /* Value to print as string. */ char *dst) /* Where to store converted value; must have * at least TCL_DOUBLE_SPACE characters. */ @@ -3275,7 +3274,6 @@ Tcl_PrintDouble( char *digits; char *end; int *precisionPtr = (int *)Tcl_GetThreadData(&precisionKey, sizeof(int)); - (void)dummy; /* * Handle NaN. @@ -3441,7 +3439,7 @@ Tcl_PrintDouble( /* ARGSUSED */ char * TclPrecTraceProc( - ClientData clientData, /* Not used. */ + ClientData clientData, Tcl_Interp *interp, /* Interpreter containing variable. */ const char *name1, /* Name of variable. */ const char *name2, /* Second part of variable name. */ -- cgit v0.12