Index: TODO =================================================================== diff -u -reed87eee0cf0a17607a7d5a056c45e6bb53ecb83 -r6c9eb2ec861ed79b5dedf32abe2ea26059168215 --- TODO (.../TODO) (revision eed87eee0cf0a17607a7d5a056c45e6bb53ecb83) +++ TODO (.../TODO) (revision 6c9eb2ec861ed79b5dedf32abe2ea26059168215) @@ -5556,6 +5556,21 @@ ======================================================================== TODO: +- Is NsfParamDefs.slotObj obsolete? + + Right now, the slot objs responsible for (method) parameters are + stored along with each Nsf_Param, and not as a + NsfParamDefs.slotObj. NsfParamDefs.slotObj is not used actively, + ::nsf::method::property slotobj is dysfunctional (expects extra + argument, which cannot be provided + control-flow issue CID 88767). + + pt. 1: For the time being, I removed ::nsf::method::property slotobj + entirely (also to fix CID 88767). Seems harmless, not tested + explicitly, not required by object-system scripts, ... + + pt. 2: NsfParamDefs.slotObj and its memory-management statements all + over remain in place, to be reviewed. + - should we change "/obj/ info lookup syntax /methodName/" to return obj and method as well? (similar to "info method syntax /methodName/") Index: generic/nsf.c =================================================================== diff -u -r0b1ac7f47948c36c4e03fc3d6dbce0a04d9418d4 -r6c9eb2ec861ed79b5dedf32abe2ea26059168215 --- generic/nsf.c (.../nsf.c) (revision 0b1ac7f47948c36c4e03fc3d6dbce0a04d9418d4) +++ generic/nsf.c (.../nsf.c) (revision 6c9eb2ec861ed79b5dedf32abe2ea26059168215) @@ -25112,36 +25112,29 @@ Tcl_SetIntObj(Tcl_GetObjResult(interp), (Tcl_Command_flags(cmd) & flag) != 0); break; } - - case MethodpropertySlotobjIdx: case MethodpropertyReturnsIdx: { NsfParamDefs *paramDefs; Tcl_Obj **objPtr; - if (valueObj == NULL && methodproperty == MethodpropertySlotobjIdx) { - return NsfPrintError(interp, "option 'slotobj' of method '%s' requires argument", - methodName); - } - paramDefs = ParamDefsGet(cmd, NULL); /*fprintf(stderr, "MethodProperty, ParamDefsGet cmd %p paramDefs %p returns %p\n", cmd, paramDefs, (paramDefs != NULL) ?paramDefs->returns:NULL);*/ if (valueObj == NULL) { - /* a query for "returns" or "slotobj" */ + /* a query for "returns" */ Tcl_Obj *resultObj; if (paramDefs == NULL) { resultObj = NsfGlobalObjs[NSF_EMPTY]; } else { - objPtr = methodproperty == MethodpropertySlotobjIdx ? ¶mDefs->slotObj : ¶mDefs->returns; + objPtr = ¶mDefs->returns; resultObj = *objPtr ? *objPtr : NsfGlobalObjs[NSF_EMPTY]; } Tcl_SetObjResult(interp, resultObj); } else { - /* setting "returns" or "slotobj" */ + /* setting "returns" */ const char *valueString = ObjStr(valueObj); if (paramDefs == NULL) { @@ -25150,10 +25143,9 @@ ParamDefsStore(interp, cmd, paramDefs, 0); /*fprintf(stderr, "new param definitions %p for cmd %p %s\n", paramDefs, cmd, methodName);*/ } - objPtr = - methodproperty == MethodpropertySlotobjIdx ? - ¶mDefs->slotObj : ¶mDefs->returns; + objPtr = ¶mDefs->returns; + /* Set a new value; if there is already a value, free it */ if (*objPtr) { DECR_REF_COUNT2("paramDefsObj", *objPtr); Index: generic/nsfAPI.decls =================================================================== diff -u -rc5f2227387dec2a5c0af9b36dc1ebc8578d6603e -r6c9eb2ec861ed79b5dedf32abe2ea26059168215 --- generic/nsfAPI.decls (.../nsfAPI.decls) (revision c5f2227387dec2a5c0af9b36dc1ebc8578d6603e) +++ generic/nsfAPI.decls (.../nsfAPI.decls) (revision 6c9eb2ec861ed79b5dedf32abe2ea26059168215) @@ -204,7 +204,7 @@ {-argName "object" -required 1 -type object} {-argName "-per-object" -required 0 -nrargs 0 -type switch} {-argName "methodName" -required 1 -type tclobj} - {-argName "methodProperty" -required 1 -type "class-only|call-private|call-protected|redefine-protected|returns|slotobj"} + {-argName "methodProperty" -required 1 -type "class-only|call-private|call-protected|redefine-protected|returns"} {-argName "value" -type tclobj} } {-nxdoc 1} Index: generic/nsfAPI.h =================================================================== diff -u -rc5f2227387dec2a5c0af9b36dc1ebc8578d6603e -r6c9eb2ec861ed79b5dedf32abe2ea26059168215 --- generic/nsfAPI.h (.../nsfAPI.h) (revision c5f2227387dec2a5c0af9b36dc1ebc8578d6603e) +++ generic/nsfAPI.h (.../nsfAPI.h) (revision 6c9eb2ec861ed79b5dedf32abe2ea26059168215) @@ -194,12 +194,12 @@ return result; } -enum MethodpropertyIdx {MethodpropertyNULL, MethodpropertyClass_onlyIdx, MethodpropertyCall_privateIdx, MethodpropertyCall_protectedIdx, MethodpropertyRedefine_protectedIdx, MethodpropertyReturnsIdx, MethodpropertySlotobjIdx}; +enum MethodpropertyIdx {MethodpropertyNULL, MethodpropertyClass_onlyIdx, MethodpropertyCall_privateIdx, MethodpropertyCall_protectedIdx, MethodpropertyRedefine_protectedIdx, MethodpropertyReturnsIdx}; static int ConvertToMethodproperty(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; - static const char *opts[] = {"class-only", "call-private", "call-protected", "redefine-protected", "returns", "slotobj", NULL}; + static const char *opts[] = {"class-only", "call-private", "call-protected", "redefine-protected", "returns", NULL}; (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "methodProperty", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); @@ -268,7 +268,7 @@ {ConvertToMethodtype, "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"}, {ConvertToFrame, "method|object|default"}, {ConvertToCurrentoption, "proc|method|methodpath|object|class|activelevel|args|activemixin|calledproc|calledmethod|calledclass|callingproc|callingmethod|callingclass|callinglevel|callingobject|filterreg|isnextcall|nextmethod"}, - {ConvertToMethodproperty, "class-only|call-private|call-protected|redefine-protected|returns|slotobj"}, + {ConvertToMethodproperty, "class-only|call-private|call-protected|redefine-protected|returns"}, {ConvertToRelationtype, "object-mixin|class-mixin|object-filter|class-filter|class|superclass|rootclass"}, {ConvertToSource, "all|application|system"}, {ConvertToConfigureoption, "debug|dtrace|filter|profile|trace|softrecreate|objectsystems|keepcmds|checkresults|checkarguments"},