summaryrefslogtreecommitdiffstats
path: root/Mac/Modules
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-07-11 21:12:55 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2000-07-11 21:12:55 (GMT)
commit85152b93cb5f910f7345d623e9c057aa1d2ca6e0 (patch)
tree26b97f8f2cacb7959683cf4950d4484e1b795eb0 /Mac/Modules
parent88887aa38eee7d6c12c5f5a108b6a0a4302d7ae5 (diff)
downloadcpython-85152b93cb5f910f7345d623e9c057aa1d2ca6e0.zip
cpython-85152b93cb5f910f7345d623e9c057aa1d2ca6e0.tar.gz
cpython-85152b93cb5f910f7345d623e9c057aa1d2ca6e0.tar.bz2
Fiddled declaration/implementation of setcallback() so that it is ansifyable.
Diffstat (limited to 'Mac/Modules')
-rw-r--r--Mac/Modules/ctl/Ctlmodule.c12
-rw-r--r--Mac/Modules/ctl/ctlsupport.py12
2 files changed, 16 insertions, 8 deletions
diff --git a/Mac/Modules/ctl/Ctlmodule.c b/Mac/Modules/ctl/Ctlmodule.c
index cafe0d6..8632767 100644
--- a/Mac/Modules/ctl/Ctlmodule.c
+++ b/Mac/Modules/ctl/Ctlmodule.c
@@ -93,6 +93,9 @@ static ControlUserPaneTrackingUPP mytrackingproc_upp;
extern int settrackfunc(PyObject *); /* forward */
extern void clrtrackfunc(void); /* forward */
+#ifndef TARGET_API_MAC_CARBON_NOTYET
+staticforward int setcallback(PyObject *, OSType, PyObject *, UniversalProcPtr *);
+#endif
static PyObject *Ctl_Error;
@@ -1441,7 +1444,7 @@ static PyObject *CtlObj_SetControlDataCallback(_self, _args)
ControlPartCode inPart;
ResType inTagName;
PyObject *callback;
- UniversalProcPtr *c_callback;
+ UniversalProcPtr c_callback;
if (!PyArg_ParseTuple(_args, "hO&O",
&inPart,
@@ -1449,7 +1452,7 @@ static PyObject *CtlObj_SetControlDataCallback(_self, _args)
&callback))
return NULL;
- if ( setcallback(_self, inTagName, callback, &c_callback) < 0 )
+ if ( setcallback((PyObject *)_self, inTagName, callback, &c_callback) < 0 )
return NULL;
_err = SetControlData(_self->ob_itself,
inPart,
@@ -2164,12 +2167,13 @@ mytracker(ControlHandle ctl, short part)
#ifndef TARGET_API_MAC_CARBON_NOTYET
static int
-setcallback(self, which, callback, uppp)
- ControlObject *self;
+setcallback(myself, which, callback, uppp)
+ PyObject *myself;
OSType which;
PyObject *callback;
UniversalProcPtr *uppp;
{
+ ControlObject *self = (ControlObject *)myself;
char keybuf[9];
if ( which == kControlUserPaneDrawProcTag )
diff --git a/Mac/Modules/ctl/ctlsupport.py b/Mac/Modules/ctl/ctlsupport.py
index 0623400..30c4491 100644
--- a/Mac/Modules/ctl/ctlsupport.py
+++ b/Mac/Modules/ctl/ctlsupport.py
@@ -93,6 +93,9 @@ static ControlUserPaneTrackingUPP mytrackingproc_upp;
extern int settrackfunc(PyObject *); /* forward */
extern void clrtrackfunc(void); /* forward */
+#ifndef TARGET_API_MAC_CARBON_NOTYET
+staticforward int setcallback(PyObject *, OSType, PyObject *, UniversalProcPtr *);
+#endif
"""
finalstuff = finalstuff + """
@@ -165,12 +168,13 @@ mytracker(ControlHandle ctl, short part)
#ifndef TARGET_API_MAC_CARBON_NOTYET
static int
-setcallback(self, which, callback, uppp)
- ControlObject *self;
+setcallback(myself, which, callback, uppp)
+ PyObject *myself;
OSType which;
PyObject *callback;
UniversalProcPtr *uppp;
{
+ ControlObject *self = (ControlObject *)myself;
char keybuf[9];
if ( which == kControlUserPaneDrawProcTag )
@@ -544,7 +548,7 @@ OSErr _err;
ControlPartCode inPart;
ResType inTagName;
PyObject *callback;
-UniversalProcPtr *c_callback;
+UniversalProcPtr c_callback;
if (!PyArg_ParseTuple(_args, "hO&O",
&inPart,
@@ -552,7 +556,7 @@ if (!PyArg_ParseTuple(_args, "hO&O",
&callback))
return NULL;
-if ( setcallback(_self, inTagName, callback, &c_callback) < 0 )
+if ( setcallback((PyObject *)_self, inTagName, callback, &c_callback) < 0 )
return NULL;
_err = SetControlData(_self->ob_itself,
inPart,