summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/ctl
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-09-05 10:31:52 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-09-05 10:31:52 (GMT)
commitfd064863ebbe90adc24c60df4c3dbf630ec3a6c4 (patch)
tree60d77f56f209d3909b275d760bb4aedc9bd1d243 /Mac/Modules/ctl
parent5a1516bce5c9aa6f957f1e93ba85d143d8eac03a (diff)
downloadcpython-fd064863ebbe90adc24c60df4c3dbf630ec3a6c4.zip
cpython-fd064863ebbe90adc24c60df4c3dbf630ec3a6c4.tar.gz
cpython-fd064863ebbe90adc24c60df4c3dbf630ec3a6c4.tar.bz2
Shut up many more gcc warnings.
Diffstat (limited to 'Mac/Modules/ctl')
-rw-r--r--Mac/Modules/ctl/_Ctlmodule.c12
-rw-r--r--Mac/Modules/ctl/ctlsupport.py8
2 files changed, 14 insertions, 6 deletions
diff --git a/Mac/Modules/ctl/_Ctlmodule.c b/Mac/Modules/ctl/_Ctlmodule.c
index 34195e9..837e86a 100644
--- a/Mac/Modules/ctl/_Ctlmodule.c
+++ b/Mac/Modules/ctl/_Ctlmodule.c
@@ -5,8 +5,12 @@
+#ifdef _WIN32
+#include "pywintoolbox.h"
+#else
#include "macglue.h"
#include "pymactoolbox.h"
+#endif
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
@@ -1676,7 +1680,8 @@ static PyObject *CtlObj_GetControlData_Handle(ControlObject *_self, PyObject *_a
if (_err != noErr) {
return PyMac_Error(_err);
}
- return Py_BuildValue("O&", OptResObj_New, hdl);
+ _res = Py_BuildValue("O&", OptResObj_New, hdl);
+ return _res;
}
@@ -2526,6 +2531,7 @@ settrackfunc(PyObject *obj)
}
tracker = obj;
Py_INCREF(tracker);
+ return 1;
}
static void
@@ -2575,7 +2581,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;
@@ -2587,7 +2593,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);
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);