+#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 ) {\
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
- dataPtr__error__: ;
return _res;
}
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
- dataPtr__error__: ;
return _res;
}
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
- dataPtr__error__: ;
return _res;
}
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
AEDesc_New, &result);
- dataPtr__error__: ;
return _res;
}
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
AEDesc_New, &result);
- dataPtr__error__: ;
return _res;
}
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
AEDesc_New, &resultList);
- factoringPtr__error__: ;
return _res;
}
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
AEDesc_New, &theAEDesc);
- dataPtr__error__: ;
return _res;
}
#endif
+#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 ) {\
+#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 ) {\
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
bytes__in__, bytes__len__);
Py_INCREF(Py_None);
_res = Py_None;
- bytes__error__: ;
return _res;
}
newBytes__in__, newBytes__len__);
Py_INCREF(Py_None);
_res = Py_None;
- newBytes__error__: ;
return _res;
}
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);
}
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);
}
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);
}
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);
}
bytes__in__, bytes__len__);
_res = Py_BuildValue("O&",
CFDataRefObj_New, _rv);
- bytes__error__: ;
return _res;
}
(CFAllocatorRef)NULL);
_res = Py_BuildValue("O&",
CFDataRefObj_New, _rv);
- bytes__error__: ;
return _res;
}
isExternalRepresentation);
_res = Py_BuildValue("O&",
CFStringRefObj_New, _rv);
- bytes__error__: ;
return _res;
}
baseURL);
_res = Py_BuildValue("O&",
CFURLRefObj_New, _rv);
- URLBytes__error__: ;
return _res;
}
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
+#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 ) {\
+#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 ) {\
if (_err != noErr) {
return PyMac_Error(_err);
}
- return Py_BuildValue("O&", OptResObj_New, hdl);
+ _res = Py_BuildValue("O&", OptResObj_New, hdl);
+ return _res;
}
}
tracker = obj;
Py_INCREF(tracker);
+ return 1;
}
static void
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;
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);
}
tracker = obj;
Py_INCREF(tracker);
+ return 1;
}
static void
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;
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);
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);
+#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 ) {\
+#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 ) {\
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
- dataPtr__error__: ;
return _res;
}
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
- dataPtr__error__: ;
return _res;
}
_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;
}
_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;
}
_err = RemoveTrackingHandler(dragglue_TrackingHandlerUPP, theWindow);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
- return Py_None;
+ _res = Py_None;
+ return _res;
}
_err = RemoveReceiveHandler(dragglue_ReceiveHandlerUPP, theWindow);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
- return Py_None;
+ _res = Py_None;
+ return _res;
}
_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)
_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)
_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)
_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)
+#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 ) {\
GetKeys(theKeys__out__);
_res = Py_BuildValue("s#",
(char *)&theKeys__out__, (int)sizeof(KeyMap));
- theKeys__error__: ;
return _res;
}
+#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 ) {\
+#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 ) {\
+#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 ) {\
+#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 ) {\
_self->ob_itself);
Py_INCREF(Py_None);
_res = Py_None;
- dataPtr__error__: ;
return _res;
}
_self->ob_itself);
Py_INCREF(Py_None);
_res = Py_None;
- dataPtr__error__: ;
return _res;
}
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;
}
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!)"
+#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 ) {\
+#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 ) {\
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
- iDataPtr__error__: ;
return _res;
}
+#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 ) {\
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;
}
cp = _self->ob_itself->baseAddr+from;
memcpy(cp, icp, length);
Py_INCREF(Py_None);
- return Py_None;
+ _res = Py_None;
+ return _res;
}
GetPenState(&pnState__out__);
_res = Py_BuildValue("s#",
(char *)&pnState__out__, (int)sizeof(PenState));
- pnState__error__: ;
return _res;
}
index);
_res = Py_BuildValue("s#",
(char *)&thePat__out__, (int)sizeof(Pattern));
- thePat__error__: ;
return _res;
}
GetQDGlobalsArrow(&arrow__out__);
_res = Py_BuildValue("s#",
(char *)&arrow__out__, (int)sizeof(Cursor));
- arrow__error__: ;
return _res;
}
GetQDGlobalsDarkGray(&dkGray__out__);
_res = Py_BuildValue("s#",
(char *)&dkGray__out__, (int)sizeof(Pattern));
- dkGray__error__: ;
return _res;
}
GetQDGlobalsLightGray(<Gray__out__);
_res = Py_BuildValue("s#",
(char *)<Gray__out__, (int)sizeof(Pattern));
- ltGray__error__: ;
return _res;
}
GetQDGlobalsGray(&gray__out__);
_res = Py_BuildValue("s#",
(char *)&gray__out__, (int)sizeof(Pattern));
- gray__error__: ;
return _res;
}
GetQDGlobalsBlack(&black__out__);
_res = Py_BuildValue("s#",
(char *)&black__out__, (int)sizeof(Pattern));
- black__error__: ;
return _res;
}
GetQDGlobalsWhite(&white__out__);
_res = Py_BuildValue("s#",
(char *)&white__out__, (int)sizeof(Pattern));
- white__error__: ;
return _res;
}
{
PyObject *_res = NULL;
char *textBuf__in__;
- int textBuf__len__;
int textBuf__in_len__;
short firstByte;
short byteCount;
&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;
}
PyObject *_res = NULL;
short _rv;
char *textBuf__in__;
- int textBuf__len__;
int textBuf__in_len__;
short firstByte;
short byteCount;
&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;
}
{
PyObject *_res = NULL;
char *textBuf__in__;
- int textBuf__len__;
int textBuf__in_len__;
short firstByte;
short byteCount;
&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;
}
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)
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"""
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"""
+#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 ) {\
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;
}
cp = GetPixBaseAddr(pm)+from;
memcpy(cp, icp, length);
Py_INCREF(Py_None);
- return Py_None;
+ _res = Py_None;
+ return _res;
}
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"""
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"""
+#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 ) {\
+#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 ) {\
{
PyObject *_res = NULL;
- return CtlObj_New((ControlHandle)_self->ob_itself);
+ _res = CtlObj_New((ControlHandle)_self->ob_itself);
+ return _res;
}
{
PyObject *_res = NULL;
- return MenuObj_New((MenuHandle)_self->ob_itself);
+ _res = MenuObj_New((MenuHandle)_self->ob_itself);
+ return _res;
}
return ResObj_New(itself);
}
-OptResObj_Convert(PyObject *v, Handle *p_itself)
+int OptResObj_Convert(PyObject *v, Handle *p_itself)
{
PyObject *tmp;
# 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):
return ResObj_New(itself);
}
-OptResObj_Convert(PyObject *v, Handle *p_itself)
+int OptResObj_Convert(PyObject *v, Handle *p_itself)
{
PyObject *tmp;
+#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
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)
{
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("s#",
(char *)&theStatus__out__, (int)sizeof(SCStatus));
- theStatus__error__: ;
return _res;
}
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))
{
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)
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("s#",
(char *)&theStatus__out__, (int)sizeof(SMStatus));
- theStatus__error__: ;
return _res;
}
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("s#",
(char *)&cp__out__, (int)sizeof(CompressionInfo));
- cp__error__: ;
return _res;
}
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
def outputFreeIt(self, itselfname):
Output("SndDisposeChannel(%s, 1);", itselfname)
+ def outputConvert(self):
+ pass # Not needed
+
#
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)
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)
+#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 ) {\
_self->ob_itself);
Py_INCREF(Py_None);
_res = Py_None;
- text__error__: ;
return _res;
}
_self->ob_itself);
Py_INCREF(Py_None);
_res = Py_None;
- text__error__: ;
return _res;
}
_self->ob_itself);
Py_INCREF(Py_None);
_res = Py_None;
- text__error__: ;
return _res;
}
just);
Py_INCREF(Py_None);
_res = Py_None;
- text__error__: ;
return _res;
}
+#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 ) {\
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);
}
if ( !PyArg_ParseTuple(_args, "i", &ptr) )
return NULL;
- return WinObj_WhichWindow((WindowPtr)ptr);
+ _res = WinObj_WhichWindow((WindowPtr)ptr);
+ return _res;
}
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()
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)