summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/ctl/ctlsupport.py
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/Modules/ctl/ctlsupport.py')
-rw-r--r--Mac/Modules/ctl/ctlsupport.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Mac/Modules/ctl/ctlsupport.py b/Mac/Modules/ctl/ctlsupport.py
index f65d7fb..d84368c 100644
--- a/Mac/Modules/ctl/ctlsupport.py
+++ b/Mac/Modules/ctl/ctlsupport.py
@@ -169,6 +169,7 @@ settrackfunc(PyObject *obj)
}
tracker = obj;
Py_INCREF(tracker);
+ return 1;
}
static void
@@ -218,7 +219,7 @@ setcallback(PyObject *myself, OSType which, PyObject *callback, UniversalProcPtr
if ( (self->ob_callbackdict = PyDict_New()) == NULL )
return -1;
/* And store the Python callback */
- sprintf(keybuf, "%x", which);
+ sprintf(keybuf, "%x", (unsigned)which);
if (PyDict_SetItemString(self->ob_callbackdict, keybuf, callback) < 0)
return -1;
return 0;
@@ -230,7 +231,7 @@ callcallback(ControlObject *self, OSType which, PyObject *arglist)
char keybuf[9];
PyObject *func, *rv;
- sprintf(keybuf, "%x", which);
+ sprintf(keybuf, "%x", (unsigned)which);
if ( self->ob_callbackdict == NULL ||
(func = PyDict_GetItemString(self->ob_callbackdict, keybuf)) == NULL ) {
PySys_WriteStderr("Control callback %x without callback object\\n", which);
@@ -554,7 +555,8 @@ _err = GetControlData(_self->ob_itself,
if (_err != noErr) {
return PyMac_Error(_err);
}
-return Py_BuildValue("O&", OptResObj_New, hdl);
+_res = Py_BuildValue("O&", OptResObj_New, hdl);
+return _res;
"""
f = ManualGenerator("GetControlData_Handle", getcontroldata_handle_body);