diff options
| author | kjnash <k.j.nash@usa.net> | 2018-09-15 18:41:23 (GMT) |
|---|---|---|
| committer | kjnash <k.j.nash@usa.net> | 2018-09-15 18:41:23 (GMT) |
| commit | d24a3eb2babc2868c7935f0815288c9ab02c3880 (patch) | |
| tree | 2ee6809fdc6448db53cbd12bb6e35df4fe077503 /generic/tclOODefineCmds.c | |
| parent | 754bb107b4100f394d445d589dddc94e59dd2d04 (diff) | |
| parent | 9a15a1b58648809ffb208eaa00cd20af4784050d (diff) | |
| download | tcl-d24a3eb2babc2868c7935f0815288c9ab02c3880.zip tcl-d24a3eb2babc2868c7935f0815288c9ab02c3880.tar.gz tcl-d24a3eb2babc2868c7935f0815288c9ab02c3880.tar.bz2 | |
merge 8.6
Diffstat (limited to 'generic/tclOODefineCmds.c')
| -rw-r--r-- | generic/tclOODefineCmds.c | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index 648ad02..c924d2b 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -1542,69 +1542,6 @@ TclOODefineMethodObjCmd( /* * ---------------------------------------------------------------------- * - * TclOODefineMixinObjCmd -- - * Implementation of the "mixin" subcommand of the "oo::define" and - * "oo::objdefine" commands. - * - * ---------------------------------------------------------------------- - */ - -int -TclOODefineMixinObjCmd( - ClientData clientData, - Tcl_Interp *interp, - const int objc, - Tcl_Obj *const *objv) -{ - int isInstanceMixin = (clientData != NULL); - Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); - Class **mixins; - int i; - - if (oPtr == NULL) { - return TCL_ERROR; - } - if (!isInstanceMixin && !oPtr->classPtr) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); - return TCL_ERROR; - } - mixins = TclStackAlloc(interp, sizeof(Class *) * (objc-1)); - - for (i=1 ; i<objc ; i++) { - Class *clsPtr = GetClassInOuterContext(interp, objv[i], - "may only mix in classes"); - - if (clsPtr == NULL) { - goto freeAndError; - } - if (!isInstanceMixin && TclOOIsReachable(oPtr->classPtr, clsPtr)) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "may not mix a class into itself", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "SELF_MIXIN", NULL); - goto freeAndError; - } - mixins[i-1] = clsPtr; - } - - if (isInstanceMixin) { - TclOOObjectSetMixins(oPtr, objc-1, mixins); - } else { - TclOOClassSetMixins(interp, oPtr->classPtr, objc-1, mixins); - } - - TclStackFree(interp, mixins); - return TCL_OK; - - freeAndError: - TclStackFree(interp, mixins); - return TCL_ERROR; -} - -/* - * ---------------------------------------------------------------------- - * * TclOODefineRenameMethodObjCmd -- * Implementation of the "renamemethod" subcommand of the "oo::define" * and "oo::objdefine" commands. |
