From 5674e4ec17e1945cf11f88963ba3e9190c6ef67d Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 1 Aug 1996 15:26:05 +0000 Subject: [PATCH] NumVersion stuff has changed --- Mac/Modules/snd/Sndmodule.c | 36 ++++++++--------------------------- Mac/Modules/snd/sndsupport.py | 19 ------------------ 2 files changed, 8 insertions(+), 47 deletions(-) diff --git a/Mac/Modules/snd/Sndmodule.c b/Mac/Modules/snd/Sndmodule.c index ba87d0c62d7..65b84df4f98 100644 --- a/Mac/Modules/snd/Sndmodule.c +++ b/Mac/Modules/snd/Sndmodule.c @@ -40,9 +40,6 @@ extern int GrafObj_Convert(PyObject *, GrafPtr *); extern PyObject *BMObj_New(BitMapPtr); extern int BMObj_Convert(PyObject *, BitMapPtr *); -extern PyObject *PMObj_New(PixMapHandle); -extern int PMObj_Convert(PyObject *, PixMapHandle *); - extern PyObject *WinObj_WhichWindow(WindowPtr); #include @@ -78,23 +75,6 @@ SndCmd_Convert(PyObject *v, SndCommand *pc) return PyArg_Parse(v, "h", &pc->cmd); } -/* Create a NumVersion object (a quintuple of integers) */ -static PyObject * -NumVer_New(NumVersion nv) -{ - return Py_BuildValue("iiiii", - nv.majorRev, -#ifdef THINK_C - nv.minorRev, - nv.bugFixRev, -#else - (nv.minorAndBugRev>>4) & 0xf, - nv.minorAndBugRev & 0xf, -#endif - nv.stage, - nv.nonRelRev); -} - static pascal void SndCh_UserRoutine(SndChannelPtr chan, SndCommand *cmd); /* Forward */ static PyObject *Snd_Error; @@ -426,12 +406,12 @@ static PyObject *Snd_SndSoundManagerVersion(_self, _args) PyObject *_args; { PyObject *_res = NULL; - long _rv; + NumVersion _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = SndSoundManagerVersion(); - _res = Py_BuildValue("l", - _rv); + _res = Py_BuildValue("O&", + PyMac_BuildNumVersion, _rv); return _res; } @@ -491,12 +471,12 @@ static PyObject *Snd_MACEVersion(_self, _args) PyObject *_args; { PyObject *_res = NULL; - long _rv; + NumVersion _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = MACEVersion(); - _res = Py_BuildValue("l", - _rv); + _res = Py_BuildValue("O&", + PyMac_BuildNumVersion, _rv); return _res; } @@ -771,7 +751,7 @@ static PyMethodDef Snd_methods[] = { {"SndControl", (PyCFunction)Snd_SndControl, 1, "(short id) -> (SndCommand cmd)"}, {"SndSoundManagerVersion", (PyCFunction)Snd_SndSoundManagerVersion, 1, - "() -> (long _rv)"}, + "() -> (NumVersion _rv)"}, {"SndManagerStatus", (PyCFunction)Snd_SndManagerStatus, 1, "(short theLength) -> (SMStatus theStatus)"}, {"SndGetSysBeepState", (PyCFunction)Snd_SndGetSysBeepState, 1, @@ -779,7 +759,7 @@ static PyMethodDef Snd_methods[] = { {"SndSetSysBeepState", (PyCFunction)Snd_SndSetSysBeepState, 1, "(short sysBeepState) -> None"}, {"MACEVersion", (PyCFunction)Snd_MACEVersion, 1, - "() -> (long _rv)"}, + "() -> (NumVersion _rv)"}, {"Comp3to1", (PyCFunction)Snd_Comp3to1, 1, "(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)"}, {"Exp1to3", (PyCFunction)Snd_Exp1to3, 1, diff --git a/Mac/Modules/snd/sndsupport.py b/Mac/Modules/snd/sndsupport.py index 97a23ad0145..b3b32f1999b 100644 --- a/Mac/Modules/snd/sndsupport.py +++ b/Mac/Modules/snd/sndsupport.py @@ -79,8 +79,6 @@ SndCallBackUPP = SndCallBackProcPtr SndCompletionProcPtr = FakeType('(SndCompletionProcPtr)0') # XXX SndCompletionUPP = SndCompletionProcPtr -NumVersion = OpaqueByValueType('NumVersion', 'NumVer') - ##InOutBuf128 = FixedInputOutputBufferType(128) StateBlock = StructInputOutputBufferType('StateBlock') @@ -119,23 +117,6 @@ SndCmd_Convert(PyObject *v, SndCommand *pc) return PyArg_Parse(v, "h", &pc->cmd); } -/* Create a NumVersion object (a quintuple of integers) */ -static PyObject * -NumVer_New(NumVersion nv) -{ - return Py_BuildValue("iiiii", - nv.majorRev, -#ifdef THINK_C - nv.minorRev, - nv.bugFixRev, -#else - (nv.minorAndBugRev>>4) & 0xf, - nv.minorAndBugRev & 0xf, -#endif - nv.stage, - nv.nonRelRev); -} - static pascal void SndCh_UserRoutine(SndChannelPtr chan, SndCommand *cmd); /* Forward */ """