Blame SOURCES/libieee1284-strict-aliasing.patch

81061a
diff -up libieee1284-0.2.11/src/ieee1284module.c.strict-aliasing libieee1284-0.2.11/src/ieee1284module.c
81061a
--- libieee1284-0.2.11/src/ieee1284module.c.strict-aliasing	2004-02-03 11:50:57.000000000 +0000
81061a
+++ libieee1284-0.2.11/src/ieee1284module.c	2010-06-23 12:36:05.093026807 +0100
81061a
@@ -28,6 +28,17 @@ typedef struct {
81061a
 	struct parport *port;
81061a
 } ParportObject;
81061a
 
81061a
+static PyObject *
81061a
+Parport_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
81061a
+{
81061a
+  ParportObject *self;
81061a
+  self = (ParportObject *) type->tp_alloc (type, 0);
81061a
+  if (self != NULL)
81061a
+    self->port = NULL;
81061a
+
81061a
+  return (PyObject *) self;
81061a
+}
81061a
+
81061a
 static int
81061a
 Parport_init (ParportObject *self, PyObject *args, PyObject *kwds)
81061a
 {
81061a
@@ -562,6 +573,23 @@ static PyTypeObject ParportType = {
81061a
 	0,					/* tp_as_buffer */
81061a
 	Py_TPFLAGS_DEFAULT,			/* tp_flags */
81061a
 	"parallel port object",			/* tp_doc */
81061a
+	0,					/* tp_traverse */
81061a
+	0,					/* tp_clear */
81061a
+	0,					/* tp_richcompare */
81061a
+	0,					/* tp_weaklistoffset */
81061a
+	0,					/* tp_iter */
81061a
+	0,					/* tp_iternext */
81061a
+	Parport_methods,			/* tp_methods */
81061a
+	0,					/* tp_members */
81061a
+	Parport_getseters,			/* tp_getset */
81061a
+	0,					/* tp_base */
81061a
+	0,					/* tp_dict */
81061a
+	0,					/* tp_descr_get */
81061a
+	0,					/* tp_descr_set */
81061a
+	0,					/* tp_dictoffset */
81061a
+	(initproc)Parport_init,			/* tp_init */
81061a
+	0,					/* tp_alloc */
81061a
+	Parport_new,		                /* tp_new */
81061a
 };
81061a
 
81061a
 static PyObject *
81061a
@@ -625,14 +653,9 @@ initieee1284 (void)
81061a
 	PyObject *d = PyModule_GetDict (m);
81061a
 	PyObject *c;
81061a
 
81061a
-	ParportType.tp_new = PyType_GenericNew;
81061a
-	ParportType.tp_init = (initproc) Parport_init;
81061a
-	ParportType.tp_getset = Parport_getseters;
81061a
-	ParportType.tp_methods = Parport_methods;
81061a
 	if (PyType_Ready (&ParportType) < 0)
81061a
 		return;
81061a
 
81061a
-	Py_INCREF (&ParportType);
81061a
 	PyModule_AddObject (m, "Parport", (PyObject *) &ParportType);
81061a
 
81061a
 	pyieee1284_error = PyErr_NewException("ieee1284.error", NULL, NULL);