diff options
| author | griffin <briang42@easystreet.net> | 2023-03-25 00:29:59 (GMT) |
|---|---|---|
| committer | griffin <briang42@easystreet.net> | 2023-03-25 00:29:59 (GMT) |
| commit | 879e7b7112b429b14e6c6bb70873c4fe41d59e1c (patch) | |
| tree | 8afefec0015395ec4eceda2146ca978b63782cb3 /generic/tclOO.c | |
| parent | ef7bbf24e8812d54b66b071036a2ff875ccb98d6 (diff) | |
| parent | b0a23df7d6a04013d6ee706f7c7a7f12b6d5b3ef (diff) | |
| download | tcl-879e7b7112b429b14e6c6bb70873c4fe41d59e1c.zip tcl-879e7b7112b429b14e6c6bb70873c4fe41d59e1c.tar.gz tcl-879e7b7112b429b14e6c6bb70873c4fe41d59e1c.tar.bz2 | |
Merge trunk
Diffstat (limited to 'generic/tclOO.c')
| -rw-r--r-- | generic/tclOO.c | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c index 0d9c7da..bee06e2 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -67,9 +67,9 @@ static int CloneClassMethod(Tcl_Interp *interp, Class *clsPtr, Method **newMPtrPtr); static int CloneObjectMethod(Tcl_Interp *interp, Object *oPtr, Method *mPtr, Tcl_Obj *namePtr); -static void DeletedDefineNamespace(ClientData clientData); -static void DeletedObjdefNamespace(ClientData clientData); -static void DeletedHelpersNamespace(ClientData clientData); +static void DeletedDefineNamespace(void *clientData); +static void DeletedObjdefNamespace(void *clientData); +static void DeletedHelpersNamespace(void *clientData); static Tcl_NRPostProc FinalizeAlloc; static Tcl_NRPostProc FinalizeNext; static Tcl_NRPostProc FinalizeObjectCall; @@ -78,23 +78,23 @@ static void InitClassSystemRoots(Tcl_Interp *interp, Foundation *fPtr); static int InitFoundation(Tcl_Interp *interp); static Tcl_InterpDeleteProc KillFoundation; -static void MyDeleted(ClientData clientData); -static void ObjectNamespaceDeleted(ClientData clientData); +static void MyDeleted(void *clientData); +static void ObjectNamespaceDeleted(void *clientData); static Tcl_CommandTraceProc ObjectRenamedTrace; -static inline void RemoveClass(Class **list, int num, int idx); -static inline void RemoveObject(Object **list, int num, int idx); +static inline void RemoveClass(Class **list, size_t num, size_t idx); +static inline void RemoveObject(Object **list, size_t num, size_t idx); static inline void SquelchCachedName(Object *oPtr); -static int PublicNRObjectCmd(ClientData clientData, +static int PublicNRObjectCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); -static int PrivateNRObjectCmd(ClientData clientData, +static int PrivateNRObjectCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); -static int MyClassNRObjCmd(ClientData clientData, +static int MyClassNRObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); -static void MyClassDeleted(ClientData clientData); +static void MyClassDeleted(void *clientData); /* * Methods in the oo::object and oo::class classes. First, we define a helper @@ -201,10 +201,10 @@ MODULE_SCOPE const TclOOStubs tclOOStubs; static inline void RemoveClass( Class **list, - int num, - int idx) + size_t num, + size_t idx) { - for (; idx < num - 1; idx++) { + for (; idx + 1 < num; idx++) { list[idx] = list[idx + 1]; } list[idx] = NULL; @@ -213,10 +213,10 @@ RemoveClass( static inline void RemoveObject( Object **list, - int num, - int idx) + size_t num, + size_t idx) { - for (; idx < num - 1; idx++) { + for (; idx + 1 < num; idx++) { list[idx] = list[idx + 1]; } list[idx] = NULL; @@ -256,7 +256,7 @@ TclOOInit( * to be fully provided. */ - if (Tcl_EvalEx(interp, initScript, -1, 0) != TCL_OK) { + if (Tcl_EvalEx(interp, initScript, TCL_INDEX_NONE, 0) != TCL_OK) { return TCL_ERROR; } @@ -352,14 +352,14 @@ InitFoundation( Tcl_DStringInit(&buffer); for (i = 0 ; defineCmds[i].name ; i++) { TclDStringAppendLiteral(&buffer, "::oo::define::"); - Tcl_DStringAppend(&buffer, defineCmds[i].name, -1); + Tcl_DStringAppend(&buffer, defineCmds[i].name, TCL_INDEX_NONE); Tcl_CreateObjCommand(interp, Tcl_DStringValue(&buffer), defineCmds[i].objProc, INT2PTR(defineCmds[i].flag), NULL); Tcl_DStringFree(&buffer); } for (i = 0 ; objdefCmds[i].name ; i++) { TclDStringAppendLiteral(&buffer, "::oo::objdefine::"); - Tcl_DStringAppend(&buffer, objdefCmds[i].name, -1); + Tcl_DStringAppend(&buffer, objdefCmds[i].name, TCL_INDEX_NONE); Tcl_CreateObjCommand(interp, Tcl_DStringValue(&buffer), objdefCmds[i].objProc, INT2PTR(objdefCmds[i].flag), NULL); Tcl_DStringFree(&buffer); @@ -429,7 +429,7 @@ InitFoundation( * Evaluate the remaining definitions, which are a compiled-in Tcl script. */ - return Tcl_EvalEx(interp, tclOOSetupScript, -1, 0); + return Tcl_EvalEx(interp, tclOOSetupScript, TCL_INDEX_NONE, 0); } /* @@ -535,7 +535,7 @@ InitClassSystemRoots( static void DeletedDefineNamespace( - ClientData clientData) + void *clientData) { Foundation *fPtr = (Foundation *)clientData; @@ -544,7 +544,7 @@ DeletedDefineNamespace( static void DeletedObjdefNamespace( - ClientData clientData) + void *clientData) { Foundation *fPtr = (Foundation *)clientData; @@ -553,7 +553,7 @@ DeletedObjdefNamespace( static void DeletedHelpersNamespace( - ClientData clientData) + void *clientData) { Foundation *fPtr = (Foundation *)clientData; @@ -789,7 +789,7 @@ SquelchCachedName( static void MyDeleted( - ClientData clientData) /* Reference to the object whose [my] has been + void *clientData) /* Reference to the object whose [my] has been * squelched. */ { Object *oPtr = (Object *)clientData; @@ -799,7 +799,7 @@ MyDeleted( static void MyClassDeleted( - ClientData clientData) + void *clientData) { Object *oPtr = (Object *)clientData; oPtr->myclassCommand = NULL; @@ -820,7 +820,7 @@ MyClassDeleted( static void ObjectRenamedTrace( - ClientData clientData, /* The object being deleted. */ + void *clientData, /* The object being deleted. */ TCL_UNUSED(Tcl_Interp *), TCL_UNUSED(const char *) /*oldName*/, TCL_UNUSED(const char *) /*newName*/, @@ -1038,7 +1038,7 @@ TclOOReleaseClassContents( if (clsPtr->metadataPtr != NULL) { Tcl_ObjectMetadataType *metadataTypePtr; - ClientData value; + void *value; FOREACH_HASH(metadataTypePtr, value, clsPtr->metadataPtr) { metadataTypePtr->deleteProc(value); @@ -1110,7 +1110,7 @@ TclOOReleaseClassContents( static void ObjectNamespaceDeleted( - ClientData clientData) /* Pointer to the class whose namespace is + void *clientData) /* Pointer to the class whose namespace is * being deleted. */ { Object *oPtr = (Object *)clientData; @@ -1261,7 +1261,7 @@ ObjectNamespaceDeleted( if (oPtr->metadataPtr != NULL) { Tcl_ObjectMetadataType *metadataTypePtr; - ClientData value; + void *value; FOREACH_HASH(metadataTypePtr, value, oPtr->metadataPtr) { metadataTypePtr->deleteProc(value); @@ -1675,7 +1675,7 @@ Tcl_NewObjectInstance( { Class *classPtr = (Class *) cls; Object *oPtr; - ClientData clientData[4]; + void *clientData[4]; oPtr = TclNewObjectInstanceCommon(interp, classPtr, nameStr, nsNameStr); if (oPtr == NULL) { @@ -1854,7 +1854,7 @@ TclNewObjectInstanceCommon( static int FinalizeAlloc( - ClientData data[], + void *data[], Tcl_Interp *interp, int result) { @@ -1870,7 +1870,7 @@ FinalizeAlloc( if (result != TCL_ERROR && Destructing(oPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "object deleted in constructor", -1)); + "object deleted in constructor", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "OO", "STILLBORN", NULL); result = TCL_ERROR; } @@ -1941,7 +1941,7 @@ Tcl_CopyObjectInstance( if (IsRootClass(oPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "may not clone the class of classes", -1)); + "may not clone the class of classes", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "OO", "CLONING_CLASS", NULL); return NULL; } @@ -1951,8 +1951,8 @@ Tcl_CopyObjectInstance( */ o2Ptr = (Object *) Tcl_NewObjectInstance(interp, - (Tcl_Class) oPtr->selfCls, targetName, targetNamespaceName, -1, - NULL, -1); + (Tcl_Class) oPtr->selfCls, targetName, targetNamespaceName, TCL_INDEX_NONE, + NULL, TCL_INDEX_NONE); if (o2Ptr == NULL) { return NULL; } @@ -2037,7 +2037,7 @@ Tcl_CopyObjectInstance( if (oPtr->metadataPtr != NULL) { Tcl_ObjectMetadataType *metadataTypePtr; - ClientData value, duplicate; + void *value, *duplicate; FOREACH_HASH(metadataTypePtr, value, oPtr->metadataPtr) { if (metadataTypePtr->cloneProc == NULL) { @@ -2182,7 +2182,7 @@ Tcl_CopyObjectInstance( if (clsPtr->metadataPtr != NULL) { Tcl_ObjectMetadataType *metadataTypePtr; - ClientData value, duplicate; + void *value, *duplicate; FOREACH_HASH(metadataTypePtr, value, clsPtr->metadataPtr) { if (metadataTypePtr->cloneProc == NULL) { @@ -2254,7 +2254,7 @@ CloneObjectMethod( TclNewInstanceMethod(interp, (Tcl_Object) oPtr, namePtr, mPtr->flags & PUBLIC_METHOD, NULL, NULL); } else if (mPtr->typePtr->cloneProc) { - ClientData newClientData; + void *newClientData; if (mPtr->typePtr->cloneProc(interp, mPtr->clientData, &newClientData) != TCL_OK) { @@ -2283,7 +2283,7 @@ CloneClassMethod( m2Ptr = (Method *) TclNewMethod(interp, (Tcl_Class) clsPtr, namePtr, mPtr->flags & PUBLIC_METHOD, NULL, NULL); } else if (mPtr->typePtr->cloneProc) { - ClientData newClientData; + void *newClientData; if (mPtr->typePtr->cloneProc(interp, mPtr->clientData, &newClientData) != TCL_OK) { @@ -2329,7 +2329,7 @@ CloneClassMethod( * ---------------------------------------------------------------------- */ -ClientData +void * Tcl_ClassGetMetadata( Tcl_Class clazz, const Tcl_ObjectMetadataType *typePtr) @@ -2366,7 +2366,7 @@ void Tcl_ClassSetMetadata( Tcl_Class clazz, const Tcl_ObjectMetadataType *typePtr, - ClientData metadata) + void *metadata) { Class *clsPtr = (Class *) clazz; Tcl_HashEntry *hPtr; @@ -2409,7 +2409,7 @@ Tcl_ClassSetMetadata( Tcl_SetHashValue(hPtr, metadata); } -ClientData +void * Tcl_ObjectGetMetadata( Tcl_Object object, const Tcl_ObjectMetadataType *typePtr) @@ -2446,7 +2446,7 @@ void Tcl_ObjectSetMetadata( Tcl_Object object, const Tcl_ObjectMetadataType *typePtr, - ClientData metadata) + void *metadata) { Object *oPtr = (Object *) object; Tcl_HashEntry *hPtr; @@ -2504,7 +2504,7 @@ Tcl_ObjectSetMetadata( int TclOOPublicObjectCmd( - ClientData clientData, + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -2514,7 +2514,7 @@ TclOOPublicObjectCmd( static int PublicNRObjectCmd( - ClientData clientData, + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -2525,7 +2525,7 @@ PublicNRObjectCmd( int TclOOPrivateObjectCmd( - ClientData clientData, + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -2535,7 +2535,7 @@ TclOOPrivateObjectCmd( static int PrivateNRObjectCmd( - ClientData clientData, + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -2586,7 +2586,7 @@ TclOOInvokeObject( int TclOOMyClassObjCmd( - ClientData clientData, + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -2596,7 +2596,7 @@ TclOOMyClassObjCmd( static int MyClassNRObjCmd( - ClientData clientData, + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) @@ -2749,7 +2749,7 @@ TclOOObjectCmdCore( } if (contextPtr->index >= contextPtr->callPtr->numChain) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "no valid method implementation", -1)); + "no valid method implementation", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", TclGetString(methodNamePtr), NULL); TclOODeleteContext(contextPtr); @@ -2768,7 +2768,7 @@ TclOOObjectCmdCore( static int FinalizeObjectCall( - ClientData data[], + void *data[], TCL_UNUSED(Tcl_Interp *), int result) { @@ -2929,7 +2929,7 @@ TclNRObjectContextInvokeNext( static int FinalizeNext( - ClientData data[], + void *data[], TCL_UNUSED(Tcl_Interp *), int result) { |
