Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5674e4e

Browse files
committed
NumVersion stuff has changed
1 parent d1f0631 commit 5674e4e

2 files changed

Lines changed: 8 additions & 47 deletions

File tree

Mac/Modules/snd/Sndmodule.c

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ extern int GrafObj_Convert(PyObject *, GrafPtr *);
4040
extern PyObject *BMObj_New(BitMapPtr);
4141
extern int BMObj_Convert(PyObject *, BitMapPtr *);
4242

43-
extern PyObject *PMObj_New(PixMapHandle);
44-
extern int PMObj_Convert(PyObject *, PixMapHandle *);
45-
4643
extern PyObject *WinObj_WhichWindow(WindowPtr);
4744

4845
#include <Sound.h>
@@ -78,23 +75,6 @@ SndCmd_Convert(PyObject *v, SndCommand *pc)
7875
return PyArg_Parse(v, "h", &pc->cmd);
7976
}
8077

81-
/* Create a NumVersion object (a quintuple of integers) */
82-
static PyObject *
83-
NumVer_New(NumVersion nv)
84-
{
85-
return Py_BuildValue("iiiii",
86-
nv.majorRev,
87-
#ifdef THINK_C
88-
nv.minorRev,
89-
nv.bugFixRev,
90-
#else
91-
(nv.minorAndBugRev>>4) & 0xf,
92-
nv.minorAndBugRev & 0xf,
93-
#endif
94-
nv.stage,
95-
nv.nonRelRev);
96-
}
97-
9878
static pascal void SndCh_UserRoutine(SndChannelPtr chan, SndCommand *cmd); /* Forward */
9979

10080
static PyObject *Snd_Error;
@@ -426,12 +406,12 @@ static PyObject *Snd_SndSoundManagerVersion(_self, _args)
426406
PyObject *_args;
427407
{
428408
PyObject *_res = NULL;
429-
long _rv;
409+
NumVersion _rv;
430410
if (!PyArg_ParseTuple(_args, ""))
431411
return NULL;
432412
_rv = SndSoundManagerVersion();
433-
_res = Py_BuildValue("l",
434-
_rv);
413+
_res = Py_BuildValue("O&",
414+
PyMac_BuildNumVersion, _rv);
435415
return _res;
436416
}
437417

@@ -491,12 +471,12 @@ static PyObject *Snd_MACEVersion(_self, _args)
491471
PyObject *_args;
492472
{
493473
PyObject *_res = NULL;
494-
long _rv;
474+
NumVersion _rv;
495475
if (!PyArg_ParseTuple(_args, ""))
496476
return NULL;
497477
_rv = MACEVersion();
498-
_res = Py_BuildValue("l",
499-
_rv);
478+
_res = Py_BuildValue("O&",
479+
PyMac_BuildNumVersion, _rv);
500480
return _res;
501481
}
502482

@@ -771,15 +751,15 @@ static PyMethodDef Snd_methods[] = {
771751
{"SndControl", (PyCFunction)Snd_SndControl, 1,
772752
"(short id) -> (SndCommand cmd)"},
773753
{"SndSoundManagerVersion", (PyCFunction)Snd_SndSoundManagerVersion, 1,
774-
"() -> (long _rv)"},
754+
"() -> (NumVersion _rv)"},
775755
{"SndManagerStatus", (PyCFunction)Snd_SndManagerStatus, 1,
776756
"(short theLength) -> (SMStatus theStatus)"},
777757
{"SndGetSysBeepState", (PyCFunction)Snd_SndGetSysBeepState, 1,
778758
"() -> (short sysBeepState)"},
779759
{"SndSetSysBeepState", (PyCFunction)Snd_SndSetSysBeepState, 1,
780760
"(short sysBeepState) -> None"},
781761
{"MACEVersion", (PyCFunction)Snd_MACEVersion, 1,
782-
"() -> (long _rv)"},
762+
"() -> (NumVersion _rv)"},
783763
{"Comp3to1", (PyCFunction)Snd_Comp3to1, 1,
784764
"(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)"},
785765
{"Exp1to3", (PyCFunction)Snd_Exp1to3, 1,

Mac/Modules/snd/sndsupport.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ def cleanup(self, name):
7979
SndCompletionProcPtr = FakeType('(SndCompletionProcPtr)0') # XXX
8080
SndCompletionUPP = SndCompletionProcPtr
8181

82-
NumVersion = OpaqueByValueType('NumVersion', 'NumVer')
83-
8482
##InOutBuf128 = FixedInputOutputBufferType(128)
8583
StateBlock = StructInputOutputBufferType('StateBlock')
8684

@@ -119,23 +117,6 @@ def cleanup(self, name):
119117
return PyArg_Parse(v, "h", &pc->cmd);
120118
}
121119
122-
/* Create a NumVersion object (a quintuple of integers) */
123-
static PyObject *
124-
NumVer_New(NumVersion nv)
125-
{
126-
return Py_BuildValue("iiiii",
127-
nv.majorRev,
128-
#ifdef THINK_C
129-
nv.minorRev,
130-
nv.bugFixRev,
131-
#else
132-
(nv.minorAndBugRev>>4) & 0xf,
133-
nv.minorAndBugRev & 0xf,
134-
#endif
135-
nv.stage,
136-
nv.nonRelRev);
137-
}
138-
139120
static pascal void SndCh_UserRoutine(SndChannelPtr chan, SndCommand *cmd); /* Forward */
140121
"""
141122

0 commit comments

Comments
 (0)