From b8ffa18096ee9a37d5105ec6c48c0b6eeea7dbc4 Mon Sep 17 00:00:00 2001 From: dgp Date: Sat, 7 Mar 2020 00:41:42 +0000 Subject: Unused arguments in the OO source code files. --- generic/tclOO.c | 30 ++++++------------ generic/tclOOBasic.c | 39 ++++++++--------------- generic/tclOOCall.c | 9 ++---- generic/tclOODefineCmds.c | 72 ++++++++++++++--------------------------- generic/tclOOInfo.c | 81 ++++++++++++++++------------------------------- generic/tclOOMethod.c | 54 ++++++++++++------------------- 6 files changed, 98 insertions(+), 187 deletions(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index 2d09f3a..322daff 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -77,13 +77,10 @@ static inline void InitClassPath(Tcl_Interp * interp, Class *clsPtr); static void InitClassSystemRoots(Tcl_Interp *interp, Foundation *fPtr); static int InitFoundation(Tcl_Interp *interp); -static void KillFoundation(ClientData clientData, - Tcl_Interp *interp); +static Tcl_InterpDeleteProc KillFoundation; static void MyDeleted(ClientData clientData); static void ObjectNamespaceDeleted(ClientData clientData); -static void ObjectRenamedTrace(ClientData clientData, - Tcl_Interp *interp, const char *oldName, - const char *newName, int flags); +static Tcl_CommandTraceProc ObjectRenamedTrace; static inline void RemoveClass(Class **list, int num, int idx); static inline void RemoveObject(Object **list, int num, int idx); static inline void SquelchCachedName(Object *oPtr); @@ -569,13 +566,11 @@ DeletedHelpersNamespace( static void KillFoundation( - ClientData dummy, /* Pointer to the OO system foundation - * structure. */ - Tcl_Interp *interp) /* The interpreter containing the OO system - * foundation. */ + TCL_UNUSED(ClientData), + Tcl_Interp *interp) /* The interpreter containing the OO system + * foundation. */ { Foundation *fPtr = GetFoundation(interp); - (void)dummy; TclDecrRefCount(fPtr->unknownMethodNameObj); TclDecrRefCount(fPtr->constructorName); @@ -819,15 +814,12 @@ MyClassDeleted( static void ObjectRenamedTrace( ClientData clientData, /* The object being deleted. */ - Tcl_Interp *interp, /* The interpreter containing the object. */ - const char *oldName, /* What the object was (last) called. */ - const char *newName, /* What it's getting renamed to. (unused) */ + TCL_UNUSED(Tcl_Interp *), + TCL_UNUSED(const char *) /*oldName*/, + TCL_UNUSED(const char *) /*newName*/, int flags) /* Why was the object deleted? */ { Object *oPtr = (Object *)clientData; - (void)interp; - (void)oldName; - (void)newName; /* * If this is a rename and not a delete of the object, we just flush the @@ -2765,10 +2757,9 @@ TclOOObjectCmdCore( static int FinalizeObjectCall( ClientData data[], - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), int result) { - (void)dummy; /* * Dispose of the call chain, which drops the lock on the object's * structure. @@ -2927,11 +2918,10 @@ TclNRObjectContextInvokeNext( static int FinalizeNext( ClientData data[], - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), int result) { CallContext *contextPtr = (CallContext *)data[0]; - (void)dummy; /* * Restore the call chain context index as we've finished the inner invoke diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c index 5420c80..9f7b526 100644 --- a/generic/tclOOBasic.c +++ b/generic/tclOOBasic.c @@ -76,7 +76,7 @@ FinalizeConstruction( int TclOO_Class_Constructor( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -84,7 +84,6 @@ TclOO_Class_Constructor( { Object *oPtr = (Object *) Tcl_ObjectContextObject(context); Tcl_Obj **invoke, *nameObj; - (void)dummy; if (objc-1 > Tcl_ObjectContextSkippedArgs(context)) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -175,7 +174,7 @@ DecrRefsPostClassConstructor( int TclOO_Class_Create( - ClientData dummy, /* Ignored. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ @@ -185,7 +184,6 @@ TclOO_Class_Create( Object *oPtr = (Object *) Tcl_ObjectContextObject(context); const char *objName; int len; - (void)dummy; /* * Sanity check; should not be possible to invoke this method on a @@ -241,7 +239,7 @@ TclOO_Class_Create( int TclOO_Class_CreateNs( - ClientData dummy, /* Ignored. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ @@ -251,7 +249,6 @@ TclOO_Class_CreateNs( Object *oPtr = (Object *) Tcl_ObjectContextObject(context); const char *objName, *nsName; int len; - (void)dummy; /* * Sanity check; should not be possible to invoke this method on a @@ -315,7 +312,7 @@ TclOO_Class_CreateNs( int TclOO_Class_New( - ClientData dummy, /* Ignored. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ @@ -323,7 +320,6 @@ TclOO_Class_New( Tcl_Obj *const *objv) /* The actual arguments. */ { Object *oPtr = (Object *) Tcl_ObjectContextObject(context); - (void)dummy; /* * Sanity check; should not be possible to invoke this method on a @@ -360,7 +356,7 @@ TclOO_Class_New( int TclOO_Object_Destroy( - ClientData dummy, /* Ignored. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ @@ -369,7 +365,6 @@ TclOO_Object_Destroy( { Object *oPtr = (Object *) Tcl_ObjectContextObject(context); CallContext *contextPtr; - (void)dummy; if (objc != Tcl_ObjectContextSkippedArgs(context)) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -422,7 +417,7 @@ AfterNRDestructor( int TclOO_Object_Eval( - ClientData dummy, /* Ignored. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ @@ -435,7 +430,6 @@ TclOO_Object_Eval( CallFrame *framePtr, **framePtrPtr = &framePtr; Tcl_Obj *scriptPtr; CmdFrame *invoker; - (void)dummy; if (objc-1 < skip) { Tcl_WrongNumArgs(interp, skip, objv, "arg ?arg ...?"); @@ -524,7 +518,7 @@ FinalizeEval( int TclOO_Object_Unknown( - ClientData dummy, /* Ignored. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ @@ -539,7 +533,6 @@ TclOO_Object_Unknown( int numMethodNames, i, skip = Tcl_ObjectContextSkippedArgs(context); CallFrame *framePtr = ((Interp *) interp)->varFramePtr; Tcl_Obj *errorMsg; - (void)dummy; /* * If no method name, generate an error asking for a method name. (Only by @@ -631,7 +624,7 @@ TclOO_Object_Unknown( int TclOO_Object_LinkVar( - ClientData dummy, /* Ignored. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ @@ -642,7 +635,6 @@ TclOO_Object_LinkVar( Tcl_Object object = Tcl_ObjectContextObject(context); Namespace *savedNsPtr; int i; - (void)dummy; if (objc-Tcl_ObjectContextSkippedArgs(context) < 0) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -734,7 +726,7 @@ TclOO_Object_LinkVar( int TclOO_Object_VarName( - ClientData dummy, /* Ignored. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interpreter in which to create the object; * also used for error reporting. */ Tcl_ObjectContext context, /* The object/call context. */ @@ -745,7 +737,6 @@ TclOO_Object_VarName( Tcl_Obj *varNamePtr, *argPtr; CallFrame *framePtr = ((Interp *) interp)->varFramePtr; const char *arg; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context)+1 != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -873,7 +864,7 @@ TclOO_Object_VarName( int TclOONextObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -881,7 +872,6 @@ TclOONextObjCmd( Interp *iPtr = (Interp *) interp; CallFrame *framePtr = iPtr->varFramePtr; Tcl_ObjectContext context; - (void)dummy; /* * Start with sanity checks on the calling context to make sure that we @@ -910,7 +900,7 @@ TclOONextObjCmd( int TclOONextToObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -922,7 +912,6 @@ TclOONextToObjCmd( int i; Tcl_Object object; const char *methodType; - (void)dummy; /* * Start with sanity checks on the calling context to make sure that we @@ -1044,7 +1033,7 @@ NextRestoreFrame( int TclOOSelfObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1062,7 +1051,6 @@ TclOOSelfObjCmd( CallContext *contextPtr; Tcl_Obj *result[3]; int index; - (void)dummy; #define CurrentlyInvoked(contextPtr) \ ((contextPtr)->callPtr->chain[(contextPtr)->index]) @@ -1282,13 +1270,12 @@ TclOOSelfObjCmd( int TclOOCopyObjectCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Object oPtr, o2Ptr; - (void)dummy; if (objc < 2 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index 41f5334..9191989 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -376,11 +376,10 @@ TclOOInvokeContext( static int SetFilterFlags( ClientData data[], - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), int result) { CallContext *contextPtr = (CallContext *)data[0]; - (void)dummy; contextPtr->oPtr->flags |= FILTER_HANDLING; return result; @@ -389,11 +388,10 @@ SetFilterFlags( static int ResetFilterFlags( ClientData data[], - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), int result) { CallContext *contextPtr = (CallContext *)data[0]; - (void)dummy; contextPtr->oPtr->flags &= ~FILTER_HANDLING; return result; @@ -402,12 +400,11 @@ ResetFilterFlags( static int FinalizeMethodRefs( ClientData data[], - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), int result) { CallContext *contextPtr = (CallContext *)data[0]; int i; - (void)dummy; for (i = 0 ; i < contextPtr->callPtr->numChain ; i++) { TclOODelMethodRef(contextPtr->callPtr->chain[i].mPtr); diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index 14ec496..76cf4ed 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -695,7 +695,7 @@ RenameDeleteMethod( int TclOOUnknownDefinition( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -705,7 +705,6 @@ TclOOUnknownDefinition( Tcl_HashEntry *hPtr; int soughtLen; const char *soughtStr, *matchedStr = NULL; - (void)dummy; if (objc < 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( @@ -1093,7 +1092,7 @@ MagicDefinitionInvoke( int TclOODefineObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1101,7 +1100,6 @@ TclOODefineObjCmd( Tcl_Namespace *nsPtr; Object *oPtr; int result; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "className arg ?arg ...?"); @@ -1170,7 +1168,7 @@ TclOODefineObjCmd( int TclOOObjDefObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1178,7 +1176,6 @@ TclOOObjDefObjCmd( Tcl_Namespace *nsPtr; Object *oPtr; int result; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "objectName arg ?arg ...?"); @@ -1240,7 +1237,7 @@ TclOOObjDefObjCmd( int TclOODefineSelfObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1248,7 +1245,6 @@ TclOODefineSelfObjCmd( Tcl_Namespace *nsPtr; Object *oPtr; int result, isPrivate; - (void)dummy; oPtr = (Object *) TclOOGetDefineCmdContext(interp); if (oPtr == NULL) { @@ -1312,13 +1308,12 @@ TclOODefineSelfObjCmd( int TclOODefineObjSelfObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Object *oPtr; - (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); @@ -1420,7 +1415,7 @@ TclOODefinePrivateObjCmd( int TclOODefineClassObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1429,7 +1424,6 @@ TclOODefineClassObjCmd( Class *clsPtr; Foundation *fPtr = TclOOGetFoundation(interp); int wasClass, willBeClass; - (void)dummy; /* * Parse the context to get the object to operate on. @@ -1530,7 +1524,7 @@ TclOODefineClassObjCmd( int TclOODefineConstructorObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1539,7 +1533,6 @@ TclOODefineConstructorObjCmd( Class *clsPtr; Tcl_Method method; int bodyLength; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "arguments body"); @@ -1600,7 +1593,7 @@ TclOODefineConstructorObjCmd( int TclOODefineDefnNsObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1614,7 +1607,6 @@ TclOODefineDefnNsObjCmd( Object *oPtr; Tcl_Namespace *nsPtr; Tcl_Obj *nsNamePtr, **storagePtr; - (void)dummy; oPtr = (Object *) TclOOGetDefineCmdContext(interp); if (oPtr == NULL) { @@ -1743,7 +1735,7 @@ TclOODefineDeleteMethodObjCmd( int TclOODefineDestructorObjCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1752,7 +1744,6 @@ TclOODefineDestructorObjCmd( Class *clsPtr; Tcl_Method method; int bodyLength; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "body"); @@ -2323,7 +2314,7 @@ TclOODefineSlots( static int ClassFilterGet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2332,7 +2323,6 @@ ClassFilterGet( Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); Tcl_Obj *resultObj, *filterObj; int i; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2358,7 +2348,7 @@ ClassFilterGet( static int ClassFilterSet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2367,7 +2357,6 @@ ClassFilterSet( Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); int filterc; Tcl_Obj **filterv; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2405,7 +2394,7 @@ ClassFilterSet( static int ClassMixinGet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2415,7 +2404,6 @@ ClassMixinGet( Tcl_Obj *resultObj; Class *mixinPtr; int i; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2443,7 +2431,7 @@ ClassMixinGet( static int ClassMixinSet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2453,7 +2441,6 @@ ClassMixinSet( int mixinc, i; Tcl_Obj **mixinv; Class **mixins; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2513,7 +2500,7 @@ ClassMixinSet( static int ClassSuperGet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2523,7 +2510,6 @@ ClassSuperGet( Tcl_Obj *resultObj; Class *superPtr; int i; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2550,7 +2536,7 @@ ClassSuperGet( static int ClassSuperSet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2560,7 +2546,6 @@ ClassSuperSet( int superc, i, j; Tcl_Obj **superv; Class **superclasses, *superPtr; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2682,7 +2667,7 @@ ClassSuperSet( static int ClassVarsGet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2691,7 +2676,6 @@ ClassVarsGet( Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); Tcl_Obj *resultObj; int i; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2727,7 +2711,7 @@ ClassVarsGet( static int ClassVarsSet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2737,7 +2721,6 @@ ClassVarsSet( int varc; Tcl_Obj **varv; int i; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2799,7 +2782,7 @@ ClassVarsSet( static int ObjFilterGet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2808,7 +2791,6 @@ ObjFilterGet( Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); Tcl_Obj *resultObj, *filterObj; int i; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2828,7 +2810,7 @@ ObjFilterGet( static int ObjFilterSet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2837,7 +2819,6 @@ ObjFilterSet( Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); int filterc; Tcl_Obj **filterv; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2869,7 +2850,7 @@ ObjFilterSet( static int ObjMixinGet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2879,7 +2860,6 @@ ObjMixinGet( Tcl_Obj *resultObj; Class *mixinPtr; int i; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2902,7 +2882,7 @@ ObjMixinGet( static int ObjMixinSet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2913,7 +2893,6 @@ ObjMixinSet( Tcl_Obj **mixinv; Class **mixins; int i; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2957,7 +2936,7 @@ ObjMixinSet( static int ObjVarsGet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2966,7 +2945,6 @@ ObjVarsGet( Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); Tcl_Obj *resultObj; int i; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -2996,7 +2974,7 @@ ObjVarsGet( static int ObjVarsSet( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -3005,7 +2983,6 @@ ObjVarsSet( Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); int varc, i; Tcl_Obj **varv; - (void)dummy; if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, @@ -3062,7 +3039,7 @@ ObjVarsSet( static int ResolveClass( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -3071,7 +3048,6 @@ ResolveClass( int idx = Tcl_ObjectContextSkippedArgs(context); Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); Class *clsPtr; - (void)dummy; /* * Check if were called wrongly. The definition context isn't used... diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c index 580a8d5..3758d55 100644 --- a/generic/tclOOInfo.c +++ b/generic/tclOOInfo.c @@ -171,13 +171,12 @@ GetClassFromObj( static int InfoObjectClassCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Object *oPtr; - (void)dummy; if (objc != 2 && objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "objName ?className?"); @@ -229,7 +228,7 @@ InfoObjectClassCmd( static int InfoObjectDefnCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -239,7 +238,6 @@ InfoObjectDefnCmd( Proc *procPtr; CompiledLocal *localPtr; Tcl_Obj *resultObjs[2]; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "objName methodName"); @@ -304,7 +302,7 @@ InfoObjectDefnCmd( static int InfoObjectFiltersCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -312,7 +310,6 @@ InfoObjectFiltersCmd( int i; Tcl_Obj *filterObj, *resultObj; Object *oPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "objName"); @@ -344,7 +341,7 @@ InfoObjectFiltersCmd( static int InfoObjectForwardCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -352,7 +349,6 @@ InfoObjectForwardCmd( Object *oPtr; Tcl_HashEntry *hPtr; Tcl_Obj *prefixObj; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "objName methodName"); @@ -402,7 +398,7 @@ InfoObjectForwardCmd( static int InfoObjectIsACmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -415,7 +411,6 @@ InfoObjectIsACmd( }; Object *oPtr, *o2Ptr; int idx, i, result = 0; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "category objName ?arg ...?"); @@ -522,7 +517,7 @@ InfoObjectIsACmd( static int InfoObjectMethodsCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -545,7 +540,6 @@ InfoObjectMethodsCmd( SCOPE_PRIVATE, SCOPE_PUBLIC, SCOPE_UNEXPORTED, SCOPE_LOCALPRIVATE }; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "objName ?-option value ...?"); @@ -643,7 +637,7 @@ InfoObjectMethodsCmd( static int InfoObjectMethodTypeCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -651,7 +645,6 @@ InfoObjectMethodTypeCmd( Object *oPtr; Tcl_HashEntry *hPtr; Method *mPtr; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "objName methodName"); @@ -701,7 +694,7 @@ InfoObjectMethodTypeCmd( static int InfoObjectMixinsCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -710,7 +703,6 @@ InfoObjectMixinsCmd( Object *oPtr; Tcl_Obj *resultObj; int i; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "objName"); @@ -745,13 +737,12 @@ InfoObjectMixinsCmd( static int InfoObjectIdCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Object *oPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "objName"); @@ -778,13 +769,12 @@ InfoObjectIdCmd( static int InfoObjectNsCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Object *oPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "objName"); @@ -812,7 +802,7 @@ InfoObjectNsCmd( static int InfoObjectVariablesCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -820,7 +810,6 @@ InfoObjectVariablesCmd( Object *oPtr; Tcl_Obj *resultObj; int i, isPrivate = 0; - (void)dummy; if (objc != 2 && objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "objName ?-private?"); @@ -867,7 +856,7 @@ InfoObjectVariablesCmd( static int InfoObjectVarsCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -877,7 +866,6 @@ InfoObjectVarsCmd( FOREACH_HASH_DECLS; VarInHash *vihPtr; Tcl_Obj *nameObj, *resultObj; - (void)dummy; if (objc != 2 && objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "objName ?pattern?"); @@ -929,7 +917,7 @@ InfoObjectVarsCmd( static int InfoClassConstrCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -938,7 +926,6 @@ InfoClassConstrCmd( CompiledLocal *localPtr; Tcl_Obj *resultObjs[2]; Class *clsPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "className"); @@ -991,7 +978,7 @@ InfoClassConstrCmd( static int InfoClassDefnCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1001,7 +988,6 @@ InfoClassDefnCmd( CompiledLocal *localPtr; Tcl_Obj *resultObjs[2]; Class *clsPtr; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "className methodName"); @@ -1060,7 +1046,7 @@ InfoClassDefnCmd( static int InfoClassDefnNsCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1073,7 +1059,6 @@ InfoClassDefnNsCmd( int kind = 0; Tcl_Obj *nsNamePtr; Class *clsPtr; - (void)dummy; if (objc != 2 && objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "className ?kind?"); @@ -1111,14 +1096,13 @@ InfoClassDefnNsCmd( static int InfoClassDestrCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Proc *procPtr; Class *clsPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "className"); @@ -1156,7 +1140,7 @@ InfoClassDestrCmd( static int InfoClassFiltersCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1164,7 +1148,6 @@ InfoClassFiltersCmd( int i; Tcl_Obj *filterObj, *resultObj; Class *clsPtr; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "className"); @@ -1195,7 +1178,7 @@ InfoClassFiltersCmd( static int InfoClassForwardCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1203,7 +1186,6 @@ InfoClassForwardCmd( Tcl_HashEntry *hPtr; Tcl_Obj *prefixObj; Class *clsPtr; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "className methodName"); @@ -1247,7 +1229,7 @@ InfoClassForwardCmd( static int InfoClassInstancesCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1257,7 +1239,6 @@ InfoClassInstancesCmd( int i; const char *pattern = NULL; Tcl_Obj *resultObj; - (void)dummy; if (objc != 2 && objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "className ?pattern?"); @@ -1296,7 +1277,7 @@ InfoClassInstancesCmd( static int InfoClassMethodsCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1317,7 +1298,6 @@ InfoClassMethodsCmd( enum Scopes { SCOPE_PRIVATE, SCOPE_PUBLIC, SCOPE_UNEXPORTED }; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "className ?-option value ...?"); @@ -1413,7 +1393,7 @@ InfoClassMethodsCmd( static int InfoClassMethodTypeCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1421,7 +1401,6 @@ InfoClassMethodTypeCmd( Tcl_HashEntry *hPtr; Method *mPtr; Class *clsPtr; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "className methodName"); @@ -1466,7 +1445,7 @@ InfoClassMethodTypeCmd( static int InfoClassMixinsCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1474,7 +1453,6 @@ InfoClassMixinsCmd( Class *clsPtr, *mixinPtr; Tcl_Obj *resultObj; int i; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "className"); @@ -1509,7 +1487,7 @@ InfoClassMixinsCmd( static int InfoClassSubsCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1518,7 +1496,6 @@ InfoClassSubsCmd( Tcl_Obj *resultObj; int i; const char *pattern = NULL; - (void)dummy; if (objc != 2 && objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "className ?pattern?"); @@ -1565,7 +1542,7 @@ InfoClassSubsCmd( static int InfoClassSupersCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1573,7 +1550,6 @@ InfoClassSupersCmd( Class *clsPtr, *superPtr; Tcl_Obj *resultObj; int i; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "className"); @@ -1605,7 +1581,7 @@ InfoClassSupersCmd( static int InfoClassVariablesCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -1613,7 +1589,6 @@ InfoClassVariablesCmd( Class *clsPtr; Tcl_Obj *resultObj; int i, isPrivate = 0; - (void)dummy; if (objc != 2 && objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "className ?-private?"); @@ -1660,14 +1635,13 @@ InfoClassVariablesCmd( static int InfoObjectCallCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Object *oPtr; CallContext *contextPtr; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "objName methodName"); @@ -1707,14 +1681,13 @@ InfoObjectCallCmd( static int InfoClassCallCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Class *clsPtr; CallChain *callPtr; - (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "className methodName"); diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 01e2c00..b1b3d8e 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -80,12 +80,9 @@ static void DeleteProcedureMethodRecord(ProcedureMethod *pmPtr); static void DeleteProcedureMethod(void *clientData); static int CloneProcedureMethod(Tcl_Interp *interp, void *clientData, void **newClientData); -static void MethodErrorHandler(Tcl_Interp *interp, - Tcl_Obj *procNameObj); -static void ConstructorErrorHandler(Tcl_Interp *interp, - Tcl_Obj *procNameObj); -static void DestructorErrorHandler(Tcl_Interp *interp, - Tcl_Obj *procNameObj); +static ProcErrorProc MethodErrorHandler; +static ProcErrorProc ConstructorErrorHandler; +static ProcErrorProc DestructorErrorHandler; static Tcl_Obj * RenderDeclarerName(void *clientData); static int InvokeForwardMethod(void *clientData, Tcl_Interp *interp, Tcl_ObjectContext context, @@ -93,13 +90,8 @@ static int InvokeForwardMethod(void *clientData, static void DeleteForwardMethod(void *clientData); static int CloneForwardMethod(Tcl_Interp *interp, void *clientData, void **newClientData); -static int ProcedureMethodVarResolver(Tcl_Interp *interp, - const char *varName, Tcl_Namespace *contextNs, - int flags, Tcl_Var *varPtr); -static int ProcedureMethodCompiledVarResolver(Tcl_Interp *interp, - const char *varName, int length, - Tcl_Namespace *contextNs, - Tcl_ResolvedVarInfo **rPtrPtr); +static Tcl_ResolveVarProc ProcedureMethodVarResolver; +static Tcl_ResolveCompiledVarProc ProcedureMethodCompiledVarResolver; /* * The types of methods defined by the core OO system. @@ -135,7 +127,7 @@ static const Tcl_MethodType fwdMethodType = { Tcl_Method Tcl_NewInstanceMethod( - Tcl_Interp *dummy, /* Unused. */ + TCL_UNUSED(Tcl_Interp *), Tcl_Object object, /* The object that has the method attached to * it. */ Tcl_Obj *nameObj, /* The name of the method. May be NULL; if so, @@ -146,14 +138,13 @@ Tcl_NewInstanceMethod( /* The type of method this is, which defines * how to invoke, delete and clone the * method. */ - void *clientData) /* Some data associated with the particular + void *clientData) /* Some data associated with the particular * method to be created. */ { Object *oPtr = (Object *) object; Method *mPtr; Tcl_HashEntry *hPtr; int isNew; - (void)dummy; if (nameObj == NULL) { mPtr = (Method *)ckalloc(sizeof(Method)); @@ -209,7 +200,7 @@ Tcl_NewInstanceMethod( Tcl_Method Tcl_NewMethod( - Tcl_Interp *dummy, /* The interpreter containing the class. */ + TCL_UNUSED(Tcl_Interp *), Tcl_Class cls, /* The class to attach the method to. */ Tcl_Obj *nameObj, /* The name of the object. May be NULL (e.g., * for constructors or destructors); if so, up @@ -219,14 +210,13 @@ Tcl_NewMethod( /* The type of method this is, which defines * how to invoke, delete and clone the * method. */ - void *clientData) /* Some data associated with the particular + void *clientData) /* Some data associated with the particular * method to be created. */ { Class *clsPtr = (Class *) cls; Method *mPtr; Tcl_HashEntry *hPtr; int isNew; - (void)dummy; if (nameObj == NULL) { mPtr = (Method *)ckalloc(sizeof(Method)); @@ -962,12 +952,11 @@ ProcedureMethodVarResolver( Tcl_Interp *interp, const char *varName, Tcl_Namespace *contextNs, - int flags, + TCL_UNUSED(int) /*flags*/, /* Ignoring variable access flags (???) */ Tcl_Var *varPtr) { int result; Tcl_ResolvedVarInfo *rPtr = NULL; - (void)flags; result = ProcedureMethodCompiledVarResolver(interp, varName, strlen(varName), contextNs, &rPtr); @@ -1110,16 +1099,14 @@ ProcedureMethodCompiledVarDelete( static int ProcedureMethodCompiledVarResolver( - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), const char *varName, int length, - Tcl_Namespace *contextNs, + TCL_UNUSED(Tcl_Namespace *), Tcl_ResolvedVarInfo **rPtrPtr) { OOResVarInfo *infoPtr; Tcl_Obj *variableObj = Tcl_NewStringObj(varName, length); - (void)dummy; - (void)contextNs; /* * Do not create resolvers for cases that contain namespace separators or @@ -1183,6 +1170,8 @@ RenderDeclarerName( * ---------------------------------------------------------------------- */ +/* TODO: Check whether Tcl_AppendLimitedToObj() can work here. */ + #define LIMIT 60 #define ELLIPSIFY(str,len) \ ((len) > LIMIT ? LIMIT : (len)), (str), ((len) > LIMIT ? "..." : "") @@ -1190,7 +1179,8 @@ RenderDeclarerName( static void MethodErrorHandler( Tcl_Interp *interp, - Tcl_Obj *methodNameObj) + TCL_UNUSED(Tcl_Obj *) /*methodNameObj*/) + /* We pull the method name out of context instead of from argument */ { int nameLen, objectNameLen; CallContext *contextPtr = (CallContext *)((Interp *) interp)->varFramePtr->clientData; @@ -1198,7 +1188,6 @@ MethodErrorHandler( const char *objectName, *kindName, *methodName = TclGetStringFromObj(mPtr->namePtr, &nameLen); Object *declarerPtr; - (void)methodNameObj; if (mPtr->declaringObjectPtr != NULL) { declarerPtr = mPtr->declaringObjectPtr; @@ -1222,14 +1211,14 @@ MethodErrorHandler( static void ConstructorErrorHandler( Tcl_Interp *interp, - Tcl_Obj *methodNameObj) + TCL_UNUSED(Tcl_Obj *) /*methodNameObj*/) + /* Ignore. We know it is the constructor. */ { CallContext *contextPtr = (CallContext *)((Interp *) interp)->varFramePtr->clientData; Method *mPtr = contextPtr->callPtr->chain[contextPtr->index].mPtr; Object *declarerPtr; const char *objectName, *kindName; int objectNameLen; - (void)methodNameObj; if (mPtr->declaringObjectPtr != NULL) { declarerPtr = mPtr->declaringObjectPtr; @@ -1252,14 +1241,14 @@ ConstructorErrorHandler( static void DestructorErrorHandler( Tcl_Interp *interp, - Tcl_Obj *methodNameObj) + TCL_UNUSED(Tcl_Obj *) /*methodNameObj*/) + /* Ignore. We know it is the destructor. */ { CallContext *contextPtr = (CallContext *)((Interp *) interp)->varFramePtr->clientData; Method *mPtr = contextPtr->callPtr->chain[contextPtr->index].mPtr; Object *declarerPtr; const char *objectName, *kindName; int objectNameLen; - (void)methodNameObj; if (mPtr->declaringObjectPtr != NULL) { declarerPtr = mPtr->declaringObjectPtr; @@ -1534,13 +1523,12 @@ DeleteForwardMethod( static int CloneForwardMethod( - Tcl_Interp *dummy, + TCL_UNUSED(Tcl_Interp *), void *clientData, void **newClientData) { ForwardMethod *fmPtr = (ForwardMethod *)clientData; ForwardMethod *fm2Ptr = (ForwardMethod *)ckalloc(sizeof(ForwardMethod)); - (void)dummy; fm2Ptr->prefixObj = fmPtr->prefixObj; Tcl_IncrRefCount(fm2Ptr->prefixObj); -- cgit v0.12