summaryrefslogtreecommitdiffstats
path: root/generic/tclOOBasic.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclOOBasic.c')
-rw-r--r--generic/tclOOBasic.c69
1 files changed, 34 insertions, 35 deletions
diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c
index 6ea4681..72dc041 100644
--- a/generic/tclOOBasic.c
+++ b/generic/tclOOBasic.c
@@ -76,7 +76,7 @@ FinalizeConstruction(
int
TclOO_Class_Constructor(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -85,11 +85,11 @@ TclOO_Class_Constructor(
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
Tcl_Obj **invoke, *nameObj;
- if (objc-1 > Tcl_ObjectContextSkippedArgs(context)) {
+ if (objc-1 > (int)Tcl_ObjectContextSkippedArgs(context)) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
"?definitionScript?");
return TCL_ERROR;
- } else if (objc == Tcl_ObjectContextSkippedArgs(context)) {
+ } else if (objc == (int)Tcl_ObjectContextSkippedArgs(context)) {
return TCL_OK;
}
@@ -108,7 +108,7 @@ TclOO_Class_Constructor(
* Delegate to [oo::define] to do the work.
*/
- invoke = (Tcl_Obj **)ckalloc(3 * sizeof(Tcl_Obj *));
+ invoke = (Tcl_Obj **)Tcl_Alloc(3 * sizeof(Tcl_Obj *));
invoke[0] = oPtr->fPtr->defineName;
invoke[1] = TclOOObjectName(interp, oPtr);
invoke[2] = objv[objc-1];
@@ -154,7 +154,7 @@ DecrRefsPostClassConstructor(
code = Tcl_EvalObjv(interp, 2, invoke, 0);
TclDecrRefCount(invoke[0]);
TclDecrRefCount(invoke[1]);
- ckfree(invoke);
+ Tcl_Free(invoke);
if (code != TCL_OK) {
Tcl_DiscardInterpState(saved);
return code;
@@ -174,7 +174,7 @@ DecrRefsPostClassConstructor(
int
TclOO_Class_Create(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -183,7 +183,7 @@ TclOO_Class_Create(
{
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
const char *objName;
- int len;
+ size_t len;
/*
* Sanity check; should not be possible to invoke this method on a
@@ -239,7 +239,7 @@ TclOO_Class_Create(
int
TclOO_Class_CreateNs(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -248,7 +248,7 @@ TclOO_Class_CreateNs(
{
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
const char *objName, *nsName;
- int len;
+ size_t len;
/*
* Sanity check; should not be possible to invoke this method on a
@@ -312,7 +312,7 @@ TclOO_Class_CreateNs(
int
TclOO_Class_New(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -356,7 +356,7 @@ TclOO_Class_New(
int
TclOO_Object_Destroy(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -366,7 +366,7 @@ TclOO_Object_Destroy(
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
CallContext *contextPtr;
- if (objc != Tcl_ObjectContextSkippedArgs(context)) {
+ if (objc != (int)Tcl_ObjectContextSkippedArgs(context)) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
NULL);
return TCL_ERROR;
@@ -417,7 +417,7 @@ AfterNRDestructor(
int
TclOO_Object_Eval(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -518,7 +518,7 @@ FinalizeEval(
int
TclOO_Object_Unknown(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -605,7 +605,7 @@ TclOO_Object_Unknown(
Tcl_AppendToObj(errorMsg, " or ", -1);
}
Tcl_AppendToObj(errorMsg, methodNames[i], -1);
- ckfree(methodNames);
+ Tcl_Free((void *)methodNames);
Tcl_SetObjResult(interp, errorMsg);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD",
TclGetString(objv[skip]), NULL);
@@ -624,7 +624,7 @@ TclOO_Object_Unknown(
int
TclOO_Object_LinkVar(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -636,7 +636,7 @@ TclOO_Object_LinkVar(
Namespace *savedNsPtr;
int i;
- if (objc-Tcl_ObjectContextSkippedArgs(context) < 0) {
+ if ((size_t)objc < Tcl_ObjectContextSkippedArgs(context)) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
"?varName ...?");
return TCL_ERROR;
@@ -726,7 +726,7 @@ TclOO_Object_LinkVar(
int
TclOO_Object_VarName(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -738,13 +738,13 @@ TclOO_Object_VarName(
CallFrame *framePtr = ((Interp *) interp)->varFramePtr;
const char *arg;
- if (Tcl_ObjectContextSkippedArgs(context)+1 != objc) {
+ if ((int)Tcl_ObjectContextSkippedArgs(context)+1 != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
"varName");
return TCL_ERROR;
}
argPtr = objv[objc-1];
- arg = Tcl_GetString(argPtr);
+ arg = TclGetString(argPtr);
/*
* Convert the variable name to fully-qualified form if it wasn't already.
@@ -777,12 +777,12 @@ TclOO_Object_VarName(
Method *mPtr = callerContext->callPtr->chain[
callerContext->index].mPtr;
PrivateVariableMapping *pvPtr;
- int i;
+ size_t i;
if (mPtr->declaringObjectPtr == oPtr) {
FOREACH_STRUCT(pvPtr, oPtr->privateVariables) {
- if (!strcmp(Tcl_GetString(pvPtr->variableObj),
- Tcl_GetString(argPtr))) {
+ if (!strcmp(TclGetString(pvPtr->variableObj),
+ TclGetString(argPtr))) {
argPtr = pvPtr->fullNameObj;
break;
}
@@ -803,8 +803,8 @@ TclOO_Object_VarName(
}
if (isInstance) {
FOREACH_STRUCT(pvPtr, clsPtr->privateVariables) {
- if (!strcmp(Tcl_GetString(pvPtr->variableObj),
- Tcl_GetString(argPtr))) {
+ if (!strcmp(TclGetString(pvPtr->variableObj),
+ TclGetString(argPtr))) {
argPtr = pvPtr->fullNameObj;
break;
}
@@ -864,7 +864,7 @@ TclOO_Object_VarName(
int
TclOONextObjCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -900,7 +900,7 @@ TclOONextObjCmd(
int
TclOONextToObjCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -909,7 +909,7 @@ TclOONextToObjCmd(
CallFrame *framePtr = iPtr->varFramePtr;
Class *classPtr;
CallContext *contextPtr;
- int i;
+ size_t i;
Tcl_Object object;
const char *methodType;
@@ -985,7 +985,7 @@ TclOONextToObjCmd(
methodType = "method";
}
- for (i=contextPtr->index ; i>=0 ; i--) {
+ for (i=contextPtr->index ; i != TCL_INDEX_NONE ; i--) {
struct MInvoke *miPtr = contextPtr->callPtr->chain + i;
if (!miPtr->isFilter && miPtr->mPtr->declaringClassPtr == classPtr) {
@@ -1033,7 +1033,7 @@ NextRestoreFrame(
int
TclOOSelfObjCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1045,12 +1045,11 @@ TclOOSelfObjCmd(
enum SelfCmds {
SELF_CALL, SELF_CALLER, SELF_CLASS, SELF_FILTER, SELF_METHOD, SELF_NS,
SELF_NEXT, SELF_OBJECT, SELF_TARGET
- };
+ } index;
Interp *iPtr = (Interp *) interp;
CallFrame *framePtr = iPtr->varFramePtr;
CallContext *contextPtr;
Tcl_Obj *result[3];
- int index;
#define CurrentlyInvoked(contextPtr) \
((contextPtr)->callPtr->chain[(contextPtr)->index])
@@ -1084,7 +1083,7 @@ TclOOSelfObjCmd(
return TCL_ERROR;
}
- switch ((enum SelfCmds) index) {
+ switch (index) {
case SELF_OBJECT:
Tcl_SetObjResult(interp, TclOOObjectName(interp, contextPtr->oPtr));
return TCL_OK;
@@ -1218,7 +1217,7 @@ TclOOSelfObjCmd(
} else {
Method *mPtr;
Object *declarerPtr;
- int i;
+ size_t i;
for (i=contextPtr->index ; i<contextPtr->callPtr->numChain ; i++){
if (!contextPtr->callPtr->chain[i].isFilter) {
@@ -1270,7 +1269,7 @@ TclOOSelfObjCmd(
int
TclOOCopyObjectCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)