db-move: moved webkitgtk-6.0 from [testing] to [extra] (x86_64)
[arch-packages.git] / libieee1284 / trunk / upstream_python_fix1.patch
blob1596327263a9189e9881361152d628925b5a312e
1 From c48855528beee1397d883f9c8a5df7aed5c917a6 Mon Sep 17 00:00:00 2001
2 From: Tim Waugh <twaugh@redhat.com>
3 Date: Wed, 23 Jun 2010 11:58:04 +0000
4 Subject: [PATCH] 2010-06-23 Tim Waugh <twaugh@redhat.com>
6 * src/ieee1284module.c: Fixed warnings.
7 ---
8 ChangeLog | 1 +
9 src/ieee1284module.c | 37 ++++++++++++++++++++++++++++---------
10 2 files changed, 29 insertions(+), 9 deletions(-)
12 diff --git a/src/ieee1284module.c b/src/ieee1284module.c
13 index 30972f8..0093d6f 100644
14 --- a/src/ieee1284module.c
15 +++ b/src/ieee1284module.c
16 @@ -28,6 +28,17 @@ typedef struct {
17 struct parport *port;
18 } ParportObject;
20 +static PyObject *
21 +Parport_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
23 + ParportObject *self;
24 + self = (ParportObject *) type->tp_alloc (type, 0);
25 + if (self != NULL)
26 + self->port = NULL;
28 + return (PyObject *) self;
31 static int
32 Parport_init (ParportObject *self, PyObject *args, PyObject *kwds)
34 @@ -215,7 +226,6 @@ Parport_release (ParportObject *self)
35 static PyObject *
36 Parport_read_data (ParportObject *self)
38 - unsigned char b[2];
39 int r = ieee1284_read_data (self->port);
40 if (r < 0) {
41 handle_error (r);
42 @@ -258,7 +268,6 @@ Parport_data_dir (ParportObject *self, PyObject *args)
43 static PyObject *
44 Parport_read_status (ParportObject *self)
46 - unsigned char b[2];
47 int r = ieee1284_read_status (self->port);
48 if (r < 0) {
49 handle_error (r);
50 @@ -293,7 +302,6 @@ Parport_wait_status (ParportObject *self, PyObject *args)
51 static PyObject *
52 Parport_read_control (ParportObject *self)
54 - unsigned char b[2];
55 int r = ieee1284_read_control (self->port);
56 if (r < 0) {
57 handle_error (r);
58 @@ -435,7 +443,6 @@ Parport_##x (ParportObject *self, PyObject *args) \
59 int len; \
60 char *buffer; \
61 ssize_t wrote; \
62 - PyObject *ret; \
64 if (!PyArg_ParseTuple (args, "s#|i", &buffer, &len, &flags)) \
65 return NULL; \
66 @@ -562,6 +569,23 @@ static PyTypeObject ParportType = {
67 0, /* tp_as_buffer */
68 Py_TPFLAGS_DEFAULT, /* tp_flags */
69 "parallel port object", /* tp_doc */
70 + 0, /* tp_traverse */
71 + 0, /* tp_clear */
72 + 0, /* tp_richcompare */
73 + 0, /* tp_weaklistoffset */
74 + 0, /* tp_iter */
75 + 0, /* tp_iternext */
76 + Parport_methods, /* tp_methods */
77 + 0, /* tp_members */
78 + Parport_getseters, /* tp_getset */
79 + 0, /* tp_base */
80 + 0, /* tp_dict */
81 + 0, /* tp_descr_get */
82 + 0, /* tp_descr_set */
83 + 0, /* tp_dictoffset */
84 + (initproc)Parport_init, /* tp_init */
85 + 0, /* tp_alloc */
86 + Parport_new, /* tp_new */
89 static PyObject *
90 @@ -625,14 +649,9 @@ initieee1284 (void)
91 PyObject *d = PyModule_GetDict (m);
92 PyObject *c;
94 - ParportType.tp_new = PyType_GenericNew;
95 - ParportType.tp_init = (initproc) Parport_init;
96 - ParportType.tp_getset = Parport_getseters;
97 - ParportType.tp_methods = Parport_methods;
98 if (PyType_Ready (&ParportType) < 0)
99 return;
101 - Py_INCREF (&ParportType);
102 PyModule_AddObject (m, "Parport", (PyObject *) &ParportType);
104 pyieee1284_error = PyErr_NewException("ieee1284.error", NULL, NULL);