Index: TODO =================================================================== diff -u -rbb292ab3dff4b1d3a65e0a532b691e8a6dcd688c -rdb9cc86bb6df8dadf59f951a504c908fb8d14ef0 --- TODO (.../TODO) (revision bb292ab3dff4b1d3a65e0a532b691e8a6dcd688c) +++ TODO (.../TODO) (revision db9cc86bb6df8dadf59f951a504c908fb8d14ef0) @@ -2181,6 +2181,9 @@ - doc-tools: title to internal links, provided css class, added nicer label - updated reference doc +- removed leftover -public flag in nsf::method +- general cleanup: removed unused arguments + TODO: - doc: NextScriptingLanguage/index.html: @@ -2215,8 +2218,8 @@ Class protected class-object method __unknown {name} {} needed? - would be nice to remove noinit as a method and leave it as a objectparameter +- ListDefinedMethods noMixins and inContext not defined yet. - - nsf::proc * check, if there are parameter types that should not be applicable for nsf::proc Index: generic/gentclAPI.decls =================================================================== diff -u -r7166c2bd4fb473924468cd82fde8a6eaa529cae9 -rdb9cc86bb6df8dadf59f951a504c908fb8d14ef0 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 7166c2bd4fb473924468cd82fde8a6eaa529cae9) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision db9cc86bb6df8dadf59f951a504c908fb8d14ef0) @@ -94,7 +94,6 @@ {-argName "object" -required 1 -type object} {-argName "-inner-namespace"} {-argName "-per-object"} - {-argName "-public"} {-argName "methodName" -required 1 -type tclobj} {-argName "arguments" -required 1 -type tclobj} {-argName "body" -required 1 -type tclobj} Index: generic/gentclAPI.tcl =================================================================== diff -u -r87c6a11296ada89c007cc2ed33df6887ac53c740 -rdb9cc86bb6df8dadf59f951a504c908fb8d14ef0 --- generic/gentclAPI.tcl (.../gentclAPI.tcl) (revision 87c6a11296ada89c007cc2ed33df6887ac53c740) +++ generic/gentclAPI.tcl (.../gentclAPI.tcl) (revision db9cc86bb6df8dadf59f951a504c908fb8d14ef0) @@ -31,6 +31,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; $opts + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "$argname", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -102,6 +103,7 @@ { if (!obj) return NsfObjErrType(interp, NULL, objv[0], "Object", NULL);} } "" { + append intro " (void)clientData;\n" set a [list] set if [list] array set cd {arglist "" ifDefs ""} Index: generic/nsf.c =================================================================== diff -u -r07da737bc4c17984c337113e5707cd8739378226 -rdb9cc86bb6df8dadf59f951a504c908fb8d14ef0 --- generic/nsf.c (.../nsf.c) (revision 07da737bc4c17984c337113e5707cd8739378226) +++ generic/nsf.c (.../nsf.c) (revision db9cc86bb6df8dadf59f951a504c908fb8d14ef0) @@ -189,7 +189,7 @@ Tcl_Command cmd, NsfObject *object, NsfClass *cl, CONST char *methodName, int frameType, int flags); static int DispatchDefaultMethod(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[], int flags); + Tcl_Obj *obj, int flags); static int DispatchDestroyMethod(Tcl_Interp *interp, NsfObject *object, int flags); static int DispatchUnknownMethod(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], NsfObject *delegator, @@ -228,8 +228,8 @@ /* prototypes for filters and mixins */ static void FilterComputeDefined(Tcl_Interp *interp, NsfObject *object); static void MixinComputeDefined(Tcl_Interp *interp, NsfObject *object); -NSF_INLINE static void GuardAdd(Tcl_Interp *interp, NsfCmdList *filterCL, Tcl_Obj *guardObj); -static int GuardCall(NsfObject *object, NsfClass *cl, Tcl_Command cmd, Tcl_Interp *interp, +NSF_INLINE static void GuardAdd(NsfCmdList *filterCL, Tcl_Obj *guardObj); +static int GuardCall(NsfObject *object, Tcl_Interp *interp, Tcl_Obj *guardObj, NsfCallStackContent *cscPtr); static void GuardDel(NsfCmdList *filterCL); @@ -618,6 +618,7 @@ } extern Nsf_Class * NsfIsClass(Tcl_Interp *interp, ClientData clientData) { + (void)interp; /* TODO; maybe remove */ if (clientData && NsfObjectIsClass((NsfObject *)clientData)) { return (Nsf_Class *) clientData; } @@ -1073,7 +1074,7 @@ INCR_REF_COUNT(nameObj); - methodObj = NsfMethodObj(interp, &baseClass->object, NSF_c_requireobject_idx); + methodObj = NsfMethodObj(&baseClass->object, NSF_c_requireobject_idx); if (methodObj) { /*fprintf(stderr, "+++ calling __unknown for %s name=%s\n", ClassName(baseClass), ObjStr(nameObj));*/ @@ -1386,7 +1387,7 @@ */ static void -AS(NsfClass *cl, NsfClass *s, NsfClasses **sl) { +AS(NsfClass *s, NsfClasses **sl) { register NsfClasses *l = *sl; while (l && l->cl != s) l = l->nextPtr; if (!l) { @@ -1403,14 +1404,15 @@ /* * keep corresponding sub in step with super */ - AS(cl, super, &cl->super); - AS(super, cl, &super->sub); + AS(super, &cl->super); + AS(cl, &super->sub); } } static int -RemoveSuper1(NsfClass *cl, NsfClass *s, NsfClasses **sl) { +RemoveSuper1(NsfClass *s, NsfClasses **sl) { NsfClasses *l = *sl; + if (!l) return 0; if (l->cl == s) { *sl = l->nextPtr; @@ -1432,8 +1434,8 @@ /* * keep corresponding sub in step with super */ - int sp = RemoveSuper1(cl, super, &cl->super); - int sb = RemoveSuper1(super, cl, &super->sub); + int sp = RemoveSuper1(super, &cl->super); + int sb = RemoveSuper1(cl, &super->sub); return sp && sb; } @@ -1547,7 +1549,7 @@ NsfObject *referencedObject; char* methodName = ObjStr(methodObj); - if (strchr(methodName, ' ') > 0) { + if (strchr(methodName, ' ')) { Tcl_Namespace *parentNsPtr; NsfObject *ensembleObject; Tcl_Obj *methodHandleObj; @@ -1831,6 +1833,7 @@ static NsfClass * SearchSimpleCMethod(Tcl_Interp *interp, /*@notnull@*/ NsfClass *cl, Tcl_Obj *methodObj, Tcl_Command *cmdPtr) { + (void)interp; /* same interface as SearchComplexCMethod() */ assert(cl); return SearchPLMethod(ComputeOrder(cl, cl->order, Super), ObjStr(methodObj), cmdPtr); } @@ -1902,7 +1905,7 @@ ObjectFindMethod(Tcl_Interp *interp, NsfObject *object, Tcl_Obj *methodObj, NsfClass **pcl) { Tcl_Command cmd = NULL; Tcl_DString ds, *dsPtr = &ds; - int containsSpace = strchr(ObjStr(methodObj), ' ') > 0; + int containsSpace = strchr(ObjStr(methodObj), ' ') != NULL; NsfClass *(*lookupFunction)(Tcl_Interp *interp, NsfClass *cl, Tcl_Obj *methodObj, Tcl_Command *cmdPtr) = containsSpace ? SearchComplexCMethod : SearchSimpleCMethod; @@ -2263,7 +2266,7 @@ *---------------------------------------------------------------------- */ Tcl_Obj * -NsfMethodObj(Tcl_Interp *interp, NsfObject *object, int methodIdx) { +NsfMethodObj(NsfObject *object, int methodIdx) { NsfObjectSystem *osPtr = GetObjectSystem(object); /* fprintf(stderr, "NsfMethodObj object %s os %p idx %d %s methodObj %p\n", @@ -2418,6 +2421,8 @@ Tcl_Obj *key; Var *newVar; + (void)nsPtr; + #if defined (VAR_RESOLVER_TRACE) fprintf(stderr, "NsColonVarResolver '%s' flags %.6x\n", varName, flags); #endif @@ -2731,6 +2736,7 @@ * handling of wrong vars */ NsfObject *object = GetSelfObj(interp); + (void)context; #if defined(VAR_RESOLVER_TRACE) fprintf(stderr, "compiled var resolver for %s, obj %p\n", name, object); @@ -2790,6 +2796,8 @@ Tcl_Obj *keyObj; Tcl_Var var; + (void)nsPtr; + if (!FOR_COLON_RESOLVER(varName) || (flags & (TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY))) { /* ordinary names and global lookups are not for us */ #if defined(VAR_RESOLVER_TRACE) @@ -2948,6 +2956,7 @@ int flags, Tcl_Command *cmdPtr) { CallFrame *varFramePtr; int frameFlags; + (void)nsPtr; /*fprintf(stderr, "InterpColonCmdResolver %s flags %.6x\n", cmdName, flags);*/ @@ -3082,7 +3091,7 @@ */ static void -NsfNamespaceInit(Tcl_Interp *interp, Tcl_Namespace *nsPtr) { +NsfNamespaceInit(Tcl_Namespace *nsPtr) { assert(nsPtr); /* @@ -3139,7 +3148,7 @@ if (!object->nsPtr) { MakeObjNamespace(interp, object); - NsfNamespaceInit(interp, object->nsPtr); + NsfNamespaceInit(object->nsPtr); } assert(object->nsPtr); @@ -3503,7 +3512,7 @@ static int NSRequireParentObject(Tcl_Interp *interp, CONST char *parentName, NsfClass *cl) { NsfClass *defaultSuperClass = DefaultSuperClass(interp, cl, cl->object.cl, 1); - Tcl_Obj *methodObj = NsfMethodObj(interp, &defaultSuperClass->object, NSF_c_requireobject_idx); + Tcl_Obj *methodObj = NsfMethodObj(&defaultSuperClass->object, NSF_c_requireobject_idx); int rc = 0; /*fprintf(stderr, "NSRequireParentObject %s cl %p (%s) methodObj %p defaultSc %p %s\n", @@ -4879,7 +4888,7 @@ new = CmdListAdd(mixinList, mixin->object.id, NULL, /*noDuplicates*/ 1); if (guardObj) { - GuardAdd(interp, new, guardObj); + GuardAdd(new, guardObj); } else if (new->clientData) { GuardDel(new); } @@ -5436,7 +5445,7 @@ */ static void -MixinResetOrderForInstances(Tcl_Interp *interp, NsfClass *cl) { +MixinResetOrderForInstances(NsfClass *cl) { Tcl_HashSearch hSrch; Tcl_HashEntry *hPtr; @@ -5530,7 +5539,7 @@ NsfClass *ncl = (NsfClass *)Tcl_GetHashKey(commandTable, hPtr); /*fprintf(stderr, "Got %s, reset for ncl %p\n", ncl?ObjStr(ncl->object.cmdName):"NULL", ncl);*/ if (ncl) { - MixinResetOrderForInstances(interp, ncl); + MixinResetOrderForInstances(ncl); /* this place seems to be sufficient to invalidate the computed object parameter definitions */ /*fprintf(stderr, "MixinInvalidateObjOrders via class mixin %s calls ifd invalidate \n", ClassName(ncl));*/ NsfInvalidateObjectParameterCmd(interp, ncl); @@ -5632,8 +5641,7 @@ if (cmdList->clientData) { if (!RUNTIME_STATE(interp)->guardCount) { /*fprintf(stderr, "guardcall\n");*/ - result = GuardCall(object, cl, (Tcl_Command) cmd, interp, - (Tcl_Obj*)cmdList->clientData, NULL); + result = GuardCall(object, interp, (Tcl_Obj*)cmdList->clientData, NULL); } } if (result == TCL_OK) { @@ -5699,7 +5707,7 @@ */ static Tcl_Command -MixinSearchMethodByName(Tcl_Interp *interp, NsfCmdList *mixinList, CONST char *name, NsfClass **cl) { +MixinSearchMethodByName(NsfCmdList *mixinList, CONST char *name, NsfClass **cl) { Tcl_Command cmd; for (; mixinList; mixinList = mixinList->nextPtr) { @@ -5726,7 +5734,7 @@ */ static Tcl_Command -FilterSearch(Tcl_Interp *interp, CONST char *name, NsfObject *startingObject, +FilterSearch(CONST char *name, NsfObject *startingObject, NsfClass *startingClass, NsfClass **cl) { Tcl_Command cmd = NULL; @@ -5743,7 +5751,7 @@ * search for filters on object mixins */ if (opt && opt->mixins) { - if ((cmd = MixinSearchMethodByName(interp, opt->mixins, name, cl))) { + if ((cmd = MixinSearchMethodByName(opt->mixins, name, cl))) { return cmd; } } @@ -5755,7 +5763,7 @@ if (startingClass) { NsfClassOpt *opt = startingClass->opt; if (opt && opt->classmixins) { - if ((cmd = MixinSearchMethodByName(interp, opt->classmixins, name, cl))) { + if ((cmd = MixinSearchMethodByName(opt->classmixins, name, cl))) { return cmd; } } @@ -5852,7 +5860,7 @@ } NSF_INLINE static void -GuardAdd(Tcl_Interp *interp, NsfCmdList *CL, Tcl_Obj *guardObj) { +GuardAdd(NsfCmdList *CL, Tcl_Obj *guardObj) { if (guardObj) { GuardDel(CL); if (strlen(ObjStr(guardObj)) != 0) { @@ -5864,17 +5872,9 @@ } } } -/* - static void - GuardAddList(Tcl_Interp *interp, NsfCmdList *dest, ClientData source) { - NsfTclObjList *s = (NsfTclObjList *)source; - GuardAdd(interp, dest, (Tcl_Obj *)s->content); - s = s->nextPtr; - } */ static int -GuardCall(NsfObject *object, NsfClass *cl, Tcl_Command cmd, - Tcl_Interp *interp, Tcl_Obj *guardObj, NsfCallStackContent *cscPtr) { +GuardCall(NsfObject *object, Tcl_Interp *interp, Tcl_Obj *guardObj, NsfCallStackContent *cscPtr) { int result = TCL_OK; if (guardObj) { @@ -5883,7 +5883,6 @@ INCR_REF_COUNT(res); - /* GuardPrint(interp, cmdList->clientData); */ /* * For the guard push a fake callframe on the Tcl stack so that * e.g. a "self calledproc" and other methods in the guard behave @@ -5912,14 +5911,13 @@ } static int -GuardAddFromDefinitionList(Tcl_Interp *interp, NsfCmdList *dest, - Tcl_Command interceptorCmd, +GuardAddFromDefinitionList(NsfCmdList *dest, Tcl_Command interceptorCmd, NsfCmdList *interceptorDefList) { NsfCmdList *h; if (interceptorDefList) { h = CmdListFindCmdInList(interceptorCmd, interceptorDefList); if (h) { - GuardAdd(interp, dest, (Tcl_Obj*) h->clientData); + GuardAdd(dest, (Tcl_Obj*) h->clientData); /* * 1 means we have added a guard successfully "interceptorCmd" */ @@ -5949,7 +5947,7 @@ for (ml = object->mixinOrder; ml && !guardAdded; ml = ml->nextPtr) { mixin = NsfGetClassFromCmdPtr(ml->cmdPtr); if (mixin && mixin->opt) { - guardAdded = GuardAddFromDefinitionList(interp, dest, filterCmd, + guardAdded = GuardAddFromDefinitionList(dest, filterCmd, mixin->opt->classfilters); } } @@ -5958,15 +5956,15 @@ /* search per-object filters */ opt = object->opt; if (!guardAdded && opt && opt->filters) { - guardAdded = GuardAddFromDefinitionList(interp, dest, filterCmd, opt->filters); + guardAdded = GuardAddFromDefinitionList(dest, filterCmd, opt->filters); } if (!guardAdded) { /* search per-class filters */ for (pl = ComputeOrder(object->cl, object->cl->order, Super); !guardAdded && pl; pl = pl->nextPtr) { NsfClassOpt *opt = pl->cl->opt; if (opt) { - guardAdded = GuardAddFromDefinitionList(interp, dest, filterCmd, + guardAdded = GuardAddFromDefinitionList(dest, filterCmd, opt->classfilters); } } @@ -5986,7 +5984,7 @@ CmdListFindNameInList(interp, (char *) Tcl_GetCommandName(interp, filterCmd), object->filterOrder); if (registeredFilter) { - GuardAdd(interp, dest, (Tcl_Obj*) registeredFilter->clientData); + GuardAdd(dest, (Tcl_Obj*) registeredFilter->clientData); } } } @@ -6036,7 +6034,7 @@ } } - if (!(cmd = FilterSearch(interp, ObjStr(nameObj), startingObject, startingClass, &cl))) { + if (!(cmd = FilterSearch(ObjStr(nameObj), startingObject, startingClass, &cl))) { if (startingObject) { return NsfPrintError(interp, "object filter: can't find filterproc '%s' on %s ", ObjStr(nameObj), ObjectName(startingObject)); @@ -6051,7 +6049,7 @@ new = CmdListAdd(filterList, cmd, cl, /*noDuplicates*/ 1); if (guardObj) { - GuardAdd(interp, new, guardObj); + GuardAdd(new, guardObj); } else if (new->clientData) { GuardDel(new); } @@ -6084,7 +6082,7 @@ CmdListRemoveEpoched(filters, GuardDel); for (cmdList = *filters; cmdList; ) { simpleName = (char *) Tcl_GetCommandName(interp, cmdList->cmdPtr); - cmd = FilterSearch(interp, simpleName, startingObject, startingClass, &cl); + cmd = FilterSearch(simpleName, startingObject, startingClass, &cl); if (cmd == NULL) { del = CmdListRemoveFromList(filters, cmdList); cmdList = cmdList->nextPtr; @@ -6407,7 +6405,7 @@ * push a filter stack information on this object */ static int -FilterStackPush(Tcl_Interp *interp, NsfObject *object, Tcl_Obj *calledProc) { +FilterStackPush(NsfObject *object, Tcl_Obj *calledProc) { register NsfFilterStack *h = NEW(NsfFilterStack); h->currentCmdPtr = NULL; @@ -6684,8 +6682,22 @@ return result; } +/* + *---------------------------------------------------------------------- + * SubstValue -- + * + * Perform subst on the provided value (Tcl_Obj) + * + * Results: + * Tcl result code. + * + * Side effects: + * Setting result of interp. + * + *---------------------------------------------------------------------- + */ static int -SubstValue(Tcl_Interp *interp, NsfObject *object, Tcl_Obj **value) { +SubstValue(Tcl_Interp *interp, Tcl_Obj **value) { Tcl_Obj *ov[2]; int result; @@ -6694,9 +6706,6 @@ result = Nsf_SubstObjCmd(NULL, interp, 2, ov); - /*fprintf(stderr, "+++++ %s.%s subst returned %d OK %d\n", - ObjectName(object), varName, rc, TCL_OK);*/ - if (result == TCL_OK) { *value = Tcl_GetObjResult(interp); } @@ -6871,8 +6880,24 @@ return NULL; } +/* + *---------------------------------------------------------------------- + * ParamDefsStore -- + * + * Store the provided parameter definitions in the provided + * command. It stores a new deleteProc which will call the original + * delete proc automatically. + * + * Results: + * Tcl result code. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ static int -ParamDefsStore(Tcl_Interp *interp, Tcl_Command cmd, NsfParamDefs *paramDefs) { +ParamDefsStore(Tcl_Command cmd, NsfParamDefs *paramDefs) { Command *cmdPtr = (Command *)cmd; if (cmdPtr->deleteProc != NsfProcDeleteProc) { @@ -6939,7 +6964,7 @@ *---------------------------------------------------------------------- */ static void -ParamDefsFormatOption(Tcl_Interp *interp, Tcl_Obj *nameStringObj, CONST char *option, +ParamDefsFormatOption(Tcl_Obj *nameStringObj, CONST char *option, int *colonWritten, int *firstOption) { if (!*colonWritten) { Tcl_AppendLimitedToObj(nameStringObj, ":", 1, INT_MAX, NULL); @@ -6995,33 +7020,33 @@ nameStringObj = Tcl_NewStringObj(pPtr->name, -1); if (pPtr->type) { - ParamDefsFormatOption(interp, nameStringObj, pPtr->type, &colonWritten, &first); + ParamDefsFormatOption(nameStringObj, pPtr->type, &colonWritten, &first); } else if (isNonpos && pPtr->nrArgs == 0) { - ParamDefsFormatOption(interp, nameStringObj, "switch", &colonWritten, &first); + ParamDefsFormatOption(nameStringObj, "switch", &colonWritten, &first); } if (outputRequired) { - ParamDefsFormatOption(interp, nameStringObj, "required", &colonWritten, &first); + ParamDefsFormatOption(nameStringObj, "required", &colonWritten, &first); } else if (outputOptional) { - ParamDefsFormatOption(interp, nameStringObj, "optional", &colonWritten, &first); + ParamDefsFormatOption(nameStringObj, "optional", &colonWritten, &first); } if ((pPtr->flags & NSF_ARG_SUBST_DEFAULT)) { - ParamDefsFormatOption(interp, nameStringObj, "substdefault", &colonWritten, &first); + ParamDefsFormatOption(nameStringObj, "substdefault", &colonWritten, &first); } if ((pPtr->flags & NSF_ARG_ALLOW_EMPTY) || (pPtr->flags & NSF_ARG_MULTIVALUED)) { char option[10] = "...."; option[0] = (pPtr->flags & NSF_ARG_ALLOW_EMPTY) ? '0' : '1'; option[3] = (pPtr->flags & NSF_ARG_MULTIVALUED) ? '*' : '1'; - ParamDefsFormatOption(interp, nameStringObj, option, &colonWritten, &first); + ParamDefsFormatOption(nameStringObj, option, &colonWritten, &first); } if ((pPtr->flags & NSF_ARG_IS_CONVERTER)) { - ParamDefsFormatOption(interp, nameStringObj, "convert", &colonWritten, &first); + ParamDefsFormatOption(nameStringObj, "convert", &colonWritten, &first); } if ((pPtr->flags & NSF_ARG_INITCMD)) { - ParamDefsFormatOption(interp, nameStringObj, "initcmd", &colonWritten, &first); + ParamDefsFormatOption(nameStringObj, "initcmd", &colonWritten, &first); } else if ((pPtr->flags & NSF_ARG_METHOD)) { - ParamDefsFormatOption(interp, nameStringObj, "method", &colonWritten, &first); + ParamDefsFormatOption(nameStringObj, "method", &colonWritten, &first); } else if ((pPtr->flags & NSF_ARG_NOARG)) { - ParamDefsFormatOption(interp, nameStringObj, "noarg", &colonWritten, &first); + ParamDefsFormatOption(nameStringObj, "noarg", &colonWritten, &first); } innerListObj = Tcl_NewListObj(0, NULL); @@ -7157,7 +7182,7 @@ */ static Tcl_Obj * -ParamDefsSyntax(Tcl_Interp *interp, NsfParam CONST *paramPtr) { +ParamDefsSyntax(NsfParam CONST *paramPtr) { Tcl_Obj *argStringObj = Tcl_NewStringObj("", 0); NsfParam CONST *pPtr; @@ -7334,8 +7359,7 @@ /* * A filter was found, check whether it has a guard. */ - result = GuardCall(object, cl, (Tcl_Command) cmdList->cmdPtr, interp, - cmdList->clientData, cscPtr); + result = GuardCall(object, interp, cmdList->clientData, cscPtr); if (result != TCL_OK) { /*fprintf(stderr, "Filter GuardCall in invokeProc returned %d\n", result);*/ @@ -7618,7 +7642,7 @@ if (objc < 2) { CallFrame frame, *framePtr = &frame; Nsf_PushFrameCsc(interp, cscPtr, framePtr); - result = DispatchDefaultMethod(cp, interp, objc, objv, NSF_CSC_IMMEDIATE); + result = DispatchDefaultMethod(cp, interp, objv[0], NSF_CSC_IMMEDIATE); Nsf_PopFrameCsc(interp, framePtr); } else { CallFrame frame, *framePtr = &frame; @@ -7980,10 +8004,7 @@ if (!cscPtr1 || (object != cscPtr1->self || (cscPtr1->frameType != NSF_CSC_TYPE_ACTIVE_FILTER))) { - // TODO could use methodObj sometimes, therefore the new obj is not needed always - // use MethodName() for the few occurances, where ->calledProc is referenced. - //FilterStackPush(interp, object, Tcl_NewStringObj(methodName,-1)); - FilterStackPush(interp, object, methodObj); + FilterStackPush(object, methodObj); flags |= NSF_CSC_FILTER_STACK_PUSHED; cmd = FilterSearchProc(interp, object, &object->filterStack->currentCmdPtr, &cl); @@ -8183,13 +8204,13 @@ */ static int DispatchDefaultMethod(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[], int flags) { + Tcl_Obj *obj, int flags) { int result; - Tcl_Obj *methodObj = NsfMethodObj(interp, (NsfObject *)clientData, NSF_o_defaultmethod_idx); + Tcl_Obj *methodObj = NsfMethodObj((NsfObject *)clientData, NSF_o_defaultmethod_idx); if (methodObj) { Tcl_Obj *tov[2]; - tov[0] = objv[0]; + tov[0] = obj; tov[1] = methodObj; result = ObjectDispatch(clientData, interp, 2, tov, flags|NSF_CM_NO_UNKNOWN); @@ -8288,7 +8309,7 @@ NsfObject *delegator, Tcl_Obj *methodObj, int flags) { int result; NsfObject *object = (NsfObject*)clientData; - Tcl_Obj *unknownObj = NsfMethodObj(interp, object, NSF_o_unknown_idx); + Tcl_Obj *unknownObj = NsfMethodObj(object, NSF_o_unknown_idx); /*fprintf(stderr, "compare unknownObj %p with methodObj %p '%s' %p %p %s\n", unknownObj, methodObj, ObjStr(methodObj), delegator, @@ -8367,7 +8388,7 @@ */ result = ObjectDispatch(clientData, interp, objc, objv, 0); } else { - result = DispatchDefaultMethod(clientData, interp, objc, objv, 0); + result = DispatchDefaultMethod(clientData, interp, objv[0], 0); } return result; } @@ -8413,6 +8434,7 @@ static int ConvertToString(Tcl_Interp *interp, Tcl_Obj *objPtr, NsfParam CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { + (void)interp; (void)pPtr; *clientData = (char *)ObjStr(objPtr); *outObjPtr = objPtr; return TCL_OK; @@ -8456,7 +8478,7 @@ if (*value == '-' && (pPtr->flags & NSF_ARG_CHECK_NONPOS) && isalpha(*(value+1)) - && strchr(value+1, ' ') == 0 + && strchr(value+1, ' ') == NULL ) { NsfLog(interp, NSF_LOG_WARN, "Value '%s' of parameter '%s' could be a non-positional argument", value, pPtr->name); @@ -8473,6 +8495,7 @@ static int ConvertToNothing(Tcl_Interp *interp, Tcl_Obj *objPtr, NsfParam CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { + (void)interp; (void)pPtr; (void)clientData; *outObjPtr = objPtr; return TCL_OK; } @@ -8573,6 +8596,7 @@ static int ConvertToRelation(Tcl_Interp *interp, Tcl_Obj *objPtr, NsfParam CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { + (void)interp; (void)pPtr; /* NsfRelationCmd is the real setter, which checks the values according to the relation type (Class, List of Class, list of filters; we treat it here just like a tclobj */ @@ -8678,6 +8702,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { Tcl_Obj *patternObj = objPtr; CONST char *pattern = ObjStr(objPtr); + (void)pPtr; if (NoMetaChars(pattern)) { /* we have no meta characters, we try to check for an existing object */ @@ -8707,7 +8732,7 @@ } static Tcl_Obj * -ParamCheckObj(Tcl_Interp *interp, CONST char *start, size_t len) { +ParamCheckObj(CONST char *start, size_t len) { Tcl_Obj *checker = Tcl_NewStringObj("type=", 5); Tcl_AppendLimitedToObj(checker, start, len, INT_MAX, NULL); return checker; @@ -8730,9 +8755,10 @@ ParamOptionParse(Tcl_Interp *interp, CONST char *argString, size_t start, size_t remainder, int disallowedOptions, NsfParam *paramPtr) { - int optionLength, result = TCL_OK; CONST char *dotdot, *option = argString + start; char *firstComma = memchr(option, ',', remainder); + size_t optionLength; + int result = TCL_OK; if (firstComma == NULL) { optionLength = remainder; @@ -8853,7 +8879,8 @@ for (i=0; stringTypeOpts[i]; i++) { /* Do not allow abbreviations, so the additional strlen checks for a full match */ - if (strncmp(option, stringTypeOpts[i], optionLength) == 0 && strlen(stringTypeOpts[i]) == optionLength) { + if (strncmp(option, stringTypeOpts[i], optionLength) == 0 + && strlen(stringTypeOpts[i]) == optionLength) { found = i; break; } @@ -8865,7 +8892,7 @@ INCR_REF_COUNT(paramPtr->converterArg); } else { /* must be a converter defined via method */ - paramPtr->converterName = ParamCheckObj(interp, option, optionLength); + paramPtr->converterName = ParamCheckObj(option, optionLength); INCR_REF_COUNT(paramPtr->converterName); result = ParamOptionSetConverter(interp, paramPtr, ObjStr(paramPtr->converterName), ConvertViaCmd); } @@ -9009,7 +9036,7 @@ return result; } if (paramPtr->converterName == NULL) { - converterNameObj = ParamCheckObj(interp, paramPtr->type, strlen(paramPtr->type)); + converterNameObj = ParamCheckObj(paramPtr->type, strlen(paramPtr->type)); INCR_REF_COUNT(converterNameObj); } else { converterNameObj = paramPtr->converterName; @@ -9138,7 +9165,7 @@ MakeProc(Tcl_Namespace *nsPtr, NsfAssertionStore *aStore, Tcl_Interp *interp, Tcl_Obj *nameObj, Tcl_Obj *args, Tcl_Obj *body, Tcl_Obj *precondition, Tcl_Obj *postcondition, NsfObject *object, - int withPublic, int withPer_object, int clsns) { + int withPer_object, int clsns) { Tcl_CallFrame frame, *framePtr = &frame; CONST char *methodName = ObjStr(nameObj); NsfParsedParam parsedParam; @@ -9204,12 +9231,7 @@ procPtr->cmdPtr->nsPtr = ((Command *)object->id)->nsPtr; } - ParamDefsStore(interp, (Tcl_Command)procPtr->cmdPtr, parsedParam.paramDefs); -#if 0 - if (!withPublic) { - Tcl_Command_flags((Tcl_Command)procPtr->cmdPtr) |= NSF_CMD_PROTECTED_METHOD; - } -#endif + ParamDefsStore((Tcl_Command)procPtr->cmdPtr, parsedParam.paramDefs); Tcl_SetObjResult(interp, MethodHandleObj(object, withPer_object, methodName)); result = TCL_OK; } @@ -9234,7 +9256,7 @@ MakeMethod(Tcl_Interp *interp, NsfObject *object, NsfClass *cl, Tcl_Obj *nameObj, Tcl_Obj *args, Tcl_Obj *body, Tcl_Obj *precondition, Tcl_Obj *postcondition, - int withPublic, int clsns) { + int clsns) { CONST char *argsStr = ObjStr(args), *bodyStr = ObjStr(body), *nameStr = ObjStr(nameObj); int result; @@ -9269,11 +9291,11 @@ } result = MakeProc(cl ? cl->nsPtr : object->nsPtr, aStore, interp, nameObj, args, body, precondition, postcondition, - object, withPublic, cl == NULL, clsns); + object, cl == NULL, clsns); #else result = MakeProc(cl ? cl->nsPtr : object->nsPtr, NULL, interp, nameObj, args, body, NULL, NULL, - object, withPublic, cl == NULL, clsns); + object, cl == NULL, clsns); #endif } @@ -9344,6 +9366,7 @@ InvokeShadowedProc(Tcl_Interp *interp, Tcl_Obj *procNameObj, int objc, Tcl_Obj *CONST objv[]) { int result; #if 1 + (void)procNameObj; /* * For the time being, we call the shadowed proc defined with a * mutated name. It should be possible to compile and call the @@ -9521,7 +9544,7 @@ } cmdNsPtr = Tcl_Command_nsPtr(cmd); - ParamDefsStore(interp, cmd, paramDefs); + ParamDefsStore(cmd, paramDefs); /*fprintf(stderr, "NsfAddParameterProc procName '%s' define cmd '%s' %p in namespace %s\n", procName, Tcl_GetCommandName(interp, cmd), cmd, cmdNsPtr->fullName);*/ @@ -10391,6 +10414,7 @@ NsfCallStackContent *cscPtr; CONST char *methodName; Tcl_Obj **nobjv; + (void)clientData; if (objc < 2) { /* No arguments were provided */ @@ -10564,6 +10588,8 @@ Tcl_Obj *obj = (Tcl_Obj *)clientData; NsfObject *object; char *resultMsg = NULL; + (void)name; + (void)name2; /*fprintf(stderr, "NsfUnsetTrace %s flags %.4x %.4x\n", name, flags, flags & TCL_INTERP_DESTROYED); **/ @@ -10852,7 +10878,7 @@ } if (nsPtr) { - NsfNamespaceInit(interp, nsPtr); + NsfNamespaceInit(nsPtr); } /* fprintf(stderr, "PrimitiveOInit %p %s, ns %p\n", object, name, nsPtr); */ @@ -11422,7 +11448,7 @@ * Trying CallDirectly does not make much sense, since init is * already defined in predefined */ - methodObj = NsfMethodObj(interp, object, NSF_o_init_idx); + methodObj = NsfMethodObj(object, NSF_o_init_idx); if (methodObj) { result = CallMethod((ClientData) object, interp, methodObj, nobjc+2, nobjv, NSF_CM_NO_PROTECT|NSF_CSC_IMMEDIATE); @@ -11443,7 +11469,7 @@ static int -HasMetaProperty(Tcl_Interp *interp, NsfClass *cl) { +HasMetaProperty(NsfClass *cl) { return cl->object.flags & NSF_IS_ROOT_META_CLASS; } @@ -11459,13 +11485,13 @@ NsfClasses *pl; /* is the class the most general meta-class? */ - if (HasMetaProperty(interp, cl)) { + if (HasMetaProperty(cl)) { return 1; } /* is the class a subclass of a meta-class? */ for (pl = ComputeOrder(cl, cl->order, Super); pl; pl = pl->nextPtr) { - if (HasMetaProperty(interp, pl->cl)) { + if (HasMetaProperty(pl->cl)) { return 1; } } @@ -11972,7 +11998,7 @@ if (objc > 1) { result = ObjectDispatch(clientData, interp, objc, objv, NSF_CSC_IMMEDIATE); } else { - result = DispatchDefaultMethod(clientData, interp, objc, objv, NSF_CSC_IMMEDIATE); + result = DispatchDefaultMethod(clientData, interp, objv[0], NSF_CSC_IMMEDIATE); } } else { /*fprintf(stderr, "CallForwarder: no nsf object %s\n", ObjStr(tcd->cmdName));*/ @@ -12168,6 +12194,10 @@ int flags) /* Information about what happened. */ { int *donePtr = (int *) clientData; + (void)interp; + (void)name1; + (void)name2; + (void)flags; *donePtr = 1; return (char *) NULL; @@ -12424,7 +12454,7 @@ static int ArgumentError(Tcl_Interp *interp, CONST char *errorMsg, NsfParam CONST *paramPtr, Tcl_Obj *cmdNameObj, Tcl_Obj *methodObj) { - Tcl_Obj *argStringObj = ParamDefsSyntax(interp, paramPtr); + Tcl_Obj *argStringObj = ParamDefsSyntax(paramPtr); NsfObjWrongArgs(interp, errorMsg, cmdNameObj, methodObj, ObjStr(argStringObj)); DECR_REF_COUNT(argStringObj); @@ -12594,7 +12624,7 @@ /* we have a default, do we have to subst it? */ if (pPtr->flags & NSF_ARG_SUBST_DEFAULT) { - int result = SubstValue(interp, pcPtr->object, &newValue); + int result = SubstValue(interp, &newValue); if (result != TCL_OK) { return result; } @@ -13006,7 +13036,7 @@ switch (style) { case 0: listObj = ParamDefsFormat(interp, paramsPtr); break; case 1: listObj = ParamDefsList(interp, paramsPtr); break; - case 2: listObj = ParamDefsSyntax(interp, paramsPtr); break; + case 2: listObj = ParamDefsSyntax(paramsPtr); break; default: listObj = NULL; } @@ -13100,7 +13130,7 @@ mdPtr->methodName);*/ if (((Command *)cmd)->objProc == mdPtr->proc) { - NsfParamDefs paramDefs = {mdPtr->paramDefs, mdPtr->nrParameters}; + NsfParamDefs paramDefs = {mdPtr->paramDefs, mdPtr->nrParameters, NULL, NULL}; Tcl_Obj *list = ListParamDefs(interp, paramDefs.paramsPtr, withVarnames); Tcl_SetObjResult(interp, list); @@ -13542,7 +13572,7 @@ } static int -ProtectionMatches(Tcl_Interp *interp, int withCallprotection, Tcl_Command cmd) { +ProtectionMatches(int withCallprotection, Tcl_Command cmd) { int result, isProtected = Tcl_Command_flags(cmd) & NSF_CMD_PROTECTED_METHOD; if (withCallprotection == CallprotectionNULL) { withCallprotection = CallprotectionPublicIdx; @@ -13556,7 +13586,7 @@ return result; } -static int MethodSourceMatches(Tcl_Interp *interp, int withSource, NsfClass *cl, NsfObject *object) { +static int MethodSourceMatches(int withSource, NsfClass *cl, NsfObject *object) { int isBaseClass; if (withSource == SourceAllIdx) { @@ -13657,7 +13687,7 @@ assert(tablePtr); - if (pattern && NoMetaChars(pattern) && strchr(pattern, ' ') == 0) { + if (pattern && NoMetaChars(pattern) && strchr(pattern, ' ') == NULL) { /* * We have a pattern that can be used for direct lookup; no need * to iterate @@ -13676,7 +13706,7 @@ return TCL_OK; } - if (ProtectionMatches(interp, withCallprotection, cmd) && methodTypeMatch) { + if (ProtectionMatches(withCallprotection, cmd) && methodTypeMatch) { if (prefixLength) { Tcl_DStringAppend(prefix, key, -1); key = Tcl_DStringValue(prefix); @@ -13736,7 +13766,7 @@ } if (Tcl_Command_flags(cmd) & NSF_CMD_CLASS_ONLY_METHOD && !NsfObjectIsClass(object)) continue; - if (!ProtectionMatches(interp, withCallprotection, cmd) || !methodTypeMatch) continue; + if (!ProtectionMatches(withCallprotection, cmd) || !methodTypeMatch) continue; if (prefixLength) { Tcl_DStringAppend(prefix, key, -1); @@ -14863,6 +14893,7 @@ */ static int NsfInvalidateObjectParameterCmd(Tcl_Interp *interp, NsfClass *cl) { + (void)interp; if (cl->parsedParamPtr) { /*fprintf(stderr, " %s invalidate %p\n", ClassName(cl), cl->parsedParamPtr);*/ ParsedParamFree(cl->parsedParamPtr); @@ -14926,7 +14957,6 @@ {-argName "object" -required 1 -type object} {-argName "-inner-namespace"} {-argName "-per-object"} - {-argName "-public"} {-argName "name" -required 1 -type tclobj} {-argName "arguments" -required 1 -type tclobj} {-argName "body" -required 1 -type tclobj} @@ -14936,7 +14966,7 @@ */ static int NsfMethodCmd(Tcl_Interp *interp, NsfObject *object, - int withInner_namespace, int withPer_object, int withPublic, + int withInner_namespace, int withPer_object, Tcl_Obj *nameObj, Tcl_Obj *arguments, Tcl_Obj *body, Tcl_Obj *withPrecondition, Tcl_Obj *withPostcondition) { NsfClass *cl = @@ -14948,7 +14978,7 @@ } return MakeMethod(interp, object, cl, nameObj, arguments, body, withPrecondition, withPostcondition, - withPublic, withInner_namespace); + withInner_namespace); } /* @@ -15067,7 +15097,7 @@ if (paramDefs == NULL) { /* acquire new paramDefs */ paramDefs = ParamDefsNew(); - ParamDefsStore(interp, cmd, paramDefs); + ParamDefsStore(cmd, paramDefs); /*fprintf(stderr, "new param defs %p for cmd %p %s\n", paramDefs, cmd, methodName);*/ } objPtr = methodproperty == MethodpropertySlotobjIdx ? ¶mDefs->slotObj : ¶mDefs->returns; @@ -16036,6 +16066,7 @@ static void ParamDupInteralRep(Tcl_Obj *srcPtr, Tcl_Obj *dupPtr) { + (void)dupPtr; Tcl_Panic("%s of type %s should not be called", "dupStringProc", srcPtr->typePtr->name); } @@ -16193,7 +16224,7 @@ * There is no parameter definition available, get a new one in * the the string representation. */ - Tcl_Obj *methodObj = NsfMethodObj(interp, object, NSF_o_objectparameter_idx); + Tcl_Obj *methodObj = NsfMethodObj(object, NSF_o_objectparameter_idx); if (methodObj) { /* fprintf(stderr, "=== calling %s objectparameter\n", ObjectName(object));*/ @@ -16647,7 +16678,7 @@ if (h->clientData) { GuardDel((NsfCmdList *) h); } - GuardAdd(interp, h, guardObj); + GuardAdd(h, guardObj); object->flags &= ~NSF_FILTER_ORDER_VALID; return TCL_OK; } @@ -16665,7 +16696,7 @@ static int NsfOInstvarMethod(Tcl_Interp *interp, NsfObject *object, int objc, Tcl_Obj *CONST objv[]) { - callFrameContext ctx = {0}; + callFrameContext ctx = {0, NULL, NULL}; int result; if (object && (object->filterStack || object->mixinStack) ) { @@ -16704,7 +16735,7 @@ if (h->clientData) { GuardDel((NsfCmdList *) h); } - GuardAdd(interp, h, guardObj); + GuardAdd(h, guardObj); object->flags &= ~NSF_MIXIN_ORDER_VALID; return TCL_OK; } @@ -16722,6 +16753,7 @@ */ static int NsfONoinitMethod(Tcl_Interp *interp, NsfObject *object) { + (void)interp; object->flags |= NSF_INIT_CALLED; return TCL_OK; } @@ -16806,7 +16838,7 @@ int i, result = TCL_ERROR; CONST char *frameInfo = NULL; Tcl_CallFrame *framePtr = NULL, *savedVarFramePtr; - + (void)object; /* * Find the level to use for executing the command. */ @@ -16878,7 +16910,7 @@ Tcl_Obj *frameInfoObj = NULL; int i, result = TCL_ERROR; CONST char *frameInfo; - callFrameContext ctx = {0}; + callFrameContext ctx = {0, NULL, NULL}; if (objc % 2 == 0) { frameInfo = ObjStr(objv[1]); @@ -16919,7 +16951,7 @@ int result = TCL_ERROR; CONST char *fullName = ObjStr(objPtr); CONST char *vn; - callFrameContext ctx = {0}; + callFrameContext ctx = {0, NULL, NULL}; if (RUNTIME_STATE(interp)->exitHandlerDestroyRound != NSF_EXITHANDLER_OFF) { fprintf(stderr, "### Can't make objects volatile during shutdown\n"); @@ -17078,7 +17110,7 @@ } else { parentNsPtr = CallingNameSpace(interp); nameObj = tmpName = NameInNamespaceObj(interp, nameString, parentNsPtr); - if (strchr(nameString, ':') > 0) { + if (strchr(nameString, ':')) { parentNsPtr = NULL; } INCR_REF_COUNT(tmpName); @@ -17128,7 +17160,7 @@ * If the name contains colons, the parentNsPtr is not appropriate * for determining the parent */ - if (strchr(nameString, ':') > 0) { + if (strchr(nameString, ':')) { parentNsPtr = NULL; } nameString = ObjStr(tmpObj); @@ -17244,6 +17276,7 @@ static int NsfCDeallocMethod(Tcl_Interp *interp, NsfClass *cl, Tcl_Obj *obj) { NsfObject *object; + (void)cl; if (GetObjectFromObj(interp, obj, &object) != TCL_OK) { return NsfPrintError(interp, "Can't destroy object %s that does not exist", @@ -17271,7 +17304,7 @@ if (h->clientData) { GuardDel(h); } - GuardAdd(interp, h, guardObj); + GuardAdd(h, guardObj); FilterInvalidateObjOrders(interp, cl); return TCL_OK; } @@ -17303,7 +17336,7 @@ if (h->clientData) { GuardDel((NsfCmdList *) h); } - GuardAdd(interp, h, guardObj); + GuardAdd(h, guardObj); MixinInvalidateObjOrders(interp, cl); return TCL_OK; } @@ -17756,7 +17789,7 @@ Tcl_InitHashTable(dups, TCL_STRING_KEYS); if (object->nsPtr) { cmdTablePtr = Tcl_Namespace_cmdTablePtr(object->nsPtr); - if (MethodSourceMatches(interp, withSource, NULL, object)) { + if (MethodSourceMatches(withSource, NULL, object)) { ListMethodKeys(interp, cmdTablePtr, NULL, pattern, methodType, withCallprotection, withPath, dups, object, withPer_object); @@ -17776,12 +17809,12 @@ assert(mixin); if (withIncontext) { if (!RUNTIME_STATE(interp)->guardCount) { - guardOk = GuardCall(object, 0, 0, interp, ml->clientData, NULL); + guardOk = GuardCall(object, interp, ml->clientData, NULL); } } if (mixin && guardOk == TCL_OK) { Tcl_HashTable *cmdTablePtr = Tcl_Namespace_cmdTablePtr(mixin->nsPtr); - if (!MethodSourceMatches(interp, withSource, mixin, NULL)) continue; + if (!MethodSourceMatches(withSource, mixin, NULL)) continue; ListMethodKeys(interp, cmdTablePtr, NULL, pattern, methodType, withCallprotection, withPath, dups, object, withPer_object); @@ -17793,7 +17826,7 @@ /* append method keys from inheritance order */ for (pl = ComputeOrder(object->cl, object->cl->order, Super); pl; pl = pl->nextPtr) { Tcl_HashTable *cmdTablePtr = Tcl_Namespace_cmdTablePtr(pl->cl->nsPtr); - if (!MethodSourceMatches(interp, withSource, pl->cl, NULL)) continue; + if (!MethodSourceMatches(withSource, pl->cl, NULL)) continue; ListMethodKeys(interp, cmdTablePtr, NULL, pattern, methodType, withCallprotection, withPath, dups, object, withPer_object); @@ -18358,6 +18391,9 @@ Tcl_Obj *CONST objv[]) { CallFrame *varFramePtr = Tcl_Interp_varFramePtr(interp); Proc *proc = Tcl_CallFrame_procPtr(varFramePtr); + (void)clientData; + (void)objc; + (void)objv; if (proc) { CompiledLocal *ap; @@ -18427,7 +18463,7 @@ } static int -ObjectHasChildren(Tcl_Interp *interp, NsfObject *object) { +ObjectHasChildren(NsfObject *object) { Tcl_Namespace *ns = object->nsPtr; int result = 0; @@ -18558,7 +18594,7 @@ char *key = Tcl_GetHashKey(commandNameTablePtr, hPtr); object = GetObjectFromString(interp, key); - if (object && !NsfObjectIsClass(object) && !ObjectHasChildren(interp, object)) { + if (object && !NsfObjectIsClass(object) && !ObjectHasChildren(object)) { /*fprintf(stderr, " ... delete object %s %p, class=%s id %p\n", key, object, ClassName(object->cl), object->id);*/ @@ -18583,7 +18619,7 @@ /*fprintf(stderr, "cl key = %s %p\n", key, cl);*/ if (cl - && !ObjectHasChildren(interp, (NsfObject*)cl) + && !ObjectHasChildren((NsfObject*)cl) && !ClassHasInstances(cl) && !ClassHasSubclasses(cl) && !IsBaseClass(cl) Index: generic/nsfInt.h =================================================================== diff -u -r821c01bd241c51be4fa0931d423d8f8658606ee1 -rdb9cc86bb6df8dadf59f951a504c908fb8d14ef0 --- generic/nsfInt.h (.../nsfInt.h) (revision 821c01bd241c51be4fa0931d423d8f8658606ee1) +++ generic/nsfInt.h (.../nsfInt.h) (revision db9cc86bb6df8dadf59f951a504c908fb8d14ef0) @@ -609,7 +609,7 @@ int NsfCallCommand(Tcl_Interp *interp, NsfGlobalNames name, int objc, Tcl_Obj *CONST objv[]); int NsfShadowTclCommands(Tcl_Interp *interp, NsfShadowOperations load); -Tcl_Obj * NsfMethodObj(Tcl_Interp *interp, NsfObject *object, int methodIdx); +Tcl_Obj * NsfMethodObj(NsfObject *object, int methodIdx); /* Index: generic/nsfShadow.c =================================================================== diff -u -rc341df315dd3856f25f65ec54abb61277268d29b -rdb9cc86bb6df8dadf59f951a504c908fb8d14ef0 --- generic/nsfShadow.c (.../nsfShadow.c) (revision c341df315dd3856f25f65ec54abb61277268d29b) +++ generic/nsfShadow.c (.../nsfShadow.c) (revision db9cc86bb6df8dadf59f951a504c908fb8d14ef0) @@ -96,7 +96,7 @@ cmd = Tcl_FindCommand(interp, ObjStr(objv[1]), (Tcl_Namespace *)NULL,0); if (cmd) { NsfObject *object = NsfGetObjectFromCmdPtr(cmd); - Tcl_Obj *methodObj = object ? NsfMethodObj(interp, object, NSF_o_move_idx) : NULL; + Tcl_Obj *methodObj = object ? NsfMethodObj(object, NSF_o_move_idx) : NULL; if (object && methodObj) { return NsfCallMethodWithArgs((ClientData)object, interp, methodObj, objv[2], 1, 0, NSF_CSC_IMMEDIATE); Index: generic/nsfStack.c =================================================================== diff -u -r9be296c7be8b0c04eaedd9f96c36d626aa7c2c97 -rdb9cc86bb6df8dadf59f951a504c908fb8d14ef0 --- generic/nsfStack.c (.../nsfStack.c) (revision 9be296c7be8b0c04eaedd9f96c36d626aa7c2c97) +++ generic/nsfStack.c (.../nsfStack.c) (revision db9cc86bb6df8dadf59f951a504c908fb8d14ef0) @@ -806,6 +806,8 @@ cscPtr->flags = 0; } #else + (void)interp; + (void)cmd; cscPtr->flags = 0; #endif Index: generic/tclAPI.h =================================================================== diff -u -r7166c2bd4fb473924468cd82fde8a6eaa529cae9 -rdb9cc86bb6df8dadf59f951a504c908fb8d14ef0 --- generic/tclAPI.h (.../tclAPI.h) (revision 7166c2bd4fb473924468cd82fde8a6eaa529cae9) +++ generic/tclAPI.h (.../tclAPI.h) (revision db9cc86bb6df8dadf59f951a504c908fb8d14ef0) @@ -13,6 +13,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static CONST char *opts[] = {"args", "body", "definition", "handle", "parameter", "parametersyntax", "type", "precondition", "postcondition", "submethods", NULL}; + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "infomethodsubcmd", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -25,6 +26,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static CONST char *opts[] = {"all", "protected", "public", NULL}; + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-callprotection", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -37,6 +39,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static CONST char *opts[] = {"all", "scripted", "builtin", "alias", "forwarder", "object", "setter", "nsfproc", NULL}; + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-methodtype", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -49,6 +52,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static CONST char *opts[] = {"all", "class", "object", NULL}; + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-scope", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -61,6 +65,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static CONST char *opts[] = {"method", "object", "default", NULL}; + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-frame", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -73,6 +78,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static CONST char *opts[] = {"check", "object-invar", "class-invar", NULL}; + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "assertionsubcmd", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -85,6 +91,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static CONST char *opts[] = {"debug", "filter", "softrecreate", "objectsystems", "keepinitcmd", "checkresults", "checkarguments", NULL}; + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "configureoption", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -97,6 +104,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static CONST char *opts[] = {"proc", "method", "methodpath", "object", "class", "activelevel", "args", "activemixin", "calledproc", "calledmethod", "calledclass", "callingproc", "callingmethod", "callingclass", "callinglevel", "callingobject", "filterreg", "isnextcall", "next", NULL}; + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "currentoption", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -109,6 +117,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static CONST char *opts[] = {"class-only", "call-protected", "redefine-protected", "returns", "slotcontainer", "slotobj", NULL}; + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "methodproperty", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -121,6 +130,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static CONST char *opts[] = {"object-mixin", "class-mixin", "object-filter", "class-filter", "class", "superclass", "rootclass", NULL}; + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "relationtype", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -133,6 +143,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static CONST char *opts[] = {"class", "baseclass", "metaclass", NULL}; + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "objectkind", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -145,6 +156,7 @@ ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static CONST char *opts[] = {"all", "application", "baseclasses", NULL}; + (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-source", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; @@ -306,7 +318,7 @@ static int NsfInvalidateObjectParameterCmd(Tcl_Interp *interp, NsfClass *class); static int NsfIsCmd(Tcl_Interp *interp, int withComplain, Tcl_Obj *constraint, Tcl_Obj *value); static int NsfIsObjectCmd(Tcl_Interp *interp, Tcl_Obj *value); -static int NsfMethodCmd(Tcl_Interp *interp, NsfObject *object, int withInner_namespace, int withPer_object, int withPublic, Tcl_Obj *methodName, Tcl_Obj *arguments, Tcl_Obj *body, Tcl_Obj *withPrecondition, Tcl_Obj *withPostcondition); +static int NsfMethodCmd(Tcl_Interp *interp, NsfObject *object, int withInner_namespace, int withPer_object, Tcl_Obj *methodName, Tcl_Obj *arguments, Tcl_Obj *body, Tcl_Obj *withPrecondition, Tcl_Obj *withPostcondition); static int NsfMethodPropertyCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *methodName, int methodproperty, Tcl_Obj *value); static int NsfMyCmd(Tcl_Interp *interp, int withLocal, Tcl_Obj *methodName, int nobjc, Tcl_Obj *CONST nobjv[]); static int NsfNSCopyCmdsCmd(Tcl_Interp *interp, Tcl_Obj *fromNs, Tcl_Obj *toNs); @@ -873,6 +885,7 @@ static int NsfAliasCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfAliasCmdIdx].paramDefs, @@ -895,6 +908,7 @@ static int NsfAssertionCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfAssertionCmdIdx].paramDefs, @@ -914,6 +928,7 @@ static int NsfColonCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + (void)clientData; @@ -924,6 +939,7 @@ static int NsfConfigureCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfConfigureCmdIdx].paramDefs, @@ -943,6 +959,7 @@ static int NsfCreateObjectSystemCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfCreateObjectSystemCmdIdx].paramDefs, @@ -963,6 +980,7 @@ static int NsfCurrentCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfCurrentCmdIdx].paramDefs, @@ -980,6 +998,7 @@ static int NsfDebugRunAssertionsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + (void)clientData; @@ -996,6 +1015,7 @@ static int NsfDispatchCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfDispatchCmdIdx].paramDefs, @@ -1016,6 +1036,7 @@ static int NsfExistsVarCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfExistsVarCmdIdx].paramDefs, @@ -1034,6 +1055,7 @@ static int NsfFinalizeObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + (void)clientData; @@ -1050,6 +1072,7 @@ static int NsfForwardCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfForwardCmdIdx].paramDefs, @@ -1077,6 +1100,7 @@ static int NsfImportvarCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfImportvarCmdIdx].paramDefs, @@ -1095,6 +1119,7 @@ static int NsfInterpObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfInterpObjCmdIdx].paramDefs, @@ -1113,6 +1138,7 @@ static int NsfInvalidateObjectParameterCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfInvalidateObjectParameterCmdIdx].paramDefs, @@ -1131,6 +1157,7 @@ static int NsfIsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfIsCmdIdx].paramDefs, @@ -1150,6 +1177,7 @@ static int NsfIsObjectCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + (void)clientData; @@ -1166,6 +1194,7 @@ static int NsfMethodCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfMethodCmdIdx].paramDefs, @@ -1176,22 +1205,22 @@ NsfObject *object = (NsfObject *)pc.clientData[0]; int withInner_namespace = (int )PTR2INT(pc.clientData[1]); int withPer_object = (int )PTR2INT(pc.clientData[2]); - int withPublic = (int )PTR2INT(pc.clientData[3]); - Tcl_Obj *methodName = (Tcl_Obj *)pc.clientData[4]; - Tcl_Obj *arguments = (Tcl_Obj *)pc.clientData[5]; - Tcl_Obj *body = (Tcl_Obj *)pc.clientData[6]; - Tcl_Obj *withPrecondition = (Tcl_Obj *)pc.clientData[7]; - Tcl_Obj *withPostcondition = (Tcl_Obj *)pc.clientData[8]; + Tcl_Obj *methodName = (Tcl_Obj *)pc.clientData[3]; + Tcl_Obj *arguments = (Tcl_Obj *)pc.clientData[4]; + Tcl_Obj *body = (Tcl_Obj *)pc.clientData[5]; + Tcl_Obj *withPrecondition = (Tcl_Obj *)pc.clientData[6]; + Tcl_Obj *withPostcondition = (Tcl_Obj *)pc.clientData[7]; assert(pc.status == 0); - return NsfMethodCmd(interp, object, withInner_namespace, withPer_object, withPublic, methodName, arguments, body, withPrecondition, withPostcondition); + return NsfMethodCmd(interp, object, withInner_namespace, withPer_object, methodName, arguments, body, withPrecondition, withPostcondition); } } static int NsfMethodPropertyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfMethodPropertyCmdIdx].paramDefs, @@ -1214,6 +1243,7 @@ static int NsfMyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfMyCmdIdx].paramDefs, @@ -1233,6 +1263,7 @@ static int NsfNSCopyCmdsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfNSCopyCmdsCmdIdx].paramDefs, @@ -1252,6 +1283,7 @@ static int NsfNSCopyVarsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfNSCopyVarsCmdIdx].paramDefs, @@ -1270,6 +1302,7 @@ static int NsfNextCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + (void)clientData; @@ -1286,6 +1319,7 @@ static int NsfProcCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfProcCmdIdx].paramDefs, @@ -1306,6 +1340,7 @@ static int NsfQualifyObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + (void)clientData; @@ -1322,6 +1357,7 @@ static int NsfRelationCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfRelationCmdIdx].paramDefs, @@ -1341,6 +1377,7 @@ static int NsfSelfCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + (void)clientData; @@ -1357,6 +1394,7 @@ static int NsfSetVarCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfSetVarCmdIdx].paramDefs, @@ -1377,6 +1415,7 @@ static int NsfSetterCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; + (void)clientData; if (ArgumentParse(interp, objc, objv, NULL, objv[0], method_definitions[NsfSetterCmdIdx].paramDefs, @@ -1396,6 +1435,7 @@ static int NsfShowStackCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + (void)clientData; @@ -2192,11 +2232,10 @@ {"::nsf::isobject", NsfIsObjectCmdStub, 1, { {"value", NSF_ARG_REQUIRED, 0, ConvertToTclobj}} }, -{"::nsf::method", NsfMethodCmdStub, 9, { +{"::nsf::method", NsfMethodCmdStub, 8, { {"object", NSF_ARG_REQUIRED, 0, ConvertToObject}, {"-inner-namespace", 0, 0, ConvertToString}, {"-per-object", 0, 0, ConvertToString}, - {"-public", 0, 0, ConvertToString}, {"methodName", NSF_ARG_REQUIRED, 0, ConvertToTclobj}, {"arguments", NSF_ARG_REQUIRED, 0, ConvertToTclobj}, {"body", NSF_ARG_REQUIRED, 0, ConvertToTclobj},