diff options
author | dgp <dgp@users.sourceforge.net> | 2020-03-06 21:22:28 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2020-03-06 21:22:28 (GMT) |
commit | 81e31a16d82ff906b74f9b726637a3f146b77a4d (patch) | |
tree | 7ddc92d372f6d334e6eb95a6edc1784b8fd6c095 /generic | |
parent | a619fad748e59645edddc28028b34018cb9b3035 (diff) | |
download | tcl-81e31a16d82ff906b74f9b726637a3f146b77a4d.zip tcl-81e31a16d82ff906b74f9b726637a3f146b77a4d.tar.gz tcl-81e31a16d82ff906b74f9b726637a3f146b77a4d.tar.bz2 |
More unused arguments through the IO code.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIOCmd.c | 80 | ||||
-rw-r--r-- | generic/tclIORChan.c | 23 | ||||
-rw-r--r-- | generic/tclIORTrans.c | 15 | ||||
-rw-r--r-- | generic/tclIOUtil.c | 21 |
4 files changed, 47 insertions, 92 deletions
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 70206be..916936b 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -36,18 +36,14 @@ static Tcl_ThreadDataKey dataKey; * Static functions for this file: */ -static void FinalizeIOCmdTSD(ClientData clientData); -static Tcl_TcpAcceptProc AcceptCallbackProc; -static int ChanPendingObjCmd(ClientData unused, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static int ChanTruncateObjCmd(ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static void RegisterTcpServerInterpCleanup(Tcl_Interp *interp, - AcceptCallback *acceptCallbackPtr); -static void TcpAcceptCallbacksDeleteProc(ClientData clientData, - Tcl_Interp *interp); +static Tcl_ExitProc FinalizeIOCmdTSD; +static Tcl_TcpAcceptProc AcceptCallbackProc; +static Tcl_ObjCmdProc ChanPendingObjCmd; +static Tcl_ObjCmdProc ChanTruncateObjCmd; +static void RegisterTcpServerInterpCleanup( + Tcl_Interp *interp, + AcceptCallback *acceptCallbackPtr); +static Tcl_InterpDeleteProc TcpAcceptCallbacksDeleteProc; static void TcpServerCloseProc(ClientData callbackData); static void UnregisterTcpServerInterpCleanupProc( Tcl_Interp *interp, @@ -71,10 +67,9 @@ static void UnregisterTcpServerInterpCleanupProc( static void FinalizeIOCmdTSD( - ClientData dummy) /* Not used. */ + TCL_UNUSED(ClientData)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - (void)dummy; if (tsdPtr->stdoutObjPtr != NULL) { Tcl_DecrRefCount(tsdPtr->stdoutObjPtr); @@ -103,7 +98,7 @@ FinalizeIOCmdTSD( /* ARGSUSED */ int Tcl_PutsObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -114,7 +109,6 @@ Tcl_PutsObjCmd( int newline; /* Add a newline at end? */ int result; /* Result of puts operation. */ int mode; /* Mode in which channel is opened. */ - (void)dummy; switch (objc) { case 2: /* [puts $x] */ @@ -231,7 +225,7 @@ Tcl_PutsObjCmd( /* ARGSUSED */ int Tcl_FlushObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -239,7 +233,6 @@ Tcl_FlushObjCmd( Tcl_Obj *chanObjPtr; Tcl_Channel chan; /* The channel to flush on. */ int mode; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "channelId"); @@ -297,7 +290,7 @@ Tcl_FlushObjCmd( /* ARGSUSED */ int Tcl_GetsObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -307,7 +300,6 @@ Tcl_GetsObjCmd( int mode; /* Mode in which channel is opened. */ Tcl_Obj *linePtr, *chanObjPtr; int code = TCL_OK; - (void)dummy; if ((objc != 2) && (objc != 3)) { Tcl_WrongNumArgs(interp, 1, objv, "channelId ?varName?"); @@ -383,7 +375,7 @@ Tcl_GetsObjCmd( /* ARGSUSED */ int Tcl_ReadObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -394,7 +386,6 @@ Tcl_ReadObjCmd( int charactersRead; /* How many characters were read? */ int mode; /* Mode in which channel is opened. */ Tcl_Obj *resultPtr, *chanObjPtr; - (void)dummy; if ((objc != 2) && (objc != 3)) { Interp *iPtr; @@ -528,7 +519,7 @@ Tcl_ReadObjCmd( /* ARGSUSED */ int Tcl_SeekObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -542,7 +533,6 @@ Tcl_SeekObjCmd( "start", "current", "end", NULL }; static const int modeArray[] = {SEEK_SET, SEEK_CUR, SEEK_END}; - (void)dummy; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 1, objv, "channelId offset ?origin?"); @@ -605,7 +595,7 @@ Tcl_SeekObjCmd( /* ARGSUSED */ int Tcl_TellObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -613,7 +603,6 @@ Tcl_TellObjCmd( Tcl_Channel chan; /* The channel to tell on. */ Tcl_WideInt newLoc; int code; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "channelId"); @@ -669,7 +658,7 @@ Tcl_TellObjCmd( /* ARGSUSED */ int Tcl_CloseObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -679,7 +668,6 @@ Tcl_CloseObjCmd( "read", "write", NULL }; static const int dirArray[] = {TCL_CLOSE_READ, TCL_CLOSE_WRITE}; - (void)dummy; if ((objc != 2) && (objc != 3)) { Tcl_WrongNumArgs(interp, 1, objv, "channelId ?direction?"); @@ -779,7 +767,7 @@ Tcl_CloseObjCmd( /* ARGSUSED */ int Tcl_FconfigureObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -787,7 +775,6 @@ Tcl_FconfigureObjCmd( const char *optionName, *valueName; Tcl_Channel chan; /* The channel to set a mode on. */ int i; /* Iterate over arg-value pairs. */ - (void)dummy; if ((objc < 2) || (((objc % 2) == 1) && (objc != 3))) { Tcl_WrongNumArgs(interp, 1, objv, "channelId ?-option value ...?"); @@ -856,13 +843,12 @@ Tcl_FconfigureObjCmd( /* ARGSUSED */ int Tcl_EofObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "channelId"); @@ -897,7 +883,7 @@ Tcl_EofObjCmd( /* ARGSUSED */ int Tcl_ExecObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -915,7 +901,6 @@ Tcl_ExecObjCmd( enum options { EXEC_IGNORESTDERR, EXEC_KEEPNEWLINE, EXEC_LAST }; - (void)dummy; /* * Check for any leading option arguments. @@ -1066,14 +1051,13 @@ Tcl_ExecObjCmd( /* ARGSUSED */ int Tcl_FblockedObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; int mode; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "channelId"); @@ -1114,7 +1098,7 @@ Tcl_FblockedObjCmd( /* ARGSUSED */ int Tcl_OpenObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1122,7 +1106,6 @@ Tcl_OpenObjCmd( int pipeline, prot; const char *modeString, *what; Tcl_Channel chan; - (void)dummy; if ((objc < 2) || (objc > 4)) { Tcl_WrongNumArgs(interp, 1, objv, "fileName ?access? ?permissions?"); @@ -1241,12 +1224,11 @@ static void TcpAcceptCallbacksDeleteProc( ClientData clientData, /* Data which was passed when the assocdata * was registered. */ - Tcl_Interp *dummy) /* Interpreter being deleted - not used. */ + TCL_UNUSED(Tcl_Interp *)) { Tcl_HashTable *hTblPtr = (Tcl_HashTable *)clientData; Tcl_HashEntry *hPtr; Tcl_HashSearch hSearch; - (void)dummy; for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); hPtr != NULL; hPtr = Tcl_NextHashEntry(&hSearch)) { @@ -1492,7 +1474,7 @@ TcpServerCloseProc( int Tcl_SocketObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1511,7 +1493,6 @@ Tcl_SocketObjCmd( const char *host, *port, *myaddr = NULL; Tcl_Obj *script = NULL; Tcl_Channel chan; - (void)dummy; if (TclpHasSockets(interp) != TCL_OK) { return TCL_ERROR; @@ -1735,7 +1716,7 @@ Tcl_SocketObjCmd( int Tcl_FcopyObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1746,7 +1727,6 @@ Tcl_FcopyObjCmd( Tcl_Obj *cmdPtr; static const char *const switches[] = { "-size", "-command", NULL }; enum { FcopySize, FcopyCommand }; - (void)dummy; if ((objc < 3) || (objc > 7) || (objc == 4) || (objc == 6)) { Tcl_WrongNumArgs(interp, 1, objv, @@ -1832,7 +1812,7 @@ Tcl_FcopyObjCmd( /* ARGSUSED */ static int ChanPendingObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1841,7 +1821,6 @@ ChanPendingObjCmd( int index, mode; static const char *const options[] = {"input", "output", NULL}; enum options {PENDING_INPUT, PENDING_OUTPUT}; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "mode channelId"); @@ -1895,14 +1874,13 @@ ChanPendingObjCmd( static int ChanTruncateObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; Tcl_WideInt length; - (void)dummy; if ((objc < 2) || (objc > 3)) { Tcl_WrongNumArgs(interp, 1, objv, "channelId ?length?"); @@ -1969,7 +1947,7 @@ ChanTruncateObjCmd( static int ChanPipeObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1977,7 +1955,6 @@ ChanPipeObjCmd( Tcl_Channel rchan, wchan; const char *channelNames[2]; Tcl_Obj *resultPtr; - (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, ""); @@ -2021,12 +1998,11 @@ ChanPipeObjCmd( int TclChannelNamesCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - (void)dummy; if (objc < 1 || objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?pattern?"); return TCL_ERROR; diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 42d1e8a..8a5675a 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -425,7 +425,7 @@ static void SrcExitProc(ClientData clientData); static void ForwardSetObjError(ForwardParam *p, Tcl_Obj *objPtr); static ReflectedChannelMap * GetThreadReflectedChannelMap(void); -static void DeleteThreadReflectedChannelMap(ClientData clientData); +static Tcl_ExitProc DeleteThreadReflectedChannelMap; #endif /* TCL_THREADS */ @@ -452,8 +452,7 @@ static int InvokeTclMethod(ReflectedChannel *rcPtr, Tcl_Obj *argTwoObj, Tcl_Obj **resultObjPtr); static ReflectedChannelMap * GetReflectedChannelMap(Tcl_Interp *interp); -static void DeleteReflectedChannelMap(ClientData clientData, - Tcl_Interp *interp); +static Tcl_InterpDeleteProc DeleteReflectedChannelMap; static int ErrnoReturn(ReflectedChannel *rcPtr, Tcl_Obj *resObj); static void MarkDead(ReflectedChannel *rcPtr); @@ -498,7 +497,7 @@ static const char *msg_dstlost = "-code 1 -level 0 -errorcode NONE -errorinfo int TclChanCreateObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -524,7 +523,6 @@ TclChanCreateObjCmd( * this interp. */ Tcl_HashEntry *hPtr; /* Entry in the above map */ int isNew; /* Placeholder. */ - (void)dummy; /* * Syntax: chan create MODE CMDPREFIX @@ -780,7 +778,7 @@ typedef struct { static int ReflectEventRun( Tcl_Event *ev, - int flags) + TCL_UNUSED(int) /*flags*/) { /* OWNER thread * @@ -790,7 +788,6 @@ ReflectEventRun( */ ReflectEvent *e = (ReflectEvent *) ev; - (void)flags; Tcl_NotifyChannel(e->rcPtr->chan, e->events); return 1; @@ -819,7 +816,7 @@ ReflectEventDelete( int TclChanPostEventObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -848,7 +845,6 @@ TclChanPostEventObjCmd( ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in * this interp. */ Tcl_HashEntry *hPtr; /* Entry in the above map */ - (void)dummy; /* * Number of arguments... @@ -2519,8 +2515,7 @@ GetReflectedChannelMap( if (rcmPtr == NULL) { rcmPtr = (ReflectedChannelMap *)ckalloc(sizeof(ReflectedChannelMap)); Tcl_InitHashTable(&rcmPtr->map, TCL_STRING_KEYS); - Tcl_SetAssocData(interp, RCMKEY, - (Tcl_InterpDeleteProc *) DeleteReflectedChannelMap, rcmPtr); + Tcl_SetAssocData(interp, RCMKEY, DeleteReflectedChannelMap, rcmPtr); } return rcmPtr; } @@ -2746,14 +2741,13 @@ GetThreadReflectedChannelMap(void) static void DeleteThreadReflectedChannelMap( - ClientData dummy) /* The per-thread data structure. */ + TCL_UNUSED(ClientData)) { Tcl_HashSearch hSearch; /* Search variable. */ Tcl_HashEntry *hPtr; /* Search variable. */ Tcl_ThreadId self = Tcl_GetCurrentThread(); ReflectedChannelMap *rcmPtr; /* The map */ ForwardingResult *resultPtr; - (void)dummy; /* * The origin thread for one or more reflected channels is gone. @@ -2971,7 +2965,7 @@ ForwardOpToHandlerThread( static int ForwardProc( Tcl_Event *evGPtr, - int mask) + TCL_UNUSED(int) /* mask */) { /* * HANDLER thread. @@ -3000,7 +2994,6 @@ ForwardProc( ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in * this interp. */ Tcl_HashEntry *hPtr; /* Entry in the above map */ - (void)mask; /* * Ignore the event if no one is waiting for its result anymore. diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index 82fce33..9a82cdb 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -503,7 +503,7 @@ static int TransformLimit(ReflectedTransform *rtPtr, int TclChanPushObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -530,7 +530,6 @@ TclChanPushObjCmd( * in this interp. */ Tcl_HashEntry *hPtr; /* Entry in the above map */ int isNew; /* Placeholder. */ - (void)dummy; /* * Syntax: chan push CHANNEL CMDPREFIX @@ -749,7 +748,7 @@ TclChanPushObjCmd( int TclChanPopObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -767,7 +766,6 @@ TclChanPopObjCmd( const char *chanId; /* Tcl level channel handle */ Tcl_Channel chan; /* Channel associated to the handle */ int mode; /* Channel r/w mode */ - (void)dummy; /* * Number of arguments... @@ -1755,7 +1753,7 @@ static ReflectedTransform * NewReflectedTransform( Tcl_Interp *interp, Tcl_Obj *cmdpfxObj, - int mode, + TCL_UNUSED(int) /*mode*/, Tcl_Obj *handleObj, Tcl_Channel parentChan) { @@ -1763,7 +1761,6 @@ NewReflectedTransform( int listc; Tcl_Obj **listv; int i; - (void)mode; rtPtr = (ReflectedTransform *)ckalloc(sizeof(ReflectedTransform)); @@ -2311,14 +2308,13 @@ GetThreadReflectedTransformMap(void) static void DeleteThreadReflectedTransformMap( - ClientData dummy) /* The per-thread data structure. */ + TCL_UNUSED(ClientData)) { Tcl_HashSearch hSearch; /* Search variable. */ Tcl_HashEntry *hPtr; /* Search variable. */ Tcl_ThreadId self = Tcl_GetCurrentThread(); ReflectedTransformMap *rtmPtr; /* The map */ ForwardingResult *resultPtr; - (void)dummy; /* * The origin thread for one or more reflected channels is gone. @@ -2506,7 +2502,7 @@ ForwardOpToOwnerThread( static int ForwardProc( Tcl_Event *evGPtr, - int mask) + TCL_UNUSED(int) /*mask*/) { /* * Notes regarding access to the referenced data. @@ -2531,7 +2527,6 @@ ForwardProc( /* Map of reflected channels with handlers in * this interp. */ Tcl_HashEntry *hPtr; /* Entry in the above map */ - (void)mask; /* * Ignore the event if no one is waiting for its result anymore. diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 6179637..4a79962 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -1228,15 +1228,12 @@ FsAddMountsToGlobResult( void Tcl_FSMountsChanged( - const Tcl_Filesystem *fsPtr) -{ + TCL_UNUSED(const Tcl_Filesystem *) /*fsPtr*/) /* * fsPtr is currently unused. In the future it might invalidate files for * a particular filesystem, or take some other more advanced action. */ - - (void)fsPtr; - +{ /* * Increment the filesystem epoch to invalidate every existing cached * internal representation. @@ -2314,11 +2311,9 @@ Tcl_FSUtime( static const char *const * NativeFileAttrStrings( - Tcl_Obj *pathPtr, - Tcl_Obj **objPtrRef) + TCL_UNUSED(Tcl_Obj *), + TCL_UNUSED(Tcl_Obj **)) { - (void)pathPtr; - (void)objPtrRef; return tclpFileAttrStrings; } @@ -3020,14 +3015,11 @@ Tcl_FSLoadFile( Tcl_LoadHandle *handlePtr, /* A place to store the token for the loaded * object. Can be passed to * (*unloadProcPtr)() to unload the file. */ - Tcl_FSUnloadFileProc **unloadProcPtr) - /* A place to store a pointer to the function - * that unloads the object. */ + TCL_UNUSED(Tcl_FSUnloadFileProc **)) { const char *symbols[3]; void *procPtrs[2]; int res; - (void)unloadProcPtr; symbols[0] = sym1; symbols[1] = sym2; @@ -4686,10 +4678,9 @@ Tcl_FSPathSeparator( static Tcl_Obj * NativeFilesystemSeparator( - Tcl_Obj *pathPtr) + TCL_UNUSED(Tcl_Obj *) /*pathPtr*/) { const char *separator = NULL; /* lint */ - (void)pathPtr; switch (tclPlatform) { case TCL_PLATFORM_UNIX: |