Index: generic/predefined.h
===================================================================
diff -u -rd16b1ff12a9ab1dd196bbdb33510ad94959155b3 -r091d3c94b06fd94c8e2bf39f806c43483909e2af
--- generic/predefined.h (.../predefined.h) (revision d16b1ff12a9ab1dd196bbdb33510ad94959155b3)
+++ generic/predefined.h (.../predefined.h) (revision 091d3c94b06fd94c8e2bf39f806c43483909e2af)
@@ -515,11 +515,11 @@
"$obj requireNamespace}} else {\n"
"namespace eval $dest {}}\n"
":copyNSVarsAndCmds $origin $dest\n"
-"foreach i [$origin info forward] {\n"
-"eval [concat $dest forward $i [$origin info forward -definition $i]]}\n"
+"foreach i [::xotcl::cmd::ObjectInfo::forward $origin] {\n"
+"eval [concat ::xotcl::forward $dest -per-object $i [::xotcl::cmd::ObjectInfo::forward $origin -definition $i]]}\n"
"if {[::xotcl::objectproperty $origin class]} {\n"
-"foreach i [$origin info instforward] {\n"
-"eval [concat $dest instforward $i [$origin info instforward -definition $i]]}}\n"
+"foreach i [::xotcl::cmd::ClassInfo::forward $origin] {\n"
+"eval [concat ::xotcl::forward $dest $i [::xotcl::cmd::ClassInfo::forward $origin -definition $i]]}}\n"
"set traces [list]\n"
"foreach var [$origin info vars] {\n"
"set cmds [::xotcl::dispatch $origin -objscope ::trace info variable $var]\n"
Index: generic/predefined.xotcl
===================================================================
diff -u -rd16b1ff12a9ab1dd196bbdb33510ad94959155b3 -r091d3c94b06fd94c8e2bf39f806c43483909e2af
--- generic/predefined.xotcl (.../predefined.xotcl) (revision d16b1ff12a9ab1dd196bbdb33510ad94959155b3)
+++ generic/predefined.xotcl (.../predefined.xotcl) (revision 091d3c94b06fd94c8e2bf39f806c43483909e2af)
@@ -991,12 +991,12 @@
namespace eval $dest {}
}
:copyNSVarsAndCmds $origin $dest
- foreach i [$origin info forward] {
- eval [concat $dest forward $i [$origin info forward -definition $i]]
+ foreach i [::xotcl::cmd::ObjectInfo::forward $origin] {
+ eval [concat ::xotcl::forward $dest -per-object $i [::xotcl::cmd::ObjectInfo::forward $origin -definition $i]]
}
if {[::xotcl::objectproperty $origin class]} {
- foreach i [$origin info instforward] {
- eval [concat $dest instforward $i [$origin info instforward -definition $i]]
+ foreach i [::xotcl::cmd::ClassInfo::forward $origin] {
+ eval [concat ::xotcl::forward $dest $i [::xotcl::cmd::ClassInfo::forward $origin -definition $i]]
}
}
set traces [list]
Index: generic/xotcl.c
===================================================================
diff -u -r2da271ea64afbde77c0b4608164d5f666edd1a69 -r091d3c94b06fd94c8e2bf39f806c43483909e2af
--- generic/xotcl.c (.../xotcl.c) (revision 2da271ea64afbde77c0b4608164d5f666edd1a69)
+++ generic/xotcl.c (.../xotcl.c) (revision 091d3c94b06fd94c8e2bf39f806c43483909e2af)
@@ -77,7 +77,7 @@
static Tcl_ObjType CONST86 *byteCodeType = NULL, *tclCmdNameType = NULL, *listType = NULL;
-int XOTclObjWrongArgs(Tcl_Interp *interp, CONST char *msg, Tcl_Obj *cmdName, Tcl_Obj *methodName, CONST char *arglist);
+int XOTclObjWrongArgs(Tcl_Interp *interp, CONST char *msg, Tcl_Obj *cmdName, Tcl_Obj *methodObj, CONST char *arglist);
static int XOTclDeprecatedCmd(Tcl_Interp *interp, CONST char *what, CONST char *oldCmd, CONST char *newCmd);
/* maybe move to stubs? */
@@ -90,15 +90,15 @@
static int NSisXOTclNamespace(Tcl_Namespace *nsPtr);
#endif
-XOTCLINLINE static void GuardAdd(Tcl_Interp *interp, XOTclCmdList *filterCL, Tcl_Obj *guard);
-static int GuardCheck(Tcl_Interp *interp, Tcl_Obj *guards);
+XOTCLINLINE static void GuardAdd(Tcl_Interp *interp, XOTclCmdList *filterCL, Tcl_Obj *guardObj);
+static int GuardCheck(Tcl_Interp *interp, Tcl_Obj *guardObjs);
static int GuardCall(XOTclObject *object, XOTclClass *cl, Tcl_Command cmd, Tcl_Interp *interp,
- Tcl_Obj *guard, XOTclCallStackContent *cscPtr);
+ Tcl_Obj *guardObj, XOTclCallStackContent *cscPtr);
static void GuardDel(XOTclCmdList *filterCL);
static int IsMetaClass(Tcl_Interp *interp, XOTclClass *cl, int withMixins);
static int hasMixin(Tcl_Interp *interp, XOTclObject *object, XOTclClass *cl);
static int isSubType(XOTclClass *subcl, XOTclClass *cl);
-static int setInstVar(Tcl_Interp *interp, XOTclObject *object, Tcl_Obj *name, Tcl_Obj *value);
+static int setInstVar(Tcl_Interp *interp, XOTclObject *object, Tcl_Obj *nameObj, Tcl_Obj *valueObj);
static void MixinComputeDefined(Tcl_Interp *interp, XOTclObject *object);
static XOTclClass *DefaultSuperClass(Tcl_Interp *interp, XOTclClass *cl, XOTclClass *mcl, int isMeta);
static XOTclCallStackContent *CallStackGetFrame(Tcl_Interp *interp, Tcl_CallFrame **framePtrPtr);
@@ -531,7 +531,7 @@
static Var *
VarHashCreateVar84(TclVarHashTable *tablePtr, Tcl_Obj *key, int *newPtr) {
- char *newName = ObjStr(key);
+ CONST char *newName = ObjStr(key);
Tcl_HashEntry *hPtr = Tcl_CreateHashEntry(tablePtr, newName, newPtr);
Var *varPtr;
@@ -673,15 +673,15 @@
* call an XOTcl method
*/
static int
-callMethod(ClientData clientData, Tcl_Interp *interp, Tcl_Obj *method,
+callMethod(ClientData clientData, Tcl_Interp *interp, Tcl_Obj *methodObj,
int objc, Tcl_Obj *CONST objv[], int flags) {
XOTclObject *object = (XOTclObject*) clientData;
int result;
ALLOC_ON_STACK(Tcl_Obj*, objc, tov);
/*fprintf(stderr, "%%%% callmethod called with method %p\n", method),*/
tov[0] = object->cmdName;
- tov[1] = method;
+ tov[1] = methodObj;
if (objc>2)
memcpy(tov+2, objv, sizeof(Tcl_Obj *)*(objc-2));
@@ -698,7 +698,7 @@
}
int
-XOTclCallMethodWithArgs(ClientData clientData, Tcl_Interp *interp, Tcl_Obj *method, Tcl_Obj *arg,
+XOTclCallMethodWithArgs(ClientData clientData, Tcl_Interp *interp, Tcl_Obj *methodObj, Tcl_Obj *arg,
int givenobjc, Tcl_Obj *CONST objv[], int flags) {
XOTclObject *object = (XOTclObject*) clientData;
int objc = givenobjc + 2;
@@ -707,7 +707,7 @@
assert(objc>1);
tov[0] = object->cmdName;
- tov[1] = method;
+ tov[1] = methodObj;
if (objc>2) {
tov[2] = arg;
}
@@ -781,11 +781,11 @@
#if defined(XOTCLOBJ_TRACE)
void objTrace(char *string, XOTclObject *object) {
- if (obj)
+ if (object)
fprintf(stderr, "--- %s tcl %p %s (%d %p) xotcl %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(obj));
+ object, obj->refCount, objectName(object));
else
fprintf(stderr, "--- No object: %s\n", string);
}
@@ -874,7 +874,7 @@
GetObjectFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, XOTclObject **objectPtr) {
int result;
XOTclObject *nobject;
- char *string;
+ CONST char *string;
Tcl_Command cmd;
/*fprintf(stderr, "GetObjectFromObj obj %p %s is of type %s\n",
@@ -902,7 +902,7 @@
string = ObjStr(objPtr);
if (!isAbsolutePath(string)) {
Tcl_Obj *tmpName = NameInNamespaceObj(interp, string, callingNameSpace(interp));
- char *nsString = ObjStr(tmpName);
+ CONST char *nsString = ObjStr(tmpName);
INCR_REF_COUNT(tmpName);
nobject = XOTclpGetObject(interp, nsString);
@@ -927,7 +927,7 @@
XOTclObject *object;
XOTclClass *cls = NULL;
int result = TCL_OK;
- char *objName = ObjStr(objPtr);
+ CONST char *objName = ObjStr(objPtr);
Tcl_Command cmd;
/*fprintf(stderr, "GetClassFromObj %s base %p\n", objName, base);*/
@@ -975,25 +975,25 @@
static Tcl_Obj *
NameInNamespaceObj(Tcl_Interp *interp, CONST char *name, Tcl_Namespace *nsPtr) {
- Tcl_Obj *objName;
+ Tcl_Obj *objPtr;
int len;
- char *p;
+ CONST char *objString;
/*fprintf(stderr, "NameInNamespaceObj %s (%p, %s) ", name, nsPtr, nsPtr?nsPtr->fullName:NULL);*/
if (!nsPtr)
nsPtr = Tcl_GetCurrentNamespace(interp);
/* fprintf(stderr, " (resolved %p, %s) ", nsPtr, nsPtr?nsPtr->fullName:NULL);*/
- objName = Tcl_NewStringObj(nsPtr->fullName,-1);
- len = Tcl_GetCharLength(objName);
- p = ObjStr(objName);
- if (len == 2 && p[0] == ':' && p[1] == ':') {
+ objPtr = Tcl_NewStringObj(nsPtr->fullName,-1);
+ len = Tcl_GetCharLength(objPtr);
+ objString = ObjStr(objPtr);
+ if (len == 2 && objString[0] == ':' && objString[1] == ':') {
} else {
- Tcl_AppendToObj(objName, "::", 2);
+ Tcl_AppendToObj(objPtr, "::", 2);
}
- Tcl_AppendToObj(objName, name, -1);
+ Tcl_AppendToObj(objPtr, name, -1);
- /*fprintf(stderr, "returns %s\n", ObjStr(objName));*/
- return objName;
+ /*fprintf(stderr, "returns %s\n", ObjStr(objPtr));*/
+ return objPtr;
}
extern void
@@ -1411,8 +1411,8 @@
#endif
if (!object->nsPtr) {
Tcl_Namespace *nsPtr;
- char *cmdName = objectName(object);
- object->nsPtr = NSGetFreshNamespace(interp, (ClientData)object, cmdName, 1);
+ object->nsPtr = NSGetFreshNamespace(interp, (ClientData)object,
+ objectName(object), 1);
if (!object->nsPtr)
Tcl_Panic("makeObjNamespace: Unable to make namespace", NULL);
nsPtr = object->nsPtr;
@@ -2111,8 +2111,8 @@
* check colons for illegal object/class names
*/
XOTCLINLINE static int
-NSCheckColons(char *name, unsigned l) {
- register char *n = name;
+NSCheckColons(CONST char *name, unsigned l) {
+ register CONST char *n = name;
if (*n == '\0') return 0; /* empty name */
if (l == 0) l=strlen(name);
if (*(n+l-1) == ':') return 0; /* name ends with : */
@@ -2351,46 +2351,46 @@
*/
static Tcl_Obj *
-AutonameIncr(Tcl_Interp *interp, Tcl_Obj *name, XOTclObject *object,
+AutonameIncr(Tcl_Interp *interp, Tcl_Obj *nameObj, XOTclObject *object,
int instanceOpt, int resetOpt) {
int valueLength, mustCopy = 1, format = 0;
char *valueString, *c;
- Tcl_Obj *valueObject, *result = NULL, *savedResult = NULL;
+ Tcl_Obj *valueObj, *result = NULL, *savedResult = NULL;
int flgs = TCL_LEAVE_ERR_MSG;
XOTcl_FrameDecls;
XOTcl_PushFrameObj(interp, object);
if (object->nsPtr)
flgs |= TCL_NAMESPACE_ONLY;
- valueObject = Tcl_ObjGetVar2(interp, XOTclGlobalObjects[XOTE_AUTONAMES], name, flgs);
- if (valueObject) {
+ valueObj = Tcl_ObjGetVar2(interp, XOTclGlobalObjects[XOTE_AUTONAMES], nameObj, flgs);
+ if (valueObj) {
long autoname_counter;
/* should probably do an overflow check here */
- Tcl_GetLongFromObj(interp, valueObject, &autoname_counter);
+ Tcl_GetLongFromObj(interp, valueObj, &autoname_counter);
autoname_counter++;
- if (Tcl_IsShared(valueObject)) {
- valueObject = Tcl_DuplicateObj(valueObject);
+ if (Tcl_IsShared(valueObj)) {
+ valueObj = Tcl_DuplicateObj(valueObj);
}
- Tcl_SetLongObj(valueObject, autoname_counter);
+ Tcl_SetLongObj(valueObj, autoname_counter);
}
- Tcl_ObjSetVar2(interp, XOTclGlobalObjects[XOTE_AUTONAMES], name,
- valueObject, flgs);
+ Tcl_ObjSetVar2(interp, XOTclGlobalObjects[XOTE_AUTONAMES], nameObj,
+ valueObj, flgs);
if (resetOpt) {
- if (valueObject) { /* we have an entry */
- Tcl_UnsetVar2(interp, XOTclGlobalStrings[XOTE_AUTONAMES], ObjStr(name), flgs);
+ if (valueObj) { /* we have an entry */
+ Tcl_UnsetVar2(interp, XOTclGlobalStrings[XOTE_AUTONAMES], ObjStr(nameObj), flgs);
}
result = XOTclGlobalObjects[XOTE_EMPTY];
INCR_REF_COUNT(result);
} else {
- if (valueObject == NULL) {
- valueObject = Tcl_ObjSetVar2(interp, XOTclGlobalObjects[XOTE_AUTONAMES],
- name, XOTclGlobalObjects[XOTE_ONE], flgs);
+ if (valueObj == NULL) {
+ valueObj = Tcl_ObjSetVar2(interp, XOTclGlobalObjects[XOTE_AUTONAMES],
+ nameObj, XOTclGlobalObjects[XOTE_ONE], flgs);
}
if (instanceOpt) {
- char buffer[1], firstChar, *nextChars;
- nextChars = ObjStr(name);
+ char buffer[1], firstChar;
+ CONST char *nextChars = ObjStr(nameObj);
firstChar = *(nextChars ++);
if (isupper((int)firstChar)) {
buffer[0] = tolower((int)firstChar);
@@ -2401,7 +2401,7 @@
}
}
if (mustCopy) {
- result = Tcl_DuplicateObj(name);
+ result = Tcl_DuplicateObj(nameObj);
INCR_REF_COUNT(result);
/*
fprintf(stderr, "*** copy %p %s = %p\n", name, ObjStr(name), result);
@@ -2429,7 +2429,7 @@
savedResult = Tcl_GetObjResult(interp);
INCR_REF_COUNT(savedResult);
ov[1] = result;
- ov[2] = valueObject;
+ ov[2] = valueObj;
if (XOTclCallCommand(interp, XOTE_FORMAT, 3, ov) != TCL_OK) {
XOTcl_PopFrameObj(interp);
DECR_REF_COUNT(savedResult);
@@ -2443,7 +2443,7 @@
DECR_REF_COUNT(savedResult);
FREE_ON_STACK(ov);
} else {
- valueString = Tcl_GetStringFromObj(valueObject, &valueLength);
+ valueString = Tcl_GetStringFromObj(valueObj, &valueLength);
Tcl_AppendToObj(result, valueString, valueLength);
/*fprintf(stderr, "+++ append to obj done\n");*/
}
@@ -2525,16 +2525,15 @@
callDestroyMethod(interp, object, 0);
if (activationCount == 0) {
- /* We assume, the object is now freed. if the obj is already
+ /* We assume, the object is now freed. if the oobjectbj is already
freed, we cannot access activation count, and we cannot call
CallStackDoDestroy */
- /* todo: check if this is leak; */
/*fprintf(stderr, " CallStackDestroyObject %p done\n", obj);*/
return;
}
}
- /* if the object is not referenced on the callstack anymore
+ /* If the object is not referenced on the callstack anymore
we have to destroy it directly, because CallStackPop won't
find the object destroy */
/*fprintf(stderr, " CallStackDestroyObject check activation count of %p => %d\n", object, object->activationCount);*/
@@ -2947,7 +2946,7 @@
while (alist) {
/* Eval instead of IfObjCmd => the substitutions in the
conditions will be done by Tcl */
- char *assStr = ObjStr(alist->content), *c = assStr;
+ CONST char *assStr = ObjStr(alist->content), *c = assStr;
int comment = 0;
for (; c && *c != '\0'; c++) {
@@ -3076,7 +3075,7 @@
if (Tcl_ListObjGetElements(interp, arg, &ocArgs, &ovArgs) == TCL_OK
&& ocArgs > 0) {
for (i = 0; i < ocArgs; i++) {
- char *option = ObjStr(ovArgs[i]);
+ CONST char *option = ObjStr(ovArgs[i]);
if (option) {
switch (*option) {
case 'c':
@@ -3298,29 +3297,29 @@
* add a mixin class to 'mixinList' by appending it
*/
static int
-MixinAdd(Tcl_Interp *interp, XOTclCmdList **mixinList, Tcl_Obj *name, XOTclClass *base) {
+MixinAdd(Tcl_Interp *interp, XOTclCmdList **mixinList, Tcl_Obj *nameObj, XOTclClass *base) {
XOTclClass *mixin;
- Tcl_Obj *guard = NULL;
+ Tcl_Obj *guardObj = NULL;
int ocName; Tcl_Obj **ovName;
XOTclCmdList *new;
- if (Tcl_ListObjGetElements(interp, name, &ocName, &ovName) == TCL_OK && ocName > 1) {
+ if (Tcl_ListObjGetElements(interp, nameObj, &ocName, &ovName) == TCL_OK && ocName > 1) {
if (ocName == 3 && !strcmp(ObjStr(ovName[1]), XOTclGlobalStrings[XOTE_GUARD_OPTION])) {
- name = ovName[0];
- guard = ovName[2];
+ nameObj = ovName[0];
+ guardObj = ovName[2];
/*fprintf(stderr, "mixinadd name = '%s', guard = '%s'\n", ObjStr(name), ObjStr(guard));*/
} /*else return XOTclVarErrMsg(interp, "mixin registration '", ObjStr(name),
"' has too many elements.", (char *) NULL);*/
}
- if (GetClassFromObj(interp, name, &mixin, base) != TCL_OK)
- return XOTclErrBadVal(interp, "mixin", "a class as mixin", ObjStr(name));
+ if (GetClassFromObj(interp, nameObj, &mixin, base) != TCL_OK)
+ return XOTclErrBadVal(interp, "mixin", "a class as mixin", ObjStr(nameObj));
new = CmdListAdd(mixinList, mixin->object.id, NULL, /*noDuplicates*/ 1);
- if (guard) {
- GuardAdd(interp, new, guard);
+ if (guardObj) {
+ GuardAdd(interp, new, guardObj);
} else {
if (new->clientData)
GuardDel(new);
@@ -3333,8 +3332,8 @@
* call AppendElement for matching values
*/
static void
-AppendMatchingElement(Tcl_Interp *interp, Tcl_Obj *name, CONST char *pattern) {
- char *string = ObjStr(name);
+AppendMatchingElement(Tcl_Interp *interp, Tcl_Obj *nameObj, CONST char *pattern) {
+ CONST char *string = ObjStr(nameObj);
if (!pattern || Tcl_StringMatch(string, pattern)) {
Tcl_AppendElement(interp, string);
}
@@ -3678,11 +3677,11 @@
XOTclCmdList *del = CmdListFindCmdInList(cmd, clopt->isObjectMixinOf);
if (del) {
/* fprintf(stderr, "Removing object %s from isObjectMixinOf of Class %s\n",
- objectName(obj), ObjStr(XOTclGetClassFromCmdPtr(cmdlist->cmdPtr)->object.cmdName)); */
+ objectName(object), ObjStr(XOTclGetClassFromCmdPtr(cmdlist->cmdPtr)->object.cmdName)); */
del = CmdListRemoveFromList(&clopt->isObjectMixinOf, del);
CmdListDeleteCmdListEntry(del, GuardDel);
}
- } /* else fprintf(stderr, "CleanupDestroyObject %s: NULL pointer in mixins!\n", objectName(obj)); */
+ } /* else fprintf(stderr, "CleanupDestroyObject %s: NULL pointer in mixins!\n", objectName(object)); */
}
}
@@ -3904,7 +3903,7 @@
cls = XOTclGetClassFromCmdPtr(cmdList->cmdPtr);
/*
fprintf(stderr, "+++ MixinSearch %s->%s in %p cmdPtr %p clientData %p\n",
- objectName(obj), methodName, cmdList,
+ objectName(object), methodName, cmdList,
cmdList->cmdPtr, cmdList->clientData);
*/
if (cls) {
@@ -4075,24 +4074,24 @@
/* check a filter guard, return 1 if ok */
static int
-GuardCheck(Tcl_Interp *interp, Tcl_Obj *guard) {
+GuardCheck(Tcl_Interp *interp, Tcl_Obj *guardObj) {
int result;
XOTclRuntimeState *rst = RUNTIME_STATE(interp);
- if (guard) {
+ if (guardObj) {
/*
* if there are more than one filter guard for this filter
* (i.e. they are inherited), then they are OR combined
* -> if one check succeeds => return 1
*/
- /*fprintf(stderr, "checking guard **%s**\n", ObjStr(guard));*/
+ /*fprintf(stderr, "checking guard **%s**\n", ObjStr(guardObj));*/
rst->guardCount++;
- result = checkConditionInScope(interp, guard);
+ result = checkConditionInScope(interp, guardObj);
rst->guardCount--;
- /*fprintf(stderr, "checking guard **%s** returned rc=%d\n", ObjStr(guard), rc);*/
+ /*fprintf(stderr, "checking guard **%s** returned rc=%d\n", ObjStr(guardObj), rc);*/
if (result == TCL_OK) {
/* fprintf(stderr, " +++ OK\n"); */
@@ -4103,7 +4102,7 @@
/* fprintf(stderr, " +++ ERROR\n");*/
- XOTclVarErrMsg(interp, "Guard Error: '", ObjStr(guard), "'\n\n",
+ XOTclVarErrMsg(interp, "Guard Error: '", ObjStr(guardObj), "'\n\n",
ObjStr(sr), (char *) NULL);
DECR_REF_COUNT(sr);
return TCL_ERROR;
@@ -4118,10 +4117,10 @@
/*
static void
GuardPrint(Tcl_Interp *interp, ClientData clientData) {
- Tcl_Obj *guard = (TclObj*) clientData;
+ Tcl_Obj *guardObj = (TclObj*) clientData;
fprintf(stderr, " +++ \n");
- if (guard) {
- fprintf(stderr, " * %s \n", ObjStr(guard));
+ if (guardObj) {
+ fprintf(stderr, " * %s \n", ObjStr(guardObj));
}
fprintf(stderr, " +++ \n");
}
@@ -4138,12 +4137,12 @@
}
XOTCLINLINE static void
-GuardAdd(Tcl_Interp *interp, XOTclCmdList *CL, Tcl_Obj *guard) {
- if (guard) {
+GuardAdd(Tcl_Interp *interp, XOTclCmdList *CL, Tcl_Obj *guardObj) {
+ if (guardObj) {
GuardDel(CL);
- if (strlen(ObjStr(guard)) != 0) {
- INCR_REF_COUNT(guard);
- CL->clientData = (ClientData) guard;
+ if (strlen(ObjStr(guardObj)) != 0) {
+ INCR_REF_COUNT(guardObj);
+ CL->clientData = (ClientData) guardObj;
/*fprintf(stderr, "guard added to %p cmdPtr=%p, clientData= %p\n",
CL, CL->cmdPtr, CL->clientData);
*/
@@ -4160,10 +4159,10 @@
static int
GuardCall(XOTclObject *object, XOTclClass *cl, Tcl_Command cmd,
- Tcl_Interp *interp, Tcl_Obj *guard, XOTclCallStackContent *cscPtr) {
+ Tcl_Interp *interp, Tcl_Obj *guardObj, XOTclCallStackContent *cscPtr) {
int result = TCL_OK;
- if (guard) {
+ if (guardObj) {
Tcl_Obj *res = Tcl_GetObjResult(interp); /* save the result */
XOTcl_FrameDecls;
INCR_REF_COUNT(res);
@@ -4184,7 +4183,7 @@
CallStackPush(interp, object, cl, cmd, XOTCL_CSC_TYPE_GUARD);
XOTcl_PushFrameObj(interp, object);
#endif
- result = GuardCheck(interp, guard);
+ result = GuardCheck(interp, guardObj);
if (cscPtr) {
XOTcl_PopFrameCsc(interp);
@@ -4314,38 +4313,38 @@
* append a filter command to the 'filterList' of an obj/class
*/
static int
-FilterAdd(Tcl_Interp *interp, XOTclCmdList **filterList, Tcl_Obj *name,
+FilterAdd(Tcl_Interp *interp, XOTclCmdList **filterList, Tcl_Obj *nameObj,
XOTclObject *startingObj, XOTclClass *startingCl) {
Tcl_Command cmd;
int ocName; Tcl_Obj **ovName;
- Tcl_Obj *guard = NULL;
+ Tcl_Obj *guardObj = NULL;
XOTclCmdList *new;
XOTclClass *cl;
- if (Tcl_ListObjGetElements(interp, name, &ocName, &ovName) == TCL_OK && ocName > 1) {
+ if (Tcl_ListObjGetElements(interp, nameObj, &ocName, &ovName) == TCL_OK && ocName > 1) {
if (ocName == 3 && !strcmp(ObjStr(ovName[1]), XOTclGlobalStrings[XOTE_GUARD_OPTION])) {
- name = ovName[0];
- guard = ovName[2];
+ nameObj = ovName[0];
+ guardObj = ovName[2];
}
}
- if (!(cmd = FilterSearch(interp, ObjStr(name), startingObj, startingCl, &cl))) {
+ if (!(cmd = FilterSearch(interp, ObjStr(nameObj), startingObj, startingCl, &cl))) {
if (startingObj)
return XOTclVarErrMsg(interp, "object filter: can't find filterproc on: ",
objectName(startingObj), " - proc: ",
- ObjStr(name), (char *) NULL);
+ ObjStr(nameObj), (char *) NULL);
else
return XOTclVarErrMsg(interp, "class filter: can't find filterproc on: ",
- ObjStr(startingCl->object.cmdName), " - proc: ",
- ObjStr(name), (char *) NULL);
+ className(startingCl), " - proc: ",
+ ObjStr(nameObj), (char *) NULL);
}
- /*fprintf(stderr, " +++ adding filter %s cl %p\n", ObjStr(name), cl);*/
+ /*fprintf(stderr, " +++ adding filter %s cl %p\n", ObjStr(nameObj), cl);*/
new = CmdListAdd(filterList, cmd, cl, /*noDuplicates*/ 1);
- if (guard) {
- GuardAdd(interp, new, guard);
+ if (guardObj) {
+ GuardAdd(interp, new, guardObj);
} else {
if (new->clientData)
GuardDel(new);
@@ -4620,7 +4619,7 @@
if (object->filterOrder) FilterResetOrder(object);
/*
- fprintf(stderr, " List: ", objectName(obj));
+ fprintf(stderr, " List: ", objectName(object));
*/
/* append classfilters registered for mixins */
@@ -4795,7 +4794,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(obj));
+ Tcl_GetCommandName(interp, (Tcl_Command)cmdList->cmdPtr), objectName(object));
*/
object->filterStack->currentCmdPtr = cmdList->cmdPtr;
cmdList = seekCurrent(object->filterStack->currentCmdPtr, object->filterOrder);
@@ -4919,39 +4918,39 @@
extern Tcl_Obj *
XOTcl_ObjSetVar2(XOTcl_Object *object, Tcl_Interp *interp, Tcl_Obj *name1, Tcl_Obj *name2,
- Tcl_Obj *value, int flgs) {
+ Tcl_Obj *valueObj, int flgs) {
Tcl_Obj *result;
XOTcl_FrameDecls;
XOTcl_PushFrameObj(interp, (XOTclObject*)object);
if (((XOTclObject*)object)->nsPtr)
flgs |= TCL_NAMESPACE_ONLY;
- result = Tcl_ObjSetVar2(interp, name1, name2, value, flgs);
+ result = Tcl_ObjSetVar2(interp, name1, name2, valueObj, flgs);
XOTcl_PopFrameObj(interp);
return result;
}
extern Tcl_Obj *
XOTcl_SetVar2Ex(XOTcl_Object *object, Tcl_Interp *interp, CONST char *name1, CONST char *name2,
- Tcl_Obj *value, int flgs) {
+ Tcl_Obj *valueObj, int flgs) {
Tcl_Obj *result;
XOTcl_FrameDecls;
XOTcl_PushFrameObj(interp, (XOTclObject*)object);
if (((XOTclObject*)object)->nsPtr)
flgs |= TCL_NAMESPACE_ONLY;
- result = Tcl_SetVar2Ex(interp, name1, name2, value, flgs);
+ result = Tcl_SetVar2Ex(interp, name1, name2, valueObj, flgs);
XOTcl_PopFrameObj(interp);
return result;
}
Tcl_Obj *
XOTclOSetInstVar(XOTcl_Object *object, Tcl_Interp *interp,
- Tcl_Obj *name, Tcl_Obj *value, int flgs) {
- return XOTcl_ObjSetVar2(object, interp, name, (Tcl_Obj *)NULL, value, (flgs|TCL_PARSE_PART1));
+ Tcl_Obj *nameObj, Tcl_Obj *valueObj, int flgs) {
+ return XOTcl_ObjSetVar2(object, interp, nameObj, (Tcl_Obj *)NULL, valueObj, (flgs|TCL_PARSE_PART1));
}
extern Tcl_Obj *
@@ -4987,8 +4986,8 @@
Tcl_Obj *
-XOTclOGetInstVar(XOTcl_Object *object, Tcl_Interp *interp, Tcl_Obj *name, int flgs) {
- return XOTcl_ObjGetVar2(object, interp, name, (Tcl_Obj *)NULL, (flgs|TCL_PARSE_PART1));
+XOTclOGetInstVar(XOTcl_Object *object, Tcl_Interp *interp, Tcl_Obj *nameObj, int flgs) {
+ return XOTcl_ObjGetVar2(object, interp, nameObj, (Tcl_Obj *)NULL, (flgs|TCL_PARSE_PART1));
}
int
@@ -5047,7 +5046,7 @@
#endif
/*fprintf(stderr, "+++++ %s.%s subst returned %d OK %d\n",
- objectName(obj), varName, rc, TCL_OK);*/
+ objectName(object), varName, rc, TCL_OK);*/
if (result == TCL_OK) {
*value = Tcl_GetObjResult(interp);
@@ -5287,12 +5286,12 @@
static Tcl_Obj *
ParamDefsFormat(Tcl_Interp *interp, XOTclParamDefs *paramDefs) {
int first, colonWritten;
- Tcl_Obj *list = Tcl_NewListObj(0, NULL), *innerList, *nameStringObj;
+ Tcl_Obj *listObj = Tcl_NewListObj(0, NULL), *innerListObj, *nameStringObj;
XOTclParam CONST *pPtr;
for (pPtr = paramDefs->paramsPtr; pPtr->name; pPtr++) {
if (pPtr -> paramObj) {
- innerList = pPtr->paramObj;
+ innerListObj = pPtr->paramObj;
} else {
/* We need this part only for C-defined parameter definitions,
defined via genTclAPI.
@@ -5331,28 +5330,28 @@
ParamDefsFormatOption(interp, nameStringObj, "multivalued", &colonWritten, &first);
}
- innerList = Tcl_NewListObj(0, NULL);
- Tcl_ListObjAppendElement(interp, innerList, nameStringObj);
+ innerListObj = Tcl_NewListObj(0, NULL);
+ Tcl_ListObjAppendElement(interp, innerListObj, nameStringObj);
if (pPtr->defaultValue) {
- Tcl_ListObjAppendElement(interp, innerList, pPtr->defaultValue);
+ Tcl_ListObjAppendElement(interp, innerListObj, pPtr->defaultValue);
}
}
- Tcl_ListObjAppendElement(interp, list, innerList);
+ Tcl_ListObjAppendElement(interp, listObj, innerListObj);
}
- return list;
+ return listObj;
}
static Tcl_Obj *
ParamDefsList(Tcl_Interp *interp, XOTclParamDefs *paramDefs) {
- Tcl_Obj *list = Tcl_NewListObj(0, NULL);
+ Tcl_Obj *listObj = Tcl_NewListObj(0, NULL);
XOTclParam CONST *pPtr;
for (pPtr = paramDefs->paramsPtr; pPtr->name; pPtr++) {
- Tcl_ListObjAppendElement(interp, list, pPtr->nameObj);
+ Tcl_ListObjAppendElement(interp, listObj, pPtr->nameObj);
}
- return list;
+ return listObj;
}
static void ParsedParamFree(XOTclParsedParam *parsedParamPtr) {
@@ -5580,7 +5579,7 @@
#else
{
TEOV_callback *rootPtr = TOP_CB(interp);
- /*fprintf(stderr, "CALL TclNRInterpProcCore %s method '%s'\n", objectName(obj), ObjStr(objv[0]));*/
+ /*fprintf(stderr, "CALL TclNRInterpProcCore %s method '%s'\n", objectName(object), ObjStr(objv[0]));*/
Tcl_NRAddCallback(interp, FinalizeProcMethod,
releasePc ? pcPtr : NULL, cscPtr, methodName, NULL);
result = TclNRInterpProcCore(interp, objv[0], 1, &MakeProcError);
@@ -5659,7 +5658,7 @@
* TODO: maybe push should happen already before assertion checking,
* but we have to check what happens in the finish target etc.
*/
- /*fprintf(stderr, "XOTcl_PushFrameCsc %s %s\n",objectName(obj), methodName);*/
+ /*fprintf(stderr, "XOTcl_PushFrameCsc %s %s\n",objectName(object), methodName);*/
XOTcl_PushFrameCsc(interp, cscPtr);
}
#endif
@@ -5765,7 +5764,7 @@
*/
cscPtr = &csc;
- /*fprintf(stderr, "we could stuff obj %p %s\n", obj, objectName(obj));*/
+ /*fprintf(stderr, "we could stuff obj %p %s\n", object, objectName(object));*/
if (proc == XOTclObjDispatch) {
/*
@@ -5804,7 +5803,7 @@
/*
The cmd has no client data
*/
- /*fprintf(stderr, "cmdMethodDispatch %s %s, nothing stacked\n",objectName(obj), methodName);*/
+ /*fprintf(stderr, "cmdMethodDispatch %s %s, nothing stacked\n",objectName(object), methodName);*/
return CmdMethodDispatch(clientData, interp, objc, objv, methodName, object, cmd, NULL);
}
@@ -5850,7 +5849,7 @@
}
#endif
/*fprintf(stderr, "ObjectDispatch obj = %s objc = %d 0=%s methodName=%s\n",
- objectName(obj), objc, ObjStr(cmdObj), methodName);*/
+ objectName(object), objc, ObjStr(cmdObj), methodName);*/
#ifdef DISPATCH_TRACE
printCall(interp, "DISPATCH", objc, objv);
@@ -5986,7 +5985,7 @@
if (!unknown) {
/*fprintf(stderr, "ObjectDispatch calls MethodDispatch with obj = %s frameType %d method %s\n",
- objectName(obj), frameType, methodName);*/
+ objectName(object), frameType, methodName);*/
if ((result = MethodDispatch(clientData, interp, objc-shift, objv+shift, cmd, object, cl,
methodName, frameType)) == TCL_ERROR) {
/*fprintf(stderr, "Call ErrInProc cl = %p, cmd %p, flags %.6x\n",
@@ -6030,7 +6029,7 @@
memcpy(tov+2, objv+shift, sizeof(Tcl_Obj *)*(objc-shift));
}
/*
- fprintf(stderr, "?? %s unknown %s\n", objectName(obj), ObjStr(tov[2]));
+ fprintf(stderr, "?? %s unknown %s\n", objectName(object), ObjStr(tov[2]));
*/
flags &= ~XOTCL_CM_NO_SHIFT;
result = ObjectDispatch(clientData, interp, objc+2-shift, tov, flags | XOTCL_CM_NO_UNKNOWN);
@@ -6352,7 +6351,7 @@
static int
ParamOptionSetConverter(Tcl_Interp *interp, XOTclParam *paramPtr,
- char *typeName, XOTclTypeConverter *converter) {
+ CONST char *typeName, XOTclTypeConverter *converter) {
if (paramPtr->converter) {
return XOTclVarErrMsg(interp, "Refuse to redefine parameter converter to use ",
typeName, (char *) NULL);
@@ -6461,7 +6460,7 @@
ParamParse(Tcl_Interp *interp, CONST char *procName, Tcl_Obj *arg, int disallowedFlags,
XOTclParam *paramPtr, int *possibleUnknowns, int *plainParams) {
int result, npac, length, j, nameLength, isNonposArgument;
- char *argString, *argName;
+ CONST char *argString, *argName;
Tcl_Obj **npav;
paramPtr->paramObj = arg;
@@ -6577,7 +6576,7 @@
if ((paramPtr->slotObj || paramPtr->converter == convertViaCmd) && paramPtr->type) {
Tcl_Obj *converterNameObj;
- char *converterNameString;
+ CONST char *converterNameString;
XOTclObject *paramObj;
XOTclClass *pcl;
Tcl_Command cmd;
@@ -6810,7 +6809,7 @@
Tcl_Obj *args, Tcl_Obj *body,
Tcl_Obj *precondition, Tcl_Obj *postcondition,
int withPublic, int clsns) {
- char *argsStr = ObjStr(args), *bodyStr = ObjStr(body), *nameStr = ObjStr(nameObj);
+ CONST char *argsStr = ObjStr(args), *bodyStr = ObjStr(body), *nameStr = ObjStr(nameObj);
int result;
if (precondition && !postcondition) {
@@ -6884,7 +6883,7 @@
}
static int
-forwardProcessOptions(Tcl_Interp *interp, Tcl_Obj *name,
+forwardProcessOptions(Tcl_Interp *interp, Tcl_Obj *nameObj,
Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withMethodprefix,
int withObjscope, Tcl_Obj *withOnerror, int withVerbose,
Tcl_Obj *target, int objc, Tcl_Obj * CONST objv[],
@@ -6923,7 +6922,7 @@
/*fprintf(stderr, "...forwardprocess objc %d\n", objc);*/
for (i=0; ineedobjmap |= (*element == '%' && *(element+1) == '@');
tcd->hasNonposArgs |= (*element == '%' && *(element+1) == '-');
@@ -6938,7 +6937,7 @@
}
if (!tcd->cmdName) {
- tcd->cmdName = name;
+ tcd->cmdName = nameObj;
}
/*fprintf(stderr, "cmdName = %s, args = %s, # = %d\n",
@@ -6951,10 +6950,10 @@
o append ...
would lead to a recursive call; so we add the appropriate namespace
*/
- char *nameString = ObjStr(tcd->cmdName);
+ CONST char *nameString = ObjStr(tcd->cmdName);
if (!isAbsolutePath(nameString)) {
tcd->cmdName = NameInNamespaceObj(interp, nameString, callingNameSpace(interp));
- /*fprintf(stderr, "name %s not absolute, therefore qualifying %s\n", name,
+ /*fprintf(stderr, "name %s not absolute, therefore qualifying %s\n", nameObj,
ObjStr(tcd->cmdName));*/
}
}
@@ -7002,8 +7001,7 @@
while (ml) {
XOTclClass *mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr);
if (pattern) {
- char *name = className(mixin);
- if (!Tcl_StringMatch(name, pattern)) continue;
+ if (!Tcl_StringMatch(className(mixin), pattern)) continue;
}
npl = XOTclClassListAdd(npl, mixin, NULL);
ml = ml->nextPtr;
@@ -7017,8 +7015,7 @@
continue;
if (pattern) {
- char *name = className(pcl->cl);
- if (!Tcl_StringMatch(name, pattern)) continue;
+ if (!Tcl_StringMatch(className(pcl->cl), pattern)) continue;
}
npl = XOTclClassListAdd(npl, pcl->cl, NULL);
}
@@ -7029,7 +7026,7 @@
StripBodyPrefix(CONST char *body) {
#if defined(PRE85)
if (strncmp(body, "::xotcl::initProcNS\n", 20) == 0)
- body+=20;
+ body += 20;
if (strncmp(body, "::eval ::xotcl::interpretNonpositionalArgs $args\n", 49) == 0)
body += 49;
#else
@@ -7130,7 +7127,7 @@
*/
XOTCLINLINE static int
NextSearchMethod(XOTclObject *object, Tcl_Interp *interp, XOTclCallStackContent *cscPtr,
- XOTclClass **cl, CONST char **method, Tcl_Command *cmd,
+ XOTclClass **cl, CONST char **methodName, Tcl_Command *cmd,
int *isMixinEntry, int *isFilterEntry,
int *endOfFilterChain, Tcl_Command *currentCmd) {
int endOfChain = 0, objflags;
@@ -7156,14 +7153,14 @@
if (cscPtr->frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) {
/* reset the information to the values of method, cl
to the values they had before calling the filters */
- *method = ObjStr(object->filterStack->calledProc);
+ *methodName = ObjStr(object->filterStack->calledProc);
endOfChain = 1;
*endOfFilterChain = 1;
*cl = 0;
/*fprintf(stderr, "EndOfChain resetting cl\n");*/
}
} else {
- *method = (char *) Tcl_GetCommandName(interp, *cmd);
+ *methodName = (char *) Tcl_GetCommandName(interp, *cmd);
*endOfFilterChain = 0;
*isFilterEntry = 1;
return TCL_OK;
@@ -7180,7 +7177,7 @@
obj->flags & XOTCL_MIXIN_ORDER_VALID, obj->mixinStack);*/
if ((objflags & XOTCL_MIXIN_ORDER_VALID) && object->mixinStack) {
- int result = MixinSearchProc(interp, object, *method, cl, currentCmd, cmd);
+ int result = MixinSearchProc(interp, object, *methodName, cl, currentCmd, cmd);
if (result != TCL_OK) {
return result;
}
@@ -7207,7 +7204,7 @@
the obj-specific methods as well */
if (object->nsPtr && endOfChain) {
- *cmd = FindMethod(object->nsPtr, *method);
+ *cmd = FindMethod(object->nsPtr, *methodName);
} else {
*cmd = NULL;
}
@@ -7238,7 +7235,7 @@
/*
* search for a further class method
*/
- *cl = SearchPLMethod(pl, *method, cmd);
+ *cl = SearchPLMethod(pl, *methodName, cmd);
/*fprintf(stderr, "no cmd, cl = %p %s\n",*cl, className((*cl)));*/
} else {
*cl = 0;
@@ -7313,7 +7310,7 @@
*methodName, endOfFilterChain);
if (obj)
- fprintf(stderr, " obj=%s,", objectName(obj));
+ fprintf(stderr, " obj=%s,", objectName(object));
if ((*cl))
fprintf(stderr, " cl=%s,", (*cl)->nsPtr->fullName);
fprintf(stderr, " mixin=%d, filter=%d, proc=%p\n",
@@ -7359,7 +7356,7 @@
/* cut the flag, that no stdargs should be used, if it is there */
if (nobjc > 1) {
- char *nobjv1 = ObjStr(nobjv[1]);
+ CONST char *nobjv1 = ObjStr(nobjv[1]);
if (nobjv1[0] == '-' && !strcmp(nobjv1, "--noArgs"))
nobjc = 1;
}
@@ -7666,7 +7663,7 @@
}
/*
fprintf(stderr, "cleanupInitObject %s: %p cl = %p\n",
- obj->cmdName ? objectName(obj) : "", obj, obj->cl);*/
+ obj->cmdName ? objectName(object) : "", object, object->cl);*/
}
static void
@@ -7742,7 +7739,7 @@
object->nsPtr = NULL;
}
- /*fprintf(stderr, " +++ OBJ/CLS free: %s\n", objectName(obj));*/
+ /*fprintf(stderr, " +++ OBJ/CLS free: %s\n", objectName(object));*/
object->flags |= XOTCL_DELETED;
objTrace("ODestroy", object);
@@ -8211,7 +8208,7 @@
assert(object);
/*fprintf(stderr, "changing %s to class %s ismeta %d\n",
- objectName(obj),
+ objectName(object),
className(cl),
IsMetaClass(interp, cl, 1));*/
@@ -8520,35 +8517,35 @@
extern int
-XOTclCreateObject(Tcl_Interp *interp, Tcl_Obj *name, XOTcl_Class *class) {
+XOTclCreateObject(Tcl_Interp *interp, Tcl_Obj *nameObj, XOTcl_Class *class) {
XOTclClass *cl = (XOTclClass*) class;
int result;
- INCR_REF_COUNT(name);
+ INCR_REF_COUNT(nameObj);
result = XOTclCallMethodWithArgs((ClientData)cl, interp,
- XOTclGlobalObjects[XOTE_CREATE], name, 1, 0, 0);
- DECR_REF_COUNT(name);
+ XOTclGlobalObjects[XOTE_CREATE], nameObj, 1, 0, 0);
+ DECR_REF_COUNT(nameObj);
return result;
}
extern int
-XOTclCreate(Tcl_Interp *interp, XOTcl_Class *class, Tcl_Obj *name, ClientData clientData,
+XOTclCreate(Tcl_Interp *interp, XOTcl_Class *class, Tcl_Obj *nameObj, ClientData clientData,
int objc, Tcl_Obj *CONST objv[]) {
XOTclClass *cl = (XOTclClass *) class;
int result;
- INCR_REF_COUNT(name);
+ INCR_REF_COUNT(nameObj);
ALLOC_ON_STACK(Tcl_Obj *, objc+2, ov);
ov[0] = NULL;
- ov[1] = name;
+ ov[1] = nameObj;
if (objc>0) {
memcpy(ov+2, objv, sizeof(Tcl_Obj *)*objc);
}
- result = createMethod(interp, cl, ObjStr(name), objc+2, ov);
+ result = createMethod(interp, cl, ObjStr(nameObj), objc+2, ov);
FREE_ON_STACK(ov);
- DECR_REF_COUNT(name);
+ DECR_REF_COUNT(nameObj);
return result;
}
@@ -8774,17 +8771,17 @@
}
static int
-setInstVar(Tcl_Interp *interp, XOTclObject *object, Tcl_Obj *name, Tcl_Obj *value) {
+setInstVar(Tcl_Interp *interp, XOTclObject *object, Tcl_Obj *nameObj, Tcl_Obj *valueObj) {
Tcl_Obj *result;
int flags = (object->nsPtr) ? TCL_LEAVE_ERR_MSG|TCL_NAMESPACE_ONLY : TCL_LEAVE_ERR_MSG;
XOTcl_FrameDecls;
XOTcl_PushFrameObj(interp, object);
- if (value == NULL) {
- result = Tcl_ObjGetVar2(interp, name, NULL, flags);
+ if (valueObj == NULL) {
+ result = Tcl_ObjGetVar2(interp, nameObj, NULL, flags);
} else {
- /*fprintf(stderr, "setvar in obj %s: name %s = %s\n", objectName(object), ObjStr(name), ObjStr(value));*/
- result = Tcl_ObjSetVar2(interp, name, NULL, value, flags);
+ /*fprintf(stderr, "setvar in obj %s: name %s = %s\n", objectName(object), ObjStr(nameObj), ObjStr(value));*/
+ result = Tcl_ObjSetVar2(interp, nameObj, NULL, valueObj, flags);
}
XOTcl_PopFrameObj(interp);
@@ -9394,19 +9391,19 @@
callConfigureMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *methodName,
int argc, Tcl_Obj *CONST argv[]) {
int result;
- Tcl_Obj *method = Tcl_NewStringObj(methodName, -1);
+ Tcl_Obj *methodObj = Tcl_NewStringObj(methodName, -1);
/* fprintf(stderr, "callConfigureMethod method %s->'%s' level %d, argc %d\n",
- objectName(obj), methodName, level, argc);*/
+ objectName(object), methodName, level, argc);*/
if (isInitString(methodName)) {
object->flags |= XOTCL_INIT_CALLED;
}
Tcl_ResetResult(interp);
- INCR_REF_COUNT(method);
- result = callMethod((ClientData)object, interp, method, argc, argv, XOTCL_CM_NO_UNKNOWN);
- DECR_REF_COUNT(method);
+ INCR_REF_COUNT(methodObj);
+ result = callMethod((ClientData)object, interp, methodObj, argc, argv, XOTCL_CM_NO_UNKNOWN);
+ DECR_REF_COUNT(methodObj);
/*fprintf(stderr, "method '%s' called args: %d o=%p, result=%d %d\n",
methodName, argc+1, obj, result, TCL_ERROR);*/
@@ -9576,7 +9573,7 @@
static int
ArgumentError(Tcl_Interp *interp, CONST char *errorMsg, XOTclParam CONST *paramPtr,
- Tcl_Obj *cmdNameObj, Tcl_Obj *methodNameObj) {
+ Tcl_Obj *cmdNameObj, Tcl_Obj *methodObj) {
Tcl_Obj *argStringObj = Tcl_NewStringObj("", 0);
XOTclParam CONST *pPtr;
@@ -9595,7 +9592,7 @@
Tcl_AppendToObj(argStringObj, "?", 1);
}
}
- XOTclObjWrongArgs(interp, errorMsg, cmdNameObj, methodNameObj, ObjStr(argStringObj));
+ XOTclObjWrongArgs(interp, errorMsg, cmdNameObj, methodObj, ObjStr(argStringObj));
DECR_REF_COUNT(argStringObj);
return TCL_ERROR;
}
@@ -9615,7 +9612,6 @@
*outObjPtr = Tcl_NewListObj(0, NULL);
INCR_REF_COUNT(*outObjPtr);
- /* TODO where is DECR */
for (i=0; iname == '-') {
int p, found;
- char *objStr;
+ CONST char *objStr;
/*
* We expect now a non-positional (named) parameter, starting
* with a "-"; such arguments can be given in an arbitrary order
@@ -10927,7 +10923,7 @@
{-argName "value" -required 0 -type tclobj}
}
*/
-static int XOTclConfigureCmd(Tcl_Interp *interp, int configureoption, Tcl_Obj *value) {
+static int XOTclConfigureCmd(Tcl_Interp *interp, int configureoption, Tcl_Obj *valueObj) {
int bool;
if (configureoption == ConfigureoptionObjectsystemsIdx) {
@@ -10944,8 +10940,8 @@
return TCL_OK;
}
- if (value) {
- int result = Tcl_GetBooleanFromObj(interp, value, &bool);
+ if (valueObj) {
+ int result = Tcl_GetBooleanFromObj(interp, valueObj, &bool);
if (result != TCL_OK)
return result;
}
@@ -10954,14 +10950,14 @@
case ConfigureoptionFilterIdx:
Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
(RUNTIME_STATE(interp)->doFilters));
- if (value)
+ if (valueObj)
RUNTIME_STATE(interp)->doFilters = bool;
break;
case ConfigureoptionSoftrecreateIdx:
Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
(RUNTIME_STATE(interp)->doSoftrecreate));
- if (value)
+ if (valueObj)
RUNTIME_STATE(interp)->doSoftrecreate = bool;
break;
}
@@ -11233,19 +11229,19 @@
*/
static int XOTclForwardCmd(Tcl_Interp *interp,
XOTclObject *object, int withPer_object,
- Tcl_Obj *method,
+ Tcl_Obj *methodObj,
Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withMethodprefix,
int withObjscope, Tcl_Obj *withOnerror, int withVerbose,
Tcl_Obj *target, int nobjc, Tcl_Obj *CONST nobjv[]) {
ForwardCmdClientData *tcd = NULL;
int result;
- result = forwardProcessOptions(interp, method,
+ result = forwardProcessOptions(interp, methodObj,
withDefault, withEarlybinding, withMethodprefix,
withObjscope, withOnerror, withVerbose,
target, nobjc, nobjv, &tcd);
if (result == TCL_OK) {
- CONST char *methodName = NSTail(ObjStr(method));
+ CONST char *methodName = NSTail(ObjStr(methodObj));
XOTclClass *cl =
(withPer_object || ! XOTclObjectIsClass(object)) ?
NULL : (XOTclClass *)object;
@@ -11350,7 +11346,7 @@
{-argName "arg" -required 0 -type tclobj}
}
*/
-static int XOTclIsCmd(Tcl_Interp *interp, Tcl_Obj *value, Tcl_Obj *constraintObj,
+static int XOTclIsCmd(Tcl_Interp *interp, Tcl_Obj *valueObj, Tcl_Obj *constraintObj,
Tcl_Obj *withHasmixin, Tcl_Obj *withType, Tcl_Obj *arg) {
int result = TCL_OK, success;
CONST char *constraintString = ObjStr(constraintObj);
@@ -11359,7 +11355,7 @@
if (isTypeString(constraintString)) {
if (arg== NULL) return XOTclObjErrArgCnt(interp, NULL, NULL, "type