libieee1284-strict-aliasing.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. diff -up libieee1284-0.2.11/src/ieee1284module.c.strict-aliasing libieee1284-0.2.11/src/ieee1284module.c
  2. --- libieee1284-0.2.11/src/ieee1284module.c.strict-aliasing 2004-02-03 11:50:57.000000000 +0000
  3. +++ libieee1284-0.2.11/src/ieee1284module.c 2010-06-23 12:36:05.093026807 +0100
  4. @@ -28,6 +28,17 @@ typedef struct {
  5. struct parport *port;
  6. } ParportObject;
  7. +static PyObject *
  8. +Parport_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
  9. +{
  10. + ParportObject *self;
  11. + self = (ParportObject *) type->tp_alloc (type, 0);
  12. + if (self != NULL)
  13. + self->port = NULL;
  14. +
  15. + return (PyObject *) self;
  16. +}
  17. +
  18. static int
  19. Parport_init (ParportObject *self, PyObject *args, PyObject *kwds)
  20. {
  21. @@ -562,6 +573,23 @@ static PyTypeObject ParportType = {
  22. 0, /* tp_as_buffer */
  23. Py_TPFLAGS_DEFAULT, /* tp_flags */
  24. "parallel port object", /* tp_doc */
  25. + 0, /* tp_traverse */
  26. + 0, /* tp_clear */
  27. + 0, /* tp_richcompare */
  28. + 0, /* tp_weaklistoffset */
  29. + 0, /* tp_iter */
  30. + 0, /* tp_iternext */
  31. + Parport_methods, /* tp_methods */
  32. + 0, /* tp_members */
  33. + Parport_getseters, /* tp_getset */
  34. + 0, /* tp_base */
  35. + 0, /* tp_dict */
  36. + 0, /* tp_descr_get */
  37. + 0, /* tp_descr_set */
  38. + 0, /* tp_dictoffset */
  39. + (initproc)Parport_init, /* tp_init */
  40. + 0, /* tp_alloc */
  41. + Parport_new, /* tp_new */
  42. };
  43. static PyObject *
  44. @@ -625,14 +653,9 @@ initieee1284 (void)
  45. PyObject *d = PyModule_GetDict (m);
  46. PyObject *c;
  47. - ParportType.tp_new = PyType_GenericNew;
  48. - ParportType.tp_init = (initproc) Parport_init;
  49. - ParportType.tp_getset = Parport_getseters;
  50. - ParportType.tp_methods = Parport_methods;
  51. if (PyType_Ready (&ParportType) < 0)
  52. return;
  53. - Py_INCREF (&ParportType);
  54. PyModule_AddObject (m, "Parport", (PyObject *) &ParportType);
  55. pyieee1284_error = PyErr_NewException("ieee1284.error", NULL, NULL);