summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/snd
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-09-05 10:31:52 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-09-05 10:31:52 (GMT)
commitfd064863ebbe90adc24c60df4c3dbf630ec3a6c4 (patch)
tree60d77f56f209d3909b275d760bb4aedc9bd1d243 /Mac/Modules/snd
parent5a1516bce5c9aa6f957f1e93ba85d143d8eac03a (diff)
downloadcpython-fd064863ebbe90adc24c60df4c3dbf630ec3a6c4.zip
cpython-fd064863ebbe90adc24c60df4c3dbf630ec3a6c4.tar.gz
cpython-fd064863ebbe90adc24c60df4c3dbf630ec3a6c4.tar.bz2
Shut up many more gcc warnings.
Diffstat (limited to 'Mac/Modules/snd')
-rw-r--r--Mac/Modules/snd/_Sndmodule.c24
-rw-r--r--Mac/Modules/snd/sndsupport.py10
2 files changed, 15 insertions, 19 deletions
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 <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;
}
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)