Index: TODO =================================================================== diff -u -r409cc953ea5440ccaeb252ff1932ab448dccd1e8 -rd49e60e74c36c563db5ba7095c2f898f1029169b --- TODO (.../TODO) (revision 409cc953ea5440ccaeb252ff1932ab448dccd1e8) +++ TODO (.../TODO) (revision d49e60e74c36c563db5ba7095c2f898f1029169b) @@ -1971,6 +1971,7 @@ - Extended regression test - make handling of redefinitions in system methods more robust +- follow Tcl nameing convention (uppercase functions) TODO: Index: generic/nsf.c =================================================================== diff -u -r409cc953ea5440ccaeb252ff1932ab448dccd1e8 -rd49e60e74c36c563db5ba7095c2f898f1029169b --- generic/nsf.c (.../nsf.c) (revision 409cc953ea5440ccaeb252ff1932ab448dccd1e8) +++ generic/nsf.c (.../nsf.c) (revision d49e60e74c36c563db5ba7095c2f898f1029169b) @@ -498,7 +498,7 @@ fprintf(stderr, "--- %s tcl %p %s (%d %p) nsf %p (%d) %s \n", string, object->cmdName, object->cmdName->typePtr ? object->cmdName->typePtr->name : "NULL", object->cmdName->refCount, object->cmdName->internalRep.twoPtrValue.ptr1, - object, obj->refCount, objectName(object)); + object, obj->refCount, ObjectName(object)); else fprintf(stderr, "--- No object: %s\n", string); } @@ -726,7 +726,7 @@ methodObj = NsfMethodObj(interp, &baseClass->object, NSF_c_requireobject_idx); if (methodObj) { /*fprintf(stderr, "+++ calling __unknown for %s name=%s\n", - className(baseClass), ObjStr(nameObj));*/ + ClassName(baseClass), ObjStr(nameObj));*/ result = CallMethod((ClientData) baseClass, interp, methodObj, 3, &nameObj, NSF_CM_NO_PROTECT|NSF_CSC_IMMEDIATE); @@ -1250,7 +1250,7 @@ *regObject = GetRegObject(interp, cmd, ObjStr(ov[0]), methodName1, fromClassNS); /*fprintf(stderr, "... regObject object '%s' reg %p, fromClassNS %d\n", - objectName(referencedObject), *regObject, *fromClassNS);*/ + ObjectName(referencedObject), *regObject, *fromClassNS);*/ /* * Build a fresh methodHandleObj to held method name and names of @@ -1736,23 +1736,23 @@ if ((*(Nsf_SytemMethodOpts[i]+1) == 'o' && object == &defOsPtr->rootClass->object) || (*(Nsf_SytemMethodOpts[i]+1) == 'c' && object == &defOsPtr->rootMetaClass->object) ) { /*fprintf(stderr, "+++ %s %.6x NOT overloading %s.%s %s (is root %d, is meta %d)\n", - className(defOsPtr->rootClass), - osPtr->overloadedMethods, objectName(object), methodName, Nsf_SytemMethodOpts[i], + ClassName(defOsPtr->rootClass), + osPtr->overloadedMethods, ObjectName(object), methodName, Nsf_SytemMethodOpts[i], object == &defOsPtr->rootClass->object, object == &defOsPtr->rootMetaClass->object);*/ } else { osPtr->overloadedMethods |= flag; /*fprintf(stderr, "+++ %s %.6x overloading %s.%s %s (is root %d, is meta %d)\n", - className(defOsPtr->rootClass), - osPtr->overloadedMethods, objectName(object), methodName, Nsf_SytemMethodOpts[i], + ClassName(defOsPtr->rootClass), + osPtr->overloadedMethods, ObjectName(object), methodName, Nsf_SytemMethodOpts[i], object == &defOsPtr->rootClass->object, object == &defOsPtr->rootMetaClass->object);*/ } } if (osPtr == defOsPtr && ((osPtr->definedMethods & flag) == 0)) { osPtr->definedMethods |= flag; - /*fprintf(stderr, "+++ %s %.6x defining %s.%s %s\n", className(defOsPtr->rootClass), - osPtr->definedMethods, objectName(object), methodName, Nsf_SytemMethodOpts[i]);*/ + /*fprintf(stderr, "+++ %s %.6x defining %s.%s %s\n", ClassName(defOsPtr->rootClass), + osPtr->definedMethods, ObjectName(object), methodName, Nsf_SytemMethodOpts[i]);*/ } } } @@ -1799,7 +1799,7 @@ /* collect all instances from all object systems */ for (osPtr = RUNTIME_STATE(interp)->objectSystems; osPtr; osPtr = osPtr->nextPtr) { - /*fprintf(stderr, "destroyObjectSystem deletes %s\n", className(osPtr->rootClass));*/ + /*fprintf(stderr, "destroyObjectSystem deletes %s\n", ClassName(osPtr->rootClass));*/ GetAllInstances(interp, commandNameTable, osPtr->rootClass); } @@ -1895,27 +1895,27 @@ } else if ((osPtr->definedMethods & flag) == 0) { /* not defined, we must call directly */ fprintf(stderr, "Warning: CallDirectly object %s idx %s not defined\n", - objectName(object), Nsf_SytemMethodOpts[methodIdx]+1); + ObjectName(object), Nsf_SytemMethodOpts[methodIdx]+1); } else { if (!(object->flags & NSF_FILTER_ORDER_VALID)) { FilterComputeDefined(interp, object); } /*fprintf(stderr, "CallDirectly object %s idx %s object flags %.6x %.6x \n", - objectName(object), sytemMethodOpts[methodIdx]+1, + ObjectName(object), sytemMethodOpts[methodIdx]+1, (object->flags & NSF_FILTER_ORDER_DEFINED_AND_VALID), NSF_FILTER_ORDER_DEFINED_AND_VALID );*/ if ((object->flags & NSF_FILTER_ORDER_DEFINED_AND_VALID) == NSF_FILTER_ORDER_DEFINED_AND_VALID) { /*fprintf(stderr, "CallDirectly object %s idx %s has filter \n", - objectName(object), sytemMethodOpts[methodIdx]+1);*/ + ObjectName(object), sytemMethodOpts[methodIdx]+1);*/ callDirectly = 0; } } } #if 0 fprintf(stderr, "CallDirectly object %s idx %d returns %s => %d\n", - objectName(object), methodIdx, + ObjectName(object), methodIdx, methodObj ? ObjStr(methodObj) : "(null)", callDirectly); #endif /* return the methodObj in every case */ @@ -1942,7 +1942,7 @@ NsfObjectSystem *osPtr = GetObjectSystem(object); /* fprintf(stderr, "NsfMethodObj object %s os %p idx %d %s methodObj %p\n", - objectName(object), osPtr, methodIdx, + ObjectName(object), osPtr, methodIdx, Nsf_SytemMethodOpts[methodIdx]+1, osPtr->methods[methodIdx]); */ @@ -1980,12 +1980,12 @@ static void MakeObjNamespace(Tcl_Interp *interp, NsfObject *object) { #ifdef NAMESPACE_TRACE - fprintf(stderr, "+++ MakeObjNamespace for %s\n", objectName(object)); + fprintf(stderr, "+++ MakeObjNamespace for %s\n", ObjectName(object)); #endif if (!object->nsPtr) { Tcl_Namespace *nsPtr; object->nsPtr = NSGetFreshNamespace(interp, (ClientData)object, - objectName(object)); + ObjectName(object)); if (!object->nsPtr) Tcl_Panic("MakeObjNamespace: Unable to make namespace", NULL); nsPtr = object->nsPtr; @@ -2194,7 +2194,7 @@ #if defined (VAR_RESOLVER_TRACE) fprintf(stderr, "...... lookup of '%s' for object '%s' returns %p\n", - varName, objectName(object), *varPtr); + varName, ObjectName(object), *varPtr); #endif if (*varPtr == NULL) { /* @@ -2324,7 +2324,7 @@ resVarInfo->lastObject = object; #if defined(VAR_RESOLVER_TRACE) - fprintf(stderr,"Fetch var %s in object %s\n",TclGetString(resVarInfo->nameObj),objectName(object)); + fprintf(stderr,"Fetch var %s in object %s\n",TclGetString(resVarInfo->nameObj),ObjectName(object)); #endif resVarInfo->var = var = (Tcl_Var) VarHashCreateVar(varTablePtr, resVarInfo->nameObj, &new); /* @@ -2795,7 +2795,7 @@ if (!Tcl_Command_cmdEpoch(cmd)) { NsfObject *object = NsfGetObjectFromCmdPtr(cmd); - /*fprintf(stderr, "... check %p %s\n", object, object ? objectName(object) : "(null)");*/ + /*fprintf(stderr, "... check %p %s\n", object, object ? ObjectName(object) : "(null)");*/ /* delete here just true children */ if (object && object->id == cmd) { @@ -3029,7 +3029,7 @@ int rc = 0; /*fprintf(stderr, "NSRequireParentObject %s cl %p (%s) methodObj %p defaultSc %p %s\n", - parentName, cl, className(cl), methodObj, defaultSuperClass, className(defaultSuperClass));*/ + parentName, cl, ClassName(cl), methodObj, defaultSuperClass, ClassName(defaultSuperClass));*/ if (methodObj) { /* call requireObject and try again */ @@ -3042,7 +3042,7 @@ INCR_REF_COUNT(ov[2]); /*fprintf(stderr, "+++ parent... calling %s __unknown for %s\n", - className(defaultSuperClass), ObjStr(ov[2]));*/ + ClassName(defaultSuperClass), ObjStr(ov[2]));*/ result = Tcl_EvalObjv(interp, 3, ov, 0); if (result == TCL_OK) { @@ -3255,7 +3255,7 @@ */ Tcl_Obj *bootstrapObj = Tcl_GetVar2Ex(interp, "::nsf::bootstrap", NULL, TCL_GLOBAL_ONLY); if (bootstrapObj == NULL) { - result = NsfVarErrMsg(interp, "Method '", methodName, "' of ", objectName(object), + result = NsfVarErrMsg(interp, "Method '", methodName, "' of ", ObjectName(object), " cannot be overwritten. Derive e.g. a sub-class!", (char *) NULL); } else { @@ -3519,7 +3519,7 @@ #ifdef OBJDELETION_TRACE fprintf(stderr, "CallStackDestroyObject %p %s activationcount %d flags %.6x\n", - object, objectName(object), object->activationCount, object->flags); + object, ObjectName(object), object->activationCount, object->flags); #endif if ((object->flags & NSF_DESTROY_CALLED) == 0) { @@ -4107,7 +4107,7 @@ } if (opt->checkoptions == CHECK_NONE && ocArgs>0) { return NsfVarErrMsg(interp, "Unknown check option in command '", - objectName(object), " check ", ObjStr(arg), + ObjectName(object), " check ", ObjStr(arg), "', valid: all pre post object-invar class-invar", (char *) NULL); } @@ -4183,7 +4183,7 @@ int i, found = 0; for (i=0, cls = *checkList; cls; i++, cls = cls->nextPtr) { /* fprintf(stderr, "+++ c%d: %s\n", i, - className(cls->cl));*/ + ClassName(cls->cl));*/ if (pl->cl == cls->cl) { found = 1; break; @@ -4213,7 +4213,7 @@ static void MixinResetOrder(NsfObject *object) { - /*fprintf(stderr, "removeList %s \n", objectName(object));*/ + /*fprintf(stderr, "removeList %s \n", ObjectName(object));*/ CmdListRemoveList(&object->mixinOrder, NULL /*GuardDel*/); object->mixinOrder = NULL; } @@ -4453,7 +4453,7 @@ if (inst->flags & NSF_TCL_DELETE) { if (RUNTIME_STATE(interp)->debugLevel > 1) { - fprintf(stderr, "Warning: Object %s is apparently deleted\n", objectName(inst)); + fprintf(stderr, "Warning: Object %s is apparently deleted\n", ObjectName(inst)); } continue; } @@ -4463,25 +4463,25 @@ if (cmdPtr && (cmdPtr->nsPtr->flags & NS_DYING)) { if (RUNTIME_STATE(interp)->debugLevel > 0) { - fprintf(stderr, "Warning: Namespace of %s is apparently deleted\n", objectName(inst)); + fprintf(stderr, "Warning: Namespace of %s is apparently deleted\n", ObjectName(inst)); } continue; } #if !defined(NDEBUG) { - NsfObject *object = GetObjectFromString(interp, objectName(inst)); + NsfObject *object = GetObjectFromString(interp, ObjectName(inst)); assert(object); } #endif /*fprintf (stderr, " -- %p flags %.6x activation %d %s id %p id->flags %.6x " "nsPtr->flags %.6x (instance of %s)\n", inst, inst->flags, inst->activationCount, - objectName(inst), inst->id, cmdPtr->flags, cmdPtr->nsPtr ? cmdPtr->nsPtr->flags : 0, + ObjectName(inst), inst->id, cmdPtr->flags, cmdPtr->nsPtr ? cmdPtr->nsPtr->flags : 0, ObjStr(startCl->object.cmdName));*/ - Tcl_CreateHashEntry(destTablePtr, objectName(inst), &new); + Tcl_CreateHashEntry(destTablePtr, ObjectName(inst), &new); } for (sc = startCl->sub; sc; sc = sc->nextPtr) { @@ -4542,7 +4542,7 @@ Tcl_CreateHashEntry(destTablePtr, (char *)cl, new); if (*new) { if (appendResult) { - if (!pattern || Tcl_StringMatch(className(cl), pattern)) { + if (!pattern || Tcl_StringMatch(ClassName(cl), pattern)) { Tcl_Obj *l = Tcl_NewListObj(0, NULL); Tcl_Obj *g = (Tcl_Obj*) clientData; Tcl_ListObjAppendElement(interp, l, cl->object.cmdName); @@ -4585,7 +4585,7 @@ NsfClasses *sc; /*fprintf(stderr, "startCl = %s, opt %p, isMixin %d, pattern '%s', matchObject %p\n", - className(startCl), startCl->opt, isMixin, pattern, matchObject);*/ + ClassName(startCl), startCl->opt, isMixin, pattern, matchObject);*/ /* * check all subclasses of startCl for mixins @@ -4608,11 +4608,11 @@ cl = NsfGetClassFromCmdPtr(m->cmdPtr); assert(cl); /*fprintf(stderr, "check %s mixinof %s\n", - className(cl), ObjStr(startCl->object.cmdName));*/ + ClassName(cl), ObjStr(startCl->object.cmdName));*/ rc = GetAllObjectMixinsOf(interp, destTablePtr, cl, isMixin, appendResult, pattern, matchObject); /* fprintf(stderr, "check %s mixinof %s done\n", - className(cl), ObjStr(startCl->object.cmdName));*/ + ClassName(cl), ObjStr(startCl->object.cmdName));*/ if (rc) {return rc;} } } @@ -4669,7 +4669,7 @@ assert(startCl); /*fprintf(stderr, "startCl = %p %s, opt %p, isMixin %d\n", - startCl, className(startCl), startCl->opt, isMixin);*/ + startCl, ClassName(startCl), startCl->opt, isMixin);*/ /* * the startCl is a per class mixin, add it to the result set @@ -4690,7 +4690,7 @@ * __default_superclass a class which has itself as subclass! */ fprintf(stderr, "... STRANGE %p is subclass of %p %s, sub %p\n", sc->cl, - startCl, className(startCl), startCl->sub); + startCl, ClassName(startCl), startCl->sub); continue; } #endif @@ -4770,22 +4770,22 @@ cl = NsfGetClassFromCmdPtr(m->cmdPtr); assert(cl); - /* fprintf(stderr, "class mixin found: %s\n", className(cl)); */ + /* fprintf(stderr, "class mixin found: %s\n", ClassName(cl)); */ if ((withGuards) && (m->clientData)) { - /* fprintf(stderr, "AddToResultSetWithGuards: %s\n", className(cl)); */ + /* fprintf(stderr, "AddToResultSetWithGuards: %s\n", ClassName(cl)); */ rc = AddToResultSetWithGuards(interp, destTablePtr, cl, m->clientData, &new, 1, pattern, matchObject); } else { - /* fprintf(stderr, "AddToResultSet: %s\n", className(cl)); */ + /* fprintf(stderr, "AddToResultSet: %s\n", ClassName(cl)); */ rc = AddToResultSet(interp, destTablePtr, &cl->object, &new, 1, pattern, matchObject); } if (rc == 1) {return rc;} if (new) { /* fprintf(stderr, "class mixin GetAllClassMixins for: %s (%s)\n", - className(cl), ObjStr(startCl->object.cmdName)); */ + ClassName(cl), ObjStr(startCl->object.cmdName)); */ rc = GetAllClassMixins(interp, destTablePtr, cl, withGuards, pattern, matchObject); if (rc) {return rc;} @@ -4818,7 +4818,7 @@ NsfCmdList *del = CmdListFindCmdInList(cmd, nclopt->isClassMixinOf); if (del) { /* fprintf(stderr, "Removing class %s from isClassMixinOf of class %s\n", - className(cl), ObjStr(NsfGetClassFromCmdPtr(cmdlist->cmdPtr)->object.cmdName)); */ + ClassName(cl), ObjStr(NsfGetClassFromCmdPtr(cmdlist->cmdPtr)->object.cmdName)); */ del = CmdListRemoveFromList(&nclopt->isClassMixinOf, del); CmdListDeleteCmdListEntry(del, GuardDel); } @@ -4835,11 +4835,11 @@ NsfCmdList *del = CmdListFindCmdInList(cmd, clopt->isObjectMixinOf); if (del) { /* fprintf(stderr, "Removing object %s from isObjectMixinOf of Class %s\n", - objectName(object), ObjStr(NsfGetClassFromCmdPtr(cmdlist->cmdPtr)->object.cmdName)); */ + ObjectName(object), ObjStr(NsfGetClassFromCmdPtr(cmdlist->cmdPtr)->object.cmdName)); */ del = CmdListRemoveFromList(&clopt->isObjectMixinOf, del); CmdListDeleteCmdListEntry(del, GuardDel); } - } /* else fprintf(stderr, "CleanupDestroyObject %s: NULL pointer in mixins!\n", objectName(object)); */ + } /* else fprintf(stderr, "CleanupDestroyObject %s: NULL pointer in mixins!\n", ObjectName(object)); */ } } @@ -4852,7 +4852,7 @@ NsfCmdList *del = CmdListFindCmdInList(cmd, clopt->classmixins); if (del) { /* fprintf(stderr, "Removing class %s from mixins of object %s\n", - className(cl), ObjStr(NsfGetObjectFromCmdPtr(cmdlist->cmdPtr)->cmdName)); */ + ClassName(cl), ObjStr(NsfGetObjectFromCmdPtr(cmdlist->cmdPtr)->cmdName)); */ del = CmdListRemoveFromList(&clopt->classmixins, del); CmdListDeleteCmdListEntry(del, GuardDel); if (cl->object.mixinOrder) MixinResetOrder(&cl->object); @@ -4870,7 +4870,7 @@ NsfCmdList *del = CmdListFindCmdInList(cmd, objopt->mixins); if (del) { /* fprintf(stderr, "Removing class %s from mixins of object %s\n", - className(cl), ObjStr(NsfGetObjectFromCmdPtr(cmdlist->cmdPtr)->cmdName)); */ + ClassName(cl), ObjStr(NsfGetObjectFromCmdPtr(cmdlist->cmdPtr)->cmdName)); */ del = CmdListRemoveFromList(&objopt->mixins, del); CmdListDeleteCmdListEntry(del, GuardDel); if (nobj->mixinOrder) MixinResetOrder(nobj); @@ -4913,7 +4913,7 @@ static void ResetOrderOfClassesUsedAsMixins(NsfClass *cl) { /*fprintf(stderr, "ResetOrderOfClassesUsedAsMixins %s - %p\n", - className(cl), cl->opt);*/ + ClassName(cl), cl->opt);*/ if (cl->opt) { NsfCmdList *ml; @@ -4981,7 +4981,7 @@ if (ncl) { MixinResetOrderForInstances(interp, 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));*/ + /*fprintf(stderr, "MixinInvalidateObjOrders via class mixin %s calls ifd invalidate \n", ClassName(ncl));*/ NsfInvalidateObjectParameterCmd(interp, ncl); } } @@ -5059,7 +5059,7 @@ assert(cl); /* fprintf(stderr, "+++ MixinSearch %s->%s in %p cmdPtr %p clientData %p\n", - objectName(object), methodName, cmdList, + ObjectName(object), methodName, cmdList, cmdList->cmdPtr, cmdList->clientData); */ cmd = FindMethod(cl->nsPtr, methodName); @@ -5069,7 +5069,7 @@ if (Tcl_Command_flags(cmd) & NSF_CMD_CLASS_ONLY_METHOD) { /*fprintf(stderr, "we found class specific method %s on class %s object %s, isclass %d\n", - methodName, className(cl), objectName(object), NsfObjectIsClass(object));*/ + methodName, ClassName(cl), ObjectName(object), NsfObjectIsClass(object));*/ if (!NsfObjectIsClass(object)) { /* the command is not for us; skip it */ cmd = NULL; @@ -5090,7 +5090,7 @@ */ *clPtr = cl; *currentCmdPtr = cmdList->cmdPtr; - /*fprintf(stderr, "mixinsearch returns %p (cl %s)\n",cmd, className(cl));*/ + /*fprintf(stderr, "mixinsearch returns %p (cl %s)\n",cmd, ClassName(cl));*/ break; } else if (result == TCL_ERROR) { break; @@ -5491,11 +5491,11 @@ if (!(cmd = FilterSearch(interp, ObjStr(nameObj), startingObject, startingClass, &cl))) { if (startingObject) return NsfVarErrMsg(interp, "object filter: can't find filterproc on: ", - objectName(startingObject), " - proc: ", + ObjectName(startingObject), " - proc: ", ObjStr(nameObj), (char *) NULL); else return NsfVarErrMsg(interp, "class filter: can't find filterproc on: ", - className(startingClass), " - proc: ", + ClassName(startingClass), " - proc: ", ObjStr(nameObj), (char *) NULL); } @@ -5605,7 +5605,7 @@ cl->order = NULL; /*fprintf(stderr, "FilterRemoveDependentFilterCmds cl %p %s, removeClass %p %s\n", - cl, className(cl), + cl, ClassName(cl), removeClass, ObjStr(removeClass->object.cmdName));*/ for (clPtr = ComputeOrder(cl, cl->order, Sub); clPtr; clPtr = clPtr->nextPtr) { @@ -5773,7 +5773,7 @@ if (object->filterOrder) FilterResetOrder(object); /* - fprintf(stderr, " List: ", objectName(object)); + fprintf(stderr, " List: ", ObjectName(object)); */ /* append classfilters registered for mixins */ @@ -5948,7 +5948,7 @@ cmdList = cmdList->nextPtr; } else if (FilterActiveOnObj(interp, object, cmdList->cmdPtr)) { /* fprintf(stderr, "Filter <%s> -- Active on: %s\n", - Tcl_GetCommandName(interp, (Tcl_Command)cmdList->cmdPtr), objectName(object)); + Tcl_GetCommandName(interp, (Tcl_Command)cmdList->cmdPtr), ObjectName(object)); */ object->filterStack->currentCmdPtr = cmdList->cmdPtr; cmdList = SeekCurrent(object->filterStack->currentCmdPtr, object->filterOrder); @@ -6062,7 +6062,7 @@ /* if there are no more super classes add the Object class as superclasses */ if (cl->super == NULL) { - fprintf(stderr, "SuperClassAdd super of '%s' is NULL\n", className(cl)); + fprintf(stderr, "SuperClassAdd super of '%s' is NULL\n", ClassName(cl)); /*AddSuper(cl, RUNTIME_STATE(interp)->theObject);*/ } @@ -6226,7 +6226,7 @@ result = Nsf_SubstObjCmd(NULL, interp, 2, ov); /*fprintf(stderr, "+++++ %s.%s subst returned %d OK %d\n", - objectName(object), varName, rc, TCL_OK);*/ + ObjectName(object), varName, rc, TCL_OK);*/ if (result == TCL_OK) { *value = Tcl_GetObjResult(interp); @@ -6667,7 +6667,7 @@ int rc; /*fprintf(stderr, "ProcMethodDispatchFinalize %s.%s flags %.6x isNRE %d\n", - objectName(object), methodName + ObjectName(object), methodName cscPtr->flags, (cscPtr->flags & NSF_CSC_CALL_IS_NRE));*/ if (opt && object->teardown && (opt->checkoptions & CHECK_POST)) { @@ -6836,7 +6836,7 @@ if (result == TCL_OK) { #if defined(NRE) /*fprintf(stderr, "CALL TclNRInterpProcCore %s method '%s'\n", - objectName(object), ObjStr(objv[0]));*/ + ObjectName(object), ObjStr(objv[0]));*/ Tcl_NRAddCallback(interp, ProcMethodDispatchFinalize, releasePc ? pcPtr : NULL, cscPtr, (ClientData)methodName, NULL); cscPtr->flags |= NSF_CSC_CALL_IS_NRE; @@ -6895,7 +6895,7 @@ * by itself not stack it; in order to get e.g. self working, we * have to stack at least an FRAME_IS_NSF_OBJECT. */ - /*fprintf(stderr, "Nsf_PushFrameCsc %s %s\n",objectName(object), methodName);*/ + /*fprintf(stderr, "Nsf_PushFrameCsc %s %s\n",ObjectName(object), methodName);*/ Nsf_PushFrameCsc(interp, cscPtr, framePtr); } @@ -6981,13 +6981,13 @@ if ((cscPtr->flags & NSF_CSC_IMMEDIATE)) { # if defined(NRE_CALLBACK_TRACE) fprintf(stderr, ".... manual run callbacks rootPtr = %p, result %d methodName %s.%s\n", - rootPtr, result, cscPtr->cl?className(cscPtr->cl):"NULL", methodName); + rootPtr, result, cscPtr->cl?ClassName(cscPtr->cl):"NULL", methodName); # endif result = NsfNRRunCallbacks(interp, result, rootPtr); } else { # if defined(NRE_CALLBACK_TRACE) fprintf(stderr, ".... don't run callbacks rootPtr = %p, result %d methodName %s.%s\n", - rootPtr, result, cscPtr->cl?className(cscPtr->cl):"NULL", methodName); + rootPtr, result, cscPtr->cl?ClassName(cscPtr->cl):"NULL", methodName); # endif } #endif @@ -7040,7 +7040,7 @@ Nsf_PushFrameCsc(interp, cscPtr, framePtr); /*fprintf(stderr, "save self %p %s (ns %p) object %p %s\n", - self, objectName(self), self->nsPtr, object, objectName(object));*/ + self, ObjectName(self), self->nsPtr, object, ObjectName(object));*/ if (self->nsPtr) { cmd = FindMethod(self->nsPtr, methodName); /* fprintf(stderr, "... method %p %s csc %p\n", cmd, methodName, cscPtr); */ @@ -7059,7 +7059,7 @@ */ /*fprintf(stderr, ".... ensemble dispatch on %s.%s csc %p\n", - objectName(object),methodName, cscPtr);*/ + ObjectName(object),methodName, cscPtr);*/ result = MethodDispatch(object, interp, objc-1, objv+1, cmd, object, NULL, methodName, cscPtr->frameType|NSF_CSC_TYPE_ENSEMBLE, @@ -7073,7 +7073,7 @@ * next to try to call such methods along the next path. */ /*fprintf(stderr, "call next instead of unknown %s.%s \n", - objectName(cscPtr->self),methodName);*/ + ObjectName(cscPtr->self),methodName);*/ { Tcl_CallFrame *framePtr1; NsfCallStackContent *cscPtr1 = CallStackGetTopFrame(interp, &framePtr1); @@ -7094,7 +7094,7 @@ } /*fprintf(stderr, "==> next %s.%s (obj %s) csc %p returned %d unknown %d\n", - objectName(self),methodName, objectName(object), cscPtr, result, rst->unknown); */ + ObjectName(self),methodName, ObjectName(object), cscPtr, result, rst->unknown); */ if (rst->unknown) { /* * The appropriate unknown class is registered on the @@ -7140,7 +7140,7 @@ CscListAdd(interp, cscPtr); /*fprintf(stderr, "cmdMethodDispatch %s.%s, nothing stacked, objflags %.6x\n", - objectName(object), methodName, object->flags); */ + ObjectName(object), methodName, object->flags); */ return CmdMethodDispatch(clientData, interp, objc, objv, methodName, object, cmd, NULL); } @@ -7175,7 +7175,7 @@ assert (cmd); /* fprintf(stderr, "MethodDispatch method '%s.%s' objc %d flags %.6x call %d\n", - objectName(object),methodName, objc, flags, call); */ + ObjectName(object),methodName, objc, flags, call); */ cscPtr = CscAlloc(interp, &csc, cmd); @@ -7235,7 +7235,7 @@ assert(object->id); /*fprintf(stderr, "ObjectDispatchFinalize %p %s.%s flags %.6x (%d) frame %.6x rst %d %s\n", - cscPtr, objectName(object), methodName, flags, + cscPtr, ObjectName(object), methodName, flags, result, cscPtr->frameType, RUNTIME_STATE(interp)->unknown, msg);*/ @@ -7255,7 +7255,7 @@ NULL); } } else { - /*fprintf(stderr, "We have no cmdPtr in cscPtr %p %s.%s", cscPtr, objectName(object), methodName); + /*fprintf(stderr, "We have no cmdPtr in cscPtr %p %s.%s", cscPtr, ObjectName(object), methodName); fprintf(stderr, "... cannot check return values!\n");*/ } @@ -7284,12 +7284,12 @@ */ if ((flags & NSF_CSC_MIXIN_STACK_PUSHED) && object->mixinStack) { /*fprintf(stderr, "MixinStackPop %s.%s %p %s\n", - objectName(object),methodName, object->mixinStack, msg);*/ + ObjectName(object),methodName, object->mixinStack, msg);*/ MixinStackPop(object); } if ((flags & NSF_CSC_FILTER_STACK_PUSHED) && object->filterStack) { /* fprintf(stderr, "FilterStackPop %s.%s %p %s\n", - objectName(object),methodName, object->filterStack, msg);*/ + ObjectName(object),methodName, object->filterStack, msg);*/ FilterStackPop(object); } @@ -7342,7 +7342,7 @@ methodName = MethodNameString(methodObj); /*fprintf(stderr, "ObjectDispatch obj = %s objc = %d 0=%s methodName=%s\n", - objectName(object), objc, ObjStr(cmdObj), methodName);*/ + ObjectName(object), objc, ObjStr(cmdObj), methodName);*/ objflags = object->flags; /* avoid stalling */ @@ -7426,7 +7426,7 @@ &object->mixinStack->currentCmdPtr, &cmd); if (result != TCL_OK) { /*fprintf(stderr, "mixinsearch returned an error for %p %s.%s\n", - object, objectName(object),methodName);*/ + object, ObjectName(object),methodName);*/ cscPtr = CscAlloc(interp, &csc, NULL); CscInit(cscPtr, object, cl, NULL, frameType, flags); goto exit_object_dispatch; @@ -7485,8 +7485,8 @@ if (object != lastSelf) { if (RUNTIME_STATE(interp)->debugLevel > 0) { fprintf(stderr, "Warning: '%s %s' fails since method %s.%s is protected.\n", - objectName(object), methodName, - cl ? className(cl) : objectName(object), methodName); + ObjectName(object), methodName, + cl ? ClassName(cl) : ObjectName(object), methodName); } /* reset cmd, since it is still unknown */ cmd = NULL; @@ -7546,7 +7546,7 @@ } /*fprintf(stderr, "ObjectDispatch %s.%s returns %d\n", - objectName(object), methodName, result);*/ + ObjectName(object), methodName, result);*/ NsfCleanupObject(object, "ObjectDispatch"); /*fprintf(stderr, "ObjectDispatch call NsfCleanupObject %p DONE\n", object);*/ @@ -7695,8 +7695,8 @@ ALLOC_ON_STACK(Tcl_Obj*, objc+3, tov); /*fprintf(stderr, "calling unknown for %s %s, flgs=%02x,%02x isClass=%d %p %s objc %d\n", - objectName(object), ObjStr(methodObj), flags, NSF_CM_NO_UNKNOWN, - NsfObjectIsClass(object), object, objectName(object), objc);*/ + ObjectName(object), ObjStr(methodObj), flags, NSF_CM_NO_UNKNOWN, + NsfObjectIsClass(object), object, ObjectName(object), objc);*/ tov[0] = object->cmdName; tov[1] = unknownObj; @@ -7717,7 +7717,7 @@ /*fprintf(stderr, "--- No unknown method Name %s objv[%d] %s\n", ObjStr(methodObj), 1, ObjStr(objv[1]));*/ - result = NsfVarErrMsg(interp, objectName(object), + result = NsfVarErrMsg(interp, ObjectName(object), ": unable to dispatch method '", ObjStr(objv[1]), "'", (char *) NULL); } @@ -8350,7 +8350,7 @@ if (RUNTIME_STATE(interp)->debugLevel > 0) { fprintf(stderr, "Warning: could not find value checker %s defined on %s\n", - converterNameString, objectName(paramObj)); + converterNameString, ObjectName(paramObj)); } paramPtr->flags |= NSF_ARG_CURRENTLY_UNKNOWN; /* TODO: for the time being, we do not return an error here */ @@ -8361,7 +8361,7 @@ if (RUNTIME_STATE(interp)->debugLevel > 0) { fprintf(stderr, "Warning: checker method %s defined on %s shadows built-in converter\n", - converterNameString, objectName(paramObj)); + converterNameString, ObjectName(paramObj)); } if (paramPtr->converterName == NULL) { @@ -8527,7 +8527,7 @@ if (!object->nsPtr) { MakeObjNamespace(interp, object); } - /*fprintf(stderr, "obj %s\n", objectName(object)); + /*fprintf(stderr, "obj %s\n", ObjectName(object)); fprintf(stderr, "ns %p object->ns %p\n", ns, object->nsPtr); fprintf(stderr, "ns %s object->ns %s\n", ns->fullName, object->nsPtr->fullName);*/ procPtr->cmdPtr->nsPtr = (Namespace*) object->nsPtr; @@ -8570,7 +8570,7 @@ int result; if (precondition && !postcondition) { - return NsfVarErrMsg(interp, className(cl), " method '", nameStr, + return NsfVarErrMsg(interp, ClassName(cl), " method '", nameStr, "'; when specifying a precondition (", ObjStr(precondition), ") a postcondition must be specified as well", (char *) NULL); @@ -8762,7 +8762,7 @@ while (ml) { NsfClass *mixin = NsfGetClassFromCmdPtr(ml->cmdPtr); if (pattern) { - if (!Tcl_StringMatch(className(mixin), pattern)) continue; + if (!Tcl_StringMatch(ClassName(mixin), pattern)) continue; } npl = NsfClassListAdd(npl, mixin, NULL); ml = ml->nextPtr; @@ -8776,7 +8776,7 @@ continue; if (pattern) { - if (!Tcl_StringMatch(className(pcl->cl), pattern)) continue; + if (!Tcl_StringMatch(ClassName(pcl->cl), pattern)) continue; } npl = NsfClassListAdd(npl, pcl->cl, NULL); } @@ -8808,7 +8808,7 @@ Tcl_DString ds, *dsPtr = &ds; DSTRING_INIT(dsPtr); - Tcl_DStringAppend(dsPtr, className(pl->cl), -1); + Tcl_DStringAppend(dsPtr, ClassName(pl->cl), -1); Tcl_DStringAppend(dsPtr, "::slot", 6); tmpObject = GetObjectFromString(interp, Tcl_DStringValue(dsPtr)); if (tmpObject) { @@ -8828,7 +8828,7 @@ if (!new) continue; cmd = (Tcl_Command) Tcl_GetHashValue(hPtr); childObject = NsfGetObjectFromCmdPtr(cmd); - /*fprintf(stderr, "we have true child obj %s\n", objectName(childObject));*/ + /*fprintf(stderr, "we have true child obj %s\n", ObjectName(childObject));*/ if (type && !IsSubType(childObject->cl, type)) continue; npl = NsfObjectListAdd(npl, childObject); } @@ -8942,7 +8942,7 @@ } /*fprintf(stderr, "nextsearch: object %s nsPtr %p endOfChain %d\n", - objectName(object), object->nsPtr, endOfChain);*/ + ObjectName(object), object->nsPtr, endOfChain);*/ /* * Otherwise: normal method dispatch @@ -8961,7 +8961,7 @@ } /* printf(stderr, "NEXT methodName %s *clPtr %p %s *cmd %p\n", - *methodNamePtr, *clPtr, className((*clPtr)), *cmdPtr);*/ + *methodNamePtr, *clPtr, ClassName((*clPtr)), *cmdPtr);*/ if (!*cmdPtr) { NsfClasses *pl; @@ -9188,7 +9188,7 @@ &isMixinEntry, &isFilterEntry, &endOfFilterChain, ¤tCmd); /* fprintf(stderr, "NEXT search on %s.%s cl %p cmd %p endOfFilterChain %d result %d\n", - objectName(object), methodName, cl, cmd, endOfFilterChain, result);*/ + ObjectName(object), methodName, cl, cmd, endOfFilterChain, result);*/ if (result != TCL_OK) { goto next_search_and_invoke_cleanup; @@ -9644,7 +9644,7 @@ } /* fprintf(stderr, "cleanupInitObject %s: %p cl = %p\n", - obj->cmdName ? objectName(object) : "", object, object->cl);*/ + obj->cmdName ? ObjectName(object) : "", object, object->cl);*/ } static void @@ -9672,7 +9672,7 @@ if ((object->flags & NSF_DURING_DELETE) || !object->teardown) return; interp = object->teardown; # ifdef OBJDELETION_TRACE - fprintf(stderr, "... %p %s\n", object, objectName(object)); + fprintf(stderr, "... %p %s\n", object, ObjectName(object)); # endif CallStackDestroyObject(interp, object); @@ -9709,7 +9709,7 @@ #ifdef OBJDELETION_TRACE fprintf(stderr, " physical delete of %p id=%p destroyCalled=%d '%s'\n", - object, object->id, (object->flags & NSF_DESTROY_CALLED), objectName(object)); + object, object->id, (object->flags & NSF_DESTROY_CALLED), ObjectName(object)); #endif CleanupDestroyObject(interp, object, 0); @@ -9726,7 +9726,7 @@ object->nsPtr = NULL; } - /*fprintf(stderr, " +++ OBJ/CLS free: %s\n", objectName(object));*/ + /*fprintf(stderr, " +++ OBJ/CLS free: %s\n", ObjectName(object));*/ object->flags |= NSF_DELETED; ObjTrace("ODestroy", object); @@ -9758,7 +9758,7 @@ int result; /*fprintf(stderr, "DoDealloc obj= %s %p flags %.6x activation %d cmd %p opt=%p\n", - objectName(object), object, object->flags, object->activationCount, + ObjectName(object), object, object->flags, object->activationCount, object->id, object->opt);*/ result = FreeUnsetTraceVariable(interp, object); @@ -9899,7 +9899,7 @@ NsfClass *resultClass = NULL; /*fprintf(stderr, "DefaultSuperClass cl %s, mcl %s, isMeta %d\n", - className(cl), className(mcl), isMeta );*/ + ClassName(cl), ClassName(mcl), isMeta );*/ if (mcl) { Tcl_Obj *resultObj = Nsf_ObjGetVar2((Nsf_Object *)mcl, interp, isMeta ? @@ -9910,13 +9910,13 @@ if (GetClassFromObj(interp, resultObj, &resultClass, NULL) != TCL_OK) { NsfErrMsg(interp, "default superclass is not a class", TCL_STATIC); } - /* fprintf(stderr, "DefaultSuperClass for %s got from var %s\n", className(cl), ObjStr(nameObj)); */ + /* fprintf(stderr, "DefaultSuperClass for %s got from var %s\n", ClassName(cl), ObjStr(nameObj)); */ } else { NsfClasses *sc; /* fprintf(stderr, "DefaultSuperClass for %s: search in superclasses starting with %p meta %d\n", - className(cl), cl->super, isMeta); */ + ClassName(cl), cl->super, isMeta); */ if (isMeta) { /* @@ -9931,7 +9931,7 @@ */ for (sc = mcl->super; sc && sc->cl != cl; sc = sc->nextPtr) { /* fprintf(stderr, " ... check ismeta %d %s root mcl %d root cl %d\n", - isMeta, className(sc->cl), + isMeta, ClassName(sc->cl), sc->cl->object.flags & NSF_IS_ROOT_META_CLASS, sc->cl->object.flags & NSF_IS_ROOT_CLASS); */ if (isMeta) { @@ -9940,7 +9940,7 @@ } } else { if (sc->cl->object.flags & NSF_IS_ROOT_CLASS) { - /* fprintf(stderr, "found root class %p %s\n", sc->cl, className(sc->cl)); */ + /* fprintf(stderr, "found root class %p %s\n", sc->cl, ClassName(sc->cl)); */ return sc->cl; } } @@ -9955,7 +9955,7 @@ * During bootstrapping, there might be no meta class defined yet */ /* fprintf(stderr, "no meta class ismeta %d %s root mcl %d root cl %d\n", - isMeta, className(cl), + isMeta, ClassName(cl), cl->object.flags & NSF_IS_ROOT_META_CLASS, cl->object.flags & NSF_IS_ROOT_CLASS); */ } @@ -9977,7 +9977,7 @@ PRINTOBJ("CleanupDestroyClass", (NsfObject *)cl); assert(softrecreate ? recreate == 1 : 1); - /* fprintf(stderr, "CleanupDestroyClass %p %s (ismeta=%d) softrecreate=%d, recreate=%d, %p\n", cl,className(cl),IsMetaClass(interp, cl, 1), + /* fprintf(stderr, "CleanupDestroyClass %p %s (ismeta=%d) softrecreate=%d, recreate=%d, %p\n", cl,ClassName(cl),IsMetaClass(interp, cl, 1), softrecreate, recreate, clopt);*/ /* @@ -10054,7 +10054,7 @@ for (; hPtr; hPtr = Tcl_NextHashEntry(&hSrch)) { NsfObject *inst = (NsfObject*)Tcl_GetHashKey(&cl->instances, hPtr); /*fprintf(stderr, " inst %p %s flags %.6x id %p baseClass %p %s\n", - inst, objectName(inst), inst->flags, inst->id,baseClass,className(baseClass));*/ + inst, ObjectName(inst), inst->flags, inst->id,baseClass,ClassName(baseClass));*/ if (inst && inst != (NsfObject*)cl && !(inst->flags & NSF_DURING_DELETE) /*inst->id*/) { if (inst != &(baseClass->object)) { (void)RemoveInstance(inst, cl->object.cl); @@ -10095,7 +10095,7 @@ */ if (subClass->super == 0 && (cl->object.flags & NSF_IS_ROOT_CLASS) == 0) { /* fprintf(stderr,"subClass %p %s baseClass %p %s\n", - cl,className(cl),baseClass,className(baseClass)); */ + cl,ClassName(cl),baseClass,ClassName(baseClass)); */ AddSuper(subClass, baseClass); } } @@ -10184,7 +10184,7 @@ /* * call and latch user destroy with object->id if we haven't */ - /*fprintf(stderr, "PrimitiveCDestroy %s flags %.6x\n", objectName(object), object->flags);*/ + /*fprintf(stderr, "PrimitiveCDestroy %s flags %.6x\n", ObjectName(object), object->flags);*/ object->teardown = NULL; CleanupDestroyClass(interp, cl, 0, 0); @@ -10301,7 +10301,7 @@ assert(object); /*fprintf(stderr, "changing %s to class %s ismeta %d\n", - objectName(object), className(cl), + ObjectName(object), ClassName(cl), IsMetaClass(interp, cl, 1));*/ if (cl != object->cl) { @@ -10319,7 +10319,7 @@ /* The target class is not a meta class. */ /*fprintf(stderr, "target class %s not a meta class, am i a class %d\n", - className(cl), NsfObjectIsClass(object) );*/ + ClassName(cl), NsfObjectIsClass(object) );*/ if (NsfObjectIsClass(object)) { return NsfVarErrMsg(interp, "cannot turn class into an object ", @@ -10595,7 +10595,7 @@ if (otherPtr == NULL) { return NsfVarErrMsg(interp, "can't import variable ", ObjStr(varName), - " into method scope: can't find variable on ", objectName(object), + " into method scope: can't find variable on ", ObjectName(object), (char *) NULL); } @@ -10610,7 +10610,7 @@ */ if (arrayPtr) { return NsfVarErrMsg(interp, "can't make instance variable ", ObjStr(varName), - " on ", objectName(object), + " on ", ObjectName(object), ": Variable cannot be an element in an array;", " use e.g. an alias.", (char *) NULL); } @@ -10686,7 +10686,7 @@ VarHashRefCount(otherPtr)++; /* fprintf(stderr, "defining an alias var='%s' in obj %s fwd %d flags %x isLink %d isTraced %d isUndefined %d\n", - ObjStr(newName), objectName(object), + ObjStr(newName), ObjectName(object), 0, varPtr->flags, TclIsVarLink(varPtr), TclIsVarTraced(varPtr), TclIsVarUndefined(varPtr)); @@ -10711,8 +10711,8 @@ if (object->nsPtr) { int rc = NSDeleteCmd(interp, object->nsPtr, methodName); if (rc < 0) - return NsfVarErrMsg(interp, objectName(object), " cannot delete method '", methodName, - "' of object ", objectName(object), (char *) NULL); + return NsfVarErrMsg(interp, ObjectName(object), " cannot delete method '", methodName, + "' of object ", ObjectName(object), (char *) NULL); } return TCL_OK; } @@ -10730,8 +10730,8 @@ rc = NSDeleteCmd(interp, cl->nsPtr, methodName); if (rc < 0) - return NsfVarErrMsg(interp, className(cl), " cannot delete method '", methodName, - "' of class ", className(cl), (char *) NULL); + return NsfVarErrMsg(interp, ClassName(cl), " cannot delete method '", methodName, + "' of class ", ClassName(cl), (char *) NULL); return TCL_OK; } @@ -10771,7 +10771,7 @@ if (valueObj == NULL) { resultObj = Tcl_ObjGetVar2(interp, nameObj, NULL, flags); } else { - /*fprintf(stderr, "setvar in obj %s: name %s = %s\n", objectName(object), ObjStr(nameObj), ObjStr(value));*/ + /*fprintf(stderr, "setvar in obj %s: name %s = %s\n", ObjectName(object), ObjStr(nameObj), ObjStr(value));*/ resultObj = Tcl_ObjSetVar2(interp, nameObj, NULL, valueObj, flags); } Nsf_PopFrameObj(interp, framePtr); @@ -11271,7 +11271,7 @@ CallFrame frame, *framePtr = &frame; int result; - /*fprintf(stderr, "objscopedMethod obj=%p %s, ptr=%p\n", object, objectName(object), tcd->objProc);*/ + /*fprintf(stderr, "objscopedMethod obj=%p %s, ptr=%p\n", object, ObjectName(object), tcd->objProc);*/ Nsf_PushFrameObj(interp, object, framePtr); result = Tcl_NRCallObjProc(interp, tcd->objProc, tcd->clientData, objc, objv); @@ -11383,7 +11383,7 @@ Tcl_Obj *methodObj = Tcl_NewStringObj(methodName, -1); /* fprintf(stderr, "CallConfigureMethod method %s->'%s' level %d, argc %d\n", - objectName(object), methodName, level, argc);*/ + ObjectName(object), methodName, level, argc);*/ if (isInitString(methodName)) { object->flags |= NSF_INIT_CALLED; @@ -11401,7 +11401,7 @@ if (result != TCL_OK) { Tcl_Obj *res = Tcl_DuplicateObj(Tcl_GetObjResult(interp)); /* save the result */ INCR_REF_COUNT(res); - NsfVarErrMsg(interp, ObjStr(res), " during '", objectName(object), " ", + NsfVarErrMsg(interp, ObjStr(res), " during '", ObjectName(object), " ", methodName, "'", (char *) NULL); DECR_REF_COUNT(res); } @@ -11694,7 +11694,7 @@ } } else if (pPtr->flags & NSF_ARG_REQUIRED) { return NsfVarErrMsg(interp, - pcPtr->object ? objectName(pcPtr->object) : "", + pcPtr->object ? ObjectName(pcPtr->object) : "", pcPtr->object ? " " : "", ObjStr(pcPtr->full_objv[0]), ": required argument '", pPtr->nameObj ? ObjStr(pPtr->nameObj) : pPtr->name, @@ -12132,7 +12132,7 @@ int subcmd, int withPer_object) { /*fprintf(stderr, "ListMethod %s %s cmd %p subcmd %d per-object %d\n", - objectName(regObject), methodName, cmd, subcmd, withPer_object);*/ + ObjectName(regObject), methodName, cmd, subcmd, withPer_object);*/ if (!cmd) { Tcl_SetObjResult(interp, NsfGlobalObjs[NSF_EMPTY]); @@ -12317,10 +12317,10 @@ regObject != defObject ? 1 : withPer_object); /* fprintf(stderr, "aliasGet %s -> %s/%s (%d) returned %p\n", - objectName(defObject), methodName, Tcl_GetCommandName(interp, cmd), + ObjectName(defObject), methodName, Tcl_GetCommandName(interp, cmd), withPer_object, entryObj); - fprintf(stderr, "... regObject %p %s\n",regObject,objectName(regObject)); - fprintf(stderr, "... defObject %p %s\n",defObject,objectName(defObject)); + fprintf(stderr, "... regObject %p %s\n",regObject,ObjectName(regObject)); + fprintf(stderr, "... defObject %p %s\n",defObject,ObjectName(defObject)); */ if (entryObj) { @@ -12381,7 +12381,7 @@ fprintf(stderr, "Warning: Could not obtain alias definition for %s. " "Maybe someone deleted the alias %s for object %s?\n", methodName, - methodName, objectName(regObject)); + methodName, ObjectName(regObject)); } Tcl_ResetResult(interp); } @@ -12604,7 +12604,7 @@ Tcl_Command cmd = (Tcl_Command)Tcl_GetHashValue(hPtr); /*fprintf(stderr, "... check %s child key %s child object %p %p\n", - objectName(object),key,GetObjectFromString(interp, key), + ObjectName(object),key,GetObjectFromString(interp, key), NsfGetObjectFromCmdPtr(cmd));*/ if ((childObject = NsfGetObjectFromCmdPtr(cmd)) && @@ -12787,7 +12787,7 @@ * object, delete the cmd. */ /*fprintf(stderr, "remove alias %s to %s\n", - Tcl_GetCommandName(interp, cmd), objectName(referencedObject));*/ + Tcl_GetCommandName(interp, cmd), ObjectName(referencedObject));*/ NsfCleanupObject(referencedObject, "AliasDeleteObjectReference"); Nsf_DeleteCommandFromToken(interp, cmd); return 1; @@ -12847,7 +12847,7 @@ NsfClasses *unstackedEntries = RUNTIME_STATE(interp)->cscList; /*fprintf(stderr, "DEBUG obj %p %s activationcount %d\n", - object, objectName(object), object->activationCount);*/ + object, ObjectName(object), object->activationCount);*/ framePtr = (Tcl_CallFrame *)Tcl_Interp_framePtr(interp); for (; framePtr; framePtr = Tcl_CallFrame_callerPtr(framePtr)) { @@ -12867,12 +12867,12 @@ if (count != object->activationCount) { fprintf(stderr, "DEBUG obj %p %s activationcount %d on stack %d; " "might be from non-stacked but active callstack content\n", - object, objectName(object), object->activationCount, count); + object, ObjectName(object), object->activationCount, count); fprintf(stderr, "fixed count %d\n", count); /*NsfShowStack(interp);*/ /* return NsfVarErrMsg(interp, "wrong activation count for object ", - objectName(object), (char *) NULL);*/ + ObjectName(object), (char *) NULL);*/ } } #endif @@ -13324,7 +13324,7 @@ int result; CONST char *methodName = ObjStr(command); - /*fprintf(stderr, "Dispatch obj=%s, cmd m='%s'\n", objectName(object), methodName);*/ + /*fprintf(stderr, "Dispatch obj=%s, cmd m='%s'\n", ObjectName(object), methodName);*/ /* * If the specified method is a fully qualified cmd name like @@ -13434,7 +13434,7 @@ "probably called outside the context of an Next Scripting Object", (char *) NULL); } - /* fprintf(stderr, "Colon dispatch %s.%s\n", objectName(self),ObjStr(nobjv[0]));*/ + /* fprintf(stderr, "Colon dispatch %s.%s\n", ObjectName(self),ObjStr(nobjv[0]));*/ return ObjectDispatch(self, interp, nobjc, nobjv, NSF_CM_NO_SHIFT); } @@ -13636,7 +13636,7 @@ static int NsfInvalidateObjectParameterCmd(Tcl_Interp *interp, NsfClass *cl) { if (cl->parsedParamPtr) { - /*fprintf(stderr, " %s invalidate %p\n", className(cl), cl->parsedParamPtr);*/ + /*fprintf(stderr, " %s invalidate %p\n", ClassName(cl), cl->parsedParamPtr);*/ ParsedParamFree(cl->parsedParamPtr); cl->parsedParamPtr = NULL; } @@ -13752,7 +13752,7 @@ if (!cmd) { Tcl_DStringFree(dsPtr); return NsfVarErrMsg(interp, "Cannot lookup object method '", - methodName, "' for object ", objectName(object), + methodName, "' for object ", ObjectName(object), (char *) NULL); } Tcl_DStringFree(dsPtr); @@ -13874,9 +13874,9 @@ CONST char *methodName = ObjStr(methodObj); Tcl_Command cmd = FindMethod(cl->nsPtr, methodName); if (cmd == NULL) { - return NsfVarErrMsg(interp, objectName(self), + return NsfVarErrMsg(interp, ObjectName(self), ": unable to dispatch local method '", - methodName, "' in class ", className(cl), + methodName, "' in class ", ClassName(cl), (char *) NULL); } result = MethodDispatch((ClientData)self, interp, nobjc+2, nobjv, cmd, self, cl, @@ -13891,7 +13891,7 @@ } else { flags = NsfImmediateFromCallerFlags(cscPtr->flags); fprintf(stderr, "XXX MY %s.%s frame has flags %.6x -> next-flags %.6x\n", - objectName(self), ObjStr(methodObj), cscPtr->flags, flags); + ObjectName(self), ObjStr(methodObj), cscPtr->flags, flags); } result = CallMethod((ClientData)self, interp, methodObj, nobjc+2, nobjv, flags); #else @@ -14169,7 +14169,7 @@ */ if (object) { - /* fprintf(stderr, "copy in obj %s var %s val '%s'\n", objectName(object), ObjStr(varNameObj), + /* fprintf(stderr, "copy in obj %s var %s val '%s'\n", ObjectName(object), ObjStr(varNameObj), ObjStr(valueOfVar(Tcl_Obj, varPtr, objPtr)));*/ Nsf_ObjSetVar2((Nsf_Object*)destObject, interp, varNameObj, NULL, @@ -14252,7 +14252,7 @@ int i; /* fprintf(stderr, "NsfRelationCmd %s rel=%d val='%s'\n", - objectName(object), relationtype, valueObj ? ObjStr(valueObj) : "NULL");*/ + ObjectName(object), relationtype, valueObj ? ObjStr(valueObj) : "NULL");*/ if (relationtype == RelationtypeClass_mixinIdx || relationtype == RelationtypeClass_filterIdx) { @@ -14318,7 +14318,7 @@ return TCL_OK; } GetClassFromObj(interp, valueObj, &cl, object->cl); - if (!cl) return NsfErrBadVal(interp, "class", "a class", objectName(object)); + if (!cl) return NsfErrBadVal(interp, "class", "a class", ObjectName(object)); return ChangeClass(interp, object, cl); case RelationtypeRootclassIdx: @@ -14369,7 +14369,7 @@ del = CmdListFindCmdInList(object->id, clopt->isObjectMixinOf); if (del) { /* fprintf(stderr, "Removing object %s from isObjectMixinOf of class %s\n", - objectName(object), ObjStr(NsfGetClassFromCmdPtr(cmdlist->cmdPtr)->object.cmdName)); */ + ObjectName(object), ObjStr(NsfGetClassFromCmdPtr(cmdlist->cmdPtr)->object.cmdName)); */ del = CmdListRemoveFromList(&clopt->isObjectMixinOf, del); CmdListDeleteCmdListEntry(del, GuardDel); } @@ -14391,16 +14391,16 @@ for (i = 0; i < oc; i++) { Tcl_Obj *ocl = NULL; - /* fprintf(stderr, "Added to mixins of %s: %s\n", objectName(object), ObjStr(ov[i])); */ + /* fprintf(stderr, "Added to mixins of %s: %s\n", ObjectName(object), ObjStr(ov[i])); */ Tcl_ListObjIndex(interp, ov[i], 0, &ocl); GetObjectFromObj(interp, ocl, &nObject); if (nObject) { /* fprintf(stderr, "Registering object %s to isObjectMixinOf of class %s\n", - objectName(object), objectName(nObject)); */ + ObjectName(object), ObjectName(nObject)); */ nclopt = NsfRequireClassOpt((NsfClass*)nObject); CmdListAdd(&nclopt->isObjectMixinOf, object->id, NULL, /*noDuplicates*/ 1); } /* else fprintf(stderr, "Problem registering %s as a mixinof of %s\n", - ObjStr(ov[i]), className(cl)); */ + ObjStr(ov[i]), ClassName(cl)); */ } MixinComputeDefined(interp, object); @@ -14445,17 +14445,17 @@ for (i = 0; i < oc; i++) { Tcl_Obj *ocl = NULL; /* fprintf(stderr, "Added to classmixins of %s: %s\n", - className(cl), ObjStr(ov[i])); */ + ClassName(cl), ObjStr(ov[i])); */ Tcl_ListObjIndex(interp, ov[i], 0, &ocl); GetObjectFromObj(interp, ocl, &nObject); if (nObject) { /* fprintf(stderr, "Registering class %s to isClassMixinOf of class %s\n", - className(cl), objectName(nObject)); */ + ClassName(cl), ObjectName(nObject)); */ nclopt = NsfRequireClassOpt((NsfClass*) nObject); CmdListAdd(&nclopt->isClassMixinOf, cl->object.id, NULL, /*noDuplicates*/ 1); } /* else fprintf(stderr, "Problem registering %s as a class-mixin of %s\n", - ObjStr(ov[i]), className(cl)); */ + ObjStr(ov[i]), ClassName(cl)); */ } break; } @@ -14567,7 +14567,7 @@ break; case CurrentoptionCalledclassIdx: - Tcl_SetResult(interp, className(FindCalledClass(interp, object)), TCL_VOLATILE); + Tcl_SetResult(interp, ClassName(FindCalledClass(interp, object)), TCL_VOLATILE); break; case CurrentoptionCallingmethodIdx: @@ -14876,14 +14876,14 @@ Tcl_Obj *methodObj = NsfMethodObj(interp, object, NSF_o_objectparameter_idx); if (methodObj) { - /* fprintf(stderr, "=== calling %s objectparameter\n", objectName(object));*/ + /* fprintf(stderr, "=== calling %s objectparameter\n", ObjectName(object));*/ result = CallMethod((ClientData) object, interp, methodObj, 2, 0, NSF_CM_NO_PROTECT|NSF_CSC_IMMEDIATE); if (result == TCL_OK) { rawConfArgs = Tcl_GetObjResult(interp); /*fprintf(stderr, ".... rawConfArgs for %s => '%s'\n", - objectName(object), ObjStr(rawConfArgs));*/ + ObjectName(object), ObjStr(rawConfArgs));*/ INCR_REF_COUNT(rawConfArgs); /* @@ -15043,7 +15043,7 @@ CallFrame frame, *framePtr = &frame; #if 0 - fprintf(stderr, "NsfOConfigureMethod %s %d ",objectName(object), objc); + fprintf(stderr, "NsfOConfigureMethod %s %d ",ObjectName(object), objc); for(i=0; iparamsPtr; paramPtr->name; paramPtr++, i++) { @@ -15215,7 +15215,7 @@ */ if (i < paramDefs->nrParams || !pc.varArgs) { #if defined(CONFIGURE_ARGS_TRACE) - fprintf(stderr, "*** %s SET %s '%s'\n", objectName(object), ObjStr(paramPtr->nameObj), ObjStr(newValue)); + fprintf(stderr, "*** %s SET %s '%s'\n", ObjectName(object), ObjStr(paramPtr->nameObj), ObjStr(newValue)); #endif /* Actually set instance variable */ Tcl_ObjSetVar2(interp, paramPtr->nameObj, NULL, newValue, TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1); @@ -15263,7 +15263,7 @@ PRINTOBJ("NsfODestroyMethod", object); /*fprintf(stderr,"NsfODestroyMethod %p %s flags %.6x activation %d cmd %p cmd->flags %.6x\n", - object, ((Command*)object->id)->flags == 0 ? objectName(object) : "(deleted)", + object, ((Command*)object->id)->flags == 0 ? ObjectName(object) : "(deleted)", object->flags, object->activationCount, object->id, ((Command*)object->id)->flags);*/ /* @@ -15284,7 +15284,7 @@ Tcl_Obj *methodObj; /*fprintf(stderr, " call dealloc on %p %s\n", object, - ((Command*)object->id)->flags == 0 ? objectName(object) : "(deleted)");*/ + ((Command*)object->id)->flags == 0 ? ObjectName(object) : "(deleted)");*/ if (CallDirectly(interp, &object->cl->object, NSF_c_dealloc_idx, &methodObj)) { result = DoDealloc(interp, object); @@ -15298,7 +15298,7 @@ * we have to call dealloc manually, otherwise we have a memory leak */ /*fprintf(stderr, "*** dealloc failed for %p %s flags %.6x, retry\n", - object, objectName(object), object->flags);*/ + object, ObjectName(object), object->flags);*/ result = DoDealloc(interp, object); } } @@ -15345,7 +15345,7 @@ } return NsfVarErrMsg(interp, "Filterguard: can't find filter ", - filter, " on ", objectName(object), (char *) NULL); + filter, " on ", ObjectName(object), (char *) NULL); } /* @@ -15365,7 +15365,7 @@ if (!Tcl_Interp_varFramePtr(interp)) { CallStackRestoreSavedFrames(interp, &ctx); - return NsfVarErrMsg(interp, "instvar used on ", objectName(object), + return NsfVarErrMsg(interp, "instvar used on ", ObjectName(object), ", but callstack is not in procedure scope", (char *) NULL); } @@ -15405,7 +15405,7 @@ } return NsfVarErrMsg(interp, "Mixinguard: can't find mixin ", - ObjStr(mixin), " on ", objectName(object), (char *) NULL); + ObjStr(mixin), " on ", ObjectName(object), (char *) NULL); } /* @@ -15477,7 +15477,7 @@ } default: { - return NsfVarErrMsg(interp, objectName(object), + return NsfVarErrMsg(interp, ObjectName(object), " configure: unexpected argument '", ObjStr(objv[i]), "' between parameters", (char *) NULL); @@ -15658,7 +15658,7 @@ */ if (NSRequireVariableOnObj(interp, object, varname, flgs) == 0) return NsfVarErrMsg(interp, "Can't lookup (and create) variable ", - varname, " on ", objectName(object), (char *) NULL); + varname, " on ", ObjectName(object), (char *) NULL); Nsf_PushFrameObj(interp, object, framePtr); /* @@ -15714,7 +15714,7 @@ instead of being checked here in the internal function */ - /*fprintf(stderr, " **** class '%s' wants to alloc '%s'\n", className(cl), nameString);*/ + /*fprintf(stderr, " **** class '%s' wants to alloc '%s'\n", ClassName(cl), nameString);*/ if (!NSCheckColons(nameString, 0)) { return NsfVarErrMsg(interp, "Cannot allocate object -- illegal name '", nameString, "'", (char *) NULL); @@ -15758,7 +15758,7 @@ * create a new object from scratch */ - /*fprintf(stderr, " **** class '%s' wants to alloc '%s'\n", className(cl), nameString);*/ + /*fprintf(stderr, " **** class '%s' wants to alloc '%s'\n", ClassName(cl), nameString);*/ if (!NSCheckColons(nameString, 0)) { return NsfVarErrMsg(interp, "Cannot allocate object -- illegal name '", nameString, "'", (char *) NULL); @@ -15847,7 +15847,7 @@ /*fprintf(stderr, "+++ createspecifiedName '%s', nameString '%s', newObject=%p ismeta(%s) %d, ismeta(%s) %d\n", specifiedName, nameString, newObject, - className(cl), IsMetaClass(interp, cl, 1), + ClassName(cl), IsMetaClass(interp, cl, 1), newObject ? ObjStr(newObject->cl->object.cmdName) : "NULL", newObject ? IsMetaClass(interp, newObject->cl, 1) : NULL );*/ @@ -15974,7 +15974,7 @@ } return NsfVarErrMsg(interp, "filterguard: can't find filter ", - filter, " on ", className(cl), (char *) NULL); + filter, " on ", ClassName(cl), (char *) NULL); } /* @@ -16008,7 +16008,7 @@ } return NsfVarErrMsg(interp, "mixinguard: can't find mixin ", - ObjStr(mixin), " on ", className(cl), (char *) NULL); + ObjStr(mixin), " on ", ClassName(cl), (char *) NULL); } /* @@ -16028,7 +16028,7 @@ Tcl_DStringInit(dsPtr); if (withChildof) { - Tcl_DStringAppend(dsPtr, objectName(withChildof), -1); + Tcl_DStringAppend(dsPtr, ObjectName(withChildof), -1); Tcl_DStringAppend(dsPtr, "::__#", 5); } else { Tcl_DStringAppend(dsPtr, "::nsf::__#", 10); @@ -16621,7 +16621,7 @@ precedenceList = ComputePrecedenceList(interp, object, pattern, !withIntrinsicOnly, 1); for (pl = precedenceList; pl; pl = pl->nextPtr) { - Tcl_AppendElement(interp, className(pl->cl)); + Tcl_AppendElement(interp, ClassName(pl->cl)); } NsfClassListFree(precedenceList); return TCL_OK; @@ -16736,7 +16736,7 @@ hPtr = Tcl_NextHashEntry(&search)) { NsfObject *inst = (NsfObject*) Tcl_GetHashKey(tablePtr, hPtr); /*fprintf(stderr, "match '%s' %p %p '%s'\n", - objectName(matchObject), matchObject, inst, objectName(inst));*/ + ObjectName(matchObject), matchObject, inst, ObjectName(inst));*/ if (matchObject && inst == matchObject) { Tcl_SetObjResult(interp, matchObject->cmdName); return 1; @@ -17157,7 +17157,7 @@ if (RUNTIME_STATE(interp)->debugLevel > 0) { fprintf(stderr, "Warning: have to fix refcount for obj %p refcount %d",object, object->refCount); if (object->refCount > 1) { - fprintf(stderr, " (name %s)", objectName(object)); + fprintf(stderr, " (name %s)", ObjectName(object)); } fprintf(stderr, "\n"); } @@ -17254,7 +17254,7 @@ object = GetObjectFromString(interp, key); if (object && !NsfObjectIsClass(object) && !ObjectHasChildren(interp, object)) { /*fprintf(stderr, " ... delete object %s %p, class=%s id %p\n", key, object, - className(object->cl), object->id);*/ + ClassName(object->cl), object->id);*/ FreeUnsetTraceVariable(interp, object); if (object->id) FinalObjectDeletion(interp, object); Index: generic/nsfInt.h =================================================================== diff -u -r96716c484bb18d390fef1eecdca764b56121dc4d -rd49e60e74c36c563db5ba7095c2f898f1029169b --- generic/nsfInt.h (.../nsfInt.h) (revision 96716c484bb18d390fef1eecdca764b56121dc4d) +++ generic/nsfInt.h (.../nsfInt.h) (revision d49e60e74c36c563db5ba7095c2f898f1029169b) @@ -231,8 +231,8 @@ # define PRINTOBJ(ctx,obj) #endif -#define className(cl) (((cl) ? ObjStr(cl->object.cmdName) : "NULL")) -#define objectName(obj) (((obj) ? ObjStr(obj->cmdName) : "NULL")) +#define ClassName(cl) (((cl) ? ObjStr(cl->object.cmdName) : "NULL")) +#define ObjectName(obj) (((obj) ? ObjStr(obj->cmdName) : "NULL")) #define LONG_AS_STRING 32 Index: generic/nsfStack.c =================================================================== diff -u -rf39b258e182cd2c9df32890902ef89490e0d77d8 -rd49e60e74c36c563db5ba7095c2f898f1029169b --- generic/nsfStack.c (.../nsfStack.c) (revision f39b258e182cd2c9df32890902ef89490e0d77d8) +++ generic/nsfStack.c (.../nsfStack.c) (revision d49e60e74c36c563db5ba7095c2f898f1029169b) @@ -93,15 +93,15 @@ cscPtr, cscPtr ? cscPtr->frameType : -1, cscPtr ? cscPtr->flags : -1, - cscPtr ? objectName(cscPtr->self) : "", + cscPtr ? ObjectName(cscPtr->self) : "", cscPtr ? cscPtr->cmdPtr : NULL, cscPtr ? Tcl_GetCommandName(interp, cscPtr->cmdPtr) : "" ); } else { fprintf(stderr, " no csc"); if (frameFlags & FRAME_IS_NSF_OBJECT) { NsfObject *object = (NsfObject *)Tcl_CallFrame_clientData(framePtr); - fprintf(stderr, " obj %p %s", object, objectName(object)); + fprintf(stderr, " obj %p %s", object, ObjectName(object)); } fprintf(stderr, "\n"); } @@ -852,7 +852,7 @@ object->activationCount ++; /*fprintf(stderr, "CscInit %s method %s activationCount ++ (%s) --> %d\n", msg, cmd ? Tcl_GetCommandName(object->teardown,cmd) : "UNK", - objectName(object), object->activationCount);*/ + ObjectName(object), object->activationCount);*/ /* * track class activations */ @@ -882,7 +882,7 @@ /*fprintf(stderr, "CscInit %p (%s) object %p %s flags %.6x cmdPtr %p\n",cscPtr, msg, - object, objectName(object), cscPtr->flags, cscPtr->cmdPtr);*/ + object, ObjectName(object), cscPtr->flags, cscPtr->cmdPtr);*/ } /* @@ -914,7 +914,7 @@ flags = cscPtr->flags; /*fprintf(stderr, "CscFinish %p object %p %s flags %.6x cmdPtr %p\n",cscPtr, - object, objectName(object), flags, cscPtr->cmdPtr);*/ + object, ObjectName(object), flags, cscPtr->cmdPtr);*/ /* * We cannot rely on the existence of cscPtr->cmdPtr (like in @@ -927,11 +927,11 @@ */ object->activationCount --; - /*fprintf(stderr, "... activationCount -- (%s) --> %d\n",objectName(object), + /*fprintf(stderr, "... activationCount -- (%s) --> %d\n",ObjectName(object), object->activationCount);*/ /*fprintf(stderr, "decr activationCount for %s to %d object->flags %.6x dc %.6x succ %.6x\n", - objectName(cscPtr->self), cscPtr->self->activationCount, object->flags, + ObjectName(cscPtr->self), cscPtr->self->activationCount, object->flags, object->flags & NSF_DESTROY_CALLED, object->flags & NSF_DESTROY_CALLED_SUCCESS );*/ @@ -949,7 +949,7 @@ } #if defined(OBJDELETION_TRACE) else if (!allowDestroy) { - fprintf(stderr,"checkFree %p %s\n",object, objectName(object)); + fprintf(stderr,"checkFree %p %s\n",object, ObjectName(object)); } #endif @@ -979,7 +979,7 @@ } #if defined(OBJDELETION_TRACE) else if (!allowDestroy) { - fprintf(stderr,"checkFree %p %s\n",object, objectName(object)); + fprintf(stderr,"checkFree %p %s\n",object, ObjectName(object)); } #endif // TODO do we have a leak now? @@ -1016,7 +1016,7 @@ Tcl_CallFrame *varFramePtr = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(interp), *prevFramePtr = varFramePtr; - fprintf(stderr, "BeginOfCallChain obj %s\n", objectName(object)); + fprintf(stderr, "BeginOfCallChain obj %s\n", ObjectName(object)); if (object) { for (; varFramePtr; varFramePtr = Tcl_CallFrame_callerPtr(varFramePtr)) { register int flags = Tcl_CallFrame_isProcCallFrame(varFramePtr);