Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit deb6373

Browse files
committed
Data of type Point is passed by value, not by reference.
1 parent 8e14f05 commit deb6373

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

Mac/Modules/ctl/Ctlmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,7 +2059,7 @@ myhittestproc(ControlHandle control, Point where)
20592059
short c_rv = -1;
20602060

20612061
ctl_obj = (ControlObject *)CtlObj_WhichControl(control);
2062-
arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, &where);
2062+
arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, where);
20632063
rv = callcallback(ctl_obj, kControlUserPaneHitTestProcTag, arglist);
20642064
Py_XDECREF(arglist);
20652065
/* Ignore errors, nothing we can do about them */
@@ -2078,7 +2078,7 @@ mytrackingproc(ControlHandle control, Point startPt, ControlActionUPP actionProc
20782078

20792079
ctl_obj = (ControlObject *)CtlObj_WhichControl(control);
20802080
/* We cannot pass the actionProc without lots of work */
2081-
arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, &startPt);
2081+
arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, startPt);
20822082
rv = callcallback(ctl_obj, kControlUserPaneTrackingProcTag, arglist);
20832083
Py_XDECREF(arglist);
20842084
if ( rv )

Mac/Modules/ctl/ctlsupport.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@
252252
short c_rv = -1;
253253
254254
ctl_obj = (ControlObject *)CtlObj_WhichControl(control);
255-
arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, &where);
255+
arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, where);
256256
rv = callcallback(ctl_obj, kControlUserPaneHitTestProcTag, arglist);
257257
Py_XDECREF(arglist);
258258
/* Ignore errors, nothing we can do about them */
@@ -271,7 +271,7 @@
271271
272272
ctl_obj = (ControlObject *)CtlObj_WhichControl(control);
273273
/* We cannot pass the actionProc without lots of work */
274-
arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, &startPt);
274+
arglist = Py_BuildValue("OO&", ctl_obj, PyMac_BuildPoint, startPt);
275275
rv = callcallback(ctl_obj, kControlUserPaneTrackingProcTag, arglist);
276276
Py_XDECREF(arglist);
277277
if ( rv )

Mac/Modules/te/TEmodule.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extern PyObject *WinObj_WhichWindow(WindowPtr);
4545
#include <TextEdit.h>
4646

4747
#define as_TE(h) ((TEHandle)h)
48-
#define as_Handle(teh) ((Handle)teh)
48+
#define as_Resource(teh) ((Handle)teh)
4949

5050
/* Exported by Qdmodule.c: */
5151
extern PyObject *QdRGB_New(RGBColor *);
@@ -743,15 +743,15 @@ static PyObject *TEObj_TEGetHiliteRgn(_self, _args)
743743
return _res;
744744
}
745745

746-
static PyObject *TEObj_as_Handle(_self, _args)
746+
static PyObject *TEObj_as_Resource(_self, _args)
747747
TEObject *_self;
748748
PyObject *_args;
749749
{
750750
PyObject *_res = NULL;
751751
Handle _rv;
752752
if (!PyArg_ParseTuple(_args, ""))
753753
return NULL;
754-
_rv = as_Handle(_self->ob_itself);
754+
_rv = as_Resource(_self->ob_itself);
755755
_res = Py_BuildValue("O&",
756756
ResObj_New, _rv);
757757
return _res;
@@ -830,7 +830,7 @@ static PyMethodDef TEObj_methods[] = {
830830
"(short feature, short action) -> (short _rv)"},
831831
{"TEGetHiliteRgn", (PyCFunction)TEObj_TEGetHiliteRgn, 1,
832832
"(RgnHandle region) -> None"},
833-
{"as_Handle", (PyCFunction)TEObj_as_Handle, 1,
833+
{"as_Resource", (PyCFunction)TEObj_as_Resource, 1,
834834
"() -> (Handle _rv)"},
835835
{NULL, NULL, 0}
836836
};
@@ -857,7 +857,7 @@ static PyObject *TEObj_getattr(self, name)
857857
return Py_BuildValue("h", (*self->ob_itself)->fontAscent);
858858
if( strcmp(name, "selPoint") == 0 )
859859
return Py_BuildValue("O&", PyMac_BuildPoint,
860-
&(*self->ob_itself)->selPoint);
860+
(*self->ob_itself)->selPoint);
861861
if( strcmp(name, "selStart") == 0 )
862862
return Py_BuildValue("h", (*self->ob_itself)->selStart);
863863
if( strcmp(name, "selEnd") == 0 )

Mac/Modules/te/tesupport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def outputGetattrHook(self):
107107
return Py_BuildValue("h", (*self->ob_itself)->fontAscent);
108108
if( strcmp(name, "selPoint") == 0 )
109109
return Py_BuildValue("O&", PyMac_BuildPoint,
110-
&(*self->ob_itself)->selPoint);
110+
(*self->ob_itself)->selPoint);
111111
if( strcmp(name, "selStart") == 0 )
112112
return Py_BuildValue("h", (*self->ob_itself)->selStart);
113113
if( strcmp(name, "selEnd") == 0 )

0 commit comments

Comments
 (0)