Index: generic/gentclAPI.tcl =================================================================== diff -u -rc942f4e117d2aa3c8594702e0476a3f73a4147df -r66c24900b6a07a0cac4a28251c492bd3a05ec8e7 --- generic/gentclAPI.tcl (.../gentclAPI.tcl) (revision c942f4e117d2aa3c8594702e0476a3f73a4147df) +++ generic/gentclAPI.tcl (.../gentclAPI.tcl) (revision 66c24900b6a07a0cac4a28251c492bd3a05ec8e7) @@ -115,7 +115,7 @@ set type "int " if {$(-nrargs) == 1} { switch -glob $(-type) { - "" {set type "char *"} + "" {set type "CONST char *"} "class" {set type "XOTclClass *"} "object" {set type "XOTclObject *"} "tclobj" {set type "Tcl_Obj *"} @@ -127,7 +127,7 @@ set varName $(-argName) set calledArg $varName switch -glob $(-type) { - "" {set type "char *"} + "" {set type "CONST char *"} "boolean" {set type "int "} "class" {set type "XOTclClass *"} "object" {set type "XOTclObject *"} @@ -148,9 +148,9 @@ } "objpattern" { set type "Tcl_Obj *" - lappend c "char *${varName}String = NULL;" "XOTclObject *${varName}Obj = NULL;" + lappend c "CONST char *${varName}String = NULL;" "XOTclObject *${varName}Obj = NULL;" set calledArg "${varName}String, ${varName}Obj" - lappend if "char *${varName}String" "XOTclObject *${varName}Obj" + lappend if "CONST char *${varName}String" "XOTclObject *${varName}Obj" set ifSet 1 append pre [subst -nocommands { if (getMatchObject(interp, ${varName}, objv[$i], &${varName}Obj, &${varName}String) == -1) { @@ -277,7 +277,7 @@ puts $::converter puts { typedef struct { - char *methodName; + CONST char *methodName; Tcl_ObjCmdProc *proc; int nrParameters; XOTclParam paramDefs[12]; @@ -288,7 +288,7 @@ XOTclParam CONST *paramPtr, int nrParameters, parseContext *pc); static int getMatchObject(Tcl_Interp *interp, Tcl_Obj *patternObj, Tcl_Obj *origObj, - XOTclObject **matchObject, char **pattern); + XOTclObject **matchObject, CONST char **pattern); /* just to define the symbol */ static methodDefinition method_definitions[]; @@ -301,7 +301,7 @@ lappend namespaces "\"$value\"" } set namespaceString [join $namespaces ",\n "] - puts "static char *method_command_namespace_names\[\] = {\n $namespaceString\n};" + puts "static CONST char *method_command_namespace_names\[\] = {\n $namespaceString\n};" puts $stubDecls puts $decls set enumString [join $enums ",\n "] Index: generic/tclAPI.h =================================================================== diff -u -r1f1067f1a36bee1c928bb28c5284f53bf422c6dd -r66c24900b6a07a0cac4a28251c492bd3a05ec8e7 --- generic/tclAPI.h (.../tclAPI.h) (revision 1f1067f1a36bee1c928bb28c5284f53bf422c6dd) +++ generic/tclAPI.h (.../tclAPI.h) (revision 66c24900b6a07a0cac4a28251c492bd3a05ec8e7) @@ -122,7 +122,7 @@ typedef struct { - char *methodName; + CONST char *methodName; Tcl_ObjCmdProc *proc; int nrParameters; XOTclParam paramDefs[12]; @@ -133,12 +133,12 @@ XOTclParam CONST *paramPtr, int nrParameters, parseContext *pc); static int getMatchObject(Tcl_Interp *interp, Tcl_Obj *patternObj, Tcl_Obj *origObj, - XOTclObject **matchObject, char **pattern); + XOTclObject **matchObject, CONST char **pattern); /* just to define the symbol */ static methodDefinition method_definitions[]; -static char *method_command_namespace_names[] = { +static CONST char *method_command_namespace_names[] = { "::xotcl::cmd::ObjectInfo", "::xotcl::cmd::Object", "::xotcl::cmd::ClassInfo", @@ -227,72 +227,72 @@ static int XOTclSetterCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclCAllocMethod(Tcl_Interp *interp, XOTclClass *cl, Tcl_Obj *name); -static int XOTclCCreateMethod(Tcl_Interp *interp, XOTclClass *cl, char *name, int objc, Tcl_Obj *CONST objv[]); +static int XOTclCCreateMethod(Tcl_Interp *interp, XOTclClass *cl, CONST char *name, int objc, Tcl_Obj *CONST objv[]); static int XOTclCDeallocMethod(Tcl_Interp *interp, XOTclClass *cl, Tcl_Obj *object); -static int XOTclCFilterGuardMethod(Tcl_Interp *interp, XOTclClass *cl, char *filter, Tcl_Obj *guard); +static int XOTclCFilterGuardMethod(Tcl_Interp *interp, XOTclClass *cl, CONST char *filter, Tcl_Obj *guard); static int XOTclCInvalidateObjectParameterMethod(Tcl_Interp *interp, XOTclClass *cl); -static int XOTclCMixinGuardMethod(Tcl_Interp *interp, XOTclClass *cl, char *mixin, Tcl_Obj *guard); +static int XOTclCMixinGuardMethod(Tcl_Interp *interp, XOTclClass *cl, CONST char *mixin, Tcl_Obj *guard); static int XOTclCNewMethod(Tcl_Interp *interp, XOTclClass *cl, XOTclObject *withChildof, int nobjc, Tcl_Obj *CONST nobjv[]); static int XOTclCRecreateMethod(Tcl_Interp *interp, XOTclClass *cl, Tcl_Obj *name, int objc, Tcl_Obj *CONST objv[]); -static int XOTclClassInfoFilterMethod(Tcl_Interp *interp, XOTclClass *class, int withGuards, char *pattern); -static int XOTclClassInfoFilterguardMethod(Tcl_Interp *interp, XOTclClass *class, char *filter); -static int XOTclClassInfoForwardMethod(Tcl_Interp *interp, XOTclClass *class, int withDefinition, char *name); -static int XOTclClassInfoHeritageMethod(Tcl_Interp *interp, XOTclClass *class, char *pattern); -static int XOTclClassInfoInstancesMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, char *patternString, XOTclObject *patternObj); -static int XOTclClassInfoMethodMethod(Tcl_Interp *interp, XOTclClass *class, int infomethodsubcmd, char *name); -static int XOTclClassInfoMethodsMethod(Tcl_Interp *interp, XOTclClass *object, int withMethodtype, int withCallprotection, int withNomixins, int withIncontext, char *pattern); -static int XOTclClassInfoMixinMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, int withGuards, char *patternString, XOTclObject *patternObj); -static int XOTclClassInfoMixinOfMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, int withScope, char *patternString, XOTclObject *patternObj); -static int XOTclClassInfoMixinguardMethod(Tcl_Interp *interp, XOTclClass *class, char *mixin); +static int XOTclClassInfoFilterMethod(Tcl_Interp *interp, XOTclClass *class, int withGuards, CONST char *pattern); +static int XOTclClassInfoFilterguardMethod(Tcl_Interp *interp, XOTclClass *class, CONST char *filter); +static int XOTclClassInfoForwardMethod(Tcl_Interp *interp, XOTclClass *class, int withDefinition, CONST char *name); +static int XOTclClassInfoHeritageMethod(Tcl_Interp *interp, XOTclClass *class, CONST char *pattern); +static int XOTclClassInfoInstancesMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, CONST char *patternString, XOTclObject *patternObj); +static int XOTclClassInfoMethodMethod(Tcl_Interp *interp, XOTclClass *class, int infomethodsubcmd, CONST char *name); +static int XOTclClassInfoMethodsMethod(Tcl_Interp *interp, XOTclClass *object, int withMethodtype, int withCallprotection, int withNomixins, int withIncontext, CONST char *pattern); +static int XOTclClassInfoMixinMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, int withGuards, CONST char *patternString, XOTclObject *patternObj); +static int XOTclClassInfoMixinOfMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, int withScope, CONST char *patternString, XOTclObject *patternObj); +static int XOTclClassInfoMixinguardMethod(Tcl_Interp *interp, XOTclClass *class, CONST char *mixin); static int XOTclClassInfoParameterMethod(Tcl_Interp *interp, XOTclClass *class); static int XOTclClassInfoSlotsMethod(Tcl_Interp *interp, XOTclClass *class); -static int XOTclClassInfoSubclassMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, char *patternString, XOTclObject *patternObj); +static int XOTclClassInfoSubclassMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, CONST char *patternString, XOTclObject *patternObj); static int XOTclClassInfoSuperclassMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, Tcl_Obj *pattern); -static int XOTclObjInfoCallableMethod(Tcl_Interp *interp, XOTclObject *object, int withWhich, int withMethodtype, int withCallprotection, int withApplication, int withNomixins, int withIncontext, char *pattern); -static int XOTclObjInfoChildrenMethod(Tcl_Interp *interp, XOTclObject *object, char *pattern); +static int XOTclObjInfoCallableMethod(Tcl_Interp *interp, XOTclObject *object, int withWhich, int withMethodtype, int withCallprotection, int withApplication, int withNomixins, int withIncontext, CONST char *pattern); +static int XOTclObjInfoChildrenMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *pattern); static int XOTclObjInfoClassMethod(Tcl_Interp *interp, XOTclObject *object); -static int XOTclObjInfoFilterMethod(Tcl_Interp *interp, XOTclObject *object, int withOrder, int withGuards, char *pattern); -static int XOTclObjInfoFilterguardMethod(Tcl_Interp *interp, XOTclObject *object, char *filter); -static int XOTclObjInfoForwardMethod(Tcl_Interp *interp, XOTclObject *object, int withDefinition, char *name); +static int XOTclObjInfoFilterMethod(Tcl_Interp *interp, XOTclObject *object, int withOrder, int withGuards, CONST char *pattern); +static int XOTclObjInfoFilterguardMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *filter); +static int XOTclObjInfoForwardMethod(Tcl_Interp *interp, XOTclObject *object, int withDefinition, CONST char *name); static int XOTclObjInfoHasnamespaceMethod(Tcl_Interp *interp, XOTclObject *object); -static int XOTclObjInfoMethodMethod(Tcl_Interp *interp, XOTclObject *object, int infomethodsubcmd, char *name); -static int XOTclObjInfoMethodsMethod(Tcl_Interp *interp, XOTclObject *object, int withMethodtype, int withCallprotection, int withNomixins, int withIncontext, char *pattern); -static int XOTclObjInfoMixinMethod(Tcl_Interp *interp, XOTclObject *object, int withGuards, int withOrder, char *patternString, XOTclObject *patternObj); -static int XOTclObjInfoMixinguardMethod(Tcl_Interp *interp, XOTclObject *object, char *mixin); +static int XOTclObjInfoMethodMethod(Tcl_Interp *interp, XOTclObject *object, int infomethodsubcmd, CONST char *name); +static int XOTclObjInfoMethodsMethod(Tcl_Interp *interp, XOTclObject *object, int withMethodtype, int withCallprotection, int withNomixins, int withIncontext, CONST char *pattern); +static int XOTclObjInfoMixinMethod(Tcl_Interp *interp, XOTclObject *object, int withGuards, int withOrder, CONST char *patternString, XOTclObject *patternObj); +static int XOTclObjInfoMixinguardMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *mixin); static int XOTclObjInfoParentMethod(Tcl_Interp *interp, XOTclObject *object); -static int XOTclObjInfoPrecedenceMethod(Tcl_Interp *interp, XOTclObject *object, int withIntrinsic, char *pattern); -static int XOTclObjInfoSlotObjectsMethod(Tcl_Interp *interp, XOTclObject *object, char *pattern); -static int XOTclObjInfoVarsMethod(Tcl_Interp *interp, XOTclObject *object, char *pattern); +static int XOTclObjInfoPrecedenceMethod(Tcl_Interp *interp, XOTclObject *object, int withIntrinsic, CONST char *pattern); +static int XOTclObjInfoSlotObjectsMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *pattern); +static int XOTclObjInfoVarsMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *pattern); static int XOTclOAutonameMethod(Tcl_Interp *interp, XOTclObject *obj, int withInstance, int withReset, Tcl_Obj *name); static int XOTclOCleanupMethod(Tcl_Interp *interp, XOTclObject *obj); static int XOTclOConfigureMethod(Tcl_Interp *interp, XOTclObject *obj, int objc, Tcl_Obj *CONST objv[]); static int XOTclODestroyMethod(Tcl_Interp *interp, XOTclObject *obj); -static int XOTclOExistsMethod(Tcl_Interp *interp, XOTclObject *obj, char *var); -static int XOTclOFilterGuardMethod(Tcl_Interp *interp, XOTclObject *obj, char *filter, Tcl_Obj *guard); -static int XOTclOFilterSearchMethod(Tcl_Interp *interp, XOTclObject *obj, char *filter); +static int XOTclOExistsMethod(Tcl_Interp *interp, XOTclObject *obj, CONST char *var); +static int XOTclOFilterGuardMethod(Tcl_Interp *interp, XOTclObject *obj, CONST char *filter, Tcl_Obj *guard); +static int XOTclOFilterSearchMethod(Tcl_Interp *interp, XOTclObject *obj, CONST char *filter); static int XOTclOInstVarMethod(Tcl_Interp *interp, XOTclObject *obj, int objc, Tcl_Obj *CONST objv[]); -static int XOTclOMixinGuardMethod(Tcl_Interp *interp, XOTclObject *obj, char *mixin, Tcl_Obj *guard); +static int XOTclOMixinGuardMethod(Tcl_Interp *interp, XOTclObject *obj, CONST char *mixin, Tcl_Obj *guard); static int XOTclONextMethod(Tcl_Interp *interp, XOTclObject *obj, int objc, Tcl_Obj *CONST objv[]); static int XOTclONoinitMethod(Tcl_Interp *interp, XOTclObject *obj); static int XOTclORequireNamespaceMethod(Tcl_Interp *interp, XOTclObject *obj); static int XOTclOResidualargsMethod(Tcl_Interp *interp, XOTclObject *obj, int objc, Tcl_Obj *CONST objv[]); static int XOTclOUplevelMethod(Tcl_Interp *interp, XOTclObject *obj, int objc, Tcl_Obj *CONST objv[]); static int XOTclOUpvarMethod(Tcl_Interp *interp, XOTclObject *obj, int objc, Tcl_Obj *CONST objv[]); static int XOTclOVolatileMethod(Tcl_Interp *interp, XOTclObject *obj); -static int XOTclOVwaitMethod(Tcl_Interp *interp, XOTclObject *obj, char *varname); -static int XOTclAliasCmd(Tcl_Interp *interp, XOTclObject *object, int withPer_object, char *methodName, int withNonleaf, int withObjscope, Tcl_Obj *cmdName); +static int XOTclOVwaitMethod(Tcl_Interp *interp, XOTclObject *obj, CONST char *varname); +static int XOTclAliasCmd(Tcl_Interp *interp, XOTclObject *object, int withPer_object, CONST char *methodName, int withNonleaf, int withObjscope, Tcl_Obj *cmdName); static int XOTclAssertionCmd(Tcl_Interp *interp, XOTclObject *object, int assertionsubcmd, Tcl_Obj *arg); static int XOTclColonCmd(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); static int XOTclConfigureCmd(Tcl_Interp *interp, int configureoption, Tcl_Obj *value); static int XOTclCreateObjectSystemCmd(Tcl_Interp *interp, Tcl_Obj *rootClass, Tcl_Obj *rootMetaClass); static int XOTclCurrentCmd(Tcl_Interp *interp, int currentoption); -static int XOTclDeprecatedCmd(Tcl_Interp *interp, char *what, char *oldCmd, char *newCmd); +static int XOTclDeprecatedCmd(Tcl_Interp *interp, CONST char *what, CONST char *oldCmd, CONST char *newCmd); static int XOTclDispatchCmd(Tcl_Interp *interp, XOTclObject *object, int withObjscope, Tcl_Obj *command, int nobjc, Tcl_Obj *CONST nobjv[]); -static int XOTclExistsVarCmd(Tcl_Interp *interp, XOTclObject *object, char *var); +static int XOTclExistsVarCmd(Tcl_Interp *interp, XOTclObject *object, CONST char *var); static int XOTclFinalizeObjCmd(Tcl_Interp *interp); static int XOTclForwardCmd(Tcl_Interp *interp, XOTclObject *object, int withPer_object, Tcl_Obj *method, Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withMethodprefix, int withObjscope, Tcl_Obj *withOnerror, int withVerbose, Tcl_Obj *target, int nobjc, Tcl_Obj *CONST nobjv[]); static int XOTclImportvarCmd(Tcl_Interp *interp, XOTclObject *object, int nobjc, Tcl_Obj *CONST nobjv[]); -static int XOTclInterpObjCmd(Tcl_Interp *interp, char *name, int objc, Tcl_Obj *CONST objv[]); +static int XOTclInterpObjCmd(Tcl_Interp *interp, CONST char *name, int objc, Tcl_Obj *CONST objv[]); static int XOTclIsCmd(Tcl_Interp *interp, Tcl_Obj *value, Tcl_Obj *constraint, Tcl_Obj *withHasmixin, Tcl_Obj *withType, Tcl_Obj *arg); static int XOTclMethodCmd(Tcl_Interp *interp, XOTclObject *object, int withInner_namespace, int withPer_object, int withPublic, Tcl_Obj *name, Tcl_Obj *args, Tcl_Obj *body, Tcl_Obj *withPrecondition, Tcl_Obj *withPostcondition); static int XOTclMethodPropertyCmd(Tcl_Interp *interp, XOTclObject *object, int withPer_object, Tcl_Obj *methodName, int methodproperty, Tcl_Obj *value); @@ -421,7 +421,7 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - char *name = (char *)pc.clientData[0]; + CONST char *name = (CONST char *)pc.clientData[0]; parseContextRelease(&pc); return XOTclCCreateMethod(interp, cl, name, objc, objv); @@ -459,7 +459,7 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - char *filter = (char *)pc.clientData[0]; + CONST char *filter = (CONST char *)pc.clientData[0]; Tcl_Obj *guard = (Tcl_Obj *)pc.clientData[1]; parseContextRelease(&pc); @@ -498,7 +498,7 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - char *mixin = (char *)pc.clientData[0]; + CONST char *mixin = (CONST char *)pc.clientData[0]; Tcl_Obj *guard = (Tcl_Obj *)pc.clientData[1]; parseContextRelease(&pc); @@ -557,7 +557,7 @@ } else { XOTclClass *class = (XOTclClass *)pc.clientData[0]; int withGuards = (int )PTR2INT(pc.clientData[1]); - char *pattern = (char *)pc.clientData[2]; + CONST char *pattern = (CONST char *)pc.clientData[2]; parseContextRelease(&pc); return XOTclClassInfoFilterMethod(interp, class, withGuards, pattern); @@ -576,7 +576,7 @@ return TCL_ERROR; } else { XOTclClass *class = (XOTclClass *)pc.clientData[0]; - char *filter = (char *)pc.clientData[1]; + CONST char *filter = (CONST char *)pc.clientData[1]; parseContextRelease(&pc); return XOTclClassInfoFilterguardMethod(interp, class, filter); @@ -596,7 +596,7 @@ } else { XOTclClass *class = (XOTclClass *)pc.clientData[0]; int withDefinition = (int )PTR2INT(pc.clientData[1]); - char *name = (char *)pc.clientData[2]; + CONST char *name = (CONST char *)pc.clientData[2]; parseContextRelease(&pc); return XOTclClassInfoForwardMethod(interp, class, withDefinition, name); @@ -615,7 +615,7 @@ return TCL_ERROR; } else { XOTclClass *class = (XOTclClass *)pc.clientData[0]; - char *pattern = (char *)pc.clientData[1]; + CONST char *pattern = (CONST char *)pc.clientData[1]; parseContextRelease(&pc); return XOTclClassInfoHeritageMethod(interp, class, pattern); @@ -635,7 +635,7 @@ } else { XOTclClass *class = (XOTclClass *)pc.clientData[0]; int withClosure = (int )PTR2INT(pc.clientData[1]); - char *patternString = NULL; + CONST char *patternString = NULL; XOTclObject *patternObj = NULL; Tcl_Obj *pattern = (Tcl_Obj *)pc.clientData[2]; int returnCode; @@ -669,7 +669,7 @@ } else { XOTclClass *class = (XOTclClass *)pc.clientData[0]; int infomethodsubcmd = (int )PTR2INT(pc.clientData[1]); - char *name = (char *)pc.clientData[2]; + CONST char *name = (CONST char *)pc.clientData[2]; parseContextRelease(&pc); return XOTclClassInfoMethodMethod(interp, class, infomethodsubcmd, name); @@ -692,7 +692,7 @@ int withCallprotection = (int )PTR2INT(pc.clientData[2]); int withNomixins = (int )PTR2INT(pc.clientData[3]); int withIncontext = (int )PTR2INT(pc.clientData[4]); - char *pattern = (char *)pc.clientData[5]; + CONST char *pattern = (CONST char *)pc.clientData[5]; parseContextRelease(&pc); return XOTclClassInfoMethodsMethod(interp, object, withMethodtype, withCallprotection, withNomixins, withIncontext, pattern); @@ -713,7 +713,7 @@ XOTclClass *class = (XOTclClass *)pc.clientData[0]; int withClosure = (int )PTR2INT(pc.clientData[1]); int withGuards = (int )PTR2INT(pc.clientData[2]); - char *patternString = NULL; + CONST char *patternString = NULL; XOTclObject *patternObj = NULL; Tcl_Obj *pattern = (Tcl_Obj *)pc.clientData[3]; int returnCode; @@ -748,7 +748,7 @@ XOTclClass *class = (XOTclClass *)pc.clientData[0]; int withClosure = (int )PTR2INT(pc.clientData[1]); int withScope = (int )PTR2INT(pc.clientData[2]); - char *patternString = NULL; + CONST char *patternString = NULL; XOTclObject *patternObj = NULL; Tcl_Obj *pattern = (Tcl_Obj *)pc.clientData[3]; int returnCode; @@ -781,7 +781,7 @@ return TCL_ERROR; } else { XOTclClass *class = (XOTclClass *)pc.clientData[0]; - char *mixin = (char *)pc.clientData[1]; + CONST char *mixin = (CONST char *)pc.clientData[1]; parseContextRelease(&pc); return XOTclClassInfoMixinguardMethod(interp, class, mixin); @@ -837,7 +837,7 @@ } else { XOTclClass *class = (XOTclClass *)pc.clientData[0]; int withClosure = (int )PTR2INT(pc.clientData[1]); - char *patternString = NULL; + CONST char *patternString = NULL; XOTclObject *patternObj = NULL; Tcl_Obj *pattern = (Tcl_Obj *)pc.clientData[2]; int returnCode; @@ -896,7 +896,7 @@ int withApplication = (int )PTR2INT(pc.clientData[4]); int withNomixins = (int )PTR2INT(pc.clientData[5]); int withIncontext = (int )PTR2INT(pc.clientData[6]); - char *pattern = (char *)pc.clientData[7]; + CONST char *pattern = (CONST char *)pc.clientData[7]; parseContextRelease(&pc); return XOTclObjInfoCallableMethod(interp, object, withWhich, withMethodtype, withCallprotection, withApplication, withNomixins, withIncontext, pattern); @@ -915,7 +915,7 @@ return TCL_ERROR; } else { XOTclObject *object = (XOTclObject *)pc.clientData[0]; - char *pattern = (char *)pc.clientData[1]; + CONST char *pattern = (CONST char *)pc.clientData[1]; parseContextRelease(&pc); return XOTclObjInfoChildrenMethod(interp, object, pattern); @@ -954,7 +954,7 @@ XOTclObject *object = (XOTclObject *)pc.clientData[0]; int withOrder = (int )PTR2INT(pc.clientData[1]); int withGuards = (int )PTR2INT(pc.clientData[2]); - char *pattern = (char *)pc.clientData[3]; + CONST char *pattern = (CONST char *)pc.clientData[3]; parseContextRelease(&pc); return XOTclObjInfoFilterMethod(interp, object, withOrder, withGuards, pattern); @@ -973,7 +973,7 @@ return TCL_ERROR; } else { XOTclObject *object = (XOTclObject *)pc.clientData[0]; - char *filter = (char *)pc.clientData[1]; + CONST char *filter = (CONST char *)pc.clientData[1]; parseContextRelease(&pc); return XOTclObjInfoFilterguardMethod(interp, object, filter); @@ -993,7 +993,7 @@ } else { XOTclObject *object = (XOTclObject *)pc.clientData[0]; int withDefinition = (int )PTR2INT(pc.clientData[1]); - char *name = (char *)pc.clientData[2]; + CONST char *name = (CONST char *)pc.clientData[2]; parseContextRelease(&pc); return XOTclObjInfoForwardMethod(interp, object, withDefinition, name); @@ -1031,7 +1031,7 @@ } else { XOTclObject *object = (XOTclObject *)pc.clientData[0]; int infomethodsubcmd = (int )PTR2INT(pc.clientData[1]); - char *name = (char *)pc.clientData[2]; + CONST char *name = (CONST char *)pc.clientData[2]; parseContextRelease(&pc); return XOTclObjInfoMethodMethod(interp, object, infomethodsubcmd, name); @@ -1054,7 +1054,7 @@ int withCallprotection = (int )PTR2INT(pc.clientData[2]); int withNomixins = (int )PTR2INT(pc.clientData[3]); int withIncontext = (int )PTR2INT(pc.clientData[4]); - char *pattern = (char *)pc.clientData[5]; + CONST char *pattern = (CONST char *)pc.clientData[5]; parseContextRelease(&pc); return XOTclObjInfoMethodsMethod(interp, object, withMethodtype, withCallprotection, withNomixins, withIncontext, pattern); @@ -1075,7 +1075,7 @@ XOTclObject *object = (XOTclObject *)pc.clientData[0]; int withGuards = (int )PTR2INT(pc.clientData[1]); int withOrder = (int )PTR2INT(pc.clientData[2]); - char *patternString = NULL; + CONST char *patternString = NULL; XOTclObject *patternObj = NULL; Tcl_Obj *pattern = (Tcl_Obj *)pc.clientData[3]; int returnCode; @@ -1108,7 +1108,7 @@ return TCL_ERROR; } else { XOTclObject *object = (XOTclObject *)pc.clientData[0]; - char *mixin = (char *)pc.clientData[1]; + CONST char *mixin = (CONST char *)pc.clientData[1]; parseContextRelease(&pc); return XOTclObjInfoMixinguardMethod(interp, object, mixin); @@ -1146,7 +1146,7 @@ } else { XOTclObject *object = (XOTclObject *)pc.clientData[0]; int withIntrinsic = (int )PTR2INT(pc.clientData[1]); - char *pattern = (char *)pc.clientData[2]; + CONST char *pattern = (CONST char *)pc.clientData[2]; parseContextRelease(&pc); return XOTclObjInfoPrecedenceMethod(interp, object, withIntrinsic, pattern); @@ -1165,7 +1165,7 @@ return TCL_ERROR; } else { XOTclObject *object = (XOTclObject *)pc.clientData[0]; - char *pattern = (char *)pc.clientData[1]; + CONST char *pattern = (CONST char *)pc.clientData[1]; parseContextRelease(&pc); return XOTclObjInfoSlotObjectsMethod(interp, object, pattern); @@ -1184,7 +1184,7 @@ return TCL_ERROR; } else { XOTclObject *object = (XOTclObject *)pc.clientData[0]; - char *pattern = (char *)pc.clientData[1]; + CONST char *pattern = (CONST char *)pc.clientData[1]; parseContextRelease(&pc); return XOTclObjInfoVarsMethod(interp, object, pattern); @@ -1272,7 +1272,7 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - char *var = (char *)pc.clientData[0]; + CONST char *var = (CONST char *)pc.clientData[0]; parseContextRelease(&pc); return XOTclOExistsMethod(interp, obj, var); @@ -1291,7 +1291,7 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - char *filter = (char *)pc.clientData[0]; + CONST char *filter = (CONST char *)pc.clientData[0]; Tcl_Obj *guard = (Tcl_Obj *)pc.clientData[1]; parseContextRelease(&pc); @@ -1311,7 +1311,7 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - char *filter = (char *)pc.clientData[0]; + CONST char *filter = (CONST char *)pc.clientData[0]; parseContextRelease(&pc); return XOTclOFilterSearchMethod(interp, obj, filter); @@ -1340,7 +1340,7 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - char *mixin = (char *)pc.clientData[0]; + CONST char *mixin = (CONST char *)pc.clientData[0]; Tcl_Obj *guard = (Tcl_Obj *)pc.clientData[1]; parseContextRelease(&pc); @@ -1457,7 +1457,7 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - char *varname = (char *)pc.clientData[0]; + CONST char *varname = (CONST char *)pc.clientData[0]; parseContextRelease(&pc); return XOTclOVwaitMethod(interp, obj, varname); @@ -1477,7 +1477,7 @@ } else { XOTclObject *object = (XOTclObject *)pc.clientData[0]; int withPer_object = (int )PTR2INT(pc.clientData[1]); - char *methodName = (char *)pc.clientData[2]; + CONST char *methodName = (CONST char *)pc.clientData[2]; int withNonleaf = (int )PTR2INT(pc.clientData[3]); int withObjscope = (int )PTR2INT(pc.clientData[4]); Tcl_Obj *cmdName = (Tcl_Obj *)pc.clientData[5]; @@ -1583,9 +1583,9 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - char *what = (char *)pc.clientData[0]; - char *oldCmd = (char *)pc.clientData[1]; - char *newCmd = (char *)pc.clientData[2]; + CONST char *what = (CONST char *)pc.clientData[0]; + CONST char *oldCmd = (CONST char *)pc.clientData[1]; + CONST char *newCmd = (CONST char *)pc.clientData[2]; parseContextRelease(&pc); return XOTclDeprecatedCmd(interp, what, oldCmd, newCmd); @@ -1624,7 +1624,7 @@ return TCL_ERROR; } else { XOTclObject *object = (XOTclObject *)pc.clientData[0]; - char *var = (char *)pc.clientData[1]; + CONST char *var = (CONST char *)pc.clientData[1]; parseContextRelease(&pc); return XOTclExistsVarCmd(interp, object, var); @@ -1705,7 +1705,7 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - char *name = (char *)pc.clientData[0]; + CONST char *name = (CONST char *)pc.clientData[0]; parseContextRelease(&pc); return XOTclInterpObjCmd(interp, name, objc, objv); Index: generic/xotcl.c =================================================================== diff -u -r1f1067f1a36bee1c928bb28c5284f53bf422c6dd -r66c24900b6a07a0cac4a28251c492bd3a05ec8e7 --- generic/xotcl.c (.../xotcl.c) (revision 1f1067f1a36bee1c928bb28c5284f53bf422c6dd) +++ generic/xotcl.c (.../xotcl.c) (revision 66c24900b6a07a0cac4a28251c492bd3a05ec8e7) @@ -78,14 +78,14 @@ int XOTclObjWrongArgs(Tcl_Interp *interp, char *msg, Tcl_Obj *cmdName, Tcl_Obj *methodName, char *arglist); -static int XOTclDeprecatedCmd(Tcl_Interp *interp, char *what, char *oldCmd, char *newCmd); +static int XOTclDeprecatedCmd(Tcl_Interp *interp, CONST char *what, CONST char *oldCmd, CONST char *newCmd); /* maybe move to stubs? */ -static int createMethod(Tcl_Interp *interp, XOTclClass *cl, char *name, int objc, Tcl_Obj *CONST objv[]); +static int createMethod(Tcl_Interp *interp, XOTclClass *cl, CONST char *name, int objc, Tcl_Obj *CONST objv[]); -static Tcl_Obj *NameInNamespaceObj(Tcl_Interp *interp, char *name, Tcl_Namespace *ns); +static Tcl_Obj *NameInNamespaceObj(Tcl_Interp *interp, CONST char *name, Tcl_Namespace *ns); static Tcl_Namespace *callingNameSpace(Tcl_Interp *interp); -XOTCLINLINE static Tcl_Command NSFindCommand(Tcl_Interp *interp, char *name, Tcl_Namespace *ns); +XOTCLINLINE static Tcl_Command NSFindCommand(Tcl_Interp *interp, CONST char *name, Tcl_Namespace *ns); #ifdef EXPERIMENTAL_CMD_RESOLVER static int NSisXOTclNamespace(Tcl_Namespace *nsPtr); #endif @@ -284,8 +284,8 @@ static int callDestroyMethod(Tcl_Interp *interp, XOTclObject *object, int flags); static int GetObjectFromObj(Tcl_Interp *interp, register Tcl_Obj *objPtr, XOTclObject **obj); -static XOTclObject *XOTclpGetObject(Tcl_Interp *interp, char *name); -static XOTclClass *XOTclpGetClass(Tcl_Interp *interp, char *name); +static XOTclObject *XOTclpGetObject(Tcl_Interp *interp, CONST char *name); +static XOTclClass *XOTclpGetClass(Tcl_Interp *interp, CONST char *name); #if !defined(NDEBUG) static void checkAllInstances(Tcl_Interp *interp, XOTclClass *startCl, int lvl); #endif @@ -974,7 +974,7 @@ } static Tcl_Obj * -NameInNamespaceObj(Tcl_Interp *interp, char *name, Tcl_Namespace *nsPtr) { +NameInNamespaceObj(Tcl_Interp *interp, CONST char *name, Tcl_Namespace *nsPtr) { Tcl_Obj *objName; int len; char *p; @@ -1967,7 +1967,7 @@ * if necessary create it. Return Var* if successful, otherwise 0 */ static Var * -NSRequireVariableOnObj(Tcl_Interp *interp, XOTclObject *object, char *name, int flgs) { +NSRequireVariableOnObj(Tcl_Interp *interp, XOTclObject *object, CONST char *name, int flgs) { XOTcl_FrameDecls; Var *varPtr, *arrayPtr; @@ -2188,7 +2188,7 @@ * to which they point. */ XOTCLINLINE static Tcl_Command -NSFindCommand(Tcl_Interp *interp, char *name, Tcl_Namespace *ns) { +NSFindCommand(Tcl_Interp *interp, CONST char *name, Tcl_Namespace *ns) { Tcl_Command cmd; if ((cmd = Tcl_FindCommand(interp, name, ns, 0))) { Tcl_Command importedCmd; @@ -2214,7 +2214,7 @@ * Find an object using a char *name */ static XOTclObject* -XOTclpGetObject(Tcl_Interp *interp, char *name) { +XOTclpGetObject(Tcl_Interp *interp, CONST char *name) { register Tcl_Command cmd; assert(name); /*fprintf(stderr, "XOTclpGetObject name = '%s'\n", name);*/ @@ -2238,12 +2238,12 @@ */ extern XOTcl_Class* -XOTclGetClass(Tcl_Interp *interp, char *name) { +XOTclGetClass(Tcl_Interp *interp, CONST char *name) { return (XOTcl_Class*)XOTclpGetClass(interp, name); } static XOTclClass* -XOTclpGetClass(Tcl_Interp *interp, char *name) { +XOTclpGetClass(Tcl_Interp *interp, CONST char *name) { XOTclObject *object = XOTclpGetObject(interp, name); return (object && XOTclObjectIsClass(object)) ? (XOTclClass*)object : NULL; } @@ -2749,7 +2749,7 @@ * for a simple Name */ static XOTclCmdList* -CmdListFindNameInList(Tcl_Interp *interp, char *name, XOTclCmdList *l) { +CmdListFindNameInList(Tcl_Interp *interp, CONST char *name, XOTclCmdList *l) { register XOTclCmdList *h; for (h = l; h; h = h->nextPtr) { CONST char *cmdName = Tcl_GetCommandName(interp, h->cmdPtr); @@ -2821,7 +2821,7 @@ } static XOTclProcAssertion* -AssertionFindProcs(XOTclAssertionStore *aStore, char *name) { +AssertionFindProcs(XOTclAssertionStore *aStore, CONST char *name) { Tcl_HashEntry *hPtr; if (aStore == NULL) return NULL; hPtr = XOTcl_FindHashEntry(&aStore->procs, name); @@ -3332,7 +3332,7 @@ * call AppendElement for matching values */ static void -AppendMatchingElement(Tcl_Interp *interp, Tcl_Obj *name, char *pattern) { +AppendMatchingElement(Tcl_Interp *interp, Tcl_Obj *name, CONST char *pattern) { char *string = ObjStr(name); if (!pattern || Tcl_StringMatch(string, pattern)) { Tcl_AppendElement(interp, string); @@ -3344,7 +3344,7 @@ */ static int AppendMatchingElementsFromCmdList(Tcl_Interp *interp, XOTclCmdList *cmdl, - char *pattern, XOTclObject *matchObject) { + CONST char *pattern, XOTclObject *matchObject) { int rc = 0; for ( ; cmdl; cmdl = cmdl->nextPtr) { XOTclObject *object = XOTclGetObjectFromCmdPtr(cmdl->cmdPtr); @@ -3364,7 +3364,7 @@ */ static int AppendMatchingElementsFromClasses(Tcl_Interp *interp, XOTclClasses *cls, - char *pattern, XOTclObject *matchObject) { + CONST char *pattern, XOTclObject *matchObject) { int rc = 0; for ( ; cls; cls = cls->nextPtr) { @@ -3418,7 +3418,7 @@ static int addToResultSet(Tcl_Interp *interp, Tcl_HashTable *destTable, XOTclObject *object, int *new, - int appendResult, char *pattern, XOTclObject *matchObject) { + int appendResult, CONST char *pattern, XOTclObject *matchObject) { Tcl_CreateHashEntry(destTable, (char *)object, new); if (*new) { if (matchObject && matchObject == object) { @@ -3438,7 +3438,7 @@ static int addToResultSetWithGuards(Tcl_Interp *interp, Tcl_HashTable *destTable, XOTclClass *cl, ClientData clientData, int *new, - int appendResult, char *pattern, XOTclObject *matchObject) { + int appendResult, CONST char *pattern, XOTclObject *matchObject) { Tcl_CreateHashEntry(destTable, (char *)cl, new); if (*new) { if (appendResult) { @@ -3467,7 +3467,7 @@ static int getAllObjectMixinsOf(Tcl_Interp *interp, Tcl_HashTable *destTable, XOTclClass *startCl, int isMixin, - int appendResult, char *pattern, XOTclObject *matchObject) { + int appendResult, CONST char *pattern, XOTclObject *matchObject) { int rc = 0, new = 0; XOTclClasses *sc; @@ -3532,7 +3532,7 @@ static int getAllClassMixinsOf(Tcl_Interp *interp, Tcl_HashTable *destTable, XOTclClass *startCl, int isMixin, - int appendResult, char *pattern, XOTclObject *matchObject) { + int appendResult, CONST char *pattern, XOTclObject *matchObject) { int rc = 0, new = 0; XOTclClass *cl; XOTclClasses *sc; @@ -3599,7 +3599,7 @@ static int getAllClassMixins(Tcl_Interp *interp, Tcl_HashTable *destTable, XOTclClass *startCl, - int withGuards, char *pattern, XOTclObject *matchObject) { + int withGuards, CONST char *pattern, XOTclObject *matchObject) { int rc = 0, new = 0; XOTclClass *cl; XOTclClasses *sc; @@ -3831,7 +3831,7 @@ } -static int MixinInfo(Tcl_Interp *interp, XOTclCmdList *m, char *pattern, +static int MixinInfo(Tcl_Interp *interp, XOTclCmdList *m, CONST char *pattern, int withGuards, XOTclObject *matchObject); /* * the mixin order is either @@ -3940,7 +3940,7 @@ * info option for mixins and classmixins */ static int -MixinInfo(Tcl_Interp *interp, XOTclCmdList *m, char *pattern, +MixinInfo(Tcl_Interp *interp, XOTclCmdList *m, CONST char *pattern, int withGuards, XOTclObject *matchObject) { Tcl_Obj *list = Tcl_NewListObj(0, NULL); XOTclClass *mixinClass; @@ -4284,7 +4284,7 @@ } static int -GuardList(Tcl_Interp *interp, XOTclCmdList *frl, char *interceptorName) { +GuardList(Tcl_Interp *interp, XOTclCmdList *frl, CONST char *interceptorName) { XOTclCmdList *h; if (frl) { /* try to find simple name first */ @@ -4505,7 +4505,7 @@ * fullProcQualifiers -> if not 0 => full names with obj/class method */ static int -FilterInfo(Tcl_Interp *interp, XOTclCmdList *f, char *pattern, +FilterInfo(Tcl_Interp *interp, XOTclCmdList *f, CONST char *pattern, int withGuards, int fullProcQualifiers) { CONST char *simpleName; Tcl_Obj *list = Tcl_NewListObj(0, NULL); @@ -6118,8 +6118,10 @@ #define NEW_STRING(target, p, l) target = ckalloc(l+1); strncpy(target, p, l); *((target)+l) = '\0' XOTCLINLINE static int -noMetaChars(char *pattern) { - register char c, *p = pattern; +noMetaChars(CONST char *pattern) { + register char c; + CONST char *p = pattern; + assert(pattern); for (c=*p; c; c = *++p) { if (c == '*' || c == '?' || c == '[') { @@ -6311,7 +6313,7 @@ static int convertToObjpattern(Tcl_Interp *interp, Tcl_Obj *objPtr, XOTclParam CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { Tcl_Obj *patternObj = objPtr; - char *pattern = ObjStr(objPtr); + CONST char *pattern = ObjStr(objPtr); if (noMetaChars(pattern)) { /* we have no meta characters, we try to check for an existing object */ @@ -6855,7 +6857,7 @@ static int getMatchObject(Tcl_Interp *interp, Tcl_Obj *patternObj, Tcl_Obj *origObj, - XOTclObject **matchObject, char **pattern) { + XOTclObject **matchObject, CONST char **pattern) { if (patternObj) { *pattern = ObjStr(patternObj); if (IsXOTclTclObj(interp, patternObj, matchObject)) { @@ -6985,7 +6987,7 @@ } static XOTclClasses * -ComputePrecedenceList(Tcl_Interp *interp, XOTclObject *object, char *pattern, +ComputePrecedenceList(Tcl_Interp *interp, XOTclObject *object, CONST char *pattern, int withMixins, int withRootClass) { XOTclClasses *precedenceList = NULL, *pcl, **npl = &precedenceList; @@ -7043,7 +7045,7 @@ static XOTclObjects * -computeSlotObjects(Tcl_Interp *interp, XOTclObject *object, char *pattern, int withRootClass) { +computeSlotObjects(Tcl_Interp *interp, XOTclObject *object, CONST char *pattern, int withRootClass) { XOTclObjects *slotObjects = NULL, **npl = &slotObjects; XOTclClasses *pl; XOTclObject *childObject, *tmpObject; @@ -9474,11 +9476,11 @@ } static int -createMethod(Tcl_Interp *interp, XOTclClass *cl, char *specifiedName, int objc, Tcl_Obj *CONST objv[]) { +createMethod(Tcl_Interp *interp, XOTclClass *cl, CONST char *specifiedName, int objc, Tcl_Obj *CONST objv[]) { XOTclObject *newObj = NULL; Tcl_Obj *nameObj, *tmpObj = NULL; int result; - char *objName = specifiedName; + CONST char *objName = specifiedName; ALLOC_ON_STACK(Tcl_Obj*, objc, tov); @@ -9982,7 +9984,7 @@ #if !defined(PRE85) || FORWARD_COMPATIBLE static int -ListVarKeys(Tcl_Interp *interp, Tcl_HashTable *tablePtr, char *pattern) { +ListVarKeys(Tcl_Interp *interp, Tcl_HashTable *tablePtr, CONST char *pattern) { Tcl_HashEntry *hPtr; if (pattern && noMetaChars(pattern)) { @@ -10037,7 +10039,7 @@ } static int -ListProcBody(Tcl_Interp *interp, Proc *procPtr, char *methodName) { +ListProcBody(Tcl_Interp *interp, Proc *procPtr, CONST char *methodName) { if (procPtr) { char *body = ObjStr(procPtr->bodyPtr); Tcl_SetObjResult(interp, Tcl_NewStringObj(StripBodyPrefix(body), -1)); @@ -10047,7 +10049,7 @@ } static int -ListCmdParams(Tcl_Interp *interp, Tcl_Command cmd, char *methodName, int withVarnames) { +ListCmdParams(Tcl_Interp *interp, Tcl_Command cmd, CONST char *methodName, int withVarnames) { Proc *procPtr = GetTclProcFromCommand(cmd); if (procPtr) { XOTclParamDefs *paramDefs = procPtr ? ParamDefsGet((Tcl_Command)procPtr->cmdPtr) : NULL; @@ -10156,8 +10158,8 @@ } static void -AppendMethodRegistration(Tcl_Interp *interp, Tcl_Obj *listObj, char *registerCmdName, - XOTclObject *object, char *methodName, Tcl_Command cmd, +AppendMethodRegistration(Tcl_Interp *interp, Tcl_Obj *listObj, CONST char *registerCmdName, + XOTclObject *object, CONST char *methodName, Tcl_Command cmd, int withObjscope, int withPer_object) { Tcl_ListObjAppendElement(interp, listObj, object->cmdName); if (withPer_object) { @@ -10184,7 +10186,7 @@ static int -ListMethod(Tcl_Interp *interp, XOTclObject *object, char *methodName, Tcl_Command cmd, +ListMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *methodName, Tcl_Command cmd, int subcmd, int withPer_object) { /*fprintf(stderr, "ListMethodtype %s %s %p subcmd %d per-object %d\n", @@ -10422,7 +10424,7 @@ } static int -ListMethodKeys(Tcl_Interp *interp, Tcl_HashTable *table, char *pattern, +ListMethodKeys(Tcl_Interp *interp, Tcl_HashTable *table, CONST char *pattern, int methodType, int withCallprotection, Tcl_HashTable *dups, XOTclObject *object, int withPer_object) { Tcl_HashSearch hSrch; @@ -10478,7 +10480,7 @@ } static int -ListChildren(Tcl_Interp *interp, XOTclObject *object, char *pattern, int classesOnly) { +ListChildren(Tcl_Interp *interp, XOTclObject *object, CONST char *pattern, int classesOnly) { XOTclObject *childObject; Tcl_HashTable *cmdTable; @@ -10526,7 +10528,7 @@ } static int -ListForward(Tcl_Interp *interp, Tcl_HashTable *table, char *pattern, int withDefinition) { +ListForward(Tcl_Interp *interp, Tcl_HashTable *table, CONST char *pattern, int withDefinition) { if (withDefinition) { Tcl_HashEntry *hPtr = table && pattern ? XOTcl_FindHashEntry(table, pattern) : 0; /* notice: we don't use pattern for wildcard matching here; @@ -10549,7 +10551,7 @@ } static int -ListDefinedMethods(Tcl_Interp *interp, XOTclObject *object, char *pattern, +ListDefinedMethods(Tcl_Interp *interp, XOTclObject *object, CONST char *pattern, int withPer_object, int methodType, int withCallproctection, int noMixins, int inContext) { Tcl_HashTable *cmdTable; @@ -10565,7 +10567,7 @@ } static int -ListCallableMethods(Tcl_Interp *interp, XOTclObject *object, char *pattern, +ListCallableMethods(Tcl_Interp *interp, XOTclObject *object, CONST char *pattern, int withPer_object, int methodType, int withCallprotection, int withApplication, int noMixins, int inContext) { XOTclClasses *pl; @@ -10632,7 +10634,7 @@ ListSuperclasses(Tcl_Interp *interp, XOTclClass *cl, Tcl_Obj *pattern, int withClosure) { XOTclObject *matchObject = NULL; Tcl_Obj *patternObj = NULL, *outObjPtr; - char *patternString = NULL; + CONST char *patternString = NULL; int rc; if (pattern && @@ -10733,7 +10735,7 @@ } */ static int XOTclAliasCmd(Tcl_Interp *interp, XOTclObject *object, int withPer_object, - char *methodName, int withNonleaf, int withObjscope, + CONST char *methodName, int withNonleaf, int withObjscope, Tcl_Obj *cmdName) { Tcl_ObjCmdProc *objProc, *newObjProc = NULL; Tcl_CmdDeleteProc *deleteProc = NULL; @@ -11031,7 +11033,7 @@ * optinal: give a new cmd */ static int -XOTclDeprecatedCmd(Tcl_Interp *interp, char *what, char *oldCmd, char *newCmd) { +XOTclDeprecatedCmd(Tcl_Interp *interp, CONST char *what, CONST char *oldCmd, CONST char *newCmd) { fprintf(stderr, "**\n**\n** The %s <%s> is deprecated.\n", what, oldCmd); if (newCmd) fprintf(stderr, "** Use <%s> instead.\n", newCmd); @@ -11170,7 +11172,7 @@ {-argName "var" -required 1} } */ -static int XOTclExistsVarCmd(Tcl_Interp *interp, XOTclObject *object, char *var) { +static int XOTclExistsVarCmd(Tcl_Interp *interp, XOTclObject *object, CONST char *var) { Tcl_SetIntObj(Tcl_GetObjResult(interp), varExists(interp, object, var, NULL, 1, 1)); return TCL_OK; } @@ -11313,7 +11315,7 @@ */ /* create a slave interp that calls XOTcl Init */ static int -XOTclInterpObjCmd(Tcl_Interp *interp, char *name, int objc, Tcl_Obj *CONST objv[]) { +XOTclInterpObjCmd(Tcl_Interp *interp, CONST char *name, int objc, Tcl_Obj *CONST objv[]) { Tcl_Interp *slave; /* create a fresh Tcl interpreter, or pass command to an existing one */ @@ -11936,7 +11938,7 @@ } */ static int XOTclQualifyObjCmd(Tcl_Interp *interp, Tcl_Obj *name) { - char *nameString = ObjStr(name); + CONST char *nameString = ObjStr(name); if (isAbsolutePath(nameString)) { Tcl_SetObjResult(interp, name); @@ -12872,12 +12874,12 @@ return TCL_OK; } -static int XOTclOExistsMethod(Tcl_Interp *interp, XOTclObject *object, char *var) { +static int XOTclOExistsMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *var) { Tcl_SetIntObj(Tcl_GetObjResult(interp), varExists(interp, object, var, NULL, 1, 1)); return TCL_OK; } -static int XOTclOFilterGuardMethod(Tcl_Interp *interp, XOTclObject *object, char *filter, Tcl_Obj *guard) { +static int XOTclOFilterGuardMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *filter, Tcl_Obj *guard) { XOTclObjectOpt *opt = object->opt; if (opt && opt->filters) { @@ -12899,7 +12901,7 @@ * Searches for filter on [self] and returns fully qualified name * if it is not found it returns an empty string */ -static int XOTclOFilterSearchMethod(Tcl_Interp *interp, XOTclObject *object, char *filter) { +static int XOTclOFilterSearchMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *filter) { XOTclCmdList *cmdList; XOTclClass *fcl; XOTclObject *fobj; @@ -12952,7 +12954,7 @@ return result; } -static int XOTclOMixinGuardMethod(Tcl_Interp *interp, XOTclObject *object, char *mixin, Tcl_Obj *guard) { +static int XOTclOMixinGuardMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *mixin, Tcl_Obj *guard) { XOTclObjectOpt *opt = object->opt; if (opt && opt->mixins) { @@ -13190,7 +13192,7 @@ return result; } -static int XOTclOVwaitMethod(Tcl_Interp *interp, XOTclObject *object, char *varname) { +static int XOTclOVwaitMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *varname) { int done, foundEvent; int flgs = TCL_TRACE_WRITES|TCL_TRACE_UNSETS; XOTcl_FrameDecls; @@ -13304,7 +13306,7 @@ return result; } -static int XOTclCCreateMethod(Tcl_Interp *interp, XOTclClass *cl, char *name, +static int XOTclCCreateMethod(Tcl_Interp *interp, XOTclClass *cl, CONST char *name, int objc, Tcl_Obj *CONST objv[]) { if (RUNTIME_STATE(interp)->exitHandlerDestroyRound != XOTCL_EXITHANDLER_OFF) { fprintf(stderr, "### Can't create object %s during shutdown\n", ObjStr(objv[1])); @@ -13407,7 +13409,7 @@ } static int XOTclCFilterGuardMethod(Tcl_Interp *interp, XOTclClass *cl, - char *filter, Tcl_Obj *guard) { + CONST char *filter, Tcl_Obj *guard) { XOTclClassOpt *opt = cl->opt; if (opt && opt->classfilters) { @@ -13425,7 +13427,7 @@ filter, " on ", className(cl), (char *) NULL); } -static int XOTclCMixinGuardMethod(Tcl_Interp *interp, XOTclClass *cl, char *mixin, Tcl_Obj *guard) { +static int XOTclCMixinGuardMethod(Tcl_Interp *interp, XOTclClass *cl, CONST char *mixin, Tcl_Obj *guard) { XOTclClassOpt *opt = cl->opt; if (opt && opt->classmixins) { @@ -13525,7 +13527,7 @@ /*************************** * Begin Object Info Methods ***************************/ -static int XOTclObjInfoChildrenMethod(Tcl_Interp *interp, XOTclObject *object, char *pattern) { +static int XOTclObjInfoChildrenMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *pattern) { return ListChildren(interp, object, pattern, 0); } @@ -13535,7 +13537,7 @@ } static int XOTclObjInfoFilterMethod(Tcl_Interp *interp, XOTclObject *object, - int withOrder, int withGuards, char *pattern) { + int withOrder, int withGuards, CONST char *pattern) { XOTclObjectOpt *opt = object->opt; if (withOrder) { if (!(object->flags & XOTCL_FILTER_ORDER_VALID)) @@ -13545,11 +13547,11 @@ return opt ? FilterInfo(interp, opt->filters, pattern, withGuards, 0) : TCL_OK; } -static int XOTclObjInfoFilterguardMethod(Tcl_Interp *interp, XOTclObject *object, char *filter) { +static int XOTclObjInfoFilterguardMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *filter) { return object->opt ? GuardList(interp, object->opt->filters, filter) : TCL_OK; } -static int XOTclObjInfoForwardMethod(Tcl_Interp *interp, XOTclObject *object, int withDefinition, char *pattern) { +static int XOTclObjInfoForwardMethod(Tcl_Interp *interp, XOTclObject *object, int withDefinition, CONST char *pattern) { return object->nsPtr ? ListForward(interp, Tcl_Namespace_cmdTable(object->nsPtr), pattern, withDefinition) : TCL_OK; @@ -13594,14 +13596,14 @@ static int XOTclClassInfoMethodsMethod(Tcl_Interp *interp, XOTclClass *class, int withMethodtype, int withCallproctection, - int withNomixins, int withIncontext, char *pattern) { + int withNomixins, int withIncontext, CONST char *pattern) { return ListDefinedMethods(interp, &class->object, pattern, 0 /* per-object */, AggregatedMethodType(withMethodtype), withCallproctection, withNomixins, withIncontext); } static int XOTclObjInfoMethodsMethod(Tcl_Interp *interp, XOTclObject *object, int withMethodtype, int withCallproctection, - int withNomixins, int withIncontext, char *pattern) { + int withNomixins, int withIncontext, CONST char *pattern) { return ListDefinedMethods(interp, object, pattern, 1 /* per-object */, AggregatedMethodType(withMethodtype), withCallproctection, withNomixins, withIncontext); @@ -13622,7 +13624,7 @@ static int XOTclObjInfoCallableMethod(Tcl_Interp *interp, XOTclObject *object, int withWhich, int withMethodtype, int withCallprotection, int withApplication, - int withNomixins, int withIncontext, char *pattern) { + int withNomixins, int withIncontext, CONST char *pattern) { if (withWhich) { XOTclClass *pcl = NULL; Tcl_Command cmd = ObjectFindMethod(interp, object, pattern, &pcl); @@ -13640,15 +13642,15 @@ } static int XOTclObjInfoMethodMethod(Tcl_Interp *interp, XOTclObject *object, - int subcmd, char *methodName) { + int subcmd, CONST char *methodName) { Tcl_Namespace *nsPtr = object->nsPtr; return ListMethod(interp, object, methodName, nsPtr ? FindMethod(nsPtr, methodName) : NULL, subcmd, 1); } static int XOTclClassInfoMethodMethod(Tcl_Interp *interp, XOTclClass *class, - int subcmd, char *methodName) { + int subcmd, CONST char *methodName) { Tcl_Namespace *nsPtr = class->nsPtr; return ListMethod(interp, &class->object, methodName, nsPtr ? FindMethod(nsPtr, methodName) : NULL, @@ -13657,7 +13659,7 @@ static int XOTclObjInfoMixinMethod(Tcl_Interp *interp, XOTclObject *object, int withGuards, int withOrder, - char *patternString, XOTclObject *patternObj) { + CONST char *patternString, XOTclObject *patternObj) { if (withOrder) { if (!(object->flags & XOTCL_MIXIN_ORDER_VALID)) @@ -13668,7 +13670,7 @@ return object->opt ? MixinInfo(interp, object->opt->mixins, patternString, withGuards, patternObj) : TCL_OK; } -static int XOTclObjInfoMixinguardMethod(Tcl_Interp *interp, XOTclObject *object, char *mixin) { +static int XOTclObjInfoMixinguardMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *mixin) { return object->opt ? GuardList(interp, object->opt->mixins, mixin) : TCL_OK; } @@ -13680,7 +13682,7 @@ } static int XOTclObjInfoPrecedenceMethod(Tcl_Interp *interp, XOTclObject *object, - int withIntrinsicOnly, char *pattern) { + int withIntrinsicOnly, CONST char *pattern) { XOTclClasses *precedenceList = NULL, *pl; precedenceList = ComputePrecedenceList(interp, object, pattern, !withIntrinsicOnly, 1); @@ -13692,7 +13694,7 @@ return TCL_OK; } -static int XOTclObjInfoSlotObjectsMethod(Tcl_Interp *interp, XOTclObject *object, char *pattern) { +static int XOTclObjInfoSlotObjectsMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *pattern) { XOTclObjects *pl; Tcl_Obj *list = Tcl_NewListObj(0, NULL); @@ -13706,7 +13708,7 @@ return TCL_OK; } -static int XOTclObjInfoVarsMethod(Tcl_Interp *interp, XOTclObject *object, char *pattern) { +static int XOTclObjInfoVarsMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *pattern) { Tcl_Obj *varlist, *okList, *element; int i, length; TclVarHashTable *varTable = object->nsPtr ? Tcl_Namespace_varTable(object->nsPtr) : object->varTable; @@ -13747,7 +13749,7 @@ /*************************** * Begin Class Info methods ***************************/ -static int XOTclClassInfoHeritageMethod(Tcl_Interp *interp, XOTclClass *cl, char *pattern) { +static int XOTclClassInfoHeritageMethod(Tcl_Interp *interp, XOTclClass *cl, CONST char *pattern) { XOTclClasses *pl = ComputeOrder(cl, cl->order, Super); Tcl_ResetResult(interp); @@ -13763,7 +13765,7 @@ * String key hashtable */ static int XOTclClassInfoInstancesMethod1(Tcl_Interp *interp, XOTclClass *startCl, - int withClosure, char *pattern, XOTclObject *matchObject) { + int withClosure, CONST char *pattern, XOTclObject *matchObject) { Tcl_HashTable *table = &startCl->instances; XOTclClasses *sc; Tcl_HashSearch search; @@ -13794,26 +13796,26 @@ } static int XOTclClassInfoInstancesMethod(Tcl_Interp *interp, XOTclClass *startCl, - int withClosure, char *pattern, XOTclObject *matchObject) { + int withClosure, CONST char *pattern, XOTclObject *matchObject) { XOTclClassInfoInstancesMethod1(interp, startCl, withClosure, pattern, matchObject); return TCL_OK; } -static int XOTclClassInfoFilterMethod(Tcl_Interp *interp, XOTclClass *class, int withGuards, char *pattern) { +static int XOTclClassInfoFilterMethod(Tcl_Interp *interp, XOTclClass *class, int withGuards, CONST char *pattern) { return class->opt ? FilterInfo(interp, class->opt->classfilters, pattern, withGuards, 0) : TCL_OK; } -static int XOTclClassInfoFilterguardMethod(Tcl_Interp *interp, XOTclClass *class, char *filter) { +static int XOTclClassInfoFilterguardMethod(Tcl_Interp *interp, XOTclClass *class, CONST char *filter) { return class->opt ? GuardList(interp, class->opt->classfilters, filter) : TCL_OK; } static int XOTclClassInfoForwardMethod(Tcl_Interp *interp, XOTclClass *class, - int withDefinition, char *pattern) { + int withDefinition, CONST char *pattern) { return ListForward(interp, Tcl_Namespace_cmdTable(class->nsPtr), pattern, withDefinition); } static int XOTclClassInfoMixinMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, int withGuards, - char *patternString, XOTclObject *patternObj) { + CONST char *patternString, XOTclObject *patternObj) { XOTclClassOpt *opt = class->opt; int rc; @@ -13833,12 +13835,12 @@ return TCL_OK; } -static int XOTclClassInfoMixinguardMethod(Tcl_Interp *interp, XOTclClass *class, char *mixin) { +static int XOTclClassInfoMixinguardMethod(Tcl_Interp *interp, XOTclClass *class, CONST char *mixin) { return class->opt ? GuardList(interp, class->opt->classmixins, mixin) : TCL_OK; } static int XOTclClassInfoMixinOfMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, int withScope, - char *patternString, XOTclObject *patternObj) { + CONST char *patternString, XOTclObject *patternObj) { XOTclClassOpt *opt = class->opt; int perClass, perObject; int rc; @@ -13924,7 +13926,7 @@ } static int XOTclClassInfoSubclassMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, - char *patternString, XOTclObject *patternObj) { + CONST char *patternString, XOTclObject *patternObj) { int rc; if (withClosure) { XOTclClasses *saved = class->order, *subclasses; Index: generic/xotcl.decls =================================================================== diff -u -re476fd3814e139958bab9cacbd8e2f8def632d00 -r66c24900b6a07a0cac4a28251c492bd3a05ec8e7 --- generic/xotcl.decls (.../xotcl.decls) (revision e476fd3814e139958bab9cacbd8e2f8def632d00) +++ generic/xotcl.decls (.../xotcl.decls) (revision 66c24900b6a07a0cac4a28251c492bd3a05ec8e7) @@ -38,7 +38,7 @@ struct XOTcl_Object *XOTclGetObject(Tcl_Interp *interp, char *name) } declare 5 generic { - struct XOTcl_Class *XOTclGetClass(Tcl_Interp *interp, char *name) + struct XOTcl_Class *XOTclGetClass(Tcl_Interp *interp, CONST char *name) } declare 6 generic { int XOTclCreateObject(Tcl_Interp *interp, Tcl_Obj *name, struct XOTcl_Class *cl) @@ -149,7 +149,7 @@ void XOTclRequireObjNamespace(Tcl_Interp *interp, XOTcl_Object *obj) } declare 37 generic { - int XOTclErrBadVal(Tcl_Interp *interp, char *context, char *expected, char *value) + int XOTclErrBadVal(Tcl_Interp *interp, char *context, char *expected, CONST char *value) } declare 38 generic { int XOTclNextObjCmd(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) Index: generic/xotclDecls.h =================================================================== diff -u -re476fd3814e139958bab9cacbd8e2f8def632d00 -r66c24900b6a07a0cac4a28251c492bd3a05ec8e7 --- generic/xotclDecls.h (.../xotclDecls.h) (revision e476fd3814e139958bab9cacbd8e2f8def632d00) +++ generic/xotclDecls.h (.../xotclDecls.h) (revision 66c24900b6a07a0cac4a28251c492bd3a05ec8e7) @@ -46,7 +46,8 @@ #ifndef XOTclGetClass_TCL_DECLARED #define XOTclGetClass_TCL_DECLARED /* 5 */ -EXTERN struct XOTcl_Class * XOTclGetClass (Tcl_Interp * interp, char * name); +EXTERN struct XOTcl_Class * XOTclGetClass (Tcl_Interp * interp, + CONST char * name); #endif #ifndef XOTclCreateObject_TCL_DECLARED #define XOTclCreateObject_TCL_DECLARED @@ -189,7 +190,7 @@ #define XOTclErrBadVal_TCL_DECLARED /* 37 */ EXTERN int XOTclErrBadVal (Tcl_Interp * interp, char * context, - char * expected, char * value); + char * expected, CONST char * value); #endif #ifndef XOTclNextObjCmd_TCL_DECLARED #define XOTclNextObjCmd_TCL_DECLARED @@ -249,7 +250,7 @@ struct XOTcl_Class * (*xOTclIsClass) (Tcl_Interp * interp, ClientData cd); /* 2 */ void *reserved3; struct XOTcl_Object * (*xOTclGetObject) (Tcl_Interp * interp, char * name); /* 4 */ - struct XOTcl_Class * (*xOTclGetClass) (Tcl_Interp * interp, char * name); /* 5 */ + struct XOTcl_Class * (*xOTclGetClass) (Tcl_Interp * interp, CONST char * name); /* 5 */ int (*xOTclCreateObject) (Tcl_Interp * interp, Tcl_Obj * name, struct XOTcl_Class * cl); /* 6 */ void *reserved7; void *reserved8; @@ -281,7 +282,7 @@ void (*xOTclSetClassClientData) (XOTcl_Class * cl, ClientData data); /* 34 */ ClientData (*xOTclGetClassClientData) (XOTcl_Class * cl); /* 35 */ void (*xOTclRequireObjNamespace) (Tcl_Interp * interp, XOTcl_Object * obj); /* 36 */ - int (*xOTclErrBadVal) (Tcl_Interp * interp, char * context, char * expected, char * value); /* 37 */ + int (*xOTclErrBadVal) (Tcl_Interp * interp, char * context, char * expected, CONST char * value); /* 37 */ int (*xOTclNextObjCmd) (ClientData cd, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[]); /* 38 */ int (*xOTclCallMethodWithArgs) (ClientData cd, Tcl_Interp * interp, Tcl_Obj * method, Tcl_Obj * arg, int objc, Tcl_Obj *CONST objv[], int flags); /* 39 */ int (*xOTclObjErrArgCnt) (Tcl_Interp * interp, Tcl_Obj * cmdName, Tcl_Obj * methodName, char * arglist); /* 40 */ Index: generic/xotclError.c =================================================================== diff -u -rc942f4e117d2aa3c8594702e0476a3f73a4147df -r66c24900b6a07a0cac4a28251c492bd3a05ec8e7 --- generic/xotclError.c (.../xotclError.c) (revision c942f4e117d2aa3c8594702e0476a3f73a4147df) +++ generic/xotclError.c (.../xotclError.c) (revision 66c24900b6a07a0cac4a28251c492bd3a05ec8e7) @@ -91,7 +91,7 @@ } int -XOTclErrBadVal(Tcl_Interp *interp, char *context, char *expected, char *value) { +XOTclErrBadVal(Tcl_Interp *interp, char *context, char *expected, CONST char *value) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, context, ": expected ", expected, " but got '", value, "'", (char *) NULL);