diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | generic/tclOO.c | 6 | ||||
-rw-r--r-- | generic/tclOO.decls | 12 | ||||
-rw-r--r-- | generic/tclOO.h | 23 | ||||
-rw-r--r-- | generic/tclOODecls.h | 10 | ||||
-rw-r--r-- | generic/tclOOInt.h | 20 | ||||
-rw-r--r-- | generic/tclOOIntDecls.h | 14 |
7 files changed, 54 insertions, 42 deletions
@@ -1,3 +1,14 @@ +2010-03-05 Donal K. Fellows <dkf@users.sf.net> + + * generic/tclOO.h, generic/tclOOInt.h: [Patch 2961556]: Change TclOO + to use the same style of function typedefs as Tcl, as this is about + the last chance to get this right. + + ***POTENTIAL INCOMPATIBILITY*** + Source code that uses function typedefs from TclOO will need to update + variables and argument definitions so that pointers to the function + values are used instead. Binary compatibility is not affected. + 2010-03-04 Donal K. Fellows <dkf@users.sf.net> * generic/tclOO.c (ObjectRenamedTrace): [Bug 2962664]: Add special diff --git a/generic/tclOO.c b/generic/tclOO.c index 905626a..820fee0 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclOO.c,v 1.35 2010/03/05 14:34:04 dkf Exp $ + * RCS: @(#) $Id: tclOO.c,v 1.36 2010/03/05 15:32:16 dkf Exp $ */ #ifdef HAVE_CONFIG_H @@ -2702,7 +2702,7 @@ Tcl_GetClassAsObject( return (Tcl_Object) ((Class *)clazz)->thisPtr; } -Tcl_ObjectMapMethodNameProc +Tcl_ObjectMapMethodNameProc * Tcl_ObjectGetMethodNameMapper( Tcl_Object object) { @@ -2712,7 +2712,7 @@ Tcl_ObjectGetMethodNameMapper( void Tcl_ObjectSetMethodNameMapper( Tcl_Object object, - Tcl_ObjectMapMethodNameProc mapMethodNameProc) + Tcl_ObjectMapMethodNameProc *mapMethodNameProc) { ((Object *) object)->mapMethodNameProc = mapMethodNameProc; } diff --git a/generic/tclOO.decls b/generic/tclOO.decls index 0be831a..f334103 100644 --- a/generic/tclOO.decls +++ b/generic/tclOO.decls @@ -1,4 +1,4 @@ -# $Id: tclOO.decls,v 1.6 2010/02/05 10:03:23 nijtmans Exp $ +# $Id: tclOO.decls,v 1.7 2010/03/05 15:32:16 dkf Exp $ library tclOO @@ -97,12 +97,12 @@ declare 23 generic { int skip) } declare 24 generic { - Tcl_ObjectMapMethodNameProc Tcl_ObjectGetMethodNameMapper( + Tcl_ObjectMapMethodNameProc *Tcl_ObjectGetMethodNameMapper( Tcl_Object object) } declare 25 generic { void Tcl_ObjectSetMethodNameMapper(Tcl_Object object, - Tcl_ObjectMapMethodNameProc mapMethodNameProc) + Tcl_ObjectMapMethodNameProc *mapMethodNameProc) } declare 26 generic { void Tcl_ClassSetConstructor(Tcl_Interp *interp, Tcl_Class clazz, @@ -164,14 +164,14 @@ declare 8 generic { } declare 9 generic { Tcl_Method TclOONewProcInstanceMethodEx(Tcl_Interp *interp, - Tcl_Object oPtr, TclOO_PreCallProc preCallPtr, - TclOO_PostCallProc postCallPtr, ProcErrorProc *errProc, + Tcl_Object oPtr, TclOO_PreCallProc *preCallPtr, + TclOO_PostCallProc *postCallPtr, ProcErrorProc *errProc, ClientData clientData, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, int flags, void **internalTokenPtr) } declare 10 generic { Tcl_Method TclOONewProcMethodEx(Tcl_Interp *interp, Tcl_Class clsPtr, - TclOO_PreCallProc preCallPtr, TclOO_PostCallProc postCallPtr, + TclOO_PreCallProc *preCallPtr, TclOO_PostCallProc *postCallPtr, ProcErrorProc *errProc, ClientData clientData, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, int flags, void **internalTokenPtr) diff --git a/generic/tclOO.h b/generic/tclOO.h index a2a6aa1..d97ec47 100644 --- a/generic/tclOO.h +++ b/generic/tclOO.h @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclOO.h,v 1.9 2009/11/27 07:27:52 dkf Exp $ + * RCS: @(#) $Id: tclOO.h,v 1.10 2010/03/05 15:32:16 dkf Exp $ */ #ifndef TCLOO_H_INCLUDED @@ -51,13 +51,13 @@ typedef struct Tcl_ObjectContext_ *Tcl_ObjectContext; * and to allow the attachment of arbitrary data to objects and classes. */ -typedef int (*Tcl_MethodCallProc)(ClientData clientData, Tcl_Interp *interp, +typedef int (Tcl_MethodCallProc)(ClientData clientData, Tcl_Interp *interp, Tcl_ObjectContext objectContext, int objc, Tcl_Obj *const *objv); -typedef void (*Tcl_MethodDeleteProc)(ClientData clientData); -typedef int (*Tcl_CloneProc)(Tcl_Interp *interp, ClientData oldClientData, +typedef void (Tcl_MethodDeleteProc)(ClientData clientData); +typedef int (Tcl_CloneProc)(Tcl_Interp *interp, ClientData oldClientData, ClientData *newClientData); -typedef void (*Tcl_ObjectMetadataDeleteProc)(ClientData clientData); -typedef int (*Tcl_ObjectMapMethodNameProc)(Tcl_Interp *interp, +typedef void (Tcl_ObjectMetadataDeleteProc)(ClientData clientData); +typedef int (Tcl_ObjectMapMethodNameProc)(Tcl_Interp *interp, Tcl_Object object, Tcl_Class *startClsPtr, Tcl_Obj *methodNameObj); /* @@ -72,12 +72,13 @@ typedef struct { * declarations. */ const char *name; /* Name of this type of method, mostly for * debugging purposes. */ - Tcl_MethodCallProc callProc;/* How to invoke this method. */ - Tcl_MethodDeleteProc deleteProc; + Tcl_MethodCallProc *callProc; + /* How to invoke this method. */ + Tcl_MethodDeleteProc *deleteProc; /* How to delete this method's type-specific * data, or NULL if the type-specific data * does not need deleting. */ - Tcl_CloneProc cloneProc; /* How to copy this method's type-specific + Tcl_CloneProc *cloneProc; /* How to copy this method's type-specific * data, or NULL if the type-specific data can * be copied directly. */ } Tcl_MethodType; @@ -101,10 +102,10 @@ typedef struct { * to TCL_OO_METADATA_VERSION_CURRENT in * declarations. */ const char *name; - Tcl_ObjectMetadataDeleteProc deleteProc; + Tcl_ObjectMetadataDeleteProc *deleteProc; /* How to delete the metadata. This must not * be NULL. */ - Tcl_CloneProc cloneProc; /* How to copy the metadata, or NULL if the + Tcl_CloneProc *cloneProc; /* How to copy the metadata, or NULL if the * type-specific data can be copied * directly. */ } Tcl_ObjectMetadataType; diff --git a/generic/tclOODecls.h b/generic/tclOODecls.h index edbb677..d6ed407 100644 --- a/generic/tclOODecls.h +++ b/generic/tclOODecls.h @@ -1,5 +1,5 @@ /* - * $Id: tclOODecls.h,v 1.14 2010/02/05 10:03:23 nijtmans Exp $ + * $Id: tclOODecls.h,v 1.15 2010/03/05 15:32:16 dkf Exp $ * * This file is (mostly) automatically generated from tclOO.decls. */ @@ -186,14 +186,14 @@ EXTERN int Tcl_ObjectContextInvokeNext(Tcl_Interp *interp, #ifndef Tcl_ObjectGetMethodNameMapper_TCL_DECLARED #define Tcl_ObjectGetMethodNameMapper_TCL_DECLARED /* 24 */ -EXTERN Tcl_ObjectMapMethodNameProc Tcl_ObjectGetMethodNameMapper( +EXTERN Tcl_ObjectMapMethodNameProc * Tcl_ObjectGetMethodNameMapper( Tcl_Object object); #endif #ifndef Tcl_ObjectSetMethodNameMapper_TCL_DECLARED #define Tcl_ObjectSetMethodNameMapper_TCL_DECLARED /* 25 */ EXTERN void Tcl_ObjectSetMethodNameMapper(Tcl_Object object, - Tcl_ObjectMapMethodNameProc mapMethodNameProc); + Tcl_ObjectMapMethodNameProc *mapMethodNameProc); #endif #ifndef Tcl_ClassSetConstructor_TCL_DECLARED #define Tcl_ClassSetConstructor_TCL_DECLARED @@ -246,8 +246,8 @@ typedef struct TclOOStubs { ClientData (*tcl_ObjectGetMetadata) (Tcl_Object object, const Tcl_ObjectMetadataType *typePtr); /* 21 */ void (*tcl_ObjectSetMetadata) (Tcl_Object object, const Tcl_ObjectMetadataType *typePtr, ClientData metadata); /* 22 */ int (*tcl_ObjectContextInvokeNext) (Tcl_Interp *interp, Tcl_ObjectContext context, int objc, Tcl_Obj *const *objv, int skip); /* 23 */ - Tcl_ObjectMapMethodNameProc (*tcl_ObjectGetMethodNameMapper) (Tcl_Object object); /* 24 */ - void (*tcl_ObjectSetMethodNameMapper) (Tcl_Object object, Tcl_ObjectMapMethodNameProc mapMethodNameProc); /* 25 */ + Tcl_ObjectMapMethodNameProc * (*tcl_ObjectGetMethodNameMapper) (Tcl_Object object); /* 24 */ + void (*tcl_ObjectSetMethodNameMapper) (Tcl_Object object, Tcl_ObjectMapMethodNameProc *mapMethodNameProc); /* 25 */ void (*tcl_ClassSetConstructor) (Tcl_Interp *interp, Tcl_Class clazz, Tcl_Method method); /* 26 */ void (*tcl_ClassSetDestructor) (Tcl_Interp *interp, Tcl_Class clazz, Tcl_Method method); /* 27 */ Tcl_Obj * (*tcl_GetObjectName) (Tcl_Interp *interp, Tcl_Object object); /* 28 */ diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h index 2103dc0..192d684 100644 --- a/generic/tclOOInt.h +++ b/generic/tclOOInt.h @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclOOInt.h,v 1.16 2010/03/04 23:42:54 dkf Exp $ + * RCS: @(#) $Id: tclOOInt.h,v 1.17 2010/03/05 15:32:16 dkf Exp $ */ #ifndef TCL_OO_INTERNAL_H @@ -67,12 +67,12 @@ typedef struct Method { * tuned in their behaviour. */ -typedef int (*TclOO_PreCallProc)(ClientData clientData, Tcl_Interp *interp, +typedef int (TclOO_PreCallProc)(ClientData clientData, Tcl_Interp *interp, Tcl_ObjectContext context, Tcl_CallFrame *framePtr, int *isFinished); -typedef int (*TclOO_PostCallProc)(ClientData clientData, Tcl_Interp *interp, +typedef int (TclOO_PostCallProc)(ClientData clientData, Tcl_Interp *interp, Tcl_ObjectContext context, Tcl_Namespace *namespacePtr, int result); -typedef void (*TclOO_PmCDDeleteProc)(ClientData clientData); -typedef ClientData (*TclOO_PmCDCloneProc)(ClientData clientData); +typedef void (TclOO_PmCDDeleteProc)(ClientData clientData); +typedef ClientData (TclOO_PmCDCloneProc)(ClientData clientData); /* * Procedure-like methods have the following extra information. @@ -87,13 +87,13 @@ typedef struct ProcedureMethod { int flags; /* Flags to control features. */ int refCount; ClientData clientData; - TclOO_PmCDDeleteProc deleteClientdataProc; - TclOO_PmCDCloneProc cloneClientdataProc; + TclOO_PmCDDeleteProc *deleteClientdataProc; + TclOO_PmCDCloneProc *cloneClientdataProc; ProcErrorProc *errProc; /* Replacement error handler. */ - TclOO_PreCallProc preCallProc; + TclOO_PreCallProc *preCallProc; /* Callback to allow for additional setup * before the method executes. */ - TclOO_PostCallProc postCallProc; + TclOO_PostCallProc *postCallProc; /* Callback to allow for additional cleanup * after the method executes. */ GetFrameInfoValueProc *gfivProc; @@ -191,7 +191,7 @@ typedef struct Object { Tcl_Obj *cachedNameObj; /* Cache of the name of the object. */ Tcl_HashTable *chainCache; /* Place to keep unused contexts. This table * is indexed by method name as Tcl_Obj. */ - Tcl_ObjectMapMethodNameProc mapMethodNameProc; + Tcl_ObjectMapMethodNameProc *mapMethodNameProc; /* Function to allow remapping of method * names. For itcl-ng. */ LIST_STATIC(Tcl_Obj *) variables; diff --git a/generic/tclOOIntDecls.h b/generic/tclOOIntDecls.h index c307287..2d3400c 100644 --- a/generic/tclOOIntDecls.h +++ b/generic/tclOOIntDecls.h @@ -1,5 +1,5 @@ /* - * $Id: tclOOIntDecls.h,v 1.12 2010/02/05 10:03:23 nijtmans Exp $ + * $Id: tclOOIntDecls.h,v 1.13 2010/03/05 15:32:16 dkf Exp $ * * This file is (mostly) automatically generated from tclOO.decls. */ @@ -101,8 +101,8 @@ EXTERN Method * TclOONewForwardInstanceMethod(Tcl_Interp *interp, /* 9 */ EXTERN Tcl_Method TclOONewProcInstanceMethodEx(Tcl_Interp *interp, Tcl_Object oPtr, - TclOO_PreCallProc preCallPtr, - TclOO_PostCallProc postCallPtr, + TclOO_PreCallProc *preCallPtr, + TclOO_PostCallProc *postCallPtr, ProcErrorProc *errProc, ClientData clientData, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, @@ -113,8 +113,8 @@ EXTERN Tcl_Method TclOONewProcInstanceMethodEx(Tcl_Interp *interp, /* 10 */ EXTERN Tcl_Method TclOONewProcMethodEx(Tcl_Interp *interp, Tcl_Class clsPtr, - TclOO_PreCallProc preCallPtr, - TclOO_PostCallProc postCallPtr, + TclOO_PreCallProc *preCallPtr, + TclOO_PostCallProc *postCallPtr, ProcErrorProc *errProc, ClientData clientData, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, @@ -168,8 +168,8 @@ typedef struct TclOOIntStubs { int (*tclOOIsReachable) (Class *targetPtr, Class *startPtr); /* 6 */ Method * (*tclOONewForwardMethod) (Tcl_Interp *interp, Class *clsPtr, int isPublic, Tcl_Obj *nameObj, Tcl_Obj *prefixObj); /* 7 */ Method * (*tclOONewForwardInstanceMethod) (Tcl_Interp *interp, Object *oPtr, int isPublic, Tcl_Obj *nameObj, Tcl_Obj *prefixObj); /* 8 */ - Tcl_Method (*tclOONewProcInstanceMethodEx) (Tcl_Interp *interp, Tcl_Object oPtr, TclOO_PreCallProc preCallPtr, TclOO_PostCallProc postCallPtr, ProcErrorProc *errProc, ClientData clientData, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, int flags, void **internalTokenPtr); /* 9 */ - Tcl_Method (*tclOONewProcMethodEx) (Tcl_Interp *interp, Tcl_Class clsPtr, TclOO_PreCallProc preCallPtr, TclOO_PostCallProc postCallPtr, ProcErrorProc *errProc, ClientData clientData, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, int flags, void **internalTokenPtr); /* 10 */ + Tcl_Method (*tclOONewProcInstanceMethodEx) (Tcl_Interp *interp, Tcl_Object oPtr, TclOO_PreCallProc *preCallPtr, TclOO_PostCallProc *postCallPtr, ProcErrorProc *errProc, ClientData clientData, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, int flags, void **internalTokenPtr); /* 9 */ + Tcl_Method (*tclOONewProcMethodEx) (Tcl_Interp *interp, Tcl_Class clsPtr, TclOO_PreCallProc *preCallPtr, TclOO_PostCallProc *postCallPtr, ProcErrorProc *errProc, ClientData clientData, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, int flags, void **internalTokenPtr); /* 10 */ int (*tclOOInvokeObject) (Tcl_Interp *interp, Tcl_Object object, Tcl_Class startCls, int publicPrivate, int objc, Tcl_Obj *const *objv); /* 11 */ void (*tclOOObjectSetFilters) (Object *oPtr, int numFilters, Tcl_Obj *const *filters); /* 12 */ void (*tclOOClassSetFilters) (Tcl_Interp *interp, Class *classPtr, int numFilters, Tcl_Obj *const *filters); /* 13 */ |