From deb6373fff220f0b0dd3024a49ba0628be7b1018 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 22 Mar 2000 15:35:24 +0000 Subject: [PATCH] Data of type Point is passed by value, not by reference. --- Mac/Modules/ctl/Ctlmodule.c | 4 ++-- Mac/Modules/ctl/ctlsupport.py | 4 ++-- Mac/Modules/te/TEmodule.c | 10 +++++----- Mac/Modules/te/tesupport.py | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Mac/Modules/ctl/Ctlmodule.c b/Mac/Modules/ctl/Ctlmodule.c index 12e5809d88a..991b567db12 100644 --- a/Mac/Modules/ctl/Ctlmodule.c +++ b/Mac/Modules/ctl/Ctlmodule.c @@ -2059,7 +2059,7 @@ myhittestproc(ControlHandle control, Point where) short c_rv = -1; ctl_obj = (ControlObject *)CtlObj_WhichControl(control); - arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, &where); + arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, where); rv = callcallback(ctl_obj, kControlUserPaneHitTestProcTag, arglist); Py_XDECREF(arglist); /* Ignore errors, nothing we can do about them */ @@ -2078,7 +2078,7 @@ mytrackingproc(ControlHandle control, Point startPt, ControlActionUPP actionProc ctl_obj = (ControlObject *)CtlObj_WhichControl(control); /* We cannot pass the actionProc without lots of work */ - arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, &startPt); + arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, startPt); rv = callcallback(ctl_obj, kControlUserPaneTrackingProcTag, arglist); Py_XDECREF(arglist); if ( rv ) diff --git a/Mac/Modules/ctl/ctlsupport.py b/Mac/Modules/ctl/ctlsupport.py index a826d5b95ed..0df5d2b1ad9 100644 --- a/Mac/Modules/ctl/ctlsupport.py +++ b/Mac/Modules/ctl/ctlsupport.py @@ -252,7 +252,7 @@ short c_rv = -1; ctl_obj = (ControlObject *)CtlObj_WhichControl(control); - arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, &where); + arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, where); rv = callcallback(ctl_obj, kControlUserPaneHitTestProcTag, arglist); Py_XDECREF(arglist); /* Ignore errors, nothing we can do about them */ @@ -271,7 +271,7 @@ ctl_obj = (ControlObject *)CtlObj_WhichControl(control); /* We cannot pass the actionProc without lots of work */ - arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, &startPt); + arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, startPt); rv = callcallback(ctl_obj, kControlUserPaneTrackingProcTag, arglist); Py_XDECREF(arglist); if ( rv ) diff --git a/Mac/Modules/te/TEmodule.c b/Mac/Modules/te/TEmodule.c index 5b6502031f8..98b8de8585b 100644 --- a/Mac/Modules/te/TEmodule.c +++ b/Mac/Modules/te/TEmodule.c @@ -45,7 +45,7 @@ extern PyObject *WinObj_WhichWindow(WindowPtr); #include #define as_TE(h) ((TEHandle)h) -#define as_Handle(teh) ((Handle)teh) +#define as_Resource(teh) ((Handle)teh) /* Exported by Qdmodule.c: */ extern PyObject *QdRGB_New(RGBColor *); @@ -743,7 +743,7 @@ static PyObject *TEObj_TEGetHiliteRgn(_self, _args) return _res; } -static PyObject *TEObj_as_Handle(_self, _args) +static PyObject *TEObj_as_Resource(_self, _args) TEObject *_self; PyObject *_args; { @@ -751,7 +751,7 @@ static PyObject *TEObj_as_Handle(_self, _args) Handle _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; - _rv = as_Handle(_self->ob_itself); + _rv = as_Resource(_self->ob_itself); _res = Py_BuildValue("O&", ResObj_New, _rv); return _res; @@ -830,7 +830,7 @@ static PyMethodDef TEObj_methods[] = { "(short feature, short action) -> (short _rv)"}, {"TEGetHiliteRgn", (PyCFunction)TEObj_TEGetHiliteRgn, 1, "(RgnHandle region) -> None"}, - {"as_Handle", (PyCFunction)TEObj_as_Handle, 1, + {"as_Resource", (PyCFunction)TEObj_as_Resource, 1, "() -> (Handle _rv)"}, {NULL, NULL, 0} }; @@ -857,7 +857,7 @@ static PyObject *TEObj_getattr(self, name) return Py_BuildValue("h", (*self->ob_itself)->fontAscent); if( strcmp(name, "selPoint") == 0 ) return Py_BuildValue("O&", PyMac_BuildPoint, - &(*self->ob_itself)->selPoint); + (*self->ob_itself)->selPoint); if( strcmp(name, "selStart") == 0 ) return Py_BuildValue("h", (*self->ob_itself)->selStart); if( strcmp(name, "selEnd") == 0 ) diff --git a/Mac/Modules/te/tesupport.py b/Mac/Modules/te/tesupport.py index b078649f2e4..b33d0bd2f7a 100644 --- a/Mac/Modules/te/tesupport.py +++ b/Mac/Modules/te/tesupport.py @@ -107,7 +107,7 @@ def outputGetattrHook(self): return Py_BuildValue("h", (*self->ob_itself)->fontAscent); if( strcmp(name, "selPoint") == 0 ) return Py_BuildValue("O&", PyMac_BuildPoint, - &(*self->ob_itself)->selPoint); + (*self->ob_itself)->selPoint); if( strcmp(name, "selStart") == 0 ) return Py_BuildValue("h", (*self->ob_itself)->selStart); if( strcmp(name, "selEnd") == 0 )