Blame SOURCES/libieee1284-strict-aliasing.patch

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