Index: generic/nsf.c =================================================================== diff -u -rb513759e6766220a06876c6fcbbf5d370e9a26b3 -r23843225a71772ef49efb6ee84423fde1b4cd762 --- generic/nsf.c (.../nsf.c) (revision b513759e6766220a06876c6fcbbf5d370e9a26b3) +++ generic/nsf.c (.../nsf.c) (revision 23843225a71772ef49efb6ee84423fde1b4cd762) @@ -1611,7 +1611,7 @@ nonnull_assert(object != NULL); fprintf(stderr, "--- %s Tcl %p %s (%d %p) nsf %p (%d) %s \n", string, - object->cmdName, (object->cmdName->typePtr != NULL) ? object->cmdName->typePtr->name : "NULL", + object->cmdName, ObjTypeStr(object->cmdName), object->cmdName->refCount, object->cmdName->internalRep.twoPtrValue.ptr1, object, object->refCount, ObjectName(object)); } @@ -1876,7 +1876,7 @@ nonnull_assert(objectPtr != NULL); /*fprintf(stderr, "GetObjectFromObj obj %p %s is of type %s\n", - objPtr, ObjStr(objPtr), (objPtr->typePtr != NULL) ? objPtr->typePtr->name : "(null)");*/ + objPtr, ObjStr(objPtr), ObjTypeStr(objPtr));*/ /* * Use the standard Tcl_GetCommandFromObj() which might convert the objPtr @@ -1909,7 +1909,7 @@ } } /*fprintf(stderr, "GetObjectFromObj convertFromAny for %s type %p %s\n", ObjStr(objPtr), - objPtr->typePtr, (objPtr->typePtr != NULL) ? objPtr->typePtr->name : "(none)");*/ + objPtr->typePtr, ObjTypeStr(objPtr));*/ /* In case, we have to revolve via the CallingNameSpace (i.e. the * argument is not fully qualified), we retry here. @@ -3618,7 +3618,7 @@ methodName = ObjStr(methodObj); /*fprintf(stderr,"methodName '%s' comp %d type %s\n", - methodName, strchr(methodName, ' ')>0, (methodObj->typePtr != NULL) ? methodObj->typePtr->name : "(none)");*/ + methodName, strchr(methodName, ' ')>0, ObjTypeStr(methodObj));*/ if (methodObj->typePtr == Nsf_OT_listType) { int length; @@ -8784,8 +8784,7 @@ nonnull_assert(nameObj != NULL); /*fprintf(stderr, "MixinAdd gets obj %p type %p %s\n", - nameObj, nameObj->typePtr, - (nameObj->typePtr != NULL) ?nameObj->typePtr->name : "NULL");*/ + nameObj, nameObj->typePtr, ObjTypeStr(nameObj));*/ /* * When the provided nameObj is of type NsfMixinregObjType, the nsf specific @@ -16020,7 +16019,7 @@ /*if (objPtr->typePtr != NULL) { fprintf(stderr, "type is on call %p %s value %s \n", - objPtr->typePtr, (objPtr->typePtr != NULL) ? objPtr->typePtr->name:"NULL", ObjStr(objPtr)); + objPtr->typePtr, ObjTypeStr(objPtr), ObjStr(objPtr)); }*/ if ((result = Tcl_GetBignumFromObj(interp, objPtr, &bignumValue)) == TCL_OK) { @@ -26228,7 +26227,7 @@ nonnull_assert(obj != NULL); fprintf(stderr, "*** obj %p refCount %d type <%s> ", - (void *)obj, obj->refCount, (obj->typePtr != NULL) ? obj->typePtr->name : ""); + (void *)obj, obj->refCount, ObjTypeStr(obj)); if (obj->typePtr == &NsfObjectMethodObjType || obj->typePtr == &NsfInstanceMethodObjType @@ -30833,6 +30832,7 @@ */ nameString = ObjStr(nameObj); if (*nameString == '-') { + //fprintf(stderr, "cget nameobj %s, type %s\n", nameString, ObjTypeStr(nameObj)); /* * Skip leading parameters from the definition, which are no nonpos args * (very unlikely). @@ -31486,7 +31486,7 @@ /*fprintf(stderr, "PrimitiveCCreate returns nameObj %p typePtr %p %s\n", nameObj, nameObj->typePtr, - nameObj->typePtr != NULL ? nameObj->typePtr->name : "NULL"); */ + ObjTypeStr(nameObj)); */ Tcl_SetObjResult(interp, nameObj); return TCL_OK; Index: generic/nsfInt.h =================================================================== diff -u -rac0c6ddaece9e3aa75c22761c5aa1e922c1d09e2 -r23843225a71772ef49efb6ee84423fde1b4cd762 --- generic/nsfInt.h (.../nsfInt.h) (revision ac0c6ddaece9e3aa75c22761c5aa1e922c1d09e2) +++ generic/nsfInt.h (.../nsfInt.h) (revision 23843225a71772ef49efb6ee84423fde1b4cd762) @@ -352,6 +352,7 @@ MEM_COUNT_ALLOC("INCR_REF_COUNT-" name,(A)); Tcl_IncrRefCount((A)) #define ObjStr(obj) ((obj)->bytes) ? ((obj)->bytes) : Tcl_GetString(obj) +#define ObjTypeStr(obj) (((obj)->typePtr != NULL) ? ((obj)->typePtr->name) : "NONE") #define ClassName(cl) (((cl) != NULL) ? ObjStr((cl)->object.cmdName) : "NULL") #define ClassName_(cl) (ObjStr((cl)->object.cmdName)) #define ObjectName(obj) (((obj) != NULL) ? ObjStr((obj)->cmdName) : "NULL")