diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2020-12-06 18:24:00 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2020-12-06 18:24:00 (GMT) |
commit | 0f93742804d047a8de0fe3acda7b019daae7b273 (patch) | |
tree | 18bed9fa65dbe84ebb028ca81c52ae123e9b3867 /generic/tclOODefineCmds.c | |
parent | 7dd7fe1b6c5348772912a64134334358a39f8211 (diff) | |
parent | fcee72d2c7daddae9dd63e4eb14746b7bd319aa9 (diff) | |
download | tcl-0f93742804d047a8de0fe3acda7b019daae7b273.zip tcl-0f93742804d047a8de0fe3acda7b019daae7b273.tar.gz tcl-0f93742804d047a8de0fe3acda7b019daae7b273.tar.bz2 |
merge core-8-branch
Diffstat (limited to 'generic/tclOODefineCmds.c')
-rw-r--r-- | generic/tclOODefineCmds.c | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index fa2b043..f94dd15 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -296,9 +296,9 @@ TclOOObjectSetFilters( int size = sizeof(Tcl_Obj *) * numFilters; /* should be size_t */ if (oPtr->filters.num == 0) { - filtersList = ckalloc(size); + filtersList = (Tcl_Obj **)ckalloc(size); } else { - filtersList = ckrealloc(oPtr->filters.list, size); + filtersList = (Tcl_Obj **)ckrealloc(oPtr->filters.list, size); } for (i = 0 ; i < numFilters ; i++) { filtersList[i] = filters[i]; @@ -355,9 +355,9 @@ TclOOClassSetFilters( int size = sizeof(Tcl_Obj *) * numFilters; /* should be size_t */ if (classPtr->filters.num == 0) { - filtersList = ckalloc(size); + filtersList = (Tcl_Obj **)ckalloc(size); } else { - filtersList = ckrealloc(classPtr->filters.list, size); + filtersList = (Tcl_Obj **)ckrealloc(classPtr->filters.list, size); } for (i = 0 ; i < numFilters ; i++) { filtersList[i] = filters[i]; @@ -411,10 +411,10 @@ TclOOObjectSetMixins( } TclOODecrRefCount(mixinPtr->thisPtr); } - oPtr->mixins.list = ckrealloc(oPtr->mixins.list, + oPtr->mixins.list = (Class **)ckrealloc(oPtr->mixins.list, sizeof(Class *) * numMixins); } else { - oPtr->mixins.list = ckalloc(sizeof(Class *) * numMixins); + oPtr->mixins.list = (Class **)ckalloc(sizeof(Class *) * numMixins); oPtr->flags &= ~USE_CLASS_CACHE; } oPtr->mixins.num = numMixins; @@ -469,10 +469,10 @@ TclOOClassSetMixins( TclOORemoveFromMixinSubs(classPtr, mixinPtr); TclOODecrRefCount(mixinPtr->thisPtr); } - classPtr->mixins.list = ckrealloc(classPtr->mixins.list, + classPtr->mixins.list = (Class **)ckrealloc(classPtr->mixins.list, sizeof(Class *) * numMixins); } else { - classPtr->mixins.list = ckalloc(sizeof(Class *) * numMixins); + classPtr->mixins.list = (Class **)ckalloc(sizeof(Class *) * numMixins); } classPtr->mixins.num = numMixins; memcpy(classPtr->mixins.list, mixins, sizeof(Class *) * numMixins); @@ -519,9 +519,9 @@ InstallStandardVariableMapping( if (varc == 0) { ckfree(vnlPtr->list); } else if (i) { - vnlPtr->list = ckrealloc(vnlPtr->list, sizeof(Tcl_Obj *) * varc); + vnlPtr->list = (Tcl_Obj **)ckrealloc(vnlPtr->list, sizeof(Tcl_Obj *) * varc); } else { - vnlPtr->list = ckalloc(sizeof(Tcl_Obj *) * varc); + vnlPtr->list = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * varc); } } vnlPtr->num = 0; @@ -542,7 +542,7 @@ InstallStandardVariableMapping( */ if (n != varc) { - vnlPtr->list = ckrealloc(vnlPtr->list, sizeof(Tcl_Obj *) * n); + vnlPtr->list = (Tcl_Obj **)ckrealloc(vnlPtr->list, sizeof(Tcl_Obj *) * n); } Tcl_DeleteHashTable(&uniqueTable); } @@ -570,10 +570,10 @@ InstallPrivateVariableMapping( if (varc == 0) { ckfree(pvlPtr->list); } else if (i) { - pvlPtr->list = ckrealloc(pvlPtr->list, + pvlPtr->list = (PrivateVariableMapping *)ckrealloc(pvlPtr->list, sizeof(PrivateVariableMapping) * varc); } else { - pvlPtr->list = ckalloc(sizeof(PrivateVariableMapping) * varc); + pvlPtr->list = (PrivateVariableMapping *)ckalloc(sizeof(PrivateVariableMapping) * varc); } } @@ -600,7 +600,7 @@ InstallPrivateVariableMapping( */ if (n != varc) { - pvlPtr->list = ckrealloc(pvlPtr->list, + pvlPtr->list = (PrivateVariableMapping *)ckrealloc(pvlPtr->list, sizeof(PrivateVariableMapping) * n); } Tcl_DeleteHashTable(&uniqueTable); @@ -681,7 +681,7 @@ RenameDeleteMethod( * Complete the splicing by changing the method's name. */ - mPtr = Tcl_GetHashValue(hPtr); + mPtr = (Method *)Tcl_GetHashValue(hPtr); if (toPtr) { Tcl_IncrRefCount(toPtr); Tcl_DecrRefCount(mPtr->namePtr); @@ -712,7 +712,7 @@ RenameDeleteMethod( int TclOOUnknownDefinition( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -739,7 +739,7 @@ TclOOUnknownDefinition( } hPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search); while (hPtr != NULL) { - const char *nameStr = Tcl_GetHashKey(&nsPtr->cmdTable, hPtr); + const char *nameStr = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, hPtr); if (strncmp(soughtStr, nameStr, soughtLen) == 0) { if (matchedStr != NULL) { @@ -755,7 +755,7 @@ TclOOUnknownDefinition( * Got one match, and only one match! */ - Tcl_Obj **newObjv = + Tcl_Obj **newObjv = (Tcl_Obj **) TclStackAlloc(interp, sizeof(Tcl_Obj*) * (objc - 1)); int result; @@ -907,7 +907,7 @@ TclOOGetDefineCmdContext( Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); return NULL; } - object = iPtr->varFramePtr->clientData; + object = (Tcl_Object)iPtr->varFramePtr->clientData; if (Tcl_ObjectDeleted(object)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "this command cannot be called when the object has been" @@ -1067,8 +1067,8 @@ MagicDefinitionInvoke( * comments above for why these contortions are necessary. */ - objPtr = Tcl_NewObj(); - obj2Ptr = Tcl_NewObj(); + TclNewObj(objPtr); + TclNewObj(obj2Ptr); cmd = FindCommand(interp, objv[cmdIndex], nsPtr); if (cmd == NULL) { /* @@ -1109,7 +1109,7 @@ MagicDefinitionInvoke( int TclOODefineObjCmd( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1185,7 +1185,7 @@ TclOODefineObjCmd( int TclOOObjDefObjCmd( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1254,7 +1254,7 @@ TclOOObjDefObjCmd( int TclOODefineSelfObjCmd( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1325,7 +1325,7 @@ TclOODefineSelfObjCmd( int TclOODefineObjSelfObjCmd( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1432,7 +1432,7 @@ TclOODefinePrivateObjCmd( int TclOODefineClassObjCmd( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1541,7 +1541,7 @@ TclOODefineClassObjCmd( int TclOODefineConstructorObjCmd( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1610,7 +1610,7 @@ TclOODefineConstructorObjCmd( int TclOODefineDefnNsObjCmd( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1752,7 +1752,7 @@ TclOODefineDeleteMethodObjCmd( int TclOODefineDestructorObjCmd( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -1858,7 +1858,7 @@ TclOODefineExportObjCmd( if (isInstanceExport) { if (!oPtr->methodsPtr) { - oPtr->methodsPtr = ckalloc(sizeof(Tcl_HashTable)); + oPtr->methodsPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable)); Tcl_InitObjHashTable(oPtr->methodsPtr); oPtr->flags &= ~USE_CLASS_CACHE; } @@ -1870,14 +1870,14 @@ TclOODefineExportObjCmd( } if (isNew) { - mPtr = ckalloc(sizeof(Method)); + mPtr = (Method *)ckalloc(sizeof(Method)); memset(mPtr, 0, sizeof(Method)); mPtr->refCount = 1; mPtr->namePtr = objv[i]; Tcl_IncrRefCount(objv[i]); Tcl_SetHashValue(hPtr, mPtr); } else { - mPtr = Tcl_GetHashValue(hPtr); + mPtr = (Method *)Tcl_GetHashValue(hPtr); } if (isNew || !(mPtr->flags & (PUBLIC_METHOD | PRIVATE_METHOD))) { mPtr->flags |= PUBLIC_METHOD; @@ -2171,7 +2171,7 @@ TclOODefineUnexportObjCmd( if (isInstanceUnexport) { if (!oPtr->methodsPtr) { - oPtr->methodsPtr = ckalloc(sizeof(Tcl_HashTable)); + oPtr->methodsPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable)); Tcl_InitObjHashTable(oPtr->methodsPtr); oPtr->flags &= ~USE_CLASS_CACHE; } @@ -2183,14 +2183,14 @@ TclOODefineUnexportObjCmd( } if (isNew) { - mPtr = ckalloc(sizeof(Method)); + mPtr = (Method *)ckalloc(sizeof(Method)); memset(mPtr, 0, sizeof(Method)); mPtr->refCount = 1; mPtr->namePtr = objv[i]; Tcl_IncrRefCount(objv[i]); Tcl_SetHashValue(hPtr, mPtr); } else { - mPtr = Tcl_GetHashValue(hPtr); + mPtr = (Method *)Tcl_GetHashValue(hPtr); } if (isNew || mPtr->flags & (PUBLIC_METHOD | TRUE_PRIVATE_METHOD)) { mPtr->flags &= ~(PUBLIC_METHOD | TRUE_PRIVATE_METHOD); @@ -2331,7 +2331,7 @@ TclOODefineSlots( static int ClassFilterGet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2355,7 +2355,7 @@ ClassFilterGet( return TCL_ERROR; } - resultObj = Tcl_NewObj(); + TclNewObj(resultObj); FOREACH(filterObj, oPtr->classPtr->filters) { Tcl_ListObjAppendElement(NULL, resultObj, filterObj); } @@ -2365,7 +2365,7 @@ ClassFilterGet( static int ClassFilterSet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2411,7 +2411,7 @@ ClassFilterSet( static int ClassMixinGet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2436,7 +2436,7 @@ ClassMixinGet( return TCL_ERROR; } - resultObj = Tcl_NewObj(); + TclNewObj(resultObj); FOREACH(mixinPtr, oPtr->classPtr->mixins) { Tcl_ListObjAppendElement(NULL, resultObj, TclOOObjectName(interp, mixinPtr->thisPtr)); @@ -2448,7 +2448,7 @@ ClassMixinGet( static int ClassMixinSet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2478,7 +2478,7 @@ ClassMixinSet( return TCL_ERROR; } - mixins = TclStackAlloc(interp, sizeof(Class *) * mixinc); + mixins = (Class **)TclStackAlloc(interp, sizeof(Class *) * mixinc); for (i = 0; i < mixinc; i++) { mixins[i] = GetClassInOuterContext(interp, mixinv[i], @@ -2517,7 +2517,7 @@ ClassMixinSet( static int ClassSuperGet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2542,7 +2542,7 @@ ClassSuperGet( return TCL_ERROR; } - resultObj = Tcl_NewObj(); + TclNewObj(resultObj); FOREACH(superPtr, oPtr->classPtr->superclasses) { Tcl_ListObjAppendElement(NULL, resultObj, TclOOObjectName(interp, superPtr->thisPtr)); @@ -2553,7 +2553,7 @@ ClassSuperGet( static int ClassSuperSet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2602,7 +2602,7 @@ ClassSuperSet( */ if (superc == 0) { - superclasses = ckrealloc(superclasses, sizeof(Class *)); + superclasses = (Class **)ckrealloc(superclasses, sizeof(Class *)); if (TclOOIsReachable(oPtr->fPtr->classCls, oPtr->classPtr)) { superclasses[0] = oPtr->fPtr->classCls; } else { @@ -2684,7 +2684,7 @@ ClassSuperSet( static int ClassVarsGet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2708,7 +2708,7 @@ ClassVarsGet( return TCL_ERROR; } - resultObj = Tcl_NewObj(); + TclNewObj(resultObj); if (IsPrivateDefine(interp)) { PrivateVariableMapping *privatePtr; @@ -2728,7 +2728,7 @@ ClassVarsGet( static int ClassVarsSet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2799,7 +2799,7 @@ ClassVarsSet( static int ObjFilterGet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2817,7 +2817,7 @@ ObjFilterGet( return TCL_ERROR; } - resultObj = Tcl_NewObj(); + TclNewObj(resultObj); FOREACH(filterObj, oPtr->filters) { Tcl_ListObjAppendElement(NULL, resultObj, filterObj); } @@ -2827,7 +2827,7 @@ ObjFilterGet( static int ObjFilterSet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2867,7 +2867,7 @@ ObjFilterSet( static int ObjMixinGet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2886,7 +2886,7 @@ ObjMixinGet( return TCL_ERROR; } - resultObj = Tcl_NewObj(); + TclNewObj(resultObj); FOREACH(mixinPtr, oPtr->mixins) { if (mixinPtr) { Tcl_ListObjAppendElement(NULL, resultObj, @@ -2899,7 +2899,7 @@ ObjMixinGet( static int ObjMixinSet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2924,7 +2924,7 @@ ObjMixinSet( return TCL_ERROR; } - mixins = TclStackAlloc(interp, sizeof(Class *) * mixinc); + mixins = (Class **)TclStackAlloc(interp, sizeof(Class *) * mixinc); for (i = 0; i < mixinc; i++) { mixins[i] = GetClassInOuterContext(interp, mixinv[i], @@ -2953,7 +2953,7 @@ ObjMixinSet( static int ObjVarsGet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -2971,7 +2971,7 @@ ObjVarsGet( return TCL_ERROR; } - resultObj = Tcl_NewObj(); + TclNewObj(resultObj); if (IsPrivateDefine(interp)) { PrivateVariableMapping *privatePtr; @@ -2991,7 +2991,7 @@ ObjVarsGet( static int ObjVarsSet( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, @@ -3056,7 +3056,7 @@ ObjVarsSet( static int ResolveClass( - ClientData clientData, + TCL_UNUSED(ClientData), Tcl_Interp *interp, Tcl_ObjectContext context, int objc, |