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 From a5406cf5c0fe5d9df20c96546433bbd707937675 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 9 Mar 2020 14:34:27 +0000 Subject: more --- generic/tclVar.c | 79 +++++++++++--------------------- generic/tclZipfs.c | 129 +++++++++++++++++------------------------------------ 2 files changed, 69 insertions(+), 139 deletions(-) diff --git a/generic/tclVar.c b/generic/tclVar.c index 2c2f967..40170dc 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); @@ -1528,13 +1527,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); @@ -2824,14 +2822,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) { /* @@ -2893,7 +2890,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. */ @@ -2902,7 +2899,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 ...?"); @@ -2960,7 +2956,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. */ @@ -2969,7 +2965,6 @@ Tcl_LappendObjCmd( int numElems, createdNewObj; Var *varPtr, *arrayPtr; int result; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "varName ?value ...?"); @@ -3167,17 +3162,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) @@ -3186,7 +3181,6 @@ ArrayForNRCmd( ArraySearch *searchPtr = NULL; Var *varPtr; int isArray, numVars; - (void)dummy; /* * array for {k v} a body @@ -3409,7 +3403,7 @@ ArrayPopulateSearch( static int ArrayStartSearchCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3417,7 +3411,6 @@ ArrayStartSearchCmd( Var *varPtr; int isArray; ArraySearch *searchPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName"); @@ -3506,7 +3499,7 @@ ArrayDoneSearch( /* ARGSUSED */ static int ArrayAnyMoreCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3516,7 +3509,6 @@ ArrayAnyMoreCmd( Tcl_Obj *varNameObj, *searchObj; int gotValue, isArray; ArraySearch *searchPtr; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId"); @@ -3586,7 +3578,7 @@ ArrayAnyMoreCmd( /* ARGSUSED */ static int ArrayNextElementCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3595,7 +3587,6 @@ ArrayNextElementCmd( Tcl_Obj *varNameObj, *searchObj; ArraySearch *searchPtr; int isArray; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId"); @@ -3668,7 +3659,7 @@ ArrayNextElementCmd( /* ARGSUSED */ static int ArrayDoneSearchCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3678,7 +3669,6 @@ ArrayDoneSearchCmd( Tcl_Obj *varNameObj, *searchObj; ArraySearch *searchPtr; int isArray; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId"); @@ -3730,14 +3720,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"); @@ -3772,7 +3761,7 @@ ArrayExistsCmd( /* ARGSUSED */ static int ArrayGetCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3783,7 +3772,6 @@ ArrayGetCmd( Tcl_HashSearch search; const char *pattern; int i, count, result, isArray; - (void)dummy; switch (objc) { case 2: @@ -3933,7 +3921,7 @@ ArrayGetCmd( /* ARGSUSED */ static int ArrayNamesCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3947,7 +3935,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?"); @@ -4102,7 +4089,7 @@ TclFindArrayPtrElements( /* ARGSUSED */ static int ArraySetCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -4111,7 +4098,6 @@ ArraySetCmd( Tcl_Obj *arrayElemObj; Var *varPtr, *arrayPtr; int result, i; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName list"); @@ -4279,7 +4265,7 @@ ArraySetCmd( /* ARGSUSED */ static int ArraySizeCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -4288,7 +4274,6 @@ ArraySizeCmd( Tcl_HashSearch search; Var *varPtr2; int isArray, size = 0; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName"); @@ -4340,7 +4325,7 @@ ArraySizeCmd( /* ARGSUSED */ static int ArrayStatsCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -4349,7 +4334,6 @@ ArrayStatsCmd( Tcl_Obj *varNameObj; char *stats; int isArray; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName"); @@ -4396,7 +4380,7 @@ ArrayStatsCmd( /* ARGSUSED */ static int ArrayUnsetCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -4407,7 +4391,6 @@ ArrayUnsetCmd( const char *pattern; const int unsetFlags = 0; /* Should this be TCL_LEAVE_ERR_MSG? */ int isArray; - (void)dummy; switch (objc) { case 2: @@ -5023,7 +5006,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. */ @@ -5033,7 +5016,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. @@ -5128,7 +5110,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. */ @@ -5139,7 +5121,6 @@ Tcl_VariableObjCmd( Tcl_Obj *varValuePtr; int i, result; Tcl_Obj *varNamePtr, *tailPtr; - (void)dummy; for (i=1 ; iflags = VAR_IN_HASHTABLE; @@ -6669,7 +6645,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. */ @@ -6681,7 +6657,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 7fae81e..f9a6a8f 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); #ifndef TCL_NO_DEPRECATED @@ -458,7 +457,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 */ @@ -1889,12 +1888,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, @@ -1925,7 +1923,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. */ @@ -1933,7 +1931,6 @@ ZipFSMountBufferObjCmd( const char *mountPoint; /* Mount point path. */ unsigned char *data; int length; - (void)dummy; if (objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?mountpoint? ?data?"); @@ -1978,15 +1975,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; } @@ -2009,12 +2002,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"); @@ -2042,14 +2034,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"); @@ -2822,13 +2813,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; @@ -2844,13 +2833,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; @@ -2883,13 +2870,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?"); @@ -2906,13 +2891,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; @@ -2945,7 +2928,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. */ @@ -2954,7 +2937,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?"); @@ -3002,7 +2984,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. */ @@ -3010,7 +2992,6 @@ ZipFSExistsObjCmd( char *filename; int exists; Tcl_DString ds; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "filename"); @@ -3056,14 +3037,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"); @@ -3107,7 +3087,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. */ @@ -3117,7 +3097,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?"); @@ -3305,15 +3284,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(); @@ -3344,11 +3319,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; @@ -3611,12 +3585,9 @@ ZipChannelSeek( static void ZipChannelWatchChannel( - void *instanceData, - int mask) + TCL_UNUSED(ClientData), + TCL_UNUSED(int) /*mask*/) { - (void)instanceData; - (void)mask; - return; } @@ -3639,14 +3610,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; } @@ -3672,13 +3639,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)))) { @@ -4199,10 +4165,8 @@ ZipFSAccessProc( static Tcl_Obj * ZipFSFilesystemSeparatorProc( - Tcl_Obj *pathPtr) + TCL_UNUSED(Tcl_Obj *) /*pathPtr*/) { - (void)pathPtr; - return Tcl_NewStringObj("/", -1); } @@ -4227,7 +4191,7 @@ ZipFSFilesystemSeparatorProc( static int ZipFSMatchInDirectoryProc( - Tcl_Interp *dummy, /* Current interpreter. */ + TCL_UNUSED(Tcl_Interp *), Tcl_Obj *result, Tcl_Obj *pathPtr, const char *pattern, @@ -4240,7 +4204,6 @@ ZipFSMatchInDirectoryProc( size_t len; char *pat, *prefix, *path; Tcl_DString dsPref; - (void)dummy; if (!normPathPtr) { return -1; @@ -4419,14 +4382,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) { @@ -4516,8 +4478,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", @@ -4528,8 +4490,6 @@ ZipFSFileAttrStringsProc( "-permissions", NULL, }; - (void)pathPtr; - (void)objPtrRef; return attrs; } @@ -4628,14 +4588,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); @@ -4657,9 +4613,8 @@ ZipFSFileAttrsSetProc( static Tcl_Obj * ZipFSFilesystemPathTypeProc( - Tcl_Obj *pathPtr) + TCL_UNUSED(Tcl_Obj *) /*pathPtr*/) { - (void)pathPtr; return Tcl_NewStringObj("zip", -1); } @@ -4941,18 +4896,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]); @@ -5056,8 +5013,6 @@ TclZipfs_AppHook( #ifdef _WIN32 Tcl_DStringFree(&ds); #endif /* _WIN32 */ -#else - (void)argcPtr; #endif /* SUPPORT_BUILTIN_ZIP_INSTALL */ } return TCL_OK; -- cgit v0.12 From bd4dfc850ea167c4a0081befe5c8a8bd9cdbd58a Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 9 Mar 2020 14:40:27 +0000 Subject: Bring TCL_UNUSED to macosx sources. --- macosx/tclMacOSXBundle.c | 3 +-- macosx/tclMacOSXNotify.c | 14 +++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/macosx/tclMacOSXBundle.c b/macosx/tclMacOSXBundle.c index 81d8d04..0c68e2d 100644 --- a/macosx/tclMacOSXBundle.c +++ b/macosx/tclMacOSXBundle.c @@ -197,7 +197,7 @@ Tcl_MacOSXOpenBundleResources( int Tcl_MacOSXOpenVersionedBundleResources( - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), const char *bundleName, const char *bundleVersion, int hasResourceFile, @@ -208,7 +208,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 1523400..8f1dbba 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. -- cgit v0.12 From 1baa16d30dfb27a4df336268d8acae3af327054a Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 9 Mar 2020 14:43:18 +0000 Subject: need internal header now. --- macosx/tclMacOSXBundle.c | 1 + 1 file changed, 1 insertion(+) diff --git a/macosx/tclMacOSXBundle.c b/macosx/tclMacOSXBundle.c index 0c68e2d..01b5de4 100644 --- a/macosx/tclMacOSXBundle.c +++ b/macosx/tclMacOSXBundle.c @@ -12,6 +12,7 @@ */ #include "tclPort.h" +#include "tclInt.h" #ifdef HAVE_COREFOUNDATION #include -- cgit v0.12 From 8816b1a873ea5b502c1fcefc3b56875e281f0458 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 9 Mar 2020 15:45:52 +0000 Subject: TCL_UNUSED in the unix sources. --- unix/tclEpollNotfy.c | 2 +- unix/tclKqueueNotfy.c | 2 +- unix/tclLoadDl.c | 8 ++------ unix/tclLoadDyld.c | 12 +++--------- unix/tclSelectNotfy.c | 5 ++--- unix/tclUnixChan.c | 9 +++------ unix/tclUnixCompat.c | 6 ++---- unix/tclUnixFCmd.c | 40 +++++++++++++--------------------------- unix/tclUnixFile.c | 18 +++++++++++------- unix/tclUnixInit.c | 21 +++++++++++---------- unix/tclUnixPipe.c | 9 +++------ unix/tclUnixSock.c | 22 ++++++---------------- unix/tclUnixTest.c | 33 ++++++++++----------------------- unix/tclUnixTime.c | 12 ++++-------- unix/tclXtNotify.c | 4 ++-- unix/tclXtTest.c | 2 +- 16 files changed, 75 insertions(+), 130 deletions(-) diff --git a/unix/tclEpollNotfy.c b/unix/tclEpollNotfy.c index e164e7e..406b7ca 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 e2ff4f4..4daab7c 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 052aa07..07fd30b 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 9d4e99c..e95d269 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 a7788a6..79475f6 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 0636b6d..045aad0 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -359,12 +359,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; @@ -1944,9 +1943,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. */ @@ -1956,7 +1954,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 c4ee1d5..7717721 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -336,10 +336,9 @@ TclpGetPwUid( #ifdef NEED_PW_CLEANER static void FreePwBuf( - ClientData dummy) + TCL_UNUSED(ClientData)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; ckfree(tsdPtr->pbuf); } @@ -520,10 +519,9 @@ TclpGetGrGid( #ifdef NEED_GR_CLEANER static void FreeGrBuf( - ClientData dummy) + TCL_UNUSED(ClientData)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; ckfree(tsdPtr->gbuf); } diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 9018bd1..473949a 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -1230,16 +1230,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: @@ -1282,14 +1279,13 @@ TraversalDelete( static int CopyFileAtts( - const char *src, /* Path name of source file (native). */ + TCL_UNUSED(const char *) /*src*/, /* Path name of source file (native). */ 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); @@ -1341,14 +1337,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); @@ -1396,14 +1391,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); @@ -1449,13 +1443,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); @@ -1492,14 +1485,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; @@ -1559,14 +1551,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; @@ -1626,7 +1617,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. */ { @@ -1636,7 +1627,6 @@ SetPermissionsAttribute( const char *native; const char *modeStringPtr = TclGetString(attributePtr); int scanned = TclParseAllWhiteSpace(modeStringPtr, -1); - (void)objIndex; /* * First supply support for octal number format @@ -1749,7 +1739,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 */ { @@ -1758,7 +1748,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 @@ -1937,7 +1926,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 @@ -1956,7 +1945,6 @@ TclpObjNormalizePath( #ifndef NO_REALPATH char normPath[MAXPATHLEN]; #endif - (void)dummy; currentPathEndPosition = path + nextCheckpoint; if (*currentPathEndPosition == '/') { @@ -2501,13 +2489,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); @@ -2543,14 +2530,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 9f4eb77..602ca63 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__ int 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 /* *---------------------------------------------------------------------- @@ -1020,9 +1025,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 0e61e85..a86fcde 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -1053,26 +1053,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 31d9671..f47e021 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 dd8ca30..325e361 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -338,10 +338,8 @@ Tcl_GetHostName(void) int TclpHasSockets( - Tcl_Interp *dummy) /* Not used. */ + TCL_UNUSED(Tcl_Interp *)) { - (void)dummy; - return TCL_OK; } @@ -627,12 +625,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 @@ -689,13 +686,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. @@ -1110,11 +1106,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; @@ -1135,12 +1130,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); } @@ -1771,7 +1762,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 */ @@ -1780,7 +1771,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 fb649d2..07b3065 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -508,11 +508,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 */ } @@ -536,10 +534,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; @@ -606,9 +603,8 @@ SetTZIfNecessary(void) static void CleanupMemory( - ClientData dummy) + TCL_UNUSED(ClientData)) { - (void)dummy; ckfree(lastTZ); } #endif /* TCL_NO_DEPRECATED */ diff --git a/unix/tclXtNotify.c b/unix/tclXtNotify.c index 490b739..cf99fb2 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. */ -- cgit v0.12 From 683144e7f0a62bea19fb406f3f3cb377a9eb7d58 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 9 Mar 2020 16:13:11 +0000 Subject: TCL_UNUSED for win sources. --- win/tclAppInit.c | 3 +-- win/tclWin32Dll.c | 6 ++---- win/tclWinChan.c | 13 ++++--------- win/tclWinConsole.c | 20 ++++++-------------- win/tclWinFCmd.c | 11 +++-------- win/tclWinFile.c | 3 +-- win/tclWinLoad.c | 12 +++--------- win/tclWinPipe.c | 18 ++++++------------ win/tclWinSerial.c | 19 ++++++------------- win/tclWinSock.c | 19 ++++++------------- win/tclWinTest.c | 40 +++++++++++++--------------------------- win/tclWinTime.c | 17 +++++------------ 12 files changed, 56 insertions(+), 125 deletions(-) diff --git a/win/tclAppInit.c b/win/tclAppInit.c index 0a47000..105af65 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 821ac35..156ec9e 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 7ffd6b5..b13dbd2 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -186,10 +186,8 @@ FileInit(void) static void FileChannelExitHandler( - ClientData dummy) /* Old window proc */ + TCL_UNUSED(ClientData)) { - (void)dummy; - Tcl_DeleteEventSource(FileSetupProc, FileCheckProc, NULL); } @@ -212,13 +210,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; @@ -256,13 +253,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; @@ -396,14 +392,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 4c1aec0..3b8753b 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 b9a5342..347c5e9 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,14 +1590,13 @@ 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. */ { int pathc, i; Tcl_Obj *splitPath; - (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], Tcl_GetString(fileName))); diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 1380217..d2777d7 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -2541,7 +2541,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 */ @@ -2552,7 +2552,6 @@ TclpObjNormalizePath( Tcl_Obj *temp = NULL; int isDrive = 1; Tcl_DString ds; /* Some workspace. */ - (void)dummy; Tcl_DStringInit(&dsNorm); path = Tcl_GetString(pathPtr); diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c index 3f48f7c..1a74618 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 26f0b3e..7066bd2 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]; @@ -3204,8 +3200,6 @@ TclpOpenTemporaryFile( DWORD flags = FILE_ATTRIBUTE_TEMPORARY; int length, 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 7884453..328fbad 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 ad9ed72..cd07a8f 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -1042,13 +1042,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 @@ -1189,7 +1188,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; @@ -1197,7 +1196,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 @@ -1670,11 +1668,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; @@ -2620,10 +2617,8 @@ SocketsEnabled(void) /* ARGSUSED */ static void SocketExitHandler( - ClientData dummy) /* Not used. */ + TCL_UNUSED(ClientData)) { - (void)dummy; - Tcl_MutexLock(&socketMutex); /* @@ -2656,13 +2651,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; @@ -2702,13 +2696,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 bc3701d..d78d5f1 100644 --- a/win/tclWinTest.c +++ b/win/tclWinTest.c @@ -33,21 +33,14 @@ * 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 int TestSizeCmd(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 TestSizeCmd; 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; /* *---------------------------------------------------------------------- @@ -105,7 +98,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. */ @@ -113,7 +106,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 ..."); @@ -182,7 +174,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. */ @@ -191,7 +183,6 @@ TestvolumetypeCmd( int found; char volType[VOL_BUF_SIZE]; const char *path; - (void)dummy; if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?name?"); @@ -249,7 +240,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 */ @@ -262,7 +253,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, ""); @@ -299,13 +289,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"); @@ -320,12 +309,11 @@ TestwinsleepCmd( static int TestSizeCmd( - ClientData dummy, /* Unused */ + TCL_UNUSED(ClientData), Tcl_Interp* interp, /* Tcl interpreter */ int objc, /* Parameter count */ Tcl_Obj *const * objv) /* Parameter vector */ { - (void)dummy; if (objc != 2) { goto syntax; @@ -370,7 +358,7 @@ syntax: static int TestExceptionCmd( - ClientData dummy, /* Unused */ + TCL_UNUSED(ClientData), Tcl_Interp* interp, /* Tcl interpreter */ int objc, /* Argument count */ Tcl_Obj *const objv[]) /* Argument vector */ @@ -397,7 +385,6 @@ TestExceptionCmd( EXCEPTION_GUARD_PAGE, EXCEPTION_INVALID_HANDLE, CONTROL_C_EXIT }; int cmd; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 0, objv, ""); @@ -660,13 +647,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 4a55c3f..8546fc2 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -413,12 +413,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. */ @@ -652,10 +649,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. @@ -698,10 +694,8 @@ void TclWinResetTimerResolution(void); static void StopCalibration( - ClientData dummy) /* Client data is unused */ + TCL_UNUSED(ClientData)) { - (void)dummy; - SetEvent(timeInfo.exitEvent); /* @@ -979,11 +973,10 @@ ComputeGMT( static DWORD WINAPI CalibrationThread( - LPVOID arg) + TCL_UNUSED(LPVOID)) { FILETIME curFileTime; DWORD waitResult; - (void)arg; /* * Get initial system time and performance counter. -- cgit v0.12 From 065483ce8b22e7da470427493d68f36e6a53b80b Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 9 Mar 2020 16:24:52 +0000 Subject: Mac fix --- unix/tclUnixFCmd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 473949a..bd93ad2 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -1279,7 +1279,11 @@ TraversalDelete( static int CopyFileAtts( - TCL_UNUSED(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 */ -- cgit v0.12