1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
http://bugs.gentoo.org/314627
http://bugs.gentoo.org/257550
--- src/aomodule.c
+++ src/aomodule.c
@@ -4,7 +4,7 @@
static ao_option *
dict_to_options(PyObject *dict)
{
- int pos = 0;
+ Py_ssize_t pos = 0;
PyObject *key, *val;
ao_option *head = NULL;
int ret;
@@ -71,7 +71,7 @@
*overwrite = 0;
- if(PyArg_ParseTupleAndKeywords(args, kwargs, "s|llllO!sl",
+ if(PyArg_ParseTupleAndKeywords(args, kwargs, "s|iiiiO!si",
(char **) driver_name_kwlist,
&driver_name,
&format->bits,
@@ -84,7 +84,7 @@
*driver_id = ao_driver_id(driver_name);
} else {
PyErr_Clear();
- if(!(PyArg_ParseTupleAndKeywords(args, kwargs, "i|llllO!sl",
+ if(!(PyArg_ParseTupleAndKeywords(args, kwargs, "i|iiiiO!si",
(char **) driver_id_kwlist,
driver_id,
&format->bits,
@@ -141,8 +141,9 @@
return NULL;
}
- retobj = (ao_Object *) PyObject_NEW(ao_Object, &ao_Type);
+ retobj = (ao_Object *) PyObject_New(ao_Object, &ao_Type);
retobj->dev = dev;
+ retobj->driver_id = driver_id;
return (PyObject *) retobj;
}
@@ -150,7 +151,7 @@
py_ao_dealloc(ao_Object *self)
{
ao_close(self->dev);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
static PyObject *
@@ -184,7 +185,7 @@
/* It's a method */
ao_Object *ao_self = (ao_Object *) self;
- info = ao_driver_info(ao_self->dev->driver_id);
+ info = ao_driver_info(ao_self->driver_id);
} else {
--- src/aomodule.h
+++ src/aomodule.h
@@ -9,6 +9,7 @@
typedef struct {
PyObject_HEAD
ao_device *dev;
+ uint32_t driver_id;
} ao_Object;
static PyObject *Py_aoError;
|