Index: TODO =================================================================== diff -u -r8eecbe5b3a2640ba1d3e1dc6dc5e9cec0c2a26ba -raa5b3f4293624fedf641985718ab15c82f5daf78 --- TODO (.../TODO) (revision 8eecbe5b3a2640ba1d3e1dc6dc5e9cec0c2a26ba) +++ TODO (.../TODO) (revision aa5b3f4293624fedf641985718ab15c82f5daf78) @@ -5816,6 +5816,10 @@ - reduce variable scope - prefer single returns statements in functions - dont't use CONST unless defined by Tcl-API + +code generator changes: +- create enum types instead of enum values for nsf API +- use enum types in code ======================================================================== TODO: Index: generic/gentclAPI.tcl =================================================================== diff -u -r16a02881bff0a0d626d0045dfd96660338d0c314 -raa5b3f4293624fedf641985718ab15c82f5daf78 --- generic/gentclAPI.tcl (.../gentclAPI.tcl) (revision 16a02881bff0a0d626d0045dfd96660338d0c314) +++ generic/gentclAPI.tcl (.../gentclAPI.tcl) (revision aa5b3f4293624fedf641985718ab15c82f5daf78) @@ -53,7 +53,7 @@ set enums [list ${name}NULL] foreach d $domain {lappend enums $name[string totitle [string map [list - _] $d]]Idx} subst { -enum ${name}Idx {[join $enums {, }]}; +typedef enum {[join $enums {, }]} ${name}Idx_t; static int ConvertTo${name}(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -105,7 +105,6 @@ if {![info exists (-typeName)]} {set (-typeName) $(-argName)} set converter [convertername $type $(-typeName)] append ::converter [createconverter $type $(-typeName)] - set (-argName) $type addFlags flags "NSF_ARG_IS_ENUMERATION" } default { @@ -183,7 +182,9 @@ set cVar 1 set (-argName) [string map [list - _] $(-argName)] if {[regexp {^_(.*)$} $(-argName) _ switchName]} { + # # non positional args + # set varName with[string totitle $switchName] set calledArg $varName set type "int " @@ -196,11 +197,18 @@ "int" {set type "Tcl_Obj *"} "int32" {set type "int "} "boolean" {set type "int "} - "*|*" {set type "int "} + "*|*" { + if {![info exists (-typeName)]} {set (-typeName) $(-argName)} + set type "[convertername $(-type) $(-typeName)]Idx_t " + #puts stderr "nonpos: (-typeName) <$(-typeName)> (-type) <$(-type)> ==> type=<$type>" + } default {error "type '$(-type)' not allowed for parameter"} } } } else { + # + # positionals + # set varName $(-argName) set calledArg $varName switch -glob $(-type) { @@ -249,7 +257,10 @@ append cleanup \n$post # end of obj pattern } - *|* {set type "int "} + *|* { + if {![info exists (-typeName)]} {set (-typeName) $(-argName)} + set type "[convertername $(-type) $(-typeName)]Idx_t " + } default { if {[info exists ::ptrConverter($(-type))]} { set type "$(-type) *" @@ -272,7 +283,7 @@ } if {!$ifSet} {lappend if "$type$varName"} if {$cVar} { - if {$type eq "int "} { + if {$type eq "int " || [string match "*Idx " $type]} { lappend c [subst -nocommands {$type$varName = ($type)PTR2INT(pc.clientData[$i]);}] } else { lappend c [subst -nocommands {$type$varName = ($type)pc.clientData[$i];}] Index: generic/nsf.c =================================================================== diff -u -r8eecbe5b3a2640ba1d3e1dc6dc5e9cec0c2a26ba -raa5b3f4293624fedf641985718ab15c82f5daf78 --- generic/nsf.c (.../nsf.c) (revision 8eecbe5b3a2640ba1d3e1dc6dc5e9cec0c2a26ba) +++ generic/nsf.c (.../nsf.c) (revision aa5b3f4293624fedf641985718ab15c82f5daf78) @@ -386,9 +386,10 @@ nonnull(1) nonnull(2) nonnull(3); static int AliasDeleteObjectReference(Tcl_Interp *interp, Tcl_Command cmd) nonnull(1) nonnull(2); -static int NsfMethodAliasCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, - const char *methodName, int withFrame, int withProtection, Tcl_Obj *cmdName) +/*static int NsfMethodAliasCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, + const char *methodName, FrameIdx_t withFrame, ProtectionIdx_t withProtection, Tcl_Obj *cmdName) nonnull(1) nonnull(2) nonnull(4); +*/ static int AliasRefetch(Tcl_Interp *interp, NsfObject *object, const char *methodName, AliasCmdClientData *tcd) @@ -424,7 +425,7 @@ EXTERN void NsfDStringArgv(Tcl_DString *dsPtr, int objc, Tcl_Obj *CONST objv[]) nonnull(1) nonnull(3); -static int MethodSourceMatches(int withSource, NsfClass *cl, NsfObject *object); +/* static int MethodSourceMatches(DefinitionsourceIdx_t withSource, NsfClass *cl, NsfObject *object); */ static NsfObjectOpt *NsfRequireObjectOpt(NsfObject *object) nonnull(1) returns_nonnull; @@ -16686,7 +16687,7 @@ if (likely(tcd->paramDefs != NULL && tcd->paramDefs->paramsPtr)) { /* * We have a parameter definition, parse the provided objv against the - * parameter definiton. + * parameter definition. */ result = ProcessMethodArguments(pcPtr, interp, NULL, (((tcd->flags & NSF_PROC_FLAG_CHECK_ALWAYS) != 0) ? NSF_ARGPARSE_CHECK : 0) @@ -22692,7 +22693,7 @@ nonnull_assert(cmd != NULL); Tcl_ListObjAppendElement(interp, listObj, object->cmdName); - if (withProtection != 0) { + if (withProtection != CallprotectionNULL) { Tcl_ListObjAppendElement(interp, listObj, ((Tcl_Command_flags(cmd) & NSF_CMD_CALL_PRIVATE_METHOD) != 0) ? Tcl_NewStringObj("private", 7) @@ -23300,10 +23301,10 @@ *---------------------------------------------------------------------- */ -static int MethodSourceMatches(int withSource, NsfClass *cl, NsfObject *object) { +static int MethodSourceMatches(DefinitionsourceIdx_t withSource, NsfClass *cl, NsfObject *object) { int isBaseClass; - if (withSource == SourceAllIdx) { + if (withSource == DefinitionsourceAllIdx) { return 1; } @@ -23313,14 +23314,14 @@ * be application specific. */ assert(object != NULL); - return (withSource == SourceApplicationIdx && !IsBaseClass(object)); + return (withSource == DefinitionsourceApplicationIdx && !IsBaseClass(object)); } assert(cl != NULL); isBaseClass = IsBaseClass(&cl->object); - if (withSource == SourceSystemIdx && isBaseClass) { + if (withSource == DefinitionsourceSystemIdx && isBaseClass) { return 1; - } else if (withSource == SourceApplicationIdx && !isBaseClass) { + } else if (withSource == DefinitionsourceApplicationIdx && !isBaseClass) { return 1; } return 0; @@ -24690,7 +24691,7 @@ } {-nxdoc 1} */ static int -NsfCmdInfoCmd(Tcl_Interp *interp, int subcmd, NsfObject *context, Tcl_Obj *methodNameObj, const char *pattern) { +NsfCmdInfoCmd(Tcl_Interp *interp, InfomethodsubcmdIdx_t subcmd, NsfObject *context, Tcl_Obj *methodNameObj, const char *pattern) { nonnull_assert(interp != NULL); nonnull_assert(methodNameObj != NULL); @@ -24705,7 +24706,7 @@ } */ static int -NsfConfigureCmd(Tcl_Interp *interp, int configureoption, Tcl_Obj *valueObj) { +NsfConfigureCmd(Tcl_Interp *interp, ConfigureoptionIdx_t configureoption, Tcl_Obj *valueObj) { int boolVal; nonnull_assert(interp != NULL); @@ -24785,6 +24786,20 @@ } switch (configureoption) { + + case ConfigureoptionDebugIdx: /* fall through */ + case ConfigureoptionObjectsystemsIdx: + /* handled above */ + break; + + case ConfigureoptionDtraceIdx: + /* not implemented */ + break; + + case ConfigureoptionNULL: + /* do nothing; just for detection if option was specfied */ + break; + case ConfigureoptionFilterIdx: Tcl_SetBooleanObj(Tcl_GetObjResult(interp), (RUNTIME_STATE(interp)->doFilters)); @@ -24852,6 +24867,7 @@ RUNTIME_STATE(interp)->doCheckArguments = (boolVal != 0) ? NSF_ARGPARSE_CHECK : 0; } break; + } return TCL_OK; } @@ -24941,7 +24957,7 @@ } */ static int -NsfDirectDispatchCmd(Tcl_Interp *interp, NsfObject *object, int withFrame, +NsfDirectDispatchCmd(Tcl_Interp *interp, NsfObject *object, FrameIdx_t withFrame, Tcl_Obj *commandObj, int nobjc, Tcl_Obj *CONST nobjv[]) { int result; const char *methodName; @@ -25345,7 +25361,7 @@ */ static int NsfMethodAliasCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, - const char *methodName, int withFrame, int withProtection, + const char *methodName, FrameIdx_t withFrame, ProtectionIdx_t withProtection, Tcl_Obj *cmdName) { Tcl_ObjCmdProc *objProc, *newObjProc = NULL; Tcl_CmdDeleteProc *deleteProc = NULL; @@ -25554,7 +25570,7 @@ */ static int -NsfMethodAssertionCmd(Tcl_Interp *interp, NsfObject *object, int subcmd, Tcl_Obj *arg) { +NsfMethodAssertionCmd(Tcl_Interp *interp, NsfObject *object, AssertionsubcmdIdx_t subcmd, Tcl_Obj *arg) { #if defined(NSF_WITH_ASSERTIONS) NsfClass *class; @@ -25596,6 +25612,10 @@ Tcl_SetObjResult(interp, AssertionList(interp, class->opt->assertions->invariants)); } } + + case AssertionsubcmdNULL: + /* do nothing; just for detection if option was specfied */ + break; } #endif return TCL_OK; @@ -25719,7 +25739,7 @@ int withEarlybinding, Tcl_Obj *withOnerror, Tcl_Obj *withMethodprefix, - int withFrame, int withVerbose, + FrameIdx_t withFrame, int withVerbose, Tcl_Obj *target, int nobjc, Tcl_Obj *CONST nobjv[]) { ForwardCmdClientData *tcd = NULL; int result; @@ -25774,7 +25794,7 @@ */ static int NsfForwardPropertyCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, - Tcl_Obj *methodObj, int methodproperty, Tcl_Obj *valueObj) { + Tcl_Obj *methodObj, ForwardpropertyIdx_t methodproperty, Tcl_Obj *valueObj) { ForwardCmdClientData *tcd; Tcl_ObjCmdProc *procPtr; Tcl_Command cmd; @@ -25834,6 +25854,10 @@ } Tcl_SetObjResult(interp, Tcl_NewBooleanObj(tcd->verbose)); break; + + case ForwardpropertyNULL: + /* do nothing; just for detection if option was specfied */ + break; } return TCL_OK; @@ -25850,7 +25874,7 @@ */ static int NsfMethodPropertyCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, - Tcl_Obj *methodObj, int methodproperty, Tcl_Obj *valueObj) { + Tcl_Obj *methodObj, MethodpropertyIdx_t methodproperty, Tcl_Obj *valueObj) { NsfObject *defObject; Tcl_Command cmd; NsfClass *cl; @@ -25951,8 +25975,9 @@ } } Tcl_SetIntObj(Tcl_GetObjResult(interp), (Tcl_Command_flags(cmd) & flag) != 0); - break; } + break; + case MethodpropertyReturnsIdx: { NsfParamDefs *paramDefs; @@ -25999,8 +26024,12 @@ INCR_REF_COUNT2("paramDefsObj", *objPtr); } } - break; } + break; + + case MethodpropertyNULL: + /* do nothing; just for detection if option was specfied */ + break; } return TCL_OK; @@ -26201,7 +26230,7 @@ */ static int -NsfObjectPropertyCmd(Tcl_Interp *interp, NsfObject *object, int objectproperty, Tcl_Obj *valueObj) { +NsfObjectPropertyCmd(Tcl_Interp *interp, NsfObject *object, ObjectpropertyIdx_t objectproperty, Tcl_Obj *valueObj) { unsigned int flags = 0u, allowSet = 0u; nonnull_assert(interp != NULL); @@ -26224,6 +26253,9 @@ case ObjectpropertyKeepcallerselfIdx: flags = NSF_KEEP_CALLER_SELF; allowSet = 1; break; case ObjectpropertyPerobjectdispatchIdx: flags = NSF_PER_OBJECT_DISPATCH; allowSet = 1; break; case ObjectpropertyHasperobjectslotsIdx: flags = NSF_HAS_PER_OBJECT_SLOTS; allowSet = 1; break; + case ObjectpropertyNULL: + /* do nothing; just for detection if option was specfied */ + break; } if (valueObj != NULL) { @@ -26665,7 +26697,7 @@ } */ static int -NsfParameterInfoCmd(Tcl_Interp *interp, int parametersubcmd, Tcl_Obj *parameterspec, Tcl_Obj *varname) { +NsfParameterInfoCmd(Tcl_Interp *interp, ParametersubcmdIdx_t parametersubcmd, Tcl_Obj *parameterspec, Tcl_Obj *varname) { NsfParsedParam parsedParam; Tcl_Obj *paramsObj, *listObj = NULL; Nsf_Param *paramsPtr; @@ -26769,6 +26801,10 @@ Tcl_SetObjResult(interp, NsfGlobalObjs[NSF_EMPTY]); } break; + + case ParametersubcmdNULL: + /* do nothing; just for detection if option was specfied */ + break; } ParamDefsRefCountDecr(parsedParam.paramDefs); @@ -27027,7 +27063,7 @@ } */ static int -NsfRelationGetCmd(Tcl_Interp *interp, NsfObject *object, int relationtype) { +NsfRelationGetCmd(Tcl_Interp *interp, NsfObject *object, RelationtypeIdx_t relationtype) { return NsfRelationSetCmd(interp, object, relationtype, NULL); } @@ -27123,7 +27159,7 @@ */ static int NsfRelationSetCmd(Tcl_Interp *interp, NsfObject *object, - int relationtype, Tcl_Obj *valueObj) { + RelationtypeIdx_t relationtype, Tcl_Obj *valueObj) { int oc; Tcl_Obj **ov; NsfClass *cl = NULL; NsfObjectOpt *objopt = NULL; @@ -27148,15 +27184,18 @@ } } + /* + * The first switch block is just responsible for obtaining objopt or clopt + * or handline other simple cases. + */ switch (relationtype) { - case RelationtypeObject_filterIdx: + case RelationtypeObject_filterIdx: /* fall through */ case RelationtypeObject_mixinIdx: if (valueObj == NULL) { objopt = object->opt; - switch (relationtype) { - case RelationtypeObject_mixinIdx: + if (relationtype == RelationtypeObject_mixinIdx) { return (objopt != NULL) ? MixinInfo(interp, objopt->objMixins, NULL, 1, NULL) : TCL_OK; - case RelationtypeObject_filterIdx: + } else /* (relationtype == RelationtypeObject_filterIdx) */ { return (objopt != NULL) ? FilterInfo(interp, objopt->objFilters, NULL, 1, 0) : TCL_OK; } } @@ -27166,15 +27205,14 @@ objopt = NsfRequireObjectOpt(object); break; - case RelationtypeClass_mixinIdx: + case RelationtypeClass_mixinIdx: /* fall through */ case RelationtypeClass_filterIdx: if (valueObj == NULL) { clopt = cl->opt; - switch (relationtype) { - case RelationtypeClass_mixinIdx: + if (relationtype == RelationtypeClass_mixinIdx) { return (clopt != NULL) ? MixinInfo(interp, clopt->classMixins, NULL, 1, NULL) : TCL_OK; - case RelationtypeClass_filterIdx: + } else /* if (relationtype == RelationtypeClass_filterIdx) */ { return (clopt != NULL) ? FilterInfo(interp, clopt->classFilters, NULL, 1, 0) : TCL_OK; } } @@ -27240,8 +27278,17 @@ allow to delete a class system at runtime? */ } + + case RelationtypeNULL: + /* do nothing; just for detection if option was specfied */ + return TCL_OK; } + /* + * The second switch block is responsible for the more complex handling of + * the relations. + */ + switch (relationtype) { case RelationtypeObject_mixinIdx: { @@ -27310,9 +27357,8 @@ MixinComputeDefined(interp, object); FilterComputeDefined(interp, object); - - break; } + break; case RelationtypeObject_filterIdx: { @@ -27333,8 +27379,8 @@ objopt->objFilters = newFilterCmdList; /*FilterComputeDefined(interp, object);*/ - break; } + break; case RelationtypeClass_mixinIdx: if (unlikely(NsfRelationClassMixinsSet(interp, cl, valueObj, oc, ov) != TCL_OK)) { @@ -27367,8 +27413,16 @@ clopt->classFilters = newFilterCmdList; - break; } + break; + + case RelationtypeClassIdx: /* fall through */ + case RelationtypeRootclassIdx: /* fall through */ + case RelationtypeSuperclassIdx: /* fall through */ + case RelationtypeNULL: + /* handled above */ + break; + } /* @@ -27384,15 +27438,15 @@ } */ static int -NsfCurrentCmd(Tcl_Interp *interp, int selfoption) { +NsfCurrentCmd(Tcl_Interp *interp, CurrentoptionIdx_t selfoption) { NsfObject *object = GetSelfObj(interp); NsfCallStackContent *cscPtr; Tcl_CallFrame *framePtr; int result = TCL_OK; nonnull_assert(interp != NULL); - if (selfoption == 0 || selfoption == CurrentoptionObjectIdx) { + if (selfoption == CurrentoptionNULL || selfoption == CurrentoptionObjectIdx) { if (likely(object != NULL)) { Tcl_SetObjResult(interp, object->cmdName); return TCL_OK; @@ -27538,6 +27592,11 @@ case CurrentoptionNextmethodIdx: result = FindSelfNext(interp); break; + + case CurrentoptionObjectIdx: /* fall through */ + case CurrentoptionNULL: + /* handled above */ + break; } return result; @@ -30129,15 +30188,15 @@ } */ static int ListMethodKeysClassList(Tcl_Interp *interp, NsfClasses *classListPtr, - int withSource, const char *pattern, + DefinitionsourceIdx_t withSource, const char *pattern, int methodType, int withCallprotection, int withPath, Tcl_HashTable *dups, NsfObject *object, int withPer_object) nonnull(1) nonnull(8) nonnull(9); static int ListMethodKeysClassList(Tcl_Interp *interp, NsfClasses *classListPtr, - int withSource, const char *pattern, + DefinitionsourceIdx_t withSource, const char *pattern, int methodType, int withCallprotection, int withPath, Tcl_HashTable *dups, NsfObject *object, int withPer_object) { @@ -30173,12 +30232,12 @@ */ static int NsfObjInfoLookupMethodsMethod(Tcl_Interp *interp, NsfObject *object, - int withCallprotection, + CallprotectionIdx_t withCallprotection, int withIncontext, - int withMethodtype, + MethodtypeIdx_t withMethodtype, int withNomixins, int withPath, - int withSource, + DefinitionsourceIdx_t withSource, const char *pattern) { int withPer_object = 1; Tcl_HashTable dupsTable, *dups = &dupsTable; @@ -30196,8 +30255,8 @@ if (withCallprotection == CallprotectionNULL) { withCallprotection = CallprotectionPublicIdx; } - if (withSource == SourceNULL) { - withSource = SourceAllIdx; + if (withSource == DefinitionsourceNULL) { + withSource = DefinitionsourceAllIdx; } Tcl_InitHashTable(dups, TCL_STRING_KEYS); @@ -30277,7 +30336,8 @@ */ static int NsfObjInfoLookupSlotsMethod(Tcl_Interp *interp, NsfObject *object, - int withSource, NsfClass *type, + DefinitionsourceIdx_t withSource, + NsfClass *type, const char *pattern) { Tcl_Obj *listObj = Tcl_NewListObj(0, NULL); NsfClasses *precendenceList, *clPtr; @@ -30329,7 +30389,7 @@ */ static int NsfObjInfoMethodMethod(Tcl_Interp *interp, NsfObject *object, - int subcmd, Tcl_Obj *methodNameObj) { + InfomethodsubcmdIdx_t subcmd, Tcl_Obj *methodNameObj) { return ListMethodResolve(interp, subcmd, NULL, NULL, object->nsPtr, object, methodNameObj, 0); } @@ -30343,8 +30403,8 @@ */ static int NsfObjInfoMethodsMethod(Tcl_Interp *interp, NsfObject *object, - int withCallproctection, - int withMethodtype, + CallprotectionIdx_t withCallproctection, + MethodtypeIdx_t withMethodtype, int withPath, const char *pattern) { @@ -30412,7 +30472,8 @@ * Actually, this method (object::info::objectparameter) is not used anymore. */ static int -NsfObjInfoObjectparameterMethod(Tcl_Interp *interp, NsfObject *object, int subcmd, const char *pattern) { +NsfObjInfoObjectparameterMethod(Tcl_Interp *interp, NsfObject *object, + InfoobjectparametersubcmdIdx_t subcmd, const char *pattern) { NsfParsedParam parsedParam; Tcl_Obj *listObj = NULL; Nsf_Param const *paramsPtr; @@ -30457,6 +30518,9 @@ case InfoobjectparametersubcmdSyntaxIdx: listObj = NsfParamDefsSyntax(interp, paramsPtr, NULL, NULL); break; + case InfoobjectparametersubcmdNULL: + /* do nothing; just for detection if option was specfied */ + break; } assert(listObj != NULL); @@ -30530,7 +30594,7 @@ nonnull_assert(object != NULL); AddSlotObjects(interp, object, "::per-object-slot", NULL, - SourceAllIdx, type, pattern, listObj); + DefinitionsourceAllIdx, type, pattern, listObj); Tcl_SetObjResult(interp, listObj); return TCL_OK; @@ -30759,7 +30823,7 @@ */ static int NsfClassInfoMethodMethod(Tcl_Interp *interp, NsfClass *class, - int subcmd, Tcl_Obj *methodNameObj) { + InfomethodsubcmdIdx_t subcmd, Tcl_Obj *methodNameObj) { return ListMethodResolve(interp, subcmd, NULL, NULL, class->nsPtr, &class->object, methodNameObj, 1); } @@ -30776,11 +30840,11 @@ */ static int NsfClassInfoMethodsMethod(Tcl_Interp *interp, NsfClass *class, - int withCallprotection, + CallprotectionIdx_t withCallprotection, int withClosure, - int withMethodtype, + MethodtypeIdx_t withMethodtype, int withPath, - int withSource, + DefinitionsourceIdx_t withSource, const char *pattern) { nonnull_assert(interp != NULL); @@ -30796,8 +30860,8 @@ withCallprotection = CallprotectionPublicIdx; } #endif - if (withSource == SourceNULL) { - withSource = SourceAllIdx; + if (withSource == DefinitionsourceNULL) { + withSource = DefinitionsourceAllIdx; } Tcl_InitHashTable(dups, TCL_STRING_KEYS); @@ -30921,8 +30985,11 @@ } */ static int -NsfClassInfoMixinOfMethod(Tcl_Interp *interp, NsfClass *class, int withClosure, int withScope, - const char *patternString, NsfObject *patternObj) { +NsfClassInfoMixinOfMethod(Tcl_Interp *interp, NsfClass *class, + int withClosure, + MixinscopeIdx_t withScope, + const char *patternString, + NsfObject *patternObj) { NsfClassOpt *opt; int perClass, perObject, rc = TCL_OK; Tcl_Obj *resultObj; @@ -30934,10 +31001,10 @@ Tcl_ResetResult(interp); resultObj = Tcl_GetObjResult(interp); - if (withScope == ScopeNULL || withScope == ScopeAllIdx) { + if (withScope == MixinscopeNULL || withScope == MixinscopeAllIdx) { perClass = 1; perObject = 1; - } else if (withScope == ScopeClassIdx) { + } else if (withScope == MixinscopeClassIdx) { perClass = 1; perObject = 0; } else { @@ -30992,8 +31059,10 @@ */ static int NsfClassInfoSlotobjectsMethod(Tcl_Interp *interp, NsfClass *class, - int withClosure, int withSource, NsfClass *type, - const char *pattern) { + int withClosure, + DefinitionsourceIdx_t withSource, + NsfClass *type, + const char *pattern) { NsfClasses *clPtr, *intrinsicClasses, *precedenceList = NULL; Tcl_Obj *listObj = Tcl_NewListObj(0, NULL); Tcl_HashTable slotTable; Index: generic/nsfAPI.decls =================================================================== diff -u -r21686b86d06844eca86086b9f9391d77d54dbc06 -raa5b3f4293624fedf641985718ab15c82f5daf78 --- generic/nsfAPI.decls (.../nsfAPI.decls) (revision 21686b86d06844eca86086b9f9391d77d54dbc06) +++ generic/nsfAPI.decls (.../nsfAPI.decls) (revision aa5b3f4293624fedf641985718ab15c82f5daf78) @@ -85,7 +85,7 @@ } cmd "directdispatch" NsfDirectDispatchCmd { {-argName "object" -required 1 -type object} - {-argName "-frame" -required 0 -type "method|object|default" -default "default"} + {-argName "-frame" -typeName "frame" -required 0 -type "method|object|default" -default "default"} {-argName "command" -required 1 -type tclobj} {-argName "args" -type args} } @@ -155,8 +155,8 @@ {-argName "object" -required 1 -type object} {-argName "-per-object" -required 0 -nrargs 0 -type switch} {-argName "methodName" -required 1} - {-argName "-frame" -required 0 -type "method|object|default" -default "default"} - {-argName "-protection" -required 0 -type "call-protected|redefine-protected|none" -default "none"} + {-argName "-frame" -required 0 -typeName "frame" -type "method|object|default" -default "default"} + {-argName "-protection" -required 0 -typeName "protection" -type "call-protected|redefine-protected|none" -default "none"} {-argName "cmdName" -required 1 -type tclobj} } {-nxdoc 1} cmd "method::assertion" NsfMethodAssertionCmd { @@ -201,7 +201,7 @@ {-argName "-earlybinding" -nrargs 0 -type switch} {-argName "-onerror" -type tclobj} {-argName "-prefix" -type tclobj} - {-argName "-frame" -nrargs 1 -type "object|method|default" -default default} + {-argName "-frame" -nrargs 1 -typeName "frame" -type "method|object|default" -default default} {-argName "-verbose" -nrargs 0 -type switch} {-argName "target" -type tclobj} {-argName "args" -type args} @@ -489,20 +489,20 @@ {-argName "name" -required 1 -type tclobj} } objectInfoMethod lookupmethods NsfObjInfoLookupMethodsMethod { - {-argName "-callprotection" -type "all|public|protected|private" -default all} + {-argName "-callprotection" -typeName "callprotection" -type "all|public|protected|private" -default all} {-argName "-incontext" -nrargs 0 -type switch} {-argName "-type" -typeName "methodtype" -type "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"} {-argName "-nomixins" -nrargs 0 -type switch} {-argName "-path" -nrargs 0 -type switch} - {-argName "-source" -type "all|application|system" -default all} + {-argName "-source" -typeName "definitionsource" -type "all|application|system" -default all} {-argName "pattern" -required 0} } objectInfoMethod lookupmixins NsfObjInfoLookupMixinsMethod { {-argName "-guards" -nrargs 0 -type switch} {-argName "pattern" -type objpattern} } objectInfoMethod lookupslots NsfObjInfoLookupSlotsMethod { - {-argName "-source" -type "all|application|system" -default all} + {-argName "-source" -typeName "definitionsource" -type "all|application|system" -default all} {-argName "-type" -required 0 -type class} {-argName "pattern" -required 0} } @@ -511,7 +511,7 @@ {-argName "name" -required 1 -type tclobj} } objectInfoMethod methods NsfObjInfoMethodsMethod { - {-argName "-callprotection" -type "all|public|protected|private" -default all} + {-argName "-callprotection" -typeName "callprotection" -type "all|public|protected|private" -default all} {-argName "-type" -typeName "methodtype" -type "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"} {-argName "-path" -nrargs 0 -type switch} {-argName "pattern" -required 0} @@ -571,11 +571,11 @@ {-argName "name" -required 1 -type tclobj} } classInfoMethod methods NsfClassInfoMethodsMethod { - {-argName "-callprotection" -type "all|public|protected|private" -default all} + {-argName "-callprotection" -typeName "callprotection" -type "all|public|protected|private" -default all} {-argName "-closure" -nrargs 0 -type switch} {-argName "-type" -nrargs 1 -typeName "methodtype" -type "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"} {-argName "-path" -nrargs 0 -type switch} - {-argName "-source" -nrargs 1 -type "all|application|system" -default all} + {-argName "-source" -nrargs 1 -typeName "definitionsource" -type "all|application|system" -default all} {-argName "pattern"} } classInfoMethod mixins NsfClassInfoMixinsMethod { @@ -589,12 +589,12 @@ } classInfoMethod mixinof NsfClassInfoMixinOfMethod { {-argName "-closure" -nrargs 0 -type switch} - {-argName "-scope" -required 0 -type "all|class|object"} + {-argName "-scope" -typeName "mixinscope" -required 0 -type "all|class|object"} {-argName "pattern" -type objpattern} } classInfoMethod slotobjects NsfClassInfoSlotobjectsMethod { {-argName "-closure" -nrargs 0 -type switch} - {-argName "-source" -type "all|application|system" -default all} + {-argName "-source" -typeName "definitionsource" -type "all|application|system" -default all} {-argName "-type" -required 0 -type class} {-argName "pattern" -required 0} } Index: generic/nsfAPI.h =================================================================== diff -u -r21686b86d06844eca86086b9f9391d77d54dbc06 -raa5b3f4293624fedf641985718ab15c82f5daf78 --- generic/nsfAPI.h (.../nsfAPI.h) (revision 21686b86d06844eca86086b9f9391d77d54dbc06) +++ generic/nsfAPI.h (.../nsfAPI.h) (revision aa5b3f4293624fedf641985718ab15c82f5daf78) @@ -64,7 +64,7 @@ -enum InfomethodsubcmdIdx {InfomethodsubcmdNULL, InfomethodsubcmdArgsIdx, InfomethodsubcmdBodyIdx, InfomethodsubcmdDefinitionIdx, InfomethodsubcmdExistsIdx, InfomethodsubcmdRegistrationhandleIdx, InfomethodsubcmdDefinitionhandleIdx, InfomethodsubcmdOriginIdx, InfomethodsubcmdParameterIdx, InfomethodsubcmdSyntaxIdx, InfomethodsubcmdTypeIdx, InfomethodsubcmdPreconditionIdx, InfomethodsubcmdPostconditionIdx, InfomethodsubcmdSubmethodsIdx, InfomethodsubcmdReturnsIdx}; +typedef enum {InfomethodsubcmdNULL, InfomethodsubcmdArgsIdx, InfomethodsubcmdBodyIdx, InfomethodsubcmdDefinitionIdx, InfomethodsubcmdExistsIdx, InfomethodsubcmdRegistrationhandleIdx, InfomethodsubcmdDefinitionhandleIdx, InfomethodsubcmdOriginIdx, InfomethodsubcmdParameterIdx, InfomethodsubcmdSyntaxIdx, InfomethodsubcmdTypeIdx, InfomethodsubcmdPreconditionIdx, InfomethodsubcmdPostconditionIdx, InfomethodsubcmdSubmethodsIdx, InfomethodsubcmdReturnsIdx} InfomethodsubcmdIdx_t; static int ConvertToInfomethodsubcmd(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -77,20 +77,20 @@ return result; } -enum CallprotectionIdx {CallprotectionNULL, CallprotectionAllIdx, CallprotectionPublicIdx, CallprotectionProtectedIdx, CallprotectionPrivateIdx}; +typedef enum {CallprotectionNULL, CallprotectionAllIdx, CallprotectionPublicIdx, CallprotectionProtectedIdx, CallprotectionPrivateIdx} CallprotectionIdx_t; static int ConvertToCallprotection(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static const char *opts[] = {"all", "public", "protected", "private", NULL}; (void)pPtr; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-callprotection", 0, &index); + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "callprotection", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; return result; } -enum MethodtypeIdx {MethodtypeNULL, MethodtypeAllIdx, MethodtypeScriptedIdx, MethodtypeBuiltinIdx, MethodtypeAliasIdx, MethodtypeForwarderIdx, MethodtypeObjectIdx, MethodtypeSetterIdx, MethodtypeNsfprocIdx}; +typedef enum {MethodtypeNULL, MethodtypeAllIdx, MethodtypeScriptedIdx, MethodtypeBuiltinIdx, MethodtypeAliasIdx, MethodtypeForwarderIdx, MethodtypeObjectIdx, MethodtypeSetterIdx, MethodtypeNsfprocIdx} MethodtypeIdx_t; static int ConvertToMethodtype(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -103,33 +103,33 @@ return result; } -enum SourceIdx {SourceNULL, SourceAllIdx, SourceApplicationIdx, SourceSystemIdx}; +typedef enum {DefinitionsourceNULL, DefinitionsourceAllIdx, DefinitionsourceApplicationIdx, DefinitionsourceSystemIdx} DefinitionsourceIdx_t; -static int ConvertToSource(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, +static int ConvertToDefinitionsource(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static const char *opts[] = {"all", "application", "system", NULL}; (void)pPtr; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-source", 0, &index); + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "definitionsource", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; return result; } -enum ScopeIdx {ScopeNULL, ScopeAllIdx, ScopeClassIdx, ScopeObjectIdx}; +typedef enum {MixinscopeNULL, MixinscopeAllIdx, MixinscopeClassIdx, MixinscopeObjectIdx} MixinscopeIdx_t; -static int ConvertToScope(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, +static int ConvertToMixinscope(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, 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); + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "mixinscope", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; return result; } -enum ConfigureoptionIdx {ConfigureoptionNULL, ConfigureoptionDebugIdx, ConfigureoptionDtraceIdx, ConfigureoptionFilterIdx, ConfigureoptionProfileIdx, ConfigureoptionTraceIdx, ConfigureoptionSoftrecreateIdx, ConfigureoptionObjectsystemsIdx, ConfigureoptionKeepcmdsIdx, ConfigureoptionCheckresultsIdx, ConfigureoptionCheckargumentsIdx}; +typedef enum {ConfigureoptionNULL, ConfigureoptionDebugIdx, ConfigureoptionDtraceIdx, ConfigureoptionFilterIdx, ConfigureoptionProfileIdx, ConfigureoptionTraceIdx, ConfigureoptionSoftrecreateIdx, ConfigureoptionObjectsystemsIdx, ConfigureoptionKeepcmdsIdx, ConfigureoptionCheckresultsIdx, ConfigureoptionCheckargumentsIdx} ConfigureoptionIdx_t; static int ConvertToConfigureoption(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -142,7 +142,7 @@ return result; } -enum CurrentoptionIdx {CurrentoptionNULL, CurrentoptionProcIdx, CurrentoptionMethodIdx, CurrentoptionMethodpathIdx, CurrentoptionObjectIdx, CurrentoptionClassIdx, CurrentoptionActivelevelIdx, CurrentoptionArgsIdx, CurrentoptionActivemixinIdx, CurrentoptionCalledprocIdx, CurrentoptionCalledmethodIdx, CurrentoptionCalledclassIdx, CurrentoptionCallingprocIdx, CurrentoptionCallingmethodIdx, CurrentoptionCallingclassIdx, CurrentoptionCallinglevelIdx, CurrentoptionCallingobjectIdx, CurrentoptionFilterregIdx, CurrentoptionIsnextcallIdx, CurrentoptionNextmethodIdx}; +typedef enum {CurrentoptionNULL, CurrentoptionProcIdx, CurrentoptionMethodIdx, CurrentoptionMethodpathIdx, CurrentoptionObjectIdx, CurrentoptionClassIdx, CurrentoptionActivelevelIdx, CurrentoptionArgsIdx, CurrentoptionActivemixinIdx, CurrentoptionCalledprocIdx, CurrentoptionCalledmethodIdx, CurrentoptionCalledclassIdx, CurrentoptionCallingprocIdx, CurrentoptionCallingmethodIdx, CurrentoptionCallingclassIdx, CurrentoptionCallinglevelIdx, CurrentoptionCallingobjectIdx, CurrentoptionFilterregIdx, CurrentoptionIsnextcallIdx, CurrentoptionNextmethodIdx} CurrentoptionIdx_t; static int ConvertToCurrentoption(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -155,20 +155,20 @@ return result; } -enum FrameIdx {FrameNULL, FrameMethodIdx, FrameObjectIdx, FrameDefaultIdx}; +typedef enum {FrameNULL, FrameMethodIdx, FrameObjectIdx, FrameDefaultIdx} FrameIdx_t; static int ConvertToFrame(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, 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); + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "frame", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; return result; } -enum ForwardpropertyIdx {ForwardpropertyNULL, ForwardpropertyPrefixIdx, ForwardpropertyTargetIdx, ForwardpropertyVerboseIdx}; +typedef enum {ForwardpropertyNULL, ForwardpropertyPrefixIdx, ForwardpropertyTargetIdx, ForwardpropertyVerboseIdx} ForwardpropertyIdx_t; static int ConvertToForwardproperty(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -181,20 +181,20 @@ return result; } -enum ProtectionIdx {ProtectionNULL, ProtectionCall_protectedIdx, ProtectionRedefine_protectedIdx, ProtectionNoneIdx}; +typedef enum {ProtectionNULL, ProtectionCall_protectedIdx, ProtectionRedefine_protectedIdx, ProtectionNoneIdx} ProtectionIdx_t; static int ConvertToProtection(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; static const char *opts[] = {"call-protected", "redefine-protected", "none", NULL}; (void)pPtr; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-protection", 0, &index); + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "protection", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; return result; } -enum AssertionsubcmdIdx {AssertionsubcmdNULL, AssertionsubcmdCheckIdx, AssertionsubcmdObject_invarIdx, AssertionsubcmdClass_invarIdx}; +typedef enum {AssertionsubcmdNULL, AssertionsubcmdCheckIdx, AssertionsubcmdObject_invarIdx, AssertionsubcmdClass_invarIdx} AssertionsubcmdIdx_t; static int ConvertToAssertionsubcmd(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -207,7 +207,7 @@ return result; } -enum MethodpropertyIdx {MethodpropertyNULL, MethodpropertyClass_onlyIdx, MethodpropertyCall_privateIdx, MethodpropertyCall_protectedIdx, MethodpropertyDebugIdx, MethodpropertyDeprecatedIdx, MethodpropertyExistsIdx, MethodpropertyRedefine_protectedIdx, MethodpropertyReturnsIdx}; +typedef enum {MethodpropertyNULL, MethodpropertyClass_onlyIdx, MethodpropertyCall_privateIdx, MethodpropertyCall_protectedIdx, MethodpropertyDebugIdx, MethodpropertyDeprecatedIdx, MethodpropertyExistsIdx, MethodpropertyRedefine_protectedIdx, MethodpropertyReturnsIdx} MethodpropertyIdx_t; static int ConvertToMethodproperty(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -220,7 +220,7 @@ return result; } -enum ObjectpropertyIdx {ObjectpropertyNULL, ObjectpropertyInitializedIdx, ObjectpropertyClassIdx, ObjectpropertyRootmetaclassIdx, ObjectpropertyRootclassIdx, ObjectpropertyVolatileIdx, ObjectpropertySlotcontainerIdx, ObjectpropertyHasperobjectslotsIdx, ObjectpropertyKeepcallerselfIdx, ObjectpropertyPerobjectdispatchIdx}; +typedef enum {ObjectpropertyNULL, ObjectpropertyInitializedIdx, ObjectpropertyClassIdx, ObjectpropertyRootmetaclassIdx, ObjectpropertyRootclassIdx, ObjectpropertyVolatileIdx, ObjectpropertySlotcontainerIdx, ObjectpropertyHasperobjectslotsIdx, ObjectpropertyKeepcallerselfIdx, ObjectpropertyPerobjectdispatchIdx} ObjectpropertyIdx_t; static int ConvertToObjectproperty(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -233,7 +233,7 @@ return result; } -enum ParametersubcmdIdx {ParametersubcmdNULL, ParametersubcmdDefaultIdx, ParametersubcmdListIdx, ParametersubcmdNameIdx, ParametersubcmdSyntaxIdx, ParametersubcmdTypeIdx}; +typedef enum {ParametersubcmdNULL, ParametersubcmdDefaultIdx, ParametersubcmdListIdx, ParametersubcmdNameIdx, ParametersubcmdSyntaxIdx, ParametersubcmdTypeIdx} ParametersubcmdIdx_t; static int ConvertToParametersubcmd(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -246,7 +246,7 @@ return result; } -enum RelationtypeIdx {RelationtypeNULL, RelationtypeObject_mixinIdx, RelationtypeClass_mixinIdx, RelationtypeObject_filterIdx, RelationtypeClass_filterIdx, RelationtypeClassIdx, RelationtypeSuperclassIdx, RelationtypeRootclassIdx}; +typedef enum {RelationtypeNULL, RelationtypeObject_mixinIdx, RelationtypeClass_mixinIdx, RelationtypeObject_filterIdx, RelationtypeClass_filterIdx, RelationtypeClassIdx, RelationtypeSuperclassIdx, RelationtypeRootclassIdx} RelationtypeIdx_t; static int ConvertToRelationtype(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -259,7 +259,7 @@ return result; } -enum InfoobjectparametersubcmdIdx {InfoobjectparametersubcmdNULL, InfoobjectparametersubcmdDefinitionsIdx, InfoobjectparametersubcmdListIdx, InfoobjectparametersubcmdNamesIdx, InfoobjectparametersubcmdSyntaxIdx}; +typedef enum {InfoobjectparametersubcmdNULL, InfoobjectparametersubcmdDefinitionsIdx, InfoobjectparametersubcmdListIdx, InfoobjectparametersubcmdNamesIdx, InfoobjectparametersubcmdSyntaxIdx} InfoobjectparametersubcmdIdx_t; static int ConvertToInfoobjectparametersubcmd(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -275,20 +275,20 @@ static Nsf_EnumeratorConverterEntry enumeratorConverterEntries[] = { {ConvertToInfoobjectparametersubcmd, "definitions|list|names|syntax"}, - {ConvertToScope, "all|class|object"}, {ConvertToInfomethodsubcmd, "args|body|definition|exists|registrationhandle|definitionhandle|origin|parameter|syntax|type|precondition|postcondition|submethods|returns"}, {ConvertToCallprotection, "all|public|protected|private"}, {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|debug|deprecated|exists|redefine-protected|returns"}, {ConvertToRelationtype, "object-mixin|class-mixin|object-filter|class-filter|class|superclass|rootclass"}, - {ConvertToSource, "all|application|system"}, + {ConvertToDefinitionsource, "all|application|system"}, {ConvertToForwardproperty, "prefix|target|verbose"}, {ConvertToConfigureoption, "debug|dtrace|filter|profile|trace|softrecreate|objectsystems|keepcmds|checkresults|checkarguments"}, {ConvertToObjectproperty, "initialized|class|rootmetaclass|rootclass|volatile|slotcontainer|hasperobjectslots|keepcallerself|perobjectdispatch"}, {ConvertToAssertionsubcmd, "check|object-invar|class-invar"}, {ConvertToParametersubcmd, "default|list|name|syntax|type"}, + {ConvertToMixinscope, "all|class|object"}, {ConvertToProtection, "call-protected|redefine-protected|none"}, {NULL, NULL} }; @@ -560,17 +560,17 @@ NSF_nonnull(1) NSF_nonnull(2); static int NsfClassInfoInstancesMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, const char *patternString, NsfObject *patternObject) NSF_nonnull(1) NSF_nonnull(2); -static int NsfClassInfoMethodMethod(Tcl_Interp *interp, NsfClass *cl, int subcmd, Tcl_Obj *name) +static int NsfClassInfoMethodMethod(Tcl_Interp *interp, NsfClass *cl, InfomethodsubcmdIdx_t subcmd, Tcl_Obj *name) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); -static int NsfClassInfoMethodsMethod(Tcl_Interp *interp, NsfClass *cl, int withCallprotection, int withClosure, int withType, int withPath, int withSource, const char *pattern) +static int NsfClassInfoMethodsMethod(Tcl_Interp *interp, NsfClass *cl, CallprotectionIdx_t withCallprotection, int withClosure, MethodtypeIdx_t withType, int withPath, DefinitionsourceIdx_t withSource, const char *pattern) NSF_nonnull(1) NSF_nonnull(2); -static int NsfClassInfoMixinOfMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, int withScope, const char *patternString, NsfObject *patternObject) +static int NsfClassInfoMixinOfMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, MixinscopeIdx_t withScope, const char *patternString, NsfObject *patternObject) NSF_nonnull(1) NSF_nonnull(2); static int NsfClassInfoMixinguardMethod(Tcl_Interp *interp, NsfClass *cl, const char *mixin) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(3); static int NsfClassInfoMixinsMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, int withGuards, int withHeritage, const char *patternString, NsfObject *patternObject) NSF_nonnull(1) NSF_nonnull(2); -static int NsfClassInfoSlotobjectsMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, int withSource, NsfClass *withType, const char *pattern) +static int NsfClassInfoSlotobjectsMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, DefinitionsourceIdx_t withSource, NsfClass *withType, const char *pattern) NSF_nonnull(1) NSF_nonnull(2); static int NsfClassInfoSubclassMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, int withDependent, const char *patternString, NsfObject *patternObject) NSF_nonnull(1) NSF_nonnull(2); @@ -580,13 +580,13 @@ NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(7) NSF_nonnull(8) NSF_nonnull(9); static int NsfAsmProcCmd(Tcl_Interp *interp, int withAd, int withCheckalways, Tcl_Obj *procName, Tcl_Obj *arguments, Tcl_Obj *body) NSF_nonnull(1) NSF_nonnull(4) NSF_nonnull(5) NSF_nonnull(6); -static int NsfCmdInfoCmd(Tcl_Interp *interp, int subcmd, NsfObject *withContext, Tcl_Obj *methodName, const char *pattern) +static int NsfCmdInfoCmd(Tcl_Interp *interp, InfomethodsubcmdIdx_t subcmd, NsfObject *withContext, Tcl_Obj *methodName, const char *pattern) NSF_nonnull(1) NSF_nonnull(4); static int NsfColonCmd(Tcl_Interp *interp, int objc, Tcl_Obj *CONST* objv) NSF_nonnull(1); -static int NsfConfigureCmd(Tcl_Interp *interp, int option, Tcl_Obj *value) +static int NsfConfigureCmd(Tcl_Interp *interp, ConfigureoptionIdx_t option, Tcl_Obj *value) NSF_nonnull(1); -static int NsfCurrentCmd(Tcl_Interp *interp, int option) +static int NsfCurrentCmd(Tcl_Interp *interp, CurrentoptionIdx_t option) NSF_nonnull(1); static int NsfDebugCompileEpoch(Tcl_Interp *interp) NSF_nonnull(1); @@ -596,29 +596,29 @@ NSF_nonnull(1); static int NsfDebugShowObj(Tcl_Interp *interp, Tcl_Obj *obj) NSF_nonnull(1) NSF_nonnull(2); -static int NsfDirectDispatchCmd(Tcl_Interp *interp, NsfObject *object, int withFrame, Tcl_Obj *command, int nobjc, Tcl_Obj *CONST* nobjv) +static int NsfDirectDispatchCmd(Tcl_Interp *interp, NsfObject *object, FrameIdx_t withFrame, Tcl_Obj *command, int nobjc, Tcl_Obj *CONST* nobjv) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); static int NsfDispatchCmd(Tcl_Interp *interp, NsfObject *object, int withIntrinsic, int withSystem, Tcl_Obj *command, int nobjc, Tcl_Obj *CONST* nobjv) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(5); static int NsfFinalizeCmd(Tcl_Interp *interp, int withKeepvars) NSF_nonnull(1); -static int NsfForwardPropertyCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *methodName, int forwardProperty, Tcl_Obj *value) +static int NsfForwardPropertyCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *methodName, ForwardpropertyIdx_t forwardProperty, Tcl_Obj *value) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); static int NsfInterpObjCmd(Tcl_Interp *interp, const char *name, int objc, Tcl_Obj *CONST* objv) NSF_nonnull(1) NSF_nonnull(2); static int NsfIsCmd(Tcl_Interp *interp, int withComplain, int withConfigure, const char *withName, Tcl_Obj *constraint, Tcl_Obj *value) NSF_nonnull(1) NSF_nonnull(5) NSF_nonnull(6); -static int NsfMethodAliasCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, const char *methodName, int withFrame, int withProtection, Tcl_Obj *cmdName) +static int NsfMethodAliasCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, const char *methodName, FrameIdx_t withFrame, ProtectionIdx_t withProtection, Tcl_Obj *cmdName) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4) NSF_nonnull(7); -static int NsfMethodAssertionCmd(Tcl_Interp *interp, NsfObject *object, int subcmd, Tcl_Obj *arg) +static int NsfMethodAssertionCmd(Tcl_Interp *interp, NsfObject *object, AssertionsubcmdIdx_t subcmd, Tcl_Obj *arg) NSF_nonnull(1) NSF_nonnull(2); static int NsfMethodCreateCmd(Tcl_Interp *interp, NsfObject *object, int withCheckalways, int withInner_namespace, int withPer_object, NsfObject *withReg_object, Tcl_Obj *methodName, Tcl_Obj *arguments, Tcl_Obj *body, Tcl_Obj *withPrecondition, Tcl_Obj *withPostcondition) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(7) NSF_nonnull(8) NSF_nonnull(9); static int NsfMethodDeleteCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *methodName) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); -static int NsfMethodForwardCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *method, Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withOnerror, Tcl_Obj *withPrefix, int withFrame, int withVerbose, Tcl_Obj *target, int nobjc, Tcl_Obj *CONST* nobjv) +static int NsfMethodForwardCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *method, Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withOnerror, Tcl_Obj *withPrefix, FrameIdx_t withFrame, int withVerbose, Tcl_Obj *target, int nobjc, Tcl_Obj *CONST* nobjv) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); -static int NsfMethodPropertyCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *methodName, int methodProperty, Tcl_Obj *value) +static int NsfMethodPropertyCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *methodName, MethodpropertyIdx_t methodProperty, Tcl_Obj *value) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); static int NsfMethodRegisteredCmd(Tcl_Interp *interp, Tcl_Obj *handle) NSF_nonnull(1) NSF_nonnull(2); @@ -634,7 +634,7 @@ NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(3); static int NsfObjectExistsCmd(Tcl_Interp *interp, Tcl_Obj *value) NSF_nonnull(1) NSF_nonnull(2); -static int NsfObjectPropertyCmd(Tcl_Interp *interp, NsfObject *objectName, int objectProperty, Tcl_Obj *value) +static int NsfObjectPropertyCmd(Tcl_Interp *interp, NsfObject *objectName, ObjectpropertyIdx_t objectProperty, Tcl_Obj *value) NSF_nonnull(1) NSF_nonnull(2); static int NsfObjectQualifyCmd(Tcl_Interp *interp, Tcl_Obj *objectName) NSF_nonnull(1) NSF_nonnull(2); @@ -644,7 +644,7 @@ NSF_nonnull(1) NSF_nonnull(2); static int NsfParameterCacheObjectInvalidateCmd(Tcl_Interp *interp, NsfObject *object) NSF_nonnull(1) NSF_nonnull(2); -static int NsfParameterInfoCmd(Tcl_Interp *interp, int subcmd, Tcl_Obj *spec, Tcl_Obj *varname) +static int NsfParameterInfoCmd(Tcl_Interp *interp, ParametersubcmdIdx_t subcmd, Tcl_Obj *spec, Tcl_Obj *varname) NSF_nonnull(1) NSF_nonnull(3); static int NsfParameterSpecsCmd(Tcl_Interp *interp, int withConfigure, int withNonposargs, Tcl_Obj *slotobjs) NSF_nonnull(1) NSF_nonnull(4); @@ -658,9 +658,9 @@ NSF_nonnull(1); static int NsfProfileTraceStub(Tcl_Interp *interp, int withEnable, int withVerbose, int withDontsave, Tcl_Obj *withBuiltins) NSF_nonnull(1); -static int NsfRelationGetCmd(Tcl_Interp *interp, NsfObject *object, int type) +static int NsfRelationGetCmd(Tcl_Interp *interp, NsfObject *object, RelationtypeIdx_t type) NSF_nonnull(1) NSF_nonnull(2); -static int NsfRelationSetCmd(Tcl_Interp *interp, NsfObject *object, int type, Tcl_Obj *value) +static int NsfRelationSetCmd(Tcl_Interp *interp, NsfObject *object, RelationtypeIdx_t type, Tcl_Obj *value) NSF_nonnull(1) NSF_nonnull(2); static int NsfSelfCmd(Tcl_Interp *interp) NSF_nonnull(1); @@ -734,23 +734,23 @@ NSF_nonnull(1) NSF_nonnull(2); static int NsfObjInfoLookupMethodMethod(Tcl_Interp *interp, NsfObject *obj, Tcl_Obj *name) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(3); -static int NsfObjInfoLookupMethodsMethod(Tcl_Interp *interp, NsfObject *obj, int withCallprotection, int withIncontext, int withType, int withNomixins, int withPath, int withSource, const char *pattern) +static int NsfObjInfoLookupMethodsMethod(Tcl_Interp *interp, NsfObject *obj, CallprotectionIdx_t withCallprotection, int withIncontext, MethodtypeIdx_t withType, int withNomixins, int withPath, DefinitionsourceIdx_t withSource, const char *pattern) NSF_nonnull(1) NSF_nonnull(2); static int NsfObjInfoLookupMixinsMethod(Tcl_Interp *interp, NsfObject *obj, int withGuards, const char *patternString, NsfObject *patternObject) NSF_nonnull(1) NSF_nonnull(2); -static int NsfObjInfoLookupSlotsMethod(Tcl_Interp *interp, NsfObject *obj, int withSource, NsfClass *withType, const char *pattern) +static int NsfObjInfoLookupSlotsMethod(Tcl_Interp *interp, NsfObject *obj, DefinitionsourceIdx_t withSource, NsfClass *withType, const char *pattern) NSF_nonnull(1) NSF_nonnull(2); -static int NsfObjInfoMethodMethod(Tcl_Interp *interp, NsfObject *obj, int subcmd, Tcl_Obj *name) +static int NsfObjInfoMethodMethod(Tcl_Interp *interp, NsfObject *obj, InfomethodsubcmdIdx_t subcmd, Tcl_Obj *name) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); -static int NsfObjInfoMethodsMethod(Tcl_Interp *interp, NsfObject *obj, int withCallprotection, int withType, int withPath, const char *pattern) +static int NsfObjInfoMethodsMethod(Tcl_Interp *interp, NsfObject *obj, CallprotectionIdx_t withCallprotection, MethodtypeIdx_t withType, int withPath, const char *pattern) NSF_nonnull(1) NSF_nonnull(2); static int NsfObjInfoMixinguardMethod(Tcl_Interp *interp, NsfObject *obj, const char *mixin) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(3); static int NsfObjInfoMixinsMethod(Tcl_Interp *interp, NsfObject *obj, int withGuards, const char *patternString, NsfObject *patternObject) NSF_nonnull(1) NSF_nonnull(2); static int NsfObjInfoNameMethod(Tcl_Interp *interp, NsfObject *obj) NSF_nonnull(1) NSF_nonnull(2); -static int NsfObjInfoObjectparameterMethod(Tcl_Interp *interp, NsfObject *obj, int subcmd, const char *pattern) +static int NsfObjInfoObjectparameterMethod(Tcl_Interp *interp, NsfObject *obj, InfoobjectparametersubcmdIdx_t subcmd, const char *pattern) NSF_nonnull(1) NSF_nonnull(2); static int NsfObjInfoParentMethod(Tcl_Interp *interp, NsfObject *obj) NSF_nonnull(1) NSF_nonnull(2); @@ -1251,7 +1251,7 @@ method_definitions[NsfClassInfoMethodMethodIdx].paramDefs, method_definitions[NsfClassInfoMethodMethodIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { - int subcmd = (int )PTR2INT(pc.clientData[0]); + InfomethodsubcmdIdx_t subcmd = (InfomethodsubcmdIdx_t )pc.clientData[0]; Tcl_Obj *name = (Tcl_Obj *)pc.clientData[1]; assert(pc.status == 0); @@ -1277,11 +1277,11 @@ method_definitions[NsfClassInfoMethodsMethodIdx].paramDefs, method_definitions[NsfClassInfoMethodsMethodIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { - int withCallprotection = (int )PTR2INT(pc.clientData[0]); + CallprotectionIdx_t withCallprotection = (CallprotectionIdx_t )pc.clientData[0]; int withClosure = (int )PTR2INT(pc.clientData[1]); - int withType = (int )PTR2INT(pc.clientData[2]); + MethodtypeIdx_t withType = (MethodtypeIdx_t )pc.clientData[2]; int withPath = (int )PTR2INT(pc.clientData[3]); - int withSource = (int )PTR2INT(pc.clientData[4]); + DefinitionsourceIdx_t withSource = (DefinitionsourceIdx_t )pc.clientData[4]; const char *pattern = (const char *)pc.clientData[5]; assert(pc.status == 0); @@ -1308,7 +1308,7 @@ method_definitions[NsfClassInfoMixinOfMethodIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { int withClosure = (int )PTR2INT(pc.clientData[0]); - int withScope = (int )PTR2INT(pc.clientData[1]); + MixinscopeIdx_t withScope = (MixinscopeIdx_t )pc.clientData[1]; const char *patternString = NULL; NsfObject *patternObject = NULL; Tcl_Obj *pattern = (Tcl_Obj *)pc.clientData[2]; @@ -1426,7 +1426,7 @@ method_definitions[NsfClassInfoSlotobjectsMethodIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { int withClosure = (int )PTR2INT(pc.clientData[0]); - int withSource = (int )PTR2INT(pc.clientData[1]); + DefinitionsourceIdx_t withSource = (DefinitionsourceIdx_t )pc.clientData[1]; NsfClass *withType = (NsfClass *)pc.clientData[2]; const char *pattern = (const char *)pc.clientData[3]; @@ -1571,7 +1571,7 @@ method_definitions[NsfCmdInfoCmdIdx].paramDefs, method_definitions[NsfCmdInfoCmdIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { - int subcmd = (int )PTR2INT(pc.clientData[0]); + InfomethodsubcmdIdx_t subcmd = (InfomethodsubcmdIdx_t )pc.clientData[0]; NsfObject *withContext = (NsfObject *)pc.clientData[1]; Tcl_Obj *methodName = (Tcl_Obj *)pc.clientData[2]; const char *pattern = (const char *)pc.clientData[3]; @@ -1604,7 +1604,7 @@ method_definitions[NsfConfigureCmdIdx].paramDefs, method_definitions[NsfConfigureCmdIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { - int option = (int )PTR2INT(pc.clientData[0]); + ConfigureoptionIdx_t option = (ConfigureoptionIdx_t )pc.clientData[0]; Tcl_Obj *value = (Tcl_Obj *)pc.clientData[1]; assert(pc.status == 0); @@ -1625,7 +1625,7 @@ method_definitions[NsfCurrentCmdIdx].paramDefs, method_definitions[NsfCurrentCmdIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { - int option = (int )PTR2INT(pc.clientData[0]); + CurrentoptionIdx_t option = (CurrentoptionIdx_t )pc.clientData[0]; assert(pc.status == 0); return NsfCurrentCmd(interp, option); @@ -1710,7 +1710,7 @@ method_definitions[NsfDirectDispatchCmdIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { NsfObject *object = (NsfObject *)pc.clientData[0]; - int withFrame = (int )PTR2INT(pc.clientData[1]); + FrameIdx_t withFrame = (FrameIdx_t )pc.clientData[1]; Tcl_Obj *command = (Tcl_Obj *)pc.clientData[2]; assert(pc.status == 0); @@ -1777,7 +1777,7 @@ NsfObject *object = (NsfObject *)pc.clientData[0]; int withPer_object = (int )PTR2INT(pc.clientData[1]); Tcl_Obj *methodName = (Tcl_Obj *)pc.clientData[2]; - int forwardProperty = (int )PTR2INT(pc.clientData[3]); + ForwardpropertyIdx_t forwardProperty = (ForwardpropertyIdx_t )pc.clientData[3]; Tcl_Obj *value = (Tcl_Obj *)pc.clientData[4]; assert(pc.status == 0); @@ -1845,8 +1845,8 @@ NsfObject *object = (NsfObject *)pc.clientData[0]; int withPer_object = (int )PTR2INT(pc.clientData[1]); const char *methodName = (const char *)pc.clientData[2]; - int withFrame = (int )PTR2INT(pc.clientData[3]); - int withProtection = (int )PTR2INT(pc.clientData[4]); + FrameIdx_t withFrame = (FrameIdx_t )pc.clientData[3]; + ProtectionIdx_t withProtection = (ProtectionIdx_t )pc.clientData[4]; Tcl_Obj *cmdName = (Tcl_Obj *)pc.clientData[5]; assert(pc.status == 0); @@ -1868,7 +1868,7 @@ method_definitions[NsfMethodAssertionCmdIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { NsfObject *object = (NsfObject *)pc.clientData[0]; - int subcmd = (int )PTR2INT(pc.clientData[1]); + AssertionsubcmdIdx_t subcmd = (AssertionsubcmdIdx_t )pc.clientData[1]; Tcl_Obj *arg = (Tcl_Obj *)pc.clientData[2]; assert(pc.status == 0); @@ -1947,7 +1947,7 @@ int withEarlybinding = (int )PTR2INT(pc.clientData[4]); Tcl_Obj *withOnerror = (Tcl_Obj *)pc.clientData[5]; Tcl_Obj *withPrefix = (Tcl_Obj *)pc.clientData[6]; - int withFrame = (int )PTR2INT(pc.clientData[7]); + FrameIdx_t withFrame = (FrameIdx_t )pc.clientData[7]; int withVerbose = (int )PTR2INT(pc.clientData[8]); Tcl_Obj *target = (Tcl_Obj *)pc.clientData[9]; @@ -1972,7 +1972,7 @@ NsfObject *object = (NsfObject *)pc.clientData[0]; int withPer_object = (int )PTR2INT(pc.clientData[1]); Tcl_Obj *methodName = (Tcl_Obj *)pc.clientData[2]; - int methodProperty = (int )PTR2INT(pc.clientData[3]); + MethodpropertyIdx_t methodProperty = (MethodpropertyIdx_t )pc.clientData[3]; Tcl_Obj *value = (Tcl_Obj *)pc.clientData[4]; assert(pc.status == 0); @@ -2130,7 +2130,7 @@ method_definitions[NsfObjectPropertyCmdIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { NsfObject *objectName = (NsfObject *)pc.clientData[0]; - int objectProperty = (int )PTR2INT(pc.clientData[1]); + ObjectpropertyIdx_t objectProperty = (ObjectpropertyIdx_t )pc.clientData[1]; Tcl_Obj *value = (Tcl_Obj *)pc.clientData[2]; assert(pc.status == 0); @@ -2229,7 +2229,7 @@ method_definitions[NsfParameterInfoCmdIdx].paramDefs, method_definitions[NsfParameterInfoCmdIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { - int subcmd = (int )PTR2INT(pc.clientData[0]); + ParametersubcmdIdx_t subcmd = (ParametersubcmdIdx_t )pc.clientData[0]; Tcl_Obj *spec = (Tcl_Obj *)pc.clientData[1]; Tcl_Obj *varname = (Tcl_Obj *)pc.clientData[2]; @@ -2376,7 +2376,7 @@ method_definitions[NsfRelationGetCmdIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { NsfObject *object = (NsfObject *)pc.clientData[0]; - int type = (int )PTR2INT(pc.clientData[1]); + RelationtypeIdx_t type = (RelationtypeIdx_t )pc.clientData[1]; assert(pc.status == 0); return NsfRelationGetCmd(interp, object, type); @@ -2397,7 +2397,7 @@ method_definitions[NsfRelationSetCmdIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { NsfObject *object = (NsfObject *)pc.clientData[0]; - int type = (int )PTR2INT(pc.clientData[1]); + RelationtypeIdx_t type = (RelationtypeIdx_t )pc.clientData[1]; Tcl_Obj *value = (Tcl_Obj *)pc.clientData[2]; assert(pc.status == 0); @@ -3177,12 +3177,12 @@ method_definitions[NsfObjInfoLookupMethodsMethodIdx].paramDefs, method_definitions[NsfObjInfoLookupMethodsMethodIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { - int withCallprotection = (int )PTR2INT(pc.clientData[0]); + CallprotectionIdx_t withCallprotection = (CallprotectionIdx_t )pc.clientData[0]; int withIncontext = (int )PTR2INT(pc.clientData[1]); - int withType = (int )PTR2INT(pc.clientData[2]); + MethodtypeIdx_t withType = (MethodtypeIdx_t )pc.clientData[2]; int withNomixins = (int )PTR2INT(pc.clientData[3]); int withPath = (int )PTR2INT(pc.clientData[4]); - int withSource = (int )PTR2INT(pc.clientData[5]); + DefinitionsourceIdx_t withSource = (DefinitionsourceIdx_t )pc.clientData[5]; const char *pattern = (const char *)pc.clientData[6]; assert(pc.status == 0); @@ -3251,7 +3251,7 @@ method_definitions[NsfObjInfoLookupSlotsMethodIdx].paramDefs, method_definitions[NsfObjInfoLookupSlotsMethodIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { - int withSource = (int )PTR2INT(pc.clientData[0]); + DefinitionsourceIdx_t withSource = (DefinitionsourceIdx_t )pc.clientData[0]; NsfClass *withType = (NsfClass *)pc.clientData[1]; const char *pattern = (const char *)pc.clientData[2]; @@ -3277,7 +3277,7 @@ method_definitions[NsfObjInfoMethodMethodIdx].paramDefs, method_definitions[NsfObjInfoMethodMethodIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { - int subcmd = (int )PTR2INT(pc.clientData[0]); + InfomethodsubcmdIdx_t subcmd = (InfomethodsubcmdIdx_t )pc.clientData[0]; Tcl_Obj *name = (Tcl_Obj *)pc.clientData[1]; assert(pc.status == 0); @@ -3302,8 +3302,8 @@ method_definitions[NsfObjInfoMethodsMethodIdx].paramDefs, method_definitions[NsfObjInfoMethodsMethodIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { - int withCallprotection = (int )PTR2INT(pc.clientData[0]); - int withType = (int )PTR2INT(pc.clientData[1]); + CallprotectionIdx_t withCallprotection = (CallprotectionIdx_t )pc.clientData[0]; + MethodtypeIdx_t withType = (MethodtypeIdx_t )pc.clientData[1]; int withPath = (int )PTR2INT(pc.clientData[2]); const char *pattern = (const char *)pc.clientData[3]; @@ -3417,7 +3417,7 @@ method_definitions[NsfObjInfoObjectparameterMethodIdx].paramDefs, method_definitions[NsfObjInfoObjectparameterMethodIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { - int subcmd = (int )PTR2INT(pc.clientData[0]); + InfoobjectparametersubcmdIdx_t subcmd = (InfoobjectparametersubcmdIdx_t )pc.clientData[0]; const char *pattern = (const char *)pc.clientData[1]; assert(pc.status == 0); @@ -3583,12 +3583,12 @@ {"-closure", 0, 0, Nsf_ConvertTo_Boolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"-type", NSF_ARG_IS_ENUMERATION, 1, ConvertToMethodtype, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-path", 0, 0, Nsf_ConvertTo_Boolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, - {"-source", NSF_ARG_IS_ENUMERATION, 1, ConvertToSource, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-source", NSF_ARG_IS_ENUMERATION, 1, ConvertToDefinitionsource, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"pattern", 0, 1, Nsf_ConvertTo_String, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, {"::nsf::methods::class::info::mixinof", NsfClassInfoMixinOfMethodStub, 3, { {"-closure", 0, 0, Nsf_ConvertTo_Boolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, - {"-scope", NSF_ARG_IS_ENUMERATION, 1, ConvertToScope, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-scope", NSF_ARG_IS_ENUMERATION, 1, ConvertToMixinscope, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"pattern", 0, 1, ConvertToObjpattern, NULL,NULL,"objpattern",NULL,NULL,NULL,NULL,NULL}} }, {"::nsf::methods::class::info::mixinguard", NsfClassInfoMixinguardMethodStub, 1, { @@ -3602,7 +3602,7 @@ }, {"::nsf::methods::class::info::slotobjects", NsfClassInfoSlotobjectsMethodStub, 4, { {"-closure", 0, 0, Nsf_ConvertTo_Boolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, - {"-source", NSF_ARG_IS_ENUMERATION, 1, ConvertToSource, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-source", NSF_ARG_IS_ENUMERATION, 1, ConvertToDefinitionsource, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-type", 0, 1, Nsf_ConvertTo_Class, NULL,NULL,"class",NULL,NULL,NULL,NULL,NULL}, {"pattern", 0, 1, Nsf_ConvertTo_String, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, @@ -3971,15 +3971,15 @@ {"-type", NSF_ARG_IS_ENUMERATION, 1, ConvertToMethodtype, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-nomixins", 0, 0, Nsf_ConvertTo_Boolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"-path", 0, 0, Nsf_ConvertTo_Boolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, - {"-source", NSF_ARG_IS_ENUMERATION, 1, ConvertToSource, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-source", NSF_ARG_IS_ENUMERATION, 1, ConvertToDefinitionsource, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"pattern", 0, 1, Nsf_ConvertTo_String, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, {"::nsf::methods::object::info::lookupmixins", NsfObjInfoLookupMixinsMethodStub, 2, { {"-guards", 0, 0, Nsf_ConvertTo_Boolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"pattern", 0, 1, ConvertToObjpattern, NULL,NULL,"objpattern",NULL,NULL,NULL,NULL,NULL}} }, {"::nsf::methods::object::info::lookupslots", NsfObjInfoLookupSlotsMethodStub, 3, { - {"-source", NSF_ARG_IS_ENUMERATION, 1, ConvertToSource, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-source", NSF_ARG_IS_ENUMERATION, 1, ConvertToDefinitionsource, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-type", 0, 1, Nsf_ConvertTo_Class, NULL,NULL,"class",NULL,NULL,NULL,NULL,NULL}, {"pattern", 0, 1, Nsf_ConvertTo_String, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, Index: library/mongodb/mongoAPI.h =================================================================== diff -u -re3e8f375df1313380cd13a6cb97028569f99d729 -raa5b3f4293624fedf641985718ab15c82f5daf78 --- library/mongodb/mongoAPI.h (.../mongoAPI.h) (revision e3e8f375df1313380cd13a6cb97028569f99d729) +++ library/mongodb/mongoAPI.h (.../mongoAPI.h) (revision aa5b3f4293624fedf641985718ab15c82f5daf78) @@ -64,7 +64,7 @@ -enum GridfilesourceIdx {GridfilesourceNULL, GridfilesourceFileIdx, GridfilesourceStringIdx}; +typedef enum {GridfilesourceNULL, GridfilesourceFileIdx, GridfilesourceStringIdx} GridfilesourceIdx_t; static int ConvertToGridfilesource(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { @@ -187,7 +187,7 @@ NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(3) NSF_nonnull(4); static int NsfMongoGridFileClose(Tcl_Interp *interp, mongoc_gridfs_file_t *gridfilePtr, Tcl_Obj *gridfileObj) NSF_nonnull(1) NSF_nonnull(2); -static int NsfMongoGridFileCreate(Tcl_Interp *interp, int withSource, mongoc_gridfs_t *gfsPtr, const char *value, const char *name, const char *contenttype, Tcl_Obj *withMetadata) +static int NsfMongoGridFileCreate(Tcl_Interp *interp, GridfilesourceIdx_t withSource, mongoc_gridfs_t *gfsPtr, const char *value, const char *name, const char *contenttype, Tcl_Obj *withMetadata) NSF_nonnull(1) NSF_nonnull(3) NSF_nonnull(4) NSF_nonnull(5) NSF_nonnull(6); static int NsfMongoGridFileDelete(Tcl_Interp *interp, mongoc_gridfs_t *gfsPtr, Tcl_Obj *query) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(3); @@ -648,7 +648,7 @@ method_definitions[NsfMongoGridFileCreateIdx].paramDefs, method_definitions[NsfMongoGridFileCreateIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { - int withSource = (int )PTR2INT(pc.clientData[0]); + GridfilesourceIdx_t withSource = (GridfilesourceIdx_t )pc.clientData[0]; mongoc_gridfs_t *gfsPtr = (mongoc_gridfs_t *)pc.clientData[1]; const char *value = (const char *)pc.clientData[2]; const char *name = (const char *)pc.clientData[3]; Index: library/mongodb/nsfmongo.c =================================================================== diff -u -r4dccd3ff7bcf142a60a2c56454411613ec50077e -raa5b3f4293624fedf641985718ab15c82f5daf78 --- library/mongodb/nsfmongo.c (.../nsfmongo.c) (revision 4dccd3ff7bcf142a60a2c56454411613ec50077e) +++ library/mongodb/nsfmongo.c (.../nsfmongo.c) (revision aa5b3f4293624fedf641985718ab15c82f5daf78) @@ -1340,7 +1340,8 @@ } */ static int -NsfMongoGridFileCreate(Tcl_Interp *interp, int withSource, +NsfMongoGridFileCreate(Tcl_Interp *interp, + GridfilesourceIdx_t withSource, mongoc_gridfs_t *gridfsPtr, CONST char *value, CONST char *name, CONST char *contenttype,