diff options
| author | dkf <donal.k.fellows@manchester.ac.uk> | 2024-01-29 20:48:15 (GMT) |
|---|---|---|
| committer | dkf <donal.k.fellows@manchester.ac.uk> | 2024-01-29 20:48:15 (GMT) |
| commit | 254a7ffd9e9012f7b59121e6d6679ce2e661800f (patch) | |
| tree | 008f10e8bddca0a84dffae8129cea894b819f2d5 /generic/tclOOBasic.c | |
| parent | 025b1d2b0807cab028100573e9d14d8e23bb8ba6 (diff) | |
| download | tcl-254a7ffd9e9012f7b59121e6d6679ce2e661800f.zip tcl-254a7ffd9e9012f7b59121e6d6679ce2e661800f.tar.gz tcl-254a7ffd9e9012f7b59121e6d6679ce2e661800f.tar.bz2 | |
Add doc comments
Diffstat (limited to 'generic/tclOOBasic.c')
| -rw-r--r-- | generic/tclOOBasic.c | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c index 2b4f220..2732036 100644 --- a/generic/tclOOBasic.c +++ b/generic/tclOOBasic.c @@ -1777,46 +1777,58 @@ static Tcl_MethodType SetterType = { void TclOOImplementObjectProperty( - Tcl_Object targetObject, + Tcl_Object targetObject, /* What to install into. */ Tcl_Obj *propNamePtr, /* Property name, without leading - */ - int installGetter, - int installSetter) + int installGetter, /* Whether to install a standard getter. */ + int installSetter) /* Whether to install a standard setter. */ { if (installGetter) { - Tcl_Obj *methodName = Tcl_ObjPrintf("<ReadProp-%s>", TclGetString(propNamePtr)); + Tcl_Obj *methodName = Tcl_ObjPrintf( + "<ReadProp-%s>", TclGetString(propNamePtr)); + // Don't know if TclNewInstanceMethod will retain a ref to the method name Tcl_IncrRefCount(methodName); - Tcl_IncrRefCount(propNamePtr); - TclNewInstanceMethod(NULL, targetObject, methodName, 0, &GetterType, propNamePtr); + Tcl_IncrRefCount(propNamePtr); // Paired with DetailsDeleter + TclNewInstanceMethod( + NULL, targetObject, methodName, 0, &GetterType, propNamePtr); Tcl_DecrRefCount(methodName); } if (installSetter) { - Tcl_Obj *methodName = Tcl_ObjPrintf("<WriteProp-%s>", TclGetString(propNamePtr)); + Tcl_Obj *methodName = Tcl_ObjPrintf( + "<WriteProp-%s>", TclGetString(propNamePtr)); + // Don't know if TclNewInstanceMethod will retain a ref to the method name Tcl_IncrRefCount(methodName); - Tcl_IncrRefCount(propNamePtr); - TclNewInstanceMethod(NULL, targetObject, methodName, 0, &SetterType, propNamePtr); + Tcl_IncrRefCount(propNamePtr); // Paired with DetailsDeleter + TclNewInstanceMethod( + NULL, targetObject, methodName, 0, &SetterType, propNamePtr); Tcl_DecrRefCount(methodName); } } void TclOOImplementClassProperty( - Tcl_Class targetClass, + Tcl_Class targetClass, /* What to install into. */ Tcl_Obj *propNamePtr, /* Property name, without leading - */ - int installGetter, - int installSetter) + int installGetter, /* Whether to install a standard getter. */ + int installSetter) /* Whether to install a standard setter. */ { if (installGetter) { - Tcl_Obj *methodName = Tcl_ObjPrintf("<ReadProp-%s>", TclGetString(propNamePtr)); + Tcl_Obj *methodName = Tcl_ObjPrintf( + "<ReadProp-%s>", TclGetString(propNamePtr)); + // Don't know if TclNewMethod will retain a ref to the method name Tcl_IncrRefCount(methodName); - Tcl_IncrRefCount(propNamePtr); - TclNewMethod(NULL, targetClass, methodName, 0, &GetterType, propNamePtr); + Tcl_IncrRefCount(propNamePtr); // Paired with DetailsDeleter + TclNewMethod( + NULL, targetClass, methodName, 0, &GetterType, propNamePtr); Tcl_DecrRefCount(methodName); } if (installSetter) { - Tcl_Obj *methodName = Tcl_ObjPrintf("<WriteProp-%s>", TclGetString(propNamePtr)); + Tcl_Obj *methodName = Tcl_ObjPrintf( + "<WriteProp-%s>", TclGetString(propNamePtr)); + // Don't know if TclNewMethod will retain a ref to the method name Tcl_IncrRefCount(methodName); - Tcl_IncrRefCount(propNamePtr); - TclNewMethod(NULL, targetClass, methodName, 0, &SetterType, propNamePtr); + Tcl_IncrRefCount(propNamePtr); // Paired with DetailsDeleter + TclNewMethod( + NULL, targetClass, methodName, 0, &SetterType, propNamePtr); Tcl_DecrRefCount(methodName); } } |
