diff options
35 files changed, 220 insertions, 425 deletions
diff --git a/generic/tclTimer.c b/generic/tclTimer.c index 837a8a3..bd6dfe9 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 bf2d0d8..b9a9a63 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 ...?"); @@ -1041,8 +1040,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 @@ -1051,7 +1049,6 @@ Tcl_CommandTraceInfo( { Command *cmdPtr; CommandTrace *tracePtr; - (void)flags; cmdPtr = (Command *) Tcl_FindCommand(interp, cmdName, NULL, TCL_LEAVE_ERR_MSG); @@ -1425,8 +1422,7 @@ TclCheckExecutionTraces( Tcl_Interp *interp, /* The current interpreter. */ const char *command, /* Pointer to beginning of the current command * string. */ - size_t numChars, /* The number of characters in 'command' which - * are part of the command string. */ + TCL_UNUSED(size_t) /*numChars*/, Command *cmdPtr, /* Points to command's Command struct. */ int code, /* The current result code. */ int traceFlags, /* Current tracing situation. */ @@ -1439,7 +1435,6 @@ TclCheckExecutionTraces( int curLevel; int traceCode = TCL_OK; Tcl_InterpState state = NULL; - (void)numChars; if (cmdPtr->tracePtr == NULL) { return traceCode; @@ -1766,7 +1761,7 @@ TraceExecutionProc( Tcl_Interp *interp, int level, const char *command, - Tcl_Command cmdInfo, + TCL_UNUSED(Tcl_Command), int objc, struct Tcl_Obj *const objv[]) { @@ -1776,7 +1771,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 c8ba12e..1bfde12 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -2382,11 +2382,10 @@ TclByteArrayMatch( /* Pattern, which may contain special * characters. */ size_t 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; @@ -3093,7 +3092,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. */ @@ -3103,7 +3102,6 @@ Tcl_PrintDouble( int signum; char *digits; char *end; - (void)dummy; /* * Handle NaN. diff --git a/generic/tclVar.c b/generic/tclVar.c index 5744132..404d3f3 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -188,8 +188,7 @@ static void ArrayPopulateSearch(Tcl_Interp *interp, static void ArrayDoneSearch(Interp *iPtr, Var *varPtr, ArraySearch *searchPtr); static Tcl_NRPostProc ArrayForLoopCallback; -static int ArrayForNRCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *const *objv); +static Tcl_ObjCmdProc ArrayForNRCmd; static void DeleteSearches(Interp *iPtr, Var *arrayVarPtr); static void DeleteArray(Interp *iPtr, Tcl_Obj *arrayNamePtr, Var *varPtr, int flags, int index); @@ -1480,13 +1479,12 @@ TclPtrGetVarIdx( /* ARGSUSED */ int Tcl_SetObjCmd( - 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 *varValueObj; - (void)dummy; if (objc == 2) { varValueObj = Tcl_ObjGetVar2(interp, objv[1], NULL,TCL_LEAVE_ERR_MSG); @@ -2678,14 +2676,13 @@ UnsetVarStruct( /* ARGSUSED */ int Tcl_UnsetObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int i, flags = TCL_LEAVE_ERR_MSG; const char *name; - (void)dummy; if (objc == 1) { /* @@ -2747,7 +2744,7 @@ Tcl_UnsetObjCmd( /* ARGSUSED */ int Tcl_AppendObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -2756,7 +2753,6 @@ Tcl_AppendObjCmd( Tcl_Obj *varValuePtr = NULL; /* Initialized to avoid compiler warning. */ int i; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "varName ?value ...?"); @@ -2814,7 +2810,7 @@ Tcl_AppendObjCmd( /* ARGSUSED */ int Tcl_LappendObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -2823,7 +2819,6 @@ Tcl_LappendObjCmd( int numElems, createdNewObj; Var *varPtr, *arrayPtr; int result; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "varName ?value ...?"); @@ -3021,17 +3016,17 @@ ArrayObjNext( static int ArrayForObjCmd( - 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, ArrayForNRCmd, dummy, objc, objv); + return Tcl_NRCallObjProc(interp, ArrayForNRCmd, clientData, objc, objv); } static int ArrayForNRCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -3040,7 +3035,6 @@ ArrayForNRCmd( ArraySearch *searchPtr = NULL; Var *varPtr; int isArray, numVars; - (void)dummy; /* * array for {k v} a body @@ -3263,7 +3257,7 @@ ArrayPopulateSearch( static int ArrayStartSearchCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3271,7 +3265,6 @@ ArrayStartSearchCmd( Var *varPtr; int isArray; ArraySearch *searchPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName"); @@ -3360,7 +3353,7 @@ ArrayDoneSearch( /* ARGSUSED */ static int ArrayAnyMoreCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3370,7 +3363,6 @@ ArrayAnyMoreCmd( Tcl_Obj *varNameObj, *searchObj; int gotValue, isArray; ArraySearch *searchPtr; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId"); @@ -3440,7 +3432,7 @@ ArrayAnyMoreCmd( /* ARGSUSED */ static int ArrayNextElementCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3449,7 +3441,6 @@ ArrayNextElementCmd( Tcl_Obj *varNameObj, *searchObj; ArraySearch *searchPtr; int isArray; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId"); @@ -3522,7 +3513,7 @@ ArrayNextElementCmd( /* ARGSUSED */ static int ArrayDoneSearchCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3532,7 +3523,6 @@ ArrayDoneSearchCmd( Tcl_Obj *varNameObj, *searchObj; ArraySearch *searchPtr; int isArray; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId"); @@ -3584,14 +3574,13 @@ ArrayDoneSearchCmd( /* ARGSUSED */ static int ArrayExistsCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *)interp; int isArray; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName"); @@ -3626,7 +3615,7 @@ ArrayExistsCmd( /* ARGSUSED */ static int ArrayGetCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3637,7 +3626,6 @@ ArrayGetCmd( Tcl_HashSearch search; const char *pattern; int i, count, result, isArray; - (void)dummy; switch (objc) { case 2: @@ -3787,7 +3775,7 @@ ArrayGetCmd( /* ARGSUSED */ static int ArrayNamesCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3801,7 +3789,6 @@ ArrayNamesCmd( Tcl_HashSearch search; const char *pattern = NULL; int isArray, mode = OPT_GLOB; - (void)dummy; if ((objc < 2) || (objc > 4)) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName ?mode? ?pattern?"); @@ -3956,7 +3943,7 @@ TclFindArrayPtrElements( /* ARGSUSED */ static int ArraySetCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3965,7 +3952,6 @@ ArraySetCmd( Tcl_Obj *arrayElemObj; Var *varPtr, *arrayPtr; int result, i; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName list"); @@ -4133,7 +4119,7 @@ ArraySetCmd( /* ARGSUSED */ static int ArraySizeCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -4142,7 +4128,6 @@ ArraySizeCmd( Tcl_HashSearch search; Var *varPtr2; int isArray, size = 0; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName"); @@ -4194,7 +4179,7 @@ ArraySizeCmd( /* ARGSUSED */ static int ArrayStatsCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -4203,7 +4188,6 @@ ArrayStatsCmd( Tcl_Obj *varNameObj; char *stats; int isArray; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName"); @@ -4250,7 +4234,7 @@ ArrayStatsCmd( /* ARGSUSED */ static int ArrayUnsetCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -4261,7 +4245,6 @@ ArrayUnsetCmd( const char *pattern; const int unsetFlags = 0; /* Should this be TCL_LEAVE_ERR_MSG? */ int isArray; - (void)dummy; switch (objc) { case 2: @@ -4820,7 +4803,7 @@ Tcl_GetVariableFullName( int Tcl_GlobalObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -4830,7 +4813,6 @@ Tcl_GlobalObjCmd( const char *varName; const char *tail; int result, i; - (void)dummy; /* * If we are not executing inside a Tcl procedure, just return. @@ -4925,7 +4907,7 @@ Tcl_GlobalObjCmd( int Tcl_VariableObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -4936,7 +4918,6 @@ Tcl_VariableObjCmd( Tcl_Obj *varValuePtr; int i, result; Tcl_Obj *varNamePtr, *tailPtr; - (void)dummy; for (i=1 ; i<objc ; i+=2) { /* @@ -5060,7 +5041,7 @@ Tcl_VariableObjCmd( /* ARGSUSED */ int Tcl_UpvarObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -5068,7 +5049,6 @@ Tcl_UpvarObjCmd( CallFrame *framePtr; int result, hasLevel; Tcl_Obj *levelObj; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, @@ -5876,7 +5856,7 @@ ObjFindNamespaceVar( int TclInfoVarsCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -5891,7 +5871,6 @@ TclInfoVarsCmd( Tcl_Obj *listPtr, *elemObjPtr, *varNamePtr; int specificNsInPattern = 0;/* Init. to avoid compiler warning. */ Tcl_Obj *simplePatternPtr = NULL; - (void)dummy; /* * Get the pattern and find the "effective namespace" in which to list @@ -6068,7 +6047,7 @@ TclInfoVarsCmd( int TclInfoGlobalsCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -6078,7 +6057,6 @@ TclInfoGlobalsCmd( Tcl_HashSearch search; Var *varPtr; Tcl_Obj *listPtr, *varNamePtr, *patternPtr; - (void)dummy; if (objc == 1) { pattern = NULL; @@ -6162,14 +6140,13 @@ TclInfoGlobalsCmd( int TclInfoLocalsCmd( - 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; Tcl_Obj *patternPtr, *listPtr; - (void)dummy; if (objc == 1) { patternPtr = NULL; @@ -6378,13 +6355,12 @@ TclInitVarHashTable( static Tcl_HashEntry * AllocVarEntry( - Tcl_HashTable *tablePtr, /* Hash table. */ + TCL_UNUSED(Tcl_HashTable *), void *keyPtr) /* Key to store in the hash table entry. */ { Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr; Tcl_HashEntry *hPtr; Var *varPtr; - (void)tablePtr; varPtr = (Var *)Tcl_Alloc(sizeof(VarInHash)); varPtr->flags = VAR_IN_HASHTABLE; @@ -6470,7 +6446,7 @@ CompareVarKeys( /* ARGSUSED */ static int ArrayDefaultCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -6482,7 +6458,6 @@ ArrayDefaultCmd( Tcl_Obj *arrayNameObj, *defaultValueObj; Var *varPtr, *arrayPtr; int isArray, option; - (void)dummy; /* * Parse arguments. diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index afba76b..397d1a6 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -386,8 +386,7 @@ static void ZipfsExitHandler(ClientData clientData); static void ZipfsSetup(void); static int ZipChannelClose(void *instanceData, Tcl_Interp *interp, int flags); -static int ZipChannelGetFile(void *instanceData, - int direction, void **handlePtr); +static Tcl_DriverGetHandleProc ZipChannelGetFile; static int ZipChannelRead(void *instanceData, char *buf, int toRead, int *errloc); static Tcl_WideInt ZipChannelWideSeek(void *instanceData, Tcl_WideInt offset, @@ -450,7 +449,7 @@ static Tcl_ChannelType ZipChannelType = { NULL, /* Get options, NULL'able */ ZipChannelWatchChannel, /* Initialize notifier */ ZipChannelGetFile, /* Get OS handle from the channel */ - ZipChannelClose, /* 2nd version of close channel, NULL'able */ + ZipChannelClose, /* 2nd version of close channel, NULL'able */ NULL, /* Set blocking mode for raw channel, NULL'able */ NULL, /* Function to flush channel, NULL'able */ NULL, /* Function to handle event, NULL'able */ @@ -1875,12 +1874,11 @@ TclZipfs_Unmount( static int ZipFSMountObjCmd( - void *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 > 4) { Tcl_WrongNumArgs(interp, 1, objv, @@ -1911,7 +1909,7 @@ ZipFSMountObjCmd( static int ZipFSMountBufferObjCmd( - void *dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1919,7 +1917,6 @@ ZipFSMountBufferObjCmd( const char *mountPoint; /* Mount point path. */ unsigned char *data; size_t length = 0; - (void)dummy; if (objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?mountpoint? ?data?"); @@ -1964,15 +1961,11 @@ ZipFSMountBufferObjCmd( static int ZipFSRootObjCmd( - void *dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(Tcl_Obj *const *)) /*objv*/ { - (void)dummy; - (void)objc; - (void)objv; - Tcl_SetObjResult(interp, Tcl_NewStringObj(ZIPFS_VOLUME, -1)); return TCL_OK; } @@ -1995,12 +1988,11 @@ ZipFSRootObjCmd( static int ZipFSUnmountObjCmd( - void *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, "zipfile"); @@ -2028,14 +2020,13 @@ ZipFSUnmountObjCmd( static int ZipFSMkKeyObjCmd( - void *dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int len, i = 0; char *pw, passBuf[264]; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "password"); @@ -2808,13 +2799,11 @@ ZipFSMkZipOrImgObjCmd( static int ZipFSMkZipObjCmd( - void *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 < 3 || objc > 5) { Tcl_WrongNumArgs(interp, 1, objv, "outfile indir ?strip? ?password?"); return TCL_ERROR; @@ -2830,13 +2819,11 @@ ZipFSMkZipObjCmd( static int ZipFSLMkZipObjCmd( - void *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 < 3 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, "outfile inlist ?password?"); return TCL_ERROR; @@ -2869,13 +2856,11 @@ ZipFSLMkZipObjCmd( static int ZipFSMkImgObjCmd( - void *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 < 3 || objc > 6) { Tcl_WrongNumArgs(interp, 1, objv, "outfile indir ?strip? ?password? ?infile?"); @@ -2892,13 +2877,11 @@ ZipFSMkImgObjCmd( static int ZipFSLMkImgObjCmd( - void *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 < 3 || objc > 5) { Tcl_WrongNumArgs(interp, 1, objv, "outfile inlist ?password infile?"); return TCL_ERROR; @@ -2931,7 +2914,7 @@ ZipFSLMkImgObjCmd( static int ZipFSCanonicalObjCmd( - void *dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -2940,7 +2923,6 @@ ZipFSCanonicalObjCmd( char *filename = NULL; char *result; Tcl_DString dPath; - (void)dummy; if (objc < 2 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, "?mountpoint? filename ?inZipfs?"); @@ -2988,7 +2970,7 @@ ZipFSCanonicalObjCmd( static int ZipFSExistsObjCmd( - void *dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -2996,7 +2978,6 @@ ZipFSExistsObjCmd( char *filename; int exists; Tcl_DString ds; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "filename"); @@ -3042,14 +3023,13 @@ ZipFSExistsObjCmd( static int ZipFSInfoObjCmd( - void *dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { char *filename; ZipEntry *z; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "filename"); @@ -3093,7 +3073,7 @@ ZipFSInfoObjCmd( static int ZipFSListObjCmd( - void *dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -3103,7 +3083,6 @@ ZipFSListObjCmd( Tcl_HashEntry *hPtr; Tcl_HashSearch search; Tcl_Obj *result = Tcl_GetObjResult(interp); - (void)dummy; if (objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?(-glob|-regexp)? ?pattern?"); @@ -3291,15 +3270,11 @@ TclZipfs_TclLibrary(void) static int ZipFSTclLibraryObjCmd( - void *dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(Tcl_Obj *const *)) /*objv*/ { - (void)dummy; - (void)objc; - (void)objv; - if (!Tcl_IsSafe(interp)) { Tcl_Obj *pResult = TclZipfs_TclLibrary(); @@ -3330,11 +3305,10 @@ ZipFSTclLibraryObjCmd( static int ZipChannelClose( void *instanceData, - Tcl_Interp *dummy, /* Current interpreter. */ + TCL_UNUSED(Tcl_Interp *), int flags) { ZipChannel *info = (ZipChannel *)instanceData; - (void)dummy; if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) { return EINVAL; @@ -3585,12 +3559,9 @@ ZipChannelWideSeek( static void ZipChannelWatchChannel( - void *instanceData, - int mask) + TCL_UNUSED(ClientData), + TCL_UNUSED(int) /*mask*/) { - (void)instanceData; - (void)mask; - return; } @@ -3613,14 +3584,10 @@ ZipChannelWatchChannel( static int ZipChannelGetFile( - void *instanceData, - int direction, - void **handlePtr) + TCL_UNUSED(ClientData), + TCL_UNUSED(int) /*direction*/, + TCL_UNUSED(ClientData *) /*handlePtr*/) { - (void)instanceData; - (void)direction; - (void)handlePtr; - return TCL_ERROR; } @@ -3646,13 +3613,12 @@ ZipChannelOpen( Tcl_Interp *interp, /* Current interpreter. */ char *filename, int mode, - int permissions) + TCL_UNUSED(int) /*permissions*/) { ZipEntry *z; ZipChannel *info; int i, ch, trunc, wr, flags = 0; char cname[128]; - (void)permissions; if ((mode & O_APPEND) || ((ZipFS.wrmax <= 0) && (mode & (O_WRONLY | O_RDWR)))) { @@ -4168,10 +4134,8 @@ ZipFSAccessProc( static Tcl_Obj * ZipFSFilesystemSeparatorProc( - Tcl_Obj *pathPtr) + TCL_UNUSED(Tcl_Obj *) /*pathPtr*/) { - (void)pathPtr; - return Tcl_NewStringObj("/", -1); } @@ -4196,7 +4160,7 @@ ZipFSFilesystemSeparatorProc( static int ZipFSMatchInDirectoryProc( - Tcl_Interp *dummy, /* Current interpreter. */ + TCL_UNUSED(Tcl_Interp *), Tcl_Obj *result, Tcl_Obj *pathPtr, const char *pattern, @@ -4209,7 +4173,6 @@ ZipFSMatchInDirectoryProc( size_t len, prefixLen; char *pat, *prefix, *path; Tcl_DString dsPref; - (void)dummy; if (!normPathPtr) { return -1; @@ -4387,14 +4350,13 @@ ZipFSMatchInDirectoryProc( static int ZipFSPathInFilesystemProc( Tcl_Obj *pathPtr, - void **dummy) + TCL_UNUSED(ClientData *)) { Tcl_HashEntry *hPtr; Tcl_HashSearch search; int ret = -1; size_t len; char *path; - (void)dummy; pathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr); if (!pathPtr) { @@ -4482,8 +4444,8 @@ ZipFSListVolumesProc(void) static const char *const * ZipFSFileAttrStringsProc( - Tcl_Obj *pathPtr, - Tcl_Obj **objPtrRef) + TCL_UNUSED(Tcl_Obj *) /*pathPtr*/, + TCL_UNUSED(Tcl_Obj **) /*objPtrRef*/) { static const char *const attrs[] = { "-uncompsize", @@ -4494,8 +4456,6 @@ ZipFSFileAttrStringsProc( "-permissions", NULL, }; - (void)pathPtr; - (void)objPtrRef; return attrs; } @@ -4594,14 +4554,10 @@ ZipFSFileAttrsGetProc( static int ZipFSFileAttrsSetProc( Tcl_Interp *interp, /* Current interpreter. */ - int index, - Tcl_Obj *pathPtr, - Tcl_Obj *objPtr) + TCL_UNUSED(int) /*index*/, + TCL_UNUSED(Tcl_Obj *) /*pathPtr*/, + TCL_UNUSED(Tcl_Obj *) /*objPtr*/) { - (void)index; - (void)pathPtr; - (void)objPtr; - if (interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj("unsupported operation", -1)); Tcl_SetErrorCode(interp, "TCL", "ZIPFS", "UNSUPPORTED_OP", NULL); @@ -4623,9 +4579,8 @@ ZipFSFileAttrsSetProc( static Tcl_Obj * ZipFSFilesystemPathTypeProc( - Tcl_Obj *pathPtr) + TCL_UNUSED(Tcl_Obj *) /*pathPtr*/) { - (void)pathPtr; return Tcl_NewStringObj("zip", -1); } @@ -4907,18 +4862,20 @@ ZipfsExitHandler( int TclZipfs_AppHook( +#ifdef SUPPORT_BUILTIN_ZIP_INSTALL int *argcPtr, /* Pointer to argc */ +#else + TCL_UNUSED(int *) /*argcPtr*/, +#endif #ifdef _WIN32 - WCHAR + TCL_UNUSED(WCHAR ***)argvPtr, #else /* !_WIN32 */ - char + char ***argvPtr) /* Pointer to argv */ #endif /* _WIN32 */ - ***argvPtr) /* Pointer to argv */ { char *archive; #ifdef _WIN32 - (void)argvPtr; Tcl_FindExecutable(NULL); #else Tcl_FindExecutable((*argvPtr)[0]); @@ -5022,8 +4979,6 @@ TclZipfs_AppHook( #ifdef _WIN32 Tcl_DStringFree(&ds); #endif /* _WIN32 */ -#else - (void)argcPtr; #endif /* SUPPORT_BUILTIN_ZIP_INSTALL */ } return TCL_OK; diff --git a/macosx/tclMacOSXBundle.c b/macosx/tclMacOSXBundle.c index 6714696..df6fbdd 100644 --- a/macosx/tclMacOSXBundle.c +++ b/macosx/tclMacOSXBundle.c @@ -12,6 +12,7 @@ */ #include "tclPort.h" +#include "tclInt.h" #ifdef HAVE_COREFOUNDATION #include <CoreFoundation/CoreFoundation.h> @@ -197,7 +198,7 @@ Tcl_MacOSXOpenBundleResources( int Tcl_MacOSXOpenVersionedBundleResources( - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), const char *bundleName, const char *bundleVersion, int hasResourceFile, @@ -208,7 +209,6 @@ Tcl_MacOSXOpenVersionedBundleResources( CFBundleRef bundleRef, versionedBundleRef = NULL; CFStringRef bundleNameRef; CFURLRef libURL; - (void)dummy; libraryPath[0] = '\0'; diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c index 3f37193..3d4daa0 100644 --- a/macosx/tclMacOSXNotify.c +++ b/macosx/tclMacOSXNotify.c @@ -755,7 +755,7 @@ StartNotifierThread(void) void Tcl_FinalizeNotifier( - ClientData clientData) /* Not used. */ + ClientData clientData) { ThreadSpecificData *tsdPtr; @@ -942,11 +942,9 @@ Tcl_SetTimer( static void TimerWakeUp( - CFRunLoopTimerRef timer, - void *info) + TCL_UNUSED(CFRunLoopTimerRef), + TCL_UNUSED(ClientData)) { - (void)timer; - (void)info; } /* @@ -1450,12 +1448,11 @@ QueueFileEvents( static void UpdateWaitingListAndServiceEvents( - CFRunLoopObserverRef observer, + TCL_UNUSED(CFRunLoopObserverRef), CFRunLoopActivity activity, void *info) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *)info; - (void)observer; if (tsdPtr->sleeping) { return; @@ -1830,14 +1827,13 @@ TclUnixWaitForFile( static TCL_NORETURN void NotifierThreadProc( - ClientData dummy) /* Not used. */ + TCL_UNUSED(ClientData)) { ThreadSpecificData *tsdPtr; fd_set readableMask, writableMask, exceptionalMask; int i, numFdBits = 0, polling; struct timeval poll = {0., 0.}, *timePtr; char buf[2]; - (void)dummy; /* * Look for file events and report them to interested threads. diff --git a/unix/tclEpollNotfy.c b/unix/tclEpollNotfy.c index f1d8cca..f6ad8ce 100644 --- a/unix/tclEpollNotfy.c +++ b/unix/tclEpollNotfy.c @@ -183,7 +183,7 @@ Tcl_InitNotifier(void) void Tcl_FinalizeNotifier( - ClientData clientData) /* Not used. */ + ClientData clientData) { if (tclNotifierHooks.finalizeNotifierProc) { tclNotifierHooks.finalizeNotifierProc(clientData); diff --git a/unix/tclKqueueNotfy.c b/unix/tclKqueueNotfy.c index 6361d63..184fb2b 100644 --- a/unix/tclKqueueNotfy.c +++ b/unix/tclKqueueNotfy.c @@ -169,7 +169,7 @@ Tcl_InitNotifier(void) void Tcl_FinalizeNotifier( - ClientData clientData) /* Not used. */ + ClientData clientData) { if (tclNotifierHooks.finalizeNotifierProc) { tclNotifierHooks.finalizeNotifierProc(clientData); diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c index 4b8fca6..f877055 100644 --- a/unix/tclLoadDl.c +++ b/unix/tclLoadDl.c @@ -281,13 +281,9 @@ UnloadFile( int TclGuessPackageName( - const char *fileName, /* Name of file containing package (already - * translated to local form if needed). */ - Tcl_DString *bufPtr) /* Initialized empty dstring. Append package - * name to this if possible. */ + TCL_UNUSED(const char *) /*fileName*/, + TCL_UNUSED(Tcl_DString *)) { - (void)fileName; - (void)bufPtr; return 0; } diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c index dac4160..a2ab24f 100644 --- a/unix/tclLoadDyld.c +++ b/unix/tclLoadDyld.c @@ -486,14 +486,9 @@ UnloadFile( int TclGuessPackageName( - const char *fileName, /* Name of file containing package (already - * translated to local form if needed). */ - Tcl_DString *bufPtr) /* Initialized empty dstring. Append package - * name to this if possible. */ + TCL_UNUSED(const char *) /*fileName*/, + TCL_UNUSED(Tcl_DString *) /*bufPtr*/) { - (void)fileName; - (void)bufPtr; - return 0; } @@ -516,11 +511,10 @@ TclGuessPackageName( #ifdef TCL_LOAD_FROM_MEMORY MODULE_SCOPE void * TclpLoadMemoryGetBuffer( - Tcl_Interp *dummy, /* Used for error reporting. */ + TCL_UNUSED(Tcl_Interp *), int size) /* Size of desired buffer. */ { void *buffer = NULL; - (void)dummy; /* * NSCreateObjectFileImageFromMemory is available but always fails diff --git a/unix/tclSelectNotfy.c b/unix/tclSelectNotfy.c index 2a22639..52b012a 100644 --- a/unix/tclSelectNotfy.c +++ b/unix/tclSelectNotfy.c @@ -376,7 +376,7 @@ Tcl_InitNotifier(void) void Tcl_FinalizeNotifier( - ClientData clientData) /* Not used. */ + ClientData clientData) { if (tclNotifierHooks.finalizeNotifierProc) { tclNotifierHooks.finalizeNotifierProc(clientData); @@ -928,7 +928,7 @@ Tcl_WaitForEvent( #if TCL_THREADS static TCL_NORETURN void NotifierThreadProc( - ClientData dummy) /* Not used. */ + TCL_UNUSED(ClientData)) { ThreadSpecificData *tsdPtr; fd_set readableMask; @@ -940,7 +940,6 @@ NotifierThreadProc( struct timeval poll = {0, 0}, *timePtr; char buf[2]; int numFdBits = 0; - (void)dummy; if (pipe(fds) != 0) { Tcl_Panic("NotifierThreadProc: %s", "could not create trigger pipe"); diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 7478627..c807b3c 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -351,12 +351,11 @@ FileOutputProc( static int FileCloseProc( void *instanceData, /* File state. */ - Tcl_Interp *dummy, /* For error reporting - unused. */ + TCL_UNUSED(Tcl_Interp *), int flags) { FileState *fsPtr = (FileState *)instanceData; int errorCode = 0; - (void)dummy; if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) { return EINVAL; @@ -1880,9 +1879,8 @@ Tcl_GetOpenFile( const char *chanID, /* String that identifies file. */ int forWriting, /* 1 means the file is going to be used for * writing, 0 means for reading. */ - int dummy, /* 1 means verify that the file was opened in - * a mode that allows the access specified by - * "forWriting". Ignored, we always check that + TCL_UNUSED(int), /* Obsolete argument. + * Ignored, we always check that * the channel is open for the requested * mode. */ void **filePtr) /* Store pointer to FILE structure here. */ @@ -1892,7 +1890,6 @@ Tcl_GetOpenFile( const Tcl_ChannelType *chanTypePtr; void *data; FILE *f; - (void)dummy; chan = Tcl_GetChannel(interp, chanID, &chanMode); if (chan == NULL) { diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index 3b81e6f..d7f64bd 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -334,10 +334,9 @@ TclpGetPwUid( #ifdef NEED_PW_CLEANER static void FreePwBuf( - ClientData dummy) + TCL_UNUSED(ClientData)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; Tcl_Free(tsdPtr->pbuf); } @@ -518,10 +517,9 @@ TclpGetGrGid( #ifdef NEED_GR_CLEANER static void FreeGrBuf( - ClientData dummy) + TCL_UNUSED(ClientData)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; Tcl_Free(tsdPtr->gbuf); } diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 1e2156c..b97c6ca 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -1233,16 +1233,13 @@ TraversalCopy( static int TraversalDelete( Tcl_DString *srcPtr, /* Source pathname (native). */ - Tcl_DString *dummy, /* Destination pathname (not used). */ - const Tcl_StatBuf *statBufPtr, - /* Stat info for file specified by srcPtr. */ + TCL_UNUSED(Tcl_DString *), + TCL_UNUSED(const Tcl_StatBuf *), int type, /* Reason for call - see TraverseUnixTree(). */ Tcl_DString *errorPtr) /* If non-NULL, uninitialized or free DString * filled with UTF-8 name of file causing * error. */ { - (void)dummy; - (void)statBufPtr; switch (type) { case DOTREE_F: @@ -1285,14 +1282,17 @@ TraversalDelete( static int CopyFileAtts( - const char *src, /* Path name of source file (native). */ +#ifdef MAC_OSX_TCL + const char *src, /* Path name of source file (native). */ +#else + TCL_UNUSED(const char *) /*src*/, +#endif const char *dst, /* Path name of target file (native). */ const Tcl_StatBuf *statBufPtr) /* Stat info for source file */ { struct utimbuf tval; mode_t newMode; - (void)src; newMode = statBufPtr->st_mode & (S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO); @@ -1344,14 +1344,13 @@ CopyFileAtts( static int GetGroupAttribute( Tcl_Interp *interp, /* The interp we are using for errors. */ - int objIndex, /* The index of the attribute. */ + TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { Tcl_StatBuf statBuf; struct group *groupPtr; int result; - (void)objIndex; result = TclpObjStat(fileName, &statBuf); @@ -1399,14 +1398,13 @@ GetGroupAttribute( static int GetOwnerAttribute( Tcl_Interp *interp, /* The interp we are using for errors. */ - int objIndex, /* The index of the attribute. */ + TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { Tcl_StatBuf statBuf; struct passwd *pwPtr; int result; - (void)objIndex; result = TclpObjStat(fileName, &statBuf); @@ -1452,13 +1450,12 @@ GetOwnerAttribute( static int GetPermissionsAttribute( Tcl_Interp *interp, /* The interp we are using for errors. */ - int objIndex, /* The index of the attribute. */ + TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { Tcl_StatBuf statBuf; int result; - (void)objIndex; result = TclpObjStat(fileName, &statBuf); @@ -1495,14 +1492,13 @@ GetPermissionsAttribute( static int SetGroupAttribute( Tcl_Interp *interp, /* The interp for error reporting. */ - int objIndex, /* The index of the attribute. */ + TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj *attributePtr) /* New group for file. */ { Tcl_WideInt gid; int result; const char *native; - (void)objIndex; if (Tcl_GetWideIntFromObj(NULL, attributePtr, &gid) != TCL_OK) { Tcl_DString ds; @@ -1563,14 +1559,13 @@ SetGroupAttribute( static int SetOwnerAttribute( Tcl_Interp *interp, /* The interp for error reporting. */ - int objIndex, /* The index of the attribute. */ + TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj *attributePtr) /* New owner for file. */ { Tcl_WideInt uid; int result; const char *native; - (void)objIndex; if (Tcl_GetWideIntFromObj(NULL, attributePtr, &uid) != TCL_OK) { Tcl_DString ds; @@ -1631,7 +1626,7 @@ SetOwnerAttribute( static int SetPermissionsAttribute( Tcl_Interp *interp, /* The interp we are using for errors. */ - int objIndex, /* The index of the attribute. */ + TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj *attributePtr) /* The attribute to set. */ { @@ -1641,7 +1636,6 @@ SetPermissionsAttribute( const char *native; const char *modeStringPtr = TclGetString(attributePtr); int scanned = TclParseAllWhiteSpace(modeStringPtr, -1); - (void)objIndex; /* * First supply support for octal number format @@ -1754,7 +1748,7 @@ TclpObjListVolumes(void) static int GetModeFromPermString( - Tcl_Interp *dummy, /* The interp we are using for errors. */ + TCL_UNUSED(Tcl_Interp *), const char *modeStringPtr, /* Permissions string */ mode_t *modePtr) /* pointer to the mode value */ { @@ -1763,7 +1757,6 @@ GetModeFromPermString( * is passed in), to allow for the chmod style * manipulation. */ int i,n, who, op, what, op_found, who_found; - (void)dummy; /* * We start off checking for an "rwxrwxrwx" style permissions string @@ -1942,7 +1935,7 @@ GetModeFromPermString( int TclpObjNormalizePath( - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), Tcl_Obj *pathPtr, /* An unshared object containing the path to * normalize. */ int nextCheckpoint) /* offset to start at in pathPtr. Must either @@ -1961,7 +1954,6 @@ TclpObjNormalizePath( #ifndef NO_REALPATH char normPath[MAXPATHLEN]; #endif - (void)dummy; currentPathEndPosition = path + nextCheckpoint; if (*currentPathEndPosition == '/') { @@ -2507,13 +2499,12 @@ SetUnixFileAttributes( static int GetUnixFileAttributes( Tcl_Interp *interp, /* The interp we are using for errors. */ - int objIndex, /* The index of the attribute. */ + TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { Tcl_StatBuf statBuf; int result; - (void)objIndex; result = TclpObjStat(fileName, &statBuf); @@ -2549,14 +2540,13 @@ GetUnixFileAttributes( static int SetUnixFileAttributes( Tcl_Interp *interp, /* The interp we are using for errors. */ - int objIndex, /* The index of the attribute. */ + TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj *attributePtr) /* The attribute to set. */ { Tcl_StatBuf statBuf; int result, readonly; const char *native; - (void)objIndex; if (Tcl_GetBooleanFromObj(interp, attributePtr, &readonly) != TCL_OK) { return TCL_ERROR; diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 83c194a..33628a0 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -34,17 +34,15 @@ static int NativeMatchType(Tcl_Interp *interp, const char* nativeEntry, *--------------------------------------------------------------------------- */ +#ifdef __CYGWIN__ void TclpFindExecutable( - const char *argv0) /* The value of the application's argv[0] - * (native). */ + TCL_UNUSED(const char *) /*argv0*/) { Tcl_Encoding encoding; -#ifdef __CYGWIN__ size_t length; wchar_t buf[PATH_MAX]; char name[PATH_MAX * 3 + 1]; - (void)argv0; GetModuleFileNameW(NULL, buf, PATH_MAX); cygwin_conv_path(3, buf, name, PATH_MAX); @@ -56,7 +54,14 @@ TclpFindExecutable( encoding = Tcl_GetEncoding(NULL, NULL); TclSetObjNameOfExecutable( Tcl_NewStringObj(name, length), encoding); +} #else +void +TclpFindExecutable( + const char *argv0) /* The value of the application's argv[0] + * (native). */ +{ + Tcl_Encoding encoding; const char *name, *p; Tcl_StatBuf statBuf; Tcl_DString buffer, nameString, cwd, utfName; @@ -194,8 +199,8 @@ TclpFindExecutable( done: Tcl_DStringFree(&buffer); -#endif } +#endif /* *---------------------------------------------------------------------- @@ -1021,9 +1026,8 @@ TclpObjLink( Tcl_Obj * TclpFilesystemPathType( - Tcl_Obj *pathPtr) + TCL_UNUSED(Tcl_Obj *)) { - (void)pathPtr; /* * All native paths are of the same type. */ diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index b37d4ad..137747f 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -1052,26 +1052,27 @@ TclpFindVariable( */ #ifdef HAVE_COREFOUNDATION +#ifdef TCL_FRAMEWORK static int MacOSXGetLibraryPath( Tcl_Interp *interp, int maxPathLen, char *tclLibPath) { - int foundInFramework = TCL_ERROR; - -#ifdef TCL_FRAMEWORK - foundInFramework = Tcl_MacOSXOpenVersionedBundleResources(interp, + return Tcl_MacOSXOpenVersionedBundleResources(interp, "com.tcltk.tcllibrary", TCL_FRAMEWORK_VERSION, 0, maxPathLen, tclLibPath); +} #else - (void)interp; - (void)maxPathLen; - (void)tclLibPath; -#endif - - return foundInFramework; +static int +MacOSXGetLibraryPath( + TCL_UNUSED(Tcl_Interp *), + TCL_UNUSED(int), + TCL_UNUSED(char *)) +{ + return TCL_ERROR; } +#endif #endif /* HAVE_COREFOUNDATION */ /* diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index a0445a2..e056f96 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -268,10 +268,9 @@ TclpTempFileName(void) Tcl_Obj * TclpTempFileNameForLibrary( Tcl_Interp *interp, /* Tcl interpreter. */ - Tcl_Obj *path) /* Path name of the library in the VFS. */ + TCL_UNUSED(Tcl_Obj *) /*path*/) { Tcl_Obj *retval = TclpTempFileName(); - (void)path; if (retval == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -811,10 +810,9 @@ Tcl_CreatePipe( Tcl_Interp *interp, /* Errors returned in result. */ Tcl_Channel *rchan, /* Returned read side. */ Tcl_Channel *wchan, /* Returned write side. */ - int flags) /* Reserved for future use. */ + TCL_UNUSED(int) /*flags*/) /* Reserved for future use. */ { int fileNums[2]; - (void)flags; if (pipe(fileNums) < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf("pipe creation failed: %s", @@ -1254,7 +1252,7 @@ Tcl_WaitPid( /* ARGSUSED */ int Tcl_PidObjCmd( - void *dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ @@ -1263,7 +1261,6 @@ Tcl_PidObjCmd( PipeState *pipePtr; int i; Tcl_Obj *resultPtr; - (void)dummy; if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?channelId?"); diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 781ef33..6e27cc5 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -335,10 +335,8 @@ Tcl_GetHostName(void) int TclpHasSockets( - Tcl_Interp *dummy) /* Not used. */ + TCL_UNUSED(Tcl_Interp *)) { - (void)dummy; - return TCL_OK; } @@ -624,12 +622,11 @@ TcpOutputProc( static int TcpCloseProc( void *instanceData, /* The socket to close. */ - Tcl_Interp *dummy) /* For error reporting - unused */ + TCL_UNUSED(Tcl_Interp *)) { TcpState *statePtr = (TcpState *)instanceData; int errorCode = 0; TcpFdList *fds; - (void)dummy; /* * Delete a file handler that may be active for this socket if this is a @@ -686,13 +683,12 @@ TcpCloseProc( static int TcpClose2Proc( void *instanceData, /* The socket to close. */ - Tcl_Interp *dummy, /* For error reporting. */ + TCL_UNUSED(Tcl_Interp *), int flags) /* Flags that indicate which side to close. */ { TcpState *statePtr = (TcpState *)instanceData; int readError = 0; int writeError = 0; - (void)dummy; /* * Shutdown the OS socket handle. @@ -1107,11 +1103,10 @@ TcpWatchProc( static int TcpGetHandleProc( void *instanceData, /* The socket state. */ - int direction, /* Not used. */ + TCL_UNUSED(int) /*direction*/, void **handlePtr) /* Where to store the handle. */ { TcpState *statePtr = (TcpState *)instanceData; - (void)direction; *handlePtr = INT2PTR(statePtr->fds.fd); return TCL_OK; @@ -1132,12 +1127,8 @@ TcpGetHandleProc( static void TcpAsyncCallback( void *clientData, /* The socket state. */ - int mask) /* Events of interest; an OR-ed combination of - * TCL_READABLE, TCL_WRITABLE and - * TCL_EXCEPTION. */ + TCL_UNUSED(int) /*mask*/) { - (void)mask; - TcpConnect(NULL, (TcpState *)clientData); } @@ -1768,7 +1759,7 @@ Tcl_OpenTcpServerEx( static void TcpAccept( void *data, /* Callback token. */ - int mask) /* Not used. */ + TCL_UNUSED(int) /*mask*/) { TcpFdList *fds = (TcpFdList *)data; /* Client data of server socket. */ int newsock; /* The new client socket */ @@ -1777,7 +1768,6 @@ TcpAccept( socklen_t len; /* For accept interface */ char channelName[SOCK_CHAN_LENGTH]; char host[NI_MAXHOST], port[NI_MAXSERV]; - (void)mask; len = sizeof(addr); newsock = accept(fds->fd, &addr.sa, &len); diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c index 8868bbe..b06abdf0 100644 --- a/unix/tclUnixTest.c +++ b/unix/tclUnixTest.c @@ -129,7 +129,7 @@ TclplatformtestInit( static int TestfilehandlerCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ @@ -139,7 +139,6 @@ TestfilehandlerCmd( static int initialized = 0; char buffer[4000]; TclFile file; - (void)dummy; /* * NOTE: When we make this code work on Windows also, the following @@ -344,7 +343,7 @@ TestFileHandlerProc( static int TestfilewaitCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ @@ -353,7 +352,6 @@ TestfilewaitCmd( Tcl_Channel channel; int fd; ClientData data; - (void)dummy; if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "file readable|writable|both timeout"); @@ -413,13 +411,12 @@ TestfilewaitCmd( static int TestfindexecutableCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { Tcl_Obj *saveName; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "argv0"); @@ -456,13 +453,12 @@ TestfindexecutableCmd( static int TestforkCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { pid_t pid; - (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, ""); @@ -503,7 +499,7 @@ TestforkCmd( static int TestalarmCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ @@ -511,7 +507,6 @@ TestalarmCmd( #ifdef SA_RESTART unsigned int sec = 1; struct sigaction action; - (void)dummy; if (objc > 1) { Tcl_GetIntFromObj(interp, objv[1], (int *)&sec); @@ -533,7 +528,6 @@ TestalarmCmd( (void) alarm(sec); return TCL_OK; #else - (void)dummy; Tcl_AppendResult(interp, "warning: sigaction SA_RESTART not support on this platform", @@ -560,10 +554,8 @@ TestalarmCmd( static void AlarmHandler( - int signum) + TCL_UNUSED(int) /*signum*/) { - (void)signum; - gotsig = "1"; } @@ -585,15 +577,11 @@ AlarmHandler( static int TestgotsigCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *const *objv) /* Argument strings. */ + TCL_UNUSED(int) /*objc*/, + TCL_UNUSED(Tcl_Obj *const *)) { - (void)dummy; - (void)objc; - (void)objv; - Tcl_AppendResult(interp, gotsig, NULL); gotsig = "0"; return TCL_OK; @@ -620,13 +608,12 @@ TestgotsigCmd( static int TestchmodCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { int i, mode; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "mode file ?file ...?"); diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index 1ca0cbb..d66b9c0 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -370,11 +370,9 @@ Tcl_QueryTimeProc( static void NativeScaleTime( - Tcl_Time *timePtr, - ClientData clientData) + TCL_UNUSED(Tcl_Time *), + TCL_UNUSED(ClientData)) { - (void)timePtr; - (void)clientData; /* Native scale is 1:1. Nothing is done */ } @@ -398,10 +396,9 @@ NativeScaleTime( static void NativeGetTime( Tcl_Time *timePtr, - ClientData dummy) + TCL_UNUSED(ClientData)) { struct timeval tv; - (void)dummy; (void) gettimeofday(&tv, NULL); timePtr->sec = tv.tv_sec; diff --git a/unix/tclXtNotify.c b/unix/tclXtNotify.c index b2ec6e6..f31503d 100644 --- a/unix/tclXtNotify.c +++ b/unix/tclXtNotify.c @@ -232,7 +232,7 @@ InitNotifier(void) static void NotifierExitHandler( - ClientData clientData) /* Not used. */ + TCL_UNUSED(ClientData)) { if (notifier.currentTimeout != 0) { XtRemoveTimeOut(notifier.currentTimeout); @@ -305,7 +305,7 @@ SetTimer( static void TimerProc( - XtPointer clientData, /* Not used. */ + TCL_UNUSED(XtPointer), XtIntervalId *id) { if (*id != notifier.currentTimeout) { diff --git a/unix/tclXtTest.c b/unix/tclXtTest.c index cb70b58..6c09a50 100644 --- a/unix/tclXtTest.c +++ b/unix/tclXtTest.c @@ -78,7 +78,7 @@ Tclxttest_Init( static int TesteventloopCmd( - ClientData clientData, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ diff --git a/win/tclAppInit.c b/win/tclAppInit.c index 3e95e3b..cc87b44 100644 --- a/win/tclAppInit.c +++ b/win/tclAppInit.c @@ -87,11 +87,10 @@ MODULE_SCOPE int TCL_LOCAL_MAIN_HOOK(int *argc, TCHAR ***argv); int main( int argc, /* Number of command-line arguments. */ - char *dummy[]) /* Not used. */ + TCL_UNUSED(char **)) { TCHAR **argv; TCHAR *p; - (void)dummy; #else int _tmain( diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index fc6fd16..a39a6c6 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.c @@ -90,7 +90,7 @@ BOOL APIENTRY DllEntryPoint( HINSTANCE hInst, /* Library instance handle. */ DWORD reason, /* Reason this function is being called. */ - LPVOID reserved) /* Not used. */ + LPVOID reserved) { return DllMain(hInst, reason, reserved); } @@ -117,10 +117,8 @@ BOOL APIENTRY DllMain( HINSTANCE hInst, /* Library instance handle. */ DWORD reason, /* Reason this function is being called. */ - LPVOID reserved) /* Not used. */ + TCL_UNUSED(LPVOID)) { - (void)reserved; - switch (reason) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hInst); diff --git a/win/tclWinChan.c b/win/tclWinChan.c index aa002f3..72f9987 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -178,10 +178,8 @@ FileInit(void) static void FileChannelExitHandler( - ClientData dummy) /* Old window proc */ + TCL_UNUSED(ClientData)) { - (void)dummy; - Tcl_DeleteEventSource(FileSetupProc, FileCheckProc, NULL); } @@ -204,13 +202,12 @@ FileChannelExitHandler( void FileSetupProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { FileInfo *infoPtr; Tcl_Time blockTime = { 0, 0 }; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if (!TEST_FLAG(flags, TCL_FILE_EVENTS)) { return; @@ -248,13 +245,12 @@ FileSetupProc( static void FileCheckProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { FileEvent *evPtr; FileInfo *infoPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if (!TEST_FLAG(flags, TCL_FILE_EVENTS)) { return; @@ -388,14 +384,13 @@ FileBlockProc( static int FileCloseProc( ClientData instanceData, /* Pointer to FileInfo structure. */ - Tcl_Interp *dummy, /* Not used. */ + TCL_UNUSED(Tcl_Interp *), int flags) { FileInfo *fileInfoPtr = (FileInfo *)instanceData; FileInfo *infoPtr; ThreadSpecificData *tsdPtr; int errorCode = 0; - (void)dummy; if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) { return EINVAL; diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index 58082d7..7e20ee9 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -317,10 +317,8 @@ ConsoleInit(void) static void ConsoleExitHandler( - ClientData dummy) /* Old window proc. */ + TCL_UNUSED(ClientData)) { - (void)dummy; - Tcl_DeleteEventSource(ConsoleSetupProc, ConsoleCheckProc, NULL); } @@ -343,10 +341,8 @@ ConsoleExitHandler( static void ProcExitHandler( - ClientData dummy) /* Old window proc. */ + TCL_UNUSED(ClientData)) { - (void)dummy; - Tcl_MutexLock(&consoleMutex); initialized = 0; Tcl_MutexUnlock(&consoleMutex); @@ -371,14 +367,13 @@ ProcExitHandler( void ConsoleSetupProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { ConsoleInfo *infoPtr; Tcl_Time blockTime = { 0, 0 }; int block = 1; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if (!(flags & TCL_FILE_EVENTS)) { return; @@ -426,13 +421,12 @@ ConsoleSetupProc( static void ConsoleCheckProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { ConsoleInfo *infoPtr; int needEvent; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if (!(flags & TCL_FILE_EVENTS)) { return; @@ -537,14 +531,13 @@ ConsoleBlockModeProc( static int ConsoleCloseProc( ClientData instanceData, /* Pointer to ConsoleInfo structure. */ - Tcl_Interp *dummy, /* For error reporting. */ + TCL_UNUSED(Tcl_Interp *), int flags) { ConsoleInfo *consolePtr = (ConsoleInfo *)instanceData; int errorCode = 0; ConsoleInfo *infoPtr, **nextPtrPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) { return EINVAL; @@ -995,11 +988,10 @@ ConsoleWatchProc( static int ConsoleGetHandleProc( ClientData instanceData, /* The console state. */ - int direction, /* TCL_READABLE or TCL_WRITABLE. */ + TCL_UNUSED(int) /*direction*/, ClientData *handlePtr) /* Where to store the handle. */ { ConsoleInfo *infoPtr = (ConsoleInfo *)instanceData; - (void)direction; *handlePtr = infoPtr->handle; return TCL_OK; diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index 960188e..cdf81a3 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -1427,13 +1427,11 @@ TraversalCopy( static int TraversalDelete( const WCHAR *nativeSrc, /* Source pathname to delete. */ - const WCHAR *dstPtr, /* Not used. */ + TCL_UNUSED(const WCHAR *) /*dstPtr*/, int type, /* Reason for call - see TraverseWinTree() */ Tcl_DString *errorPtr) /* If non-NULL, initialized DString filled * with UTF-8 name of file causing error. */ { - (void)dstPtr; - switch (type) { case DOTREE_F: if (TclpDeleteFile(nativeSrc) == TCL_OK) { @@ -1592,7 +1590,7 @@ GetWinFileAttributes( static int ConvertFileNameFormat( Tcl_Interp *interp, /* The interp we are using for errors. */ - int objIndex, /* The index of the attribute. */ + TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file. */ int longShort, /* 0 to short name, 1 to long name. */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ @@ -1600,7 +1598,6 @@ ConvertFileNameFormat( int pathc, i; Tcl_Obj *splitPath; size_t length; - (void)objIndex; splitPath = Tcl_FSSplitPath(fileName, &pathc); @@ -1895,10 +1892,8 @@ CannotSetAttribute( Tcl_Interp *interp, /* The interp we are using for errors. */ int objIndex, /* The index of the attribute. */ Tcl_Obj *fileName, /* The name of the file. */ - Tcl_Obj *attributePtr) /* The new value of the attribute. */ + TCL_UNUSED(Tcl_Obj *) /*attributePtr*/) { - (void)attributePtr; - Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot set attribute \"%s\" for file \"%s\": attribute is readonly", tclpFileAttrStrings[objIndex], TclGetString(fileName))); diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 083375d..3977418 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -2522,7 +2522,7 @@ TclpFilesystemPathType( int TclpObjNormalizePath( - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), Tcl_Obj *pathPtr, /* An unshared object containing the path to * normalize */ int nextCheckpoint) /* offset to start at in pathPtr */ @@ -2533,7 +2533,6 @@ TclpObjNormalizePath( Tcl_Obj *temp = NULL; int isDrive = 1; Tcl_DString ds; /* Some workspace. */ - (void)dummy; Tcl_DStringInit(&dsNorm); path = TclGetString(pathPtr); diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c index 238af65..91bac43 100644 --- a/win/tclWinLoad.c +++ b/win/tclWinLoad.c @@ -61,13 +61,12 @@ TclpDlopen( /* Filled with address of Tcl_FSUnloadFileProc * function which should be used for this * file. */ - int flags) + TCL_UNUSED(int) /*flags*/) { HINSTANCE hInstance = NULL; const WCHAR *nativeName; Tcl_LoadHandle handlePtr; DWORD firstError; - (void)flags; /* * First try the full path the user gave us. This is particularly @@ -282,14 +281,9 @@ UnloadFile( int TclGuessPackageName( - const char *fileName, /* Name of file containing package (already - * translated to local form if needed). */ - Tcl_DString *bufPtr) /* Initialized empty dstring. Append package - * name to this if possible. */ + TCL_UNUSED(const char *), + TCL_UNUSED(Tcl_DString *)) { - (void)fileName; - (void)bufPtr; - return 0; } diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index d21425b..70cb188 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -310,14 +310,13 @@ TclpFinalizePipes(void) void PipeSetupProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { PipeInfo *infoPtr; Tcl_Time blockTime = { 0, 0 }; int block = 1; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if (!(flags & TCL_FILE_EVENTS)) { return; @@ -364,14 +363,13 @@ PipeSetupProc( static void PipeCheckProc( - ClientData dummy, /* Not used. */ + TCL_UNUNSED(ClientData), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { PipeInfo *infoPtr; PipeEvent *evPtr; int needEvent; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if (!(flags & TCL_FILE_EVENTS)) { return; @@ -1858,11 +1856,10 @@ Tcl_CreatePipe( Tcl_Interp *interp, /* Errors returned in result.*/ Tcl_Channel *rchan, /* Where to return the read side. */ Tcl_Channel *wchan, /* Where to return the write side. */ - int flags) /* Reserved for future use. */ + TCL_UNUSED(int) /*flags*/) /* Reserved for future use. */ { HANDLE readHandle, writeHandle; SECURITY_ATTRIBUTES sec; - (void)flags; sec.nLength = sizeof(SECURITY_ATTRIBUTES); sec.lpSecurityDescriptor = NULL; @@ -2746,7 +2743,7 @@ TclWinAddProcess( /* ARGSUSED */ int Tcl_PidObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ @@ -2756,7 +2753,6 @@ Tcl_PidObjCmd( PipeInfo *pipePtr; int i; Tcl_Obj *resultPtr; - (void)dummy; if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?channelId?"); @@ -3193,9 +3189,9 @@ PipeThreadActionProc( Tcl_Channel TclpOpenTemporaryFile( - Tcl_Obj *dirObj, + TCL_UNUSED(Tcl_Obj *) /*dirObj*/, Tcl_Obj *basenameObj, - Tcl_Obj *extensionObj, + TCL_UNUSED(Tcl_Obj *) /*extensionObj*/, Tcl_Obj *resultingNameObj) { WCHAR name[MAX_PATH]; @@ -3205,8 +3201,6 @@ TclpOpenTemporaryFile( size_t length; int counter, counter2; Tcl_DString buf; - (void)dirObj; - (void)extensionObj; if (!resultingNameObj) { flags |= FILE_FLAG_DELETE_ON_CLOSE; diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index e529f77..d8106f4 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -285,11 +285,10 @@ SerialInit(void) static void SerialExitHandler( - ClientData dummy) /* Old window proc */ + TCL_UNUSED(ClientData)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); SerialInfo *infoPtr; - (void)dummy; /* * Clear all eventually pending output. Otherwise Tcl's exit could totally @@ -324,10 +323,8 @@ SerialExitHandler( static void ProcExitHandler( - ClientData dummy) /* Old window proc */ + TCL_UNUSED(ClientData)) { - (void)dummy; - Tcl_MutexLock(&serialMutex); initialized = 0; Tcl_MutexUnlock(&serialMutex); @@ -409,14 +406,13 @@ SerialGetMilliseconds(void) void SerialSetupProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { SerialInfo *infoPtr; int block = 1; int msec = INT_MAX; /* min. found block time */ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if (!(flags & TCL_FILE_EVENTS)) { return; @@ -465,7 +461,7 @@ SerialSetupProc( static void SerialCheckProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { SerialInfo *infoPtr; @@ -474,7 +470,6 @@ SerialCheckProc( ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); COMSTAT cStat; unsigned int time; - (void)dummy; if (!(flags & TCL_FILE_EVENTS)) { return; @@ -606,14 +601,13 @@ SerialBlockProc( static int SerialCloseProc( ClientData instanceData, /* Pointer to SerialInfo structure. */ - Tcl_Interp *dummy, /* For error reporting. */ + TCL_UNUSED(Tcl_Interp *), int flags) { SerialInfo *serialPtr = (SerialInfo *) instanceData; int errorCode = 0, result = 0; SerialInfo *infoPtr, **nextPtrPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) { return EINVAL; @@ -1256,11 +1250,10 @@ SerialWatchProc( static int SerialGetHandleProc( ClientData instanceData, /* The serial state. */ - int direction, /* TCL_READABLE or TCL_WRITABLE */ + TCL_UNUSED(int) /*direction*/, ClientData *handlePtr) /* Where to store the handle. */ { SerialInfo *infoPtr = (SerialInfo *) instanceData; - (void)direction; *handlePtr = (ClientData) infoPtr->handle; return TCL_OK; diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 5dc32a2..79582fe 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -1038,13 +1038,12 @@ TcpOutputProc( static int TcpCloseProc( ClientData instanceData, /* The socket to close. */ - Tcl_Interp *dummy) /* Unused. */ + TCL_UNUSED(Tcl_Interp *)) { TcpState *statePtr = (TcpState *)instanceData; /* TIP #218 */ int errorCode = 0; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; /* * Check that WinSock is initialized; do not call it if not, to prevent @@ -1185,7 +1184,7 @@ TcpSetOptionProc( ClientData instanceData, /* Socket state. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */ const char *optionName, /* Name of the option to set. */ - const char *value) /* New value for option. */ + TCL_UNUSED(const char *) /*value*/) /* New value for option. */ { #ifdef TCL_FEATURE_KEEPALIVE_NAGLE TcpState *statePtr = instanceData; @@ -1193,7 +1192,6 @@ TcpSetOptionProc( #else (void)instanceData; #endif /*TCL_FEATURE_KEEPALIVE_NAGLE*/ - (void)value; /* * Check that WinSock is initialized; do not call it if not, to prevent @@ -1666,11 +1664,10 @@ TcpWatchProc( static int TcpGetHandleProc( ClientData instanceData, /* The socket state. */ - int direction, /* Not used. */ + TCL_UNUSED(int) /*direction*/, ClientData *handlePtr) /* Where to store the handle. */ { TcpState *statePtr = (TcpState *)instanceData; - (void)direction; *handlePtr = INT2PTR(statePtr->sockets->fd); return TCL_OK; @@ -2616,10 +2613,8 @@ SocketsEnabled(void) /* ARGSUSED */ static void SocketExitHandler( - ClientData dummy) /* Not used. */ + TCL_UNUSED(ClientData)) { - (void)dummy; - Tcl_MutexLock(&socketMutex); /* @@ -2652,13 +2647,12 @@ SocketExitHandler( void SocketSetupProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { TcpState *statePtr; Tcl_Time blockTime = { 0, 0 }; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if (!GOT_BITS(flags, TCL_FILE_EVENTS)) { return; @@ -2698,13 +2692,12 @@ SocketSetupProc( static void SocketCheckProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { TcpState *statePtr; SocketEvent *evPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if (!GOT_BITS(flags, TCL_FILE_EVENTS)) { return; diff --git a/win/tclWinTest.c b/win/tclWinTest.c index 062e4f1..97cc6f8 100644 --- a/win/tclWinTest.c +++ b/win/tclWinTest.c @@ -33,19 +33,13 @@ * Forward declarations of functions defined later in this file: */ -static int TesteventloopCmd(ClientData dummy, Tcl_Interp* interp, - int objc, Tcl_Obj *const objv[]); -static int TestvolumetypeCmd(ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static int TestwinclockCmd(ClientData dummy, Tcl_Interp* interp, - int objc, Tcl_Obj *const objv[]); -static int TestwinsleepCmd(ClientData dummy, Tcl_Interp* interp, - int objc, Tcl_Obj *const objv[]); +static Tcl_ObjCmdProc TesteventloopCmd; +static Tcl_ObjCmdProc TestvolumetypeCmd; +static Tcl_ObjCmdProc TestwinclockCmd; +static Tcl_ObjCmdProc TestwinsleepCmd; static Tcl_ObjCmdProc TestExceptionCmd; static int TestplatformChmod(const char *nativePath, int pmode); -static int TestchmodCmd(ClientData dummy, Tcl_Interp* interp, - int objc, Tcl_Obj *const objv[]); +static Tcl_ObjCmdProc TestchmodCmd; /* *---------------------------------------------------------------------- @@ -102,7 +96,7 @@ TclplatformtestInit( static int TesteventloopCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -110,7 +104,6 @@ TesteventloopCmd( static int *framePtr = NULL;/* Pointer to integer on stack frame of * innermost invocation of the "wait" * subcommand. */ - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ..."); @@ -179,7 +172,7 @@ TesteventloopCmd( static int TestvolumetypeCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -188,7 +181,6 @@ TestvolumetypeCmd( int found; char volType[VOL_BUF_SIZE]; const char *path; - (void)dummy; if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?name?"); @@ -246,7 +238,7 @@ TestvolumetypeCmd( static int TestwinclockCmd( - ClientData dummy, /* Unused */ + TCL_UNUSED(ClientData), Tcl_Interp* interp, /* Tcl interpreter */ int objc, /* Argument count */ Tcl_Obj *const objv[]) /* Argument vector */ @@ -259,7 +251,6 @@ TestwinclockCmd( Tcl_Obj *result; /* Result of the command */ LARGE_INTEGER t1, t2; LARGE_INTEGER p1, p2; - (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, ""); @@ -296,13 +287,12 @@ TestwinclockCmd( static int TestwinsleepCmd( - ClientData dummy, /* Unused */ + TCL_UNUSED(ClientData), Tcl_Interp* interp, /* Tcl interpreter */ int objc, /* Parameter count */ Tcl_Obj *const * objv) /* Parameter vector */ { int ms; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "ms"); @@ -340,7 +330,7 @@ TestwinsleepCmd( static int TestExceptionCmd( - ClientData dummy, /* Unused */ + TCL_UNUSED(ClientData), Tcl_Interp* interp, /* Tcl interpreter */ int objc, /* Argument count */ Tcl_Obj *const objv[]) /* Argument vector */ @@ -367,7 +357,6 @@ TestExceptionCmd( EXCEPTION_GUARD_PAGE, EXCEPTION_INVALID_HANDLE, CONTROL_C_EXIT }; int cmd; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 0, objv, "<type-of-exception>"); @@ -630,13 +619,12 @@ TestplatformChmod( static int TestchmodCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Parameter count */ Tcl_Obj *const * objv) /* Parameter vector */ { int i, mode; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "mode file ?file ...?"); diff --git a/win/tclWinTime.c b/win/tclWinTime.c index 0c2f212..643b899 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -385,12 +385,9 @@ Tcl_GetTime( static void NativeScaleTime( - Tcl_Time *timePtr, - ClientData dummy) + TCL_UNUSED(Tcl_Time *), + TCL_UNUSED(ClientData)) { - (void)timePtr; - (void)dummy; - /* * Native scale is 1:1. Nothing is done. */ @@ -624,10 +621,9 @@ NativeGetMicroseconds(void) static void NativeGetTime( Tcl_Time *timePtr, - ClientData dummy) + TCL_UNUSED(ClientData)) { Tcl_WideInt usecSincePosixEpoch; - (void)dummy; /* * Try to use high resolution timer. @@ -670,10 +666,8 @@ void TclWinResetTimerResolution(void); static void StopCalibration( - ClientData dummy) /* Client data is unused */ + TCL_UNUSED(ClientData)) { - (void)dummy; - SetEvent(timeInfo.exitEvent); /* @@ -714,11 +708,10 @@ StopCalibration( static DWORD WINAPI CalibrationThread( - LPVOID arg) + TCL_UNUSED(LPVOID)) { FILETIME curFileTime; DWORD waitResult; - (void)arg; /* * Get initial system time and performance counter. |