diff options
author | dgp <dgp@users.sourceforge.net> | 2020-03-07 00:41:42 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2020-03-07 00:41:42 (GMT) |
commit | 84ba768f8328c15b136bf634054cb81638ee7613 (patch) | |
tree | 7321f0e262b9ecc21400ff7b2ad9130422049585 /generic/tclOOMethod.c | |
parent | 7c3b0c1d0a1f29387d63de05e09a139a4900a295 (diff) | |
download | tcl-84ba768f8328c15b136bf634054cb81638ee7613.zip tcl-84ba768f8328c15b136bf634054cb81638ee7613.tar.gz tcl-84ba768f8328c15b136bf634054cb81638ee7613.tar.bz2 |
Unused arguments in the OO source code files.
Diffstat (limited to 'generic/tclOOMethod.c')
-rw-r--r-- | generic/tclOOMethod.c | 54 |
1 files changed, 21 insertions, 33 deletions
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); |