]> granicus.if.org Git - python/commitdiff
Shut up many more gcc warnings.
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 5 Sep 2001 10:31:52 +0000 (10:31 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 5 Sep 2001 10:31:52 +0000 (10:31 +0000)
31 files changed:
Mac/Modules/ae/_AEmodule.c
Mac/Modules/app/_Appmodule.c
Mac/Modules/cf/_CFmodule.c
Mac/Modules/cf/cfsupport.py
Mac/Modules/cm/_Cmmodule.c
Mac/Modules/ctl/_Ctlmodule.c
Mac/Modules/ctl/ctlsupport.py
Mac/Modules/dlg/_Dlgmodule.c
Mac/Modules/drag/_Dragmodule.c
Mac/Modules/drag/dragsupport.py
Mac/Modules/evt/_Evtmodule.c
Mac/Modules/fm/_Fmmodule.c
Mac/Modules/help/_Helpmodule.c
Mac/Modules/icn/_Icnmodule.c
Mac/Modules/list/_Listmodule.c
Mac/Modules/list/listsupport.py
Mac/Modules/menu/_Menumodule.c
Mac/Modules/mlte/_Mltemodule.c
Mac/Modules/qd/_Qdmodule.c
Mac/Modules/qd/qdsupport.py
Mac/Modules/qdoffs/_Qdoffsmodule.c
Mac/Modules/qdoffs/qdoffssupport.py
Mac/Modules/qt/_Qtmodule.c
Mac/Modules/res/_Resmodule.c
Mac/Modules/res/resedit.py
Mac/Modules/res/ressupport.py
Mac/Modules/snd/_Sndmodule.c
Mac/Modules/snd/sndsupport.py
Mac/Modules/te/_TEmodule.c
Mac/Modules/win/_Winmodule.c
Mac/Modules/win/winsupport.py

index d01b1007c581f1ae9ba5fe8c6c59bf1972d2e7cc..b6e3c48ba7290ea7d88dcb9f3ebc4d53fa352590 100644 (file)
@@ -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
index b70feda6eee9f3d8b81611eaf0b39d789a37644d..b672db0579e6ba9d42e693de5eb770ee70c7595e 100644 (file)
@@ -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 )  {\
index 124f9dc5052acc02ad56d3996c6f3549428cfe13..649e437ec483cf4ae7a2ed9b3d8a0d431b84a958 100644 (file)
@@ -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, "<CFTypeRef type-%d object at 0x%8.8x for 0x%8.8x>", CFGetTypeID(self->ob_itself), (unsigned long)self, (unsigned long)self->ob_itself);
+       sprintf(buf, "<CFTypeRef type-%d object at 0x%8.8x for 0x%8.8x>", 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, "<CFArrayRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+       sprintf(buf, "<CFArrayRef object at 0x%8.8x for 0x%8.8x>", (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, "<CFMutableArrayRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+       sprintf(buf, "<CFMutableArrayRef object at 0x%8.8x for 0x%8.8x>", (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, "<CFDictionaryRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+       sprintf(buf, "<CFDictionaryRef object at 0x%8.8x for 0x%8.8x>", (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, "<CFMutableDictionaryRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+       sprintf(buf, "<CFMutableDictionaryRef object at 0x%8.8x for 0x%8.8x>", (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, "<CFDataRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+       sprintf(buf, "<CFDataRef object at 0x%8.8x for 0x%8.8x>", (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, "<CFMutableDataRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+       sprintf(buf, "<CFMutableDataRef object at 0x%8.8x for 0x%8.8x>", (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, "<CFStringRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+       sprintf(buf, "<CFStringRef object at 0x%8.8x for 0x%8.8x>", (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, "<CFMutableStringRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+       sprintf(buf, "<CFMutableStringRef object at 0x%8.8x for 0x%8.8x>", (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, "<CFURL object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+       sprintf(buf, "<CFURL object at 0x%8.8x for 0x%8.8x>", (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;
 }
 
index 18361feae9438cc8f91cc9b5649f40fe86a7927e..af62b66ee5e848bf76b959370bae1fed3e927c5b 100644 (file)
@@ -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, "<CFTypeRef type-%%d object at 0x%%8.8x for 0x%%8.8x>", CFGetTypeID(self->ob_itself), (unsigned long)self, (unsigned long)self->ob_itself);""")
+               Output("""sprintf(buf, "<CFTypeRef type-%%d object at 0x%%8.8x for 0x%%8.8x>", 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, "<CFArrayRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+               Output("""sprintf(buf, "<CFArrayRef object at 0x%%8.8x for 0x%%8.8x>", (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, "<CFMutableArrayRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+               Output("""sprintf(buf, "<CFMutableArrayRef object at 0x%%8.8x for 0x%%8.8x>", (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, "<CFDictionaryRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+               Output("""sprintf(buf, "<CFDictionaryRef object at 0x%%8.8x for 0x%%8.8x>", (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, "<CFMutableDictionaryRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+               Output("""sprintf(buf, "<CFMutableDictionaryRef object at 0x%%8.8x for 0x%%8.8x>", (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, "<CFDataRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+               Output("""sprintf(buf, "<CFDataRef object at 0x%%8.8x for 0x%%8.8x>", (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, "<CFMutableDataRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+               Output("""sprintf(buf, "<CFMutableDataRef object at 0x%%8.8x for 0x%%8.8x>", (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, "<CFStringRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+               Output("""sprintf(buf, "<CFStringRef object at 0x%%8.8x for 0x%%8.8x>", (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, "<CFMutableStringRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+               Output("""sprintf(buf, "<CFMutableStringRef object at 0x%%8.8x for 0x%%8.8x>", (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, "<CFURL object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+               Output("""sprintf(buf, "<CFURL object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
                Output("return PyString_FromString(buf);")
                OutRbrace()
 
index 10d4acbf5a76912a9afb1de42fff9192153ba39a..b643c8226e1fb18a4e57d78cc65fe1dbb6c83ba7 100644 (file)
@@ -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 )  {\
index 34195e9dc8fc2c5c59df4243f506e40623d9ec16..837e86ae28fa5e6ca7a93b5ef9327dc0db0ceadd 100644 (file)
@@ -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);
index f65d7fb1347830fab6813ae408851dffc53a3cfd..d84368c6843b23f1ebc1ec2713a44c60f39f3f80 100644 (file)
@@ -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);
index 1a02654ecd7fdad024579810e2713ab0cfe07391..e465129c2106e5fe51b7a60815b0c3f44cf4274c 100644 (file)
@@ -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 )  {\
index 9139abc35739d10cb80aea5b803dae6c84fcf043..47ce4550f4ac48d2212e98043433e6f6c0a7b44c 100644 (file)
@@ -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;
 
 }
 
index e26ddd5b31f989ad34b819c6882b095876dc209a..c63699376a22c3d2fb673c70a74ed89970aee61c 100644 (file)
@@ -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)
index 6cd946416f6446882f21a3a5d68d759abfecc419..d282dfe0cc63d4a526d0887ff171c1c8c29eb832 100644 (file)
@@ -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;
 }
 
index 9cafebc9474c55c2929be67c1ab347d9185cf524..c5ab18a14d6bb2c4b9aee9adcaaf87f861d22aed 100644 (file)
@@ -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 )  {\
index 7a2836d12ce8108709390a2159f1a49f11967f64..f284166b766698e710467433408798fcf8a194fe 100644 (file)
@@ -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 )  {\
index a9af768a99365d1aae1af81ac936322f75650d43..bc27732fb0c70c72c34e5a87ad1a16b4661632cd 100644 (file)
@@ -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 )  {\
index 6b74bccf0efba58cb871bad02894633fbb100110..c87255a55c847bdba6ef46be912d73aba7ccf528 100644 (file)
@@ -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;
 
 }
 
index b9bb96479bf014943a720976b9c5da35d24eb384..98f0f9e1bb26f9a92a1b2122a530f1ea960ec09f 100644 (file)
@@ -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!)"
index 62d6df4af8cae91218028851fc1cc5005f801ae0..2900fd359c7dd09800a7f6a657385c475b01b622 100644 (file)
@@ -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 )  {\
index d4f347661df7b2cb52ffc01c8c929414ceaad43a..7254015f24c6231d52b59dfd18d7a13fc1735292 100644 (file)
@@ -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;
 }
 
index ec44936ce8c52d36fe6c48861ea9f747dec4e08c..3bbe2c3cfc49e0f37223623cfb9106244c6cae41 100644 (file)
@@ -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(&ltGray__out__);
        _res = Py_BuildValue("s#",
                             (char *)&ltGray__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;
 }
 
index 5f7c5bc7d62f591421c2471170b0d9001e080e44..9c177b6b09a3702101faafa7e44e82ce2485bd4e 100644 (file)
@@ -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"""
index 3d51259daf8c35afe33cdb8bfce0f6ddea715a25..f98e5d9a0cc484ae7eef6856c634479805fdf00b 100644 (file)
@@ -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;
 
 }
 
index cee5f94ced234eaf6b2cc94bab65cb77852d0989..3e0337e143d438b6b41f69ec446c6ff2767864e2 100644 (file)
@@ -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"""
index 7f57ae4880b8724f16f1b7be3f12d41b063661f9..bfecbd19943f75981aa40d5aa95f3396100cd7d7 100644 (file)
@@ -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 )  {\
index 76d3becdfa85b5ddd780e7bd6768e1175d0aa11a..775e668c64bbc101c28ae514ea31515af42b35e6 100644 (file)
@@ -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;
        
index 16848704b5d0476b9c84f420eab888fd631f7c73..fce0bd11a71153b34f53650d5861ef29bdb89cb2 100644 (file)
@@ -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):
index 2a72748aa94cce78e3848f8f07329f3d0da279b8..f7a1f45ed53141ee836c20a822ea10090152f3ce 100644 (file)
@@ -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;
        
index e772f91cfa6b844b90d0a3ff2f52ef13f856722d..cf60a8b9e97925eed02026db2fe5d6b71d98f68a 100644 (file)
@@ -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 )  {\
 #include <Carbon/Carbon.h>
 #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;
 }
 
index 9c100acfd3569b8253cac01150722bdb4dbd4028..91f3bb6e6cc8486a36fbef6cf399cc66172dd284 100644 (file)
@@ -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)
index a5cff235b72daf3b63776919886752f40d227a38..90efc8c536931c1448388c38422b006c02b0d026 100644 (file)
@@ -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;
 }
 
index 5d597aca76f43cc25116413a649082ba4fca7f30..13ebe20f1478c741651da3bf56cb3eed452ee6ec 100644 (file)
@@ -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, "<Window object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+       sprintf(buf, "<Window object at 0x%8.8x for 0x%8.8x>", (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;
 
 }
 
index 5bb5bdadf3d7f760025da8c4af47336ee0201b68..8a38b97c696407959df583aaca5dbd6f7ba41da2 100644 (file)
@@ -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, "<Window object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+               Output("""sprintf(buf, "<Window object at 0x%%8.8x for 0x%%8.8x>", (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)