From fd064863ebbe90adc24c60df4c3dbf630ec3a6c4 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 5 Sep 2001 10:31:52 +0000 Subject: Shut up many more gcc warnings. --- Mac/Modules/ae/_AEmodule.c | 11 ++++------- Mac/Modules/app/_Appmodule.c | 4 ++++ Mac/Modules/cf/_CFmodule.c | 30 ++++++++++++++---------------- Mac/Modules/cf/cfsupport.py | 20 ++++++++++---------- Mac/Modules/cm/_Cmmodule.c | 4 ++++ Mac/Modules/ctl/_Ctlmodule.c | 12 +++++++++--- Mac/Modules/ctl/ctlsupport.py | 8 +++++--- Mac/Modules/dlg/_Dlgmodule.c | 4 ++++ Mac/Modules/drag/_Dragmodule.c | 18 ++++++++++++------ Mac/Modules/drag/dragsupport.py | 12 ++++++++---- Mac/Modules/evt/_Evtmodule.c | 5 ++++- Mac/Modules/fm/_Fmmodule.c | 4 ++++ Mac/Modules/help/_Helpmodule.c | 4 ++++ Mac/Modules/icn/_Icnmodule.c | 4 ++++ Mac/Modules/list/_Listmodule.c | 9 ++++++--- Mac/Modules/list/listsupport.py | 3 ++- Mac/Modules/menu/_Menumodule.c | 4 ++++ Mac/Modules/mlte/_Mltemodule.c | 5 ++++- Mac/Modules/qd/_Qdmodule.c | 30 ++++++++++++++---------------- Mac/Modules/qd/qdsupport.py | 12 +++++++++--- Mac/Modules/qdoffs/_Qdoffsmodule.c | 10 ++++++++-- Mac/Modules/qdoffs/qdoffssupport.py | 6 ++++-- Mac/Modules/qt/_Qtmodule.c | 4 ++++ Mac/Modules/res/_Resmodule.c | 12 +++++++++--- Mac/Modules/res/resedit.py | 3 ++- Mac/Modules/res/ressupport.py | 2 +- Mac/Modules/snd/_Sndmodule.c | 24 ++++++++---------------- Mac/Modules/snd/sndsupport.py | 10 +++++++--- Mac/Modules/te/_TEmodule.c | 8 ++++---- Mac/Modules/win/_Winmodule.c | 9 +++++++-- Mac/Modules/win/winsupport.py | 5 +++-- 31 files changed, 186 insertions(+), 110 deletions(-) diff --git a/Mac/Modules/ae/_AEmodule.c b/Mac/Modules/ae/_AEmodule.c index d01b100..b6e3c48 100644 --- a/Mac/Modules/ae/_AEmodule.c +++ b/Mac/Modules/ae/_AEmodule.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 ) {\ @@ -158,7 +162,6 @@ static PyObject *AEDesc_AEPutPtr(AEDescObject *_self, PyObject *_args) if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; - dataPtr__error__: ; return _res; } @@ -302,7 +305,6 @@ static PyObject *AEDesc_AEPutParamPtr(AEDescObject *_self, PyObject *_args) if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; - dataPtr__error__: ; return _res; } @@ -517,7 +519,6 @@ static PyObject *AEDesc_AEPutAttributePtr(AEDescObject *_self, PyObject *_args) if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; - dataPtr__error__: ; return _res; } @@ -827,7 +828,6 @@ static PyObject *AE_AECoercePtr(PyObject *_self, PyObject *_args) if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&", AEDesc_New, &result); - dataPtr__error__: ; return _res; } @@ -851,7 +851,6 @@ static PyObject *AE_AECreateDesc(PyObject *_self, PyObject *_args) if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&", AEDesc_New, &result); - dataPtr__error__: ; return _res; } @@ -875,7 +874,6 @@ static PyObject *AE_AECreateList(PyObject *_self, PyObject *_args) if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&", AEDesc_New, &resultList); - factoringPtr__error__: ; return _res; } @@ -930,7 +928,6 @@ static PyObject *AE_AEReplaceDescData(PyObject *_self, PyObject *_args) if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&", AEDesc_New, &theAEDesc); - dataPtr__error__: ; return _res; } #endif diff --git a/Mac/Modules/app/_Appmodule.c b/Mac/Modules/app/_Appmodule.c index b70feda..b672db0 100644 --- a/Mac/Modules/app/_Appmodule.c +++ b/Mac/Modules/app/_Appmodule.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 ) {\ diff --git a/Mac/Modules/cf/_CFmodule.c b/Mac/Modules/cf/_CFmodule.c index 124f9dc..649e437 100644 --- a/Mac/Modules/cf/_CFmodule.c +++ b/Mac/Modules/cf/_CFmodule.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 ) {\ @@ -272,7 +276,7 @@ static int CFTypeRefObj_compare(CFTypeRefObject *self, CFTypeRefObject *other) static PyObject * CFTypeRefObj_repr(CFTypeRefObject *self) { char buf[100]; - sprintf(buf, "", CFGetTypeID(self->ob_itself), (unsigned long)self, (unsigned long)self->ob_itself); + sprintf(buf, "", CFGetTypeID(self->ob_itself), (unsigned)self, (unsigned)self->ob_itself); return PyString_FromString(buf); } @@ -422,7 +426,7 @@ static int CFArrayRefObj_compare(CFArrayRefObject *self, CFArrayRefObject *other static PyObject * CFArrayRefObj_repr(CFArrayRefObject *self) { char buf[100]; - sprintf(buf, "", self, self->ob_itself); + sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself); return PyString_FromString(buf); } @@ -575,7 +579,7 @@ static int CFMutableArrayRefObj_compare(CFMutableArrayRefObject *self, CFMutable static PyObject * CFMutableArrayRefObj_repr(CFMutableArrayRefObject *self) { char buf[100]; - sprintf(buf, "", self, self->ob_itself); + sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself); return PyString_FromString(buf); } @@ -707,7 +711,7 @@ static int CFDictionaryRefObj_compare(CFDictionaryRefObject *self, CFDictionaryR static PyObject * CFDictionaryRefObj_repr(CFDictionaryRefObject *self) { char buf[100]; - sprintf(buf, "", self, self->ob_itself); + sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself); return PyString_FromString(buf); } @@ -823,7 +827,7 @@ static int CFMutableDictionaryRefObj_compare(CFMutableDictionaryRefObject *self, static PyObject * CFMutableDictionaryRefObj_repr(CFMutableDictionaryRefObject *self) { char buf[100]; - sprintf(buf, "", self, self->ob_itself); + sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself); return PyString_FromString(buf); } @@ -973,7 +977,7 @@ static int CFDataRefObj_compare(CFDataRefObject *self, CFDataRefObject *other) static PyObject * CFDataRefObj_repr(CFDataRefObject *self) { char buf[100]; - sprintf(buf, "", self, self->ob_itself); + sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself); return PyString_FromString(buf); } @@ -1096,7 +1100,6 @@ static PyObject *CFMutableDataRefObj_CFDataAppendBytes(CFMutableDataRefObject *_ bytes__in__, bytes__len__); Py_INCREF(Py_None); _res = Py_None; - bytes__error__: ; return _res; } @@ -1118,7 +1121,6 @@ static PyObject *CFMutableDataRefObj_CFDataReplaceBytes(CFMutableDataRefObject * newBytes__in__, newBytes__len__); Py_INCREF(Py_None); _res = Py_None; - newBytes__error__: ; return _res; } @@ -1171,7 +1173,7 @@ static int CFMutableDataRefObj_compare(CFMutableDataRefObject *self, CFMutableDa static PyObject * CFMutableDataRefObj_repr(CFMutableDataRefObject *self) { char buf[100]; - sprintf(buf, "", self, self->ob_itself); + sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself); return PyString_FromString(buf); } @@ -1774,7 +1776,7 @@ static int CFStringRefObj_compare(CFStringRefObject *self, CFStringRefObject *ot static PyObject * CFStringRefObj_repr(CFStringRefObject *self) { char buf[100]; - sprintf(buf, "", self, self->ob_itself); + sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself); return PyString_FromString(buf); } @@ -2061,7 +2063,7 @@ static int CFMutableStringRefObj_compare(CFMutableStringRefObject *self, CFMutab static PyObject * CFMutableStringRefObj_repr(CFMutableStringRefObject *self) { char buf[100]; - sprintf(buf, "", self, self->ob_itself); + sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself); return PyString_FromString(buf); } @@ -2433,7 +2435,7 @@ static int CFURLRefObj_compare(CFURLRefObject *self, CFURLRefObject *other) static PyObject * CFURLRefObj_repr(CFURLRefObject *self) { char buf[100]; - sprintf(buf, "", self, self->ob_itself); + sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself); return PyString_FromString(buf); } @@ -2590,7 +2592,6 @@ static PyObject *CF_CFDataCreate(PyObject *_self, PyObject *_args) bytes__in__, bytes__len__); _res = Py_BuildValue("O&", CFDataRefObj_New, _rv); - bytes__error__: ; return _res; } @@ -2611,7 +2612,6 @@ static PyObject *CF_CFDataCreateWithBytesNoCopy(PyObject *_self, PyObject *_args (CFAllocatorRef)NULL); _res = Py_BuildValue("O&", CFDataRefObj_New, _rv); - bytes__error__: ; return _res; } @@ -2848,7 +2848,6 @@ static PyObject *CF_CFStringCreateWithBytes(PyObject *_self, PyObject *_args) isExternalRepresentation); _res = Py_BuildValue("O&", CFStringRefObj_New, _rv); - bytes__error__: ; return _res; } @@ -3038,7 +3037,6 @@ static PyObject *CF_CFURLCreateWithBytes(PyObject *_self, PyObject *_args) baseURL); _res = Py_BuildValue("O&", CFURLRefObj_New, _rv); - URLBytes__error__: ; return _res; } diff --git a/Mac/Modules/cf/cfsupport.py b/Mac/Modules/cf/cfsupport.py index 18361fe..af62b66 100644 --- a/Mac/Modules/cf/cfsupport.py +++ b/Mac/Modules/cf/cfsupport.py @@ -190,7 +190,7 @@ class MyGlobalObjectDefinition(GlobalObjectDefinition): Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[100];") - Output("""sprintf(buf, "", CFGetTypeID(self->ob_itself), (unsigned long)self, (unsigned long)self->ob_itself);""") + Output("""sprintf(buf, "", CFGetTypeID(self->ob_itself), (unsigned)self, (unsigned)self->ob_itself);""") Output("return PyString_FromString(buf);") OutRbrace() @@ -205,7 +205,7 @@ class CFArrayRefObjectDefinition(MyGlobalObjectDefinition): Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[100];") - Output("""sprintf(buf, "", self, self->ob_itself);""") + Output("""sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself);""") Output("return PyString_FromString(buf);") OutRbrace() @@ -217,7 +217,7 @@ class CFMutableArrayRefObjectDefinition(MyGlobalObjectDefinition): Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[100];") - Output("""sprintf(buf, "", self, self->ob_itself);""") + Output("""sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself);""") Output("return PyString_FromString(buf);") OutRbrace() @@ -229,7 +229,7 @@ class CFDictionaryRefObjectDefinition(MyGlobalObjectDefinition): Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[100];") - Output("""sprintf(buf, "", self, self->ob_itself);""") + Output("""sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself);""") Output("return PyString_FromString(buf);") OutRbrace() @@ -241,7 +241,7 @@ class CFMutableDictionaryRefObjectDefinition(MyGlobalObjectDefinition): Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[100];") - Output("""sprintf(buf, "", self, self->ob_itself);""") + Output("""sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself);""") Output("return PyString_FromString(buf);") OutRbrace() @@ -253,7 +253,7 @@ class CFDataRefObjectDefinition(MyGlobalObjectDefinition): Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[100];") - Output("""sprintf(buf, "", self, self->ob_itself);""") + Output("""sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself);""") Output("return PyString_FromString(buf);") OutRbrace() @@ -265,7 +265,7 @@ class CFMutableDataRefObjectDefinition(MyGlobalObjectDefinition): Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[100];") - Output("""sprintf(buf, "", self, self->ob_itself);""") + Output("""sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself);""") Output("return PyString_FromString(buf);") OutRbrace() @@ -296,7 +296,7 @@ class CFStringRefObjectDefinition(MyGlobalObjectDefinition): Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[100];") - Output("""sprintf(buf, "", self, self->ob_itself);""") + Output("""sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself);""") Output("return PyString_FromString(buf);") OutRbrace() @@ -312,7 +312,7 @@ class CFMutableStringRefObjectDefinition(CFStringRefObjectDefinition): Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[100];") - Output("""sprintf(buf, "", self, self->ob_itself);""") + Output("""sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself);""") Output("return PyString_FromString(buf);") OutRbrace() @@ -324,7 +324,7 @@ class CFURLRefObjectDefinition(MyGlobalObjectDefinition): Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[100];") - Output("""sprintf(buf, "", self, self->ob_itself);""") + Output("""sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself);""") Output("return PyString_FromString(buf);") OutRbrace() diff --git a/Mac/Modules/cm/_Cmmodule.c b/Mac/Modules/cm/_Cmmodule.c index 10d4acb..b643c82 100644 --- a/Mac/Modules/cm/_Cmmodule.c +++ b/Mac/Modules/cm/_Cmmodule.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 ) {\ 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); diff --git a/Mac/Modules/dlg/_Dlgmodule.c b/Mac/Modules/dlg/_Dlgmodule.c index 1a02654..e465129 100644 --- a/Mac/Modules/dlg/_Dlgmodule.c +++ b/Mac/Modules/dlg/_Dlgmodule.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 ) {\ diff --git a/Mac/Modules/drag/_Dragmodule.c b/Mac/Modules/drag/_Dragmodule.c index 9139abc..47ce455 100644 --- a/Mac/Modules/drag/_Dragmodule.c +++ b/Mac/Modules/drag/_Dragmodule.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 ) {\ @@ -121,7 +125,6 @@ static PyObject *DragObj_AddDragItemFlavor(DragObjObject *_self, PyObject *_args if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; - dataPtr__error__: ; return _res; } @@ -150,7 +153,6 @@ static PyObject *DragObj_SetDragItemFlavorData(DragObjObject *_self, PyObject *_ if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; - dataPtr__error__: ; return _res; } @@ -801,7 +803,8 @@ static PyObject *Drag_InstallTrackingHandler(PyObject *_self, PyObject *_args) _err = InstallTrackingHandler(dragglue_TrackingHandlerUPP, theWindow, (void *)callback); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); - return Py_None; + _res = Py_None; + return _res; } @@ -819,7 +822,8 @@ static PyObject *Drag_InstallReceiveHandler(PyObject *_self, PyObject *_args) _err = InstallReceiveHandler(dragglue_ReceiveHandlerUPP, theWindow, (void *)callback); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); - return Py_None; + _res = Py_None; + return _res; } @@ -835,7 +839,8 @@ static PyObject *Drag_RemoveTrackingHandler(PyObject *_self, PyObject *_args) _err = RemoveTrackingHandler(dragglue_TrackingHandlerUPP, theWindow); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); - return Py_None; + _res = Py_None; + return _res; } @@ -851,7 +856,8 @@ static PyObject *Drag_RemoveReceiveHandler(PyObject *_self, PyObject *_args) _err = RemoveReceiveHandler(dragglue_ReceiveHandlerUPP, theWindow); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); - return Py_None; + _res = Py_None; + return _res; } diff --git a/Mac/Modules/drag/dragsupport.py b/Mac/Modules/drag/dragsupport.py index e26ddd5..c636993 100644 --- a/Mac/Modules/drag/dragsupport.py +++ b/Mac/Modules/drag/dragsupport.py @@ -236,7 +236,8 @@ installtracking_body = """ _err = InstallTrackingHandler(dragglue_TrackingHandlerUPP, theWindow, (void *)callback); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); - return Py_None; + _res = Py_None; + return _res; """ installtracking = ManualGenerator("InstallTrackingHandler", installtracking_body) module.add(installtracking) @@ -252,7 +253,8 @@ installreceive_body = """ _err = InstallReceiveHandler(dragglue_ReceiveHandlerUPP, theWindow, (void *)callback); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); - return Py_None; + _res = Py_None; + return _res; """ installreceive = ManualGenerator("InstallReceiveHandler", installreceive_body) module.add(installreceive) @@ -266,7 +268,8 @@ removetracking_body = """ _err = RemoveTrackingHandler(dragglue_TrackingHandlerUPP, theWindow); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); - return Py_None; + _res = Py_None; + return _res; """ removetracking = ManualGenerator("RemoveTrackingHandler", removetracking_body) module.add(removetracking) @@ -280,7 +283,8 @@ removereceive_body = """ _err = RemoveReceiveHandler(dragglue_ReceiveHandlerUPP, theWindow); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); - return Py_None; + _res = Py_None; + return _res; """ removereceive = ManualGenerator("RemoveReceiveHandler", removereceive_body) module.add(removereceive) diff --git a/Mac/Modules/evt/_Evtmodule.c b/Mac/Modules/evt/_Evtmodule.c index 6cd9464..d282dfe 100644 --- a/Mac/Modules/evt/_Evtmodule.c +++ b/Mac/Modules/evt/_Evtmodule.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 ) {\ @@ -106,7 +110,6 @@ static PyObject *Evt_GetKeys(PyObject *_self, PyObject *_args) GetKeys(theKeys__out__); _res = Py_BuildValue("s#", (char *)&theKeys__out__, (int)sizeof(KeyMap)); - theKeys__error__: ; return _res; } diff --git a/Mac/Modules/fm/_Fmmodule.c b/Mac/Modules/fm/_Fmmodule.c index 9cafebc..c5ab18a 100644 --- a/Mac/Modules/fm/_Fmmodule.c +++ b/Mac/Modules/fm/_Fmmodule.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 ) {\ diff --git a/Mac/Modules/help/_Helpmodule.c b/Mac/Modules/help/_Helpmodule.c index 7a2836d..f284166 100644 --- a/Mac/Modules/help/_Helpmodule.c +++ b/Mac/Modules/help/_Helpmodule.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 ) {\ diff --git a/Mac/Modules/icn/_Icnmodule.c b/Mac/Modules/icn/_Icnmodule.c index a9af768..bc27732 100644 --- a/Mac/Modules/icn/_Icnmodule.c +++ b/Mac/Modules/icn/_Icnmodule.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 ) {\ diff --git a/Mac/Modules/list/_Listmodule.c b/Mac/Modules/list/_Listmodule.c index 6b74bcc..c87255a 100644 --- a/Mac/Modules/list/_Listmodule.c +++ b/Mac/Modules/list/_Listmodule.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 ) {\ @@ -361,7 +365,6 @@ static PyObject *ListObj_LAddToCell(ListObject *_self, PyObject *_args) _self->ob_itself); Py_INCREF(Py_None); _res = Py_None; - dataPtr__error__: ; return _res; } @@ -439,7 +442,6 @@ static PyObject *ListObj_LSetCell(ListObject *_self, PyObject *_args) _self->ob_itself); Py_INCREF(Py_None); _res = Py_None; - dataPtr__error__: ; return _res; } @@ -929,7 +931,8 @@ static PyObject *List_as_List(PyObject *_self, PyObject *_args) return NULL; l = (ListObject *)ListObj_New(as_List(h)); l->ob_must_be_disposed = 0; - return Py_BuildValue("O", l); + _res = Py_BuildValue("O", l); + return _res; } diff --git a/Mac/Modules/list/listsupport.py b/Mac/Modules/list/listsupport.py index b9bb964..98f0f9e 100644 --- a/Mac/Modules/list/listsupport.py +++ b/Mac/Modules/list/listsupport.py @@ -176,7 +176,8 @@ if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &h)) return NULL; l = (ListObject *)ListObj_New(as_List(h)); l->ob_must_be_disposed = 0; -return Py_BuildValue("O", l); +_res = Py_BuildValue("O", l); +return _res; """ f = ManualGenerator("as_List", as_List_body) f.docstring = lambda: "(Resource)->List.\nReturns List object (which is not auto-freed!)" diff --git a/Mac/Modules/menu/_Menumodule.c b/Mac/Modules/menu/_Menumodule.c index 62d6df4..2900fd3 100644 --- a/Mac/Modules/menu/_Menumodule.c +++ b/Mac/Modules/menu/_Menumodule.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 ) {\ diff --git a/Mac/Modules/mlte/_Mltemodule.c b/Mac/Modules/mlte/_Mltemodule.c index d4f3476..7254015 100644 --- a/Mac/Modules/mlte/_Mltemodule.c +++ b/Mac/Modules/mlte/_Mltemodule.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 ) {\ @@ -683,7 +687,6 @@ static PyObject *TXNObj_TXNSetData(TXNObjectObject *_self, PyObject *_args) if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; - iDataPtr__error__: ; return _res; } diff --git a/Mac/Modules/qd/_Qdmodule.c b/Mac/Modules/qd/_Qdmodule.c index ec44936..3bbe2c3 100644 --- a/Mac/Modules/qd/_Qdmodule.c +++ b/Mac/Modules/qd/_Qdmodule.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 ) {\ @@ -442,7 +446,8 @@ static PyObject *BMObj_getdata(BitMapObject *_self, PyObject *_args) if ( !PyArg_ParseTuple(_args, "ii", &from, &length) ) return NULL; cp = _self->ob_itself->baseAddr+from; - return PyString_FromStringAndSize(cp, length); + _res = PyString_FromStringAndSize(cp, length); + return _res; } @@ -458,7 +463,8 @@ static PyObject *BMObj_putdata(BitMapObject *_self, PyObject *_args) cp = _self->ob_itself->baseAddr+from; memcpy(cp, icp, length); Py_INCREF(Py_None); - return Py_None; + _res = Py_None; + return _res; } @@ -912,7 +918,6 @@ static PyObject *Qd_GetPenState(PyObject *_self, PyObject *_args) GetPenState(&pnState__out__); _res = Py_BuildValue("s#", (char *)&pnState__out__, (int)sizeof(PenState)); - pnState__error__: ; return _res; } @@ -3470,7 +3475,6 @@ static PyObject *Qd_GetIndPattern(PyObject *_self, PyObject *_args) index); _res = Py_BuildValue("s#", (char *)&thePat__out__, (int)sizeof(Pattern)); - thePat__error__: ; return _res; } @@ -4116,7 +4120,6 @@ static PyObject *Qd_GetQDGlobalsArrow(PyObject *_self, PyObject *_args) GetQDGlobalsArrow(&arrow__out__); _res = Py_BuildValue("s#", (char *)&arrow__out__, (int)sizeof(Cursor)); - arrow__error__: ; return _res; } @@ -4129,7 +4132,6 @@ static PyObject *Qd_GetQDGlobalsDarkGray(PyObject *_self, PyObject *_args) GetQDGlobalsDarkGray(&dkGray__out__); _res = Py_BuildValue("s#", (char *)&dkGray__out__, (int)sizeof(Pattern)); - dkGray__error__: ; return _res; } @@ -4142,7 +4144,6 @@ static PyObject *Qd_GetQDGlobalsLightGray(PyObject *_self, PyObject *_args) GetQDGlobalsLightGray(<Gray__out__); _res = Py_BuildValue("s#", (char *)<Gray__out__, (int)sizeof(Pattern)); - ltGray__error__: ; return _res; } @@ -4155,7 +4156,6 @@ static PyObject *Qd_GetQDGlobalsGray(PyObject *_self, PyObject *_args) GetQDGlobalsGray(&gray__out__); _res = Py_BuildValue("s#", (char *)&gray__out__, (int)sizeof(Pattern)); - gray__error__: ; return _res; } @@ -4168,7 +4168,6 @@ static PyObject *Qd_GetQDGlobalsBlack(PyObject *_self, PyObject *_args) GetQDGlobalsBlack(&black__out__); _res = Py_BuildValue("s#", (char *)&black__out__, (int)sizeof(Pattern)); - black__error__: ; return _res; } @@ -4181,7 +4180,6 @@ static PyObject *Qd_GetQDGlobalsWhite(PyObject *_self, PyObject *_args) GetQDGlobalsWhite(&white__out__); _res = Py_BuildValue("s#", (char *)&white__out__, (int)sizeof(Pattern)); - white__error__: ; return _res; } @@ -4448,7 +4446,6 @@ static PyObject *Qd_MacDrawText(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; char *textBuf__in__; - int textBuf__len__; int textBuf__in_len__; short firstByte; short byteCount; @@ -4457,12 +4454,13 @@ static PyObject *Qd_MacDrawText(PyObject *_self, PyObject *_args) &firstByte, &byteCount)) return NULL; + /* Fool compiler warnings */ + textBuf__in_len__ = textBuf__in_len__; MacDrawText(textBuf__in__, firstByte, byteCount); Py_INCREF(Py_None); _res = Py_None; - textBuf__error__: ; return _res; } @@ -4499,7 +4497,6 @@ static PyObject *Qd_TextWidth(PyObject *_self, PyObject *_args) PyObject *_res = NULL; short _rv; char *textBuf__in__; - int textBuf__len__; int textBuf__in_len__; short firstByte; short byteCount; @@ -4508,12 +4505,13 @@ static PyObject *Qd_TextWidth(PyObject *_self, PyObject *_args) &firstByte, &byteCount)) return NULL; + /* Fool compiler warnings */ + textBuf__in_len__ = textBuf__in_len__; _rv = TextWidth(textBuf__in__, firstByte, byteCount); _res = Py_BuildValue("h", _rv); - textBuf__error__: ; return _res; } @@ -4977,7 +4975,6 @@ static PyObject *Qd_DrawText(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; char *textBuf__in__; - int textBuf__len__; int textBuf__in_len__; short firstByte; short byteCount; @@ -4986,12 +4983,13 @@ static PyObject *Qd_DrawText(PyObject *_self, PyObject *_args) &firstByte, &byteCount)) return NULL; + /* Fool compiler warnings */ + textBuf__in_len__ = textBuf__in_len__; DrawText(textBuf__in__, firstByte, byteCount); Py_INCREF(Py_None); _res = Py_None; - textBuf__error__: ; return _res; } diff --git a/Mac/Modules/qd/qdsupport.py b/Mac/Modules/qd/qdsupport.py index 5f7c5bc..9c177b6 100644 --- a/Mac/Modules/qd/qdsupport.py +++ b/Mac/Modules/qd/qdsupport.py @@ -24,7 +24,11 @@ from macsupport import * class TextThingieClass(FixedInputBufferType): def getargsCheck(self, name): - pass + Output("/* Fool compiler warnings */") + Output("%s__in_len__ = %s__in_len__;", name, name) + + def declareSize(self, name): + Output("int %s__in_len__;", name) TextThingie = TextThingieClass(None) @@ -566,7 +570,8 @@ char *cp; if ( !PyArg_ParseTuple(_args, "ii", &from, &length) ) return NULL; cp = _self->ob_itself->baseAddr+from; -return PyString_FromStringAndSize(cp, length); +_res = PyString_FromStringAndSize(cp, length); +return _res; """ f = ManualGenerator("getdata", getdata_body) f.docstring = lambda: """(int start, int size) -> string. Return bytes from the bitmap""" @@ -582,7 +587,8 @@ if ( !PyArg_ParseTuple(_args, "is#", &from, &icp, &length) ) cp = _self->ob_itself->baseAddr+from; memcpy(cp, icp, length); Py_INCREF(Py_None); -return Py_None; +_res = Py_None; +return _res; """ f = ManualGenerator("putdata", putdata_body) f.docstring = lambda: """(int start, string data). Store bytes into the bitmap""" diff --git a/Mac/Modules/qdoffs/_Qdoffsmodule.c b/Mac/Modules/qdoffs/_Qdoffsmodule.c index 3d51259..f98e5d9 100644 --- a/Mac/Modules/qdoffs/_Qdoffsmodule.c +++ b/Mac/Modules/qdoffs/_Qdoffsmodule.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 ) {\ @@ -503,7 +507,8 @@ static PyObject *Qdoffs_GetPixMapBytes(PyObject *_self, PyObject *_args) if ( !PyArg_ParseTuple(_args, "O&ii", ResObj_Convert, &pm, &from, &length) ) return NULL; cp = GetPixBaseAddr(pm)+from; - return PyString_FromStringAndSize(cp, length); + _res = PyString_FromStringAndSize(cp, length); + return _res; } @@ -520,7 +525,8 @@ static PyObject *Qdoffs_PutPixMapBytes(PyObject *_self, PyObject *_args) cp = GetPixBaseAddr(pm)+from; memcpy(cp, icp, length); Py_INCREF(Py_None); - return Py_None; + _res = Py_None; + return _res; } diff --git a/Mac/Modules/qdoffs/qdoffssupport.py b/Mac/Modules/qdoffs/qdoffssupport.py index cee5f94..3e0337e 100644 --- a/Mac/Modules/qdoffs/qdoffssupport.py +++ b/Mac/Modules/qdoffs/qdoffssupport.py @@ -105,7 +105,8 @@ char *cp; if ( !PyArg_ParseTuple(_args, "O&ii", ResObj_Convert, &pm, &from, &length) ) return NULL; cp = GetPixBaseAddr(pm)+from; -return PyString_FromStringAndSize(cp, length); +_res = PyString_FromStringAndSize(cp, length); +return _res; """ f = ManualGenerator("GetPixMapBytes", pixmapgetbytes_body) f.docstring = lambda: """(pixmap, int start, int size) -> string. Return bytes from the pixmap""" @@ -122,7 +123,8 @@ if ( !PyArg_ParseTuple(_args, "O&is#", ResObj_Convert, &pm, &from, &icp, &length cp = GetPixBaseAddr(pm)+from; memcpy(cp, icp, length); Py_INCREF(Py_None); -return Py_None; +_res = Py_None; +return _res; """ f = ManualGenerator("PutPixMapBytes", pixmapputbytes_body) f.docstring = lambda: """(pixmap, int start, string data). Store bytes into the pixmap""" diff --git a/Mac/Modules/qt/_Qtmodule.c b/Mac/Modules/qt/_Qtmodule.c index 7f57ae4..bfecbd1 100644 --- a/Mac/Modules/qt/_Qtmodule.c +++ b/Mac/Modules/qt/_Qtmodule.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 ) {\ diff --git a/Mac/Modules/res/_Resmodule.c b/Mac/Modules/res/_Resmodule.c index 76d3bec..775e668 100644 --- a/Mac/Modules/res/_Resmodule.c +++ b/Mac/Modules/res/_Resmodule.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 ) {\ @@ -394,7 +398,8 @@ static PyObject *ResObj_as_Control(ResourceObject *_self, PyObject *_args) { PyObject *_res = NULL; - return CtlObj_New((ControlHandle)_self->ob_itself); + _res = CtlObj_New((ControlHandle)_self->ob_itself); + return _res; } @@ -402,7 +407,8 @@ static PyObject *ResObj_as_Menu(ResourceObject *_self, PyObject *_args) { PyObject *_res = NULL; - return MenuObj_New((MenuHandle)_self->ob_itself); + _res = MenuObj_New((MenuHandle)_self->ob_itself); + return _res; } @@ -1533,7 +1539,7 @@ PyObject *OptResObj_New(Handle itself) return ResObj_New(itself); } -OptResObj_Convert(PyObject *v, Handle *p_itself) +int OptResObj_Convert(PyObject *v, Handle *p_itself) { PyObject *tmp; diff --git a/Mac/Modules/res/resedit.py b/Mac/Modules/res/resedit.py index 1684870..fce0bd1 100644 --- a/Mac/Modules/res/resedit.py +++ b/Mac/Modules/res/resedit.py @@ -58,7 +58,8 @@ functions.append(f) # Convert resources to other things. as_xxx_body = """ -return %sObj_New((%sHandle)_self->ob_itself); +_res = %sObj_New((%sHandle)_self->ob_itself); +return _res; """ def genresconverter(longname, shortname): diff --git a/Mac/Modules/res/ressupport.py b/Mac/Modules/res/ressupport.py index 2a72748..f7a1f45 100644 --- a/Mac/Modules/res/ressupport.py +++ b/Mac/Modules/res/ressupport.py @@ -61,7 +61,7 @@ PyObject *OptResObj_New(Handle itself) return ResObj_New(itself); } -OptResObj_Convert(PyObject *v, Handle *p_itself) +int OptResObj_Convert(PyObject *v, Handle *p_itself) { PyObject *tmp; diff --git a/Mac/Modules/snd/_Sndmodule.c b/Mac/Modules/snd/_Sndmodule.c index e772f91..cf60a8b 100644 --- a/Mac/Modules/snd/_Sndmodule.c +++ b/Mac/Modules/snd/_Sndmodule.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 ) {\ @@ -23,13 +27,14 @@ #include #endif - +#if !TARGET_API_MAC_CARBON /* Create a SndCommand object (an (int, int, int) tuple) */ static PyObject * SndCmd_New(SndCommand *pc) { return Py_BuildValue("hhl", pc->cmd, pc->param1, pc->param2); } +#endif /* Convert a SndCommand argument */ static int @@ -80,16 +85,6 @@ static PyObject *SndCh_New(SndChannelPtr itself) it->ob_A5 = SetCurrentA5(); return (PyObject *)it; } -static int SndCh_Convert(PyObject *v, SndChannelPtr *p_itself) -{ - if (!SndCh_Check(v)) - { - PyErr_SetString(PyExc_TypeError, "SndChannel required"); - return 0; - } - *p_itself = ((SndChannelObject *)v)->ob_itself; - return 1; -} static void SndCh_dealloc(SndChannelObject *self) { @@ -233,7 +228,6 @@ static PyObject *SndCh_SndChannelStatus(SndChannelObject *_self, PyObject *_args if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("s#", (char *)&theStatus__out__, (int)sizeof(SCStatus)); - theStatus__error__: ; return _res; } @@ -372,7 +366,7 @@ static PyObject *SPBObj_New(void) it->ob_spb.userLong = (long)it; return (PyObject *)it; } -static SPBObj_Convert(PyObject *v, SPBPtr *p_itself) +static int SPBObj_Convert(PyObject *v, SPBPtr *p_itself) { if (!SPBObj_Check(v)) { @@ -474,7 +468,7 @@ staticforward PyTypeObject SPB_Type = { static PyObject *Snd_SPB(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; - return SPBObj_New(); + _res = SPBObj_New(); return _res; } static PyObject *Snd_SysBeep(PyObject *_self, PyObject *_args) @@ -572,7 +566,6 @@ static PyObject *Snd_SndManagerStatus(PyObject *_self, PyObject *_args) if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("s#", (char *)&theStatus__out__, (int)sizeof(SMStatus)); - theStatus__error__: ; return _res; } @@ -896,7 +889,6 @@ static PyObject *Snd_GetCompressionInfo(PyObject *_self, PyObject *_args) if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("s#", (char *)&cp__out__, (int)sizeof(CompressionInfo)); - cp__error__: ; return _res; } diff --git a/Mac/Modules/snd/sndsupport.py b/Mac/Modules/snd/sndsupport.py index 9c100ac..91f3bb6 100644 --- a/Mac/Modules/snd/sndsupport.py +++ b/Mac/Modules/snd/sndsupport.py @@ -95,13 +95,14 @@ SMStatus = StructOutputBufferType('SMStatus') CompressionInfo = StructOutputBufferType('CompressionInfo') includestuff = includestuff + """ - +#if !TARGET_API_MAC_CARBON /* Create a SndCommand object (an (int, int, int) tuple) */ static PyObject * SndCmd_New(SndCommand *pc) { return Py_BuildValue("hhl", pc->cmd, pc->param1, pc->param2); } +#endif /* Convert a SndCommand argument */ static int @@ -230,6 +231,9 @@ class SndObjectDefinition(ObjectDefinition): def outputFreeIt(self, itselfname): Output("SndDisposeChannel(%s, 1);", itselfname) + def outputConvert(self): + pass # Not needed + # class SpbObjectDefinition(ObjectDefinition): @@ -270,7 +274,7 @@ class SpbObjectDefinition(ObjectDefinition): Output("Py_XDECREF(self->ob_interrupt);") def outputConvert(self): - Output("%s%s_Convert(PyObject *v, %s *p_itself)", self.static, self.prefix, self.itselftype) + Output("%sint %s_Convert(PyObject *v, %s *p_itself)", self.static, self.prefix, self.itselftype) OutLbrace() self.outputCheckConvertArg() Output("if (!%s_Check(v))", self.prefix) @@ -333,7 +337,7 @@ class SpbObjectDefinition(ObjectDefinition): sndobject = SndObjectDefinition('SndChannel', 'SndCh', 'SndChannelPtr') spbobject = SpbObjectDefinition('SPB', 'SPBObj', 'SPBPtr') -spbgenerator = ManualGenerator("SPB", "return SPBObj_New();") +spbgenerator = ManualGenerator("SPB", "_res = SPBObj_New(); return _res;") module = MacModule('_Snd', 'Snd', includestuff, finalstuff, initstuff) module.addobject(sndobject) module.addobject(spbobject) diff --git a/Mac/Modules/te/_TEmodule.c b/Mac/Modules/te/_TEmodule.c index a5cff23..90efc8c 100644 --- a/Mac/Modules/te/_TEmodule.c +++ b/Mac/Modules/te/_TEmodule.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 ) {\ @@ -113,7 +117,6 @@ static PyObject *TEObj_TESetText(TEObject *_self, PyObject *_args) _self->ob_itself); Py_INCREF(Py_None); _res = Py_None; - text__error__: ; return _res; } @@ -251,7 +254,6 @@ static PyObject *TEObj_TEInsert(TEObject *_self, PyObject *_args) _self->ob_itself); Py_INCREF(Py_None); _res = Py_None; - text__error__: ; return _res; } @@ -531,7 +533,6 @@ static PyObject *TEObj_TEStyleInsert(TEObject *_self, PyObject *_args) _self->ob_itself); Py_INCREF(Py_None); _res = Py_None; - text__error__: ; return _res; } @@ -873,7 +874,6 @@ static PyObject *TE_TETextBox(PyObject *_self, PyObject *_args) just); Py_INCREF(Py_None); _res = Py_None; - text__error__: ; return _res; } diff --git a/Mac/Modules/win/_Winmodule.c b/Mac/Modules/win/_Winmodule.c index 5d597ac..13ebe20 100644 --- a/Mac/Modules/win/_Winmodule.c +++ b/Mac/Modules/win/_Winmodule.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 ) {\ @@ -2125,7 +2129,7 @@ static int WinObj_compare(WindowObject *self, WindowObject *other) static PyObject * WinObj_repr(WindowObject *self) { char buf[100]; - sprintf(buf, "", self, self->ob_itself); + sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself); return PyString_FromString(buf); } @@ -2643,7 +2647,8 @@ static PyObject *Win_WhichWindow(PyObject *_self, PyObject *_args) if ( !PyArg_ParseTuple(_args, "i", &ptr) ) return NULL; - return WinObj_WhichWindow((WindowPtr)ptr); + _res = WinObj_WhichWindow((WindowPtr)ptr); + return _res; } diff --git a/Mac/Modules/win/winsupport.py b/Mac/Modules/win/winsupport.py index 5bb5bda..8a38b97 100644 --- a/Mac/Modules/win/winsupport.py +++ b/Mac/Modules/win/winsupport.py @@ -179,7 +179,7 @@ class MyObjectDefinition(GlobalObjectDefinition): Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[100];") - Output("""sprintf(buf, "", self, self->ob_itself);""") + Output("""sprintf(buf, "", (unsigned)self, (unsigned)self->ob_itself);""") Output("return PyString_FromString(buf);") OutRbrace() @@ -208,7 +208,8 @@ long ptr; if ( !PyArg_ParseTuple(_args, "i", &ptr) ) return NULL; -return WinObj_WhichWindow((WindowPtr)ptr); +_res = WinObj_WhichWindow((WindowPtr)ptr); +return _res; """ f = ManualGenerator("WhichWindow", whichwin_body) -- cgit v0.12