[Python-modules-commits] r11894 - in packages/gamera/trunk/debian/patches (1 file)

jwilk at users.alioth.debian.org jwilk at users.alioth.debian.org
Tue Feb 23 12:39:06 UTC 2010


    Date: Tuesday, February 23, 2010 @ 12:38:45
  Author: jwilk
Revision: 11894

Fix error handling in fix-unaligned-access.diff.

Modified:
  packages/gamera/trunk/debian/patches/fix-unaligned-access.diff

Modified: packages/gamera/trunk/debian/patches/fix-unaligned-access.diff
===================================================================
--- packages/gamera/trunk/debian/patches/fix-unaligned-access.diff	2010-02-23 12:13:24 UTC (rev 11893)
+++ packages/gamera/trunk/debian/patches/fix-unaligned-access.diff	2010-02-23 12:38:45 UTC (rev 11894)
@@ -6,14 +6,13 @@
 Index: gamera-3.2.4/gamera/generate.py
 ===================================================================
 --- gamera-3.2.4.orig/gamera/generate.py	2009-07-03 17:21:42.000000000 +0200
-+++ gamera-3.2.4/gamera/generate.py	2010-02-22 21:17:23.000000000 +0100
-@@ -182,11 +182,23 @@
-       [[end]]
++++ gamera-3.2.4/gamera/generate.py	2010-02-23 13:25:19.000000000 +0100
+@@ -183,10 +183,23 @@
  
        [[if function.feature_function]]
-+         PyObject* array = 0;
           feature_t* feature_buffer = 0;
 -         PyObject* str = 0;
++         PyObject* array = 0;
           if (offset < 0) {
 -           str = PyString_FromStringAndSize(NULL, [[function.return_type.length]] * sizeof(feature_t));
 -           feature_buffer = (feature_t*)PyString_AsString(str);
@@ -23,18 +22,19 @@
 +           if (str == 0)
 +             return 0;
 +           PyObject* array_init = get_ArrayInit();
-+           if (array_init == 0)
++           if (array_init != 0)
++             array = PyObject_CallFunction(
++               array_init, (char *)\"sO\", (char *)\"d\", str);
++           Py_DECREF(str);
++           if (array == 0)
 +             return 0;
-+           array = PyObject_CallFunction(
-+             array_init, (char *)\"sO\", (char *)\"d\", str);
-+           Py_DECREF(str);
 +           if (PyObject_AsWriteBuffer(array, &feature_buffer_v, &feature_buffer_len) < 0)
 +             return 0;
 +           feature_buffer = (feature_t*)feature_buffer_v;
           } else {
             if (self_arg->features_len < offset + [[function.return_type.length]]) {
               PyErr_Format(PyExc_ValueError, \"Offset as given (%d) will cause data to be written outside of array of length (%d).  Perhaps the feature array is not initialised?\", offset, (int)self_arg->features_len);
-@@ -212,14 +224,7 @@
+@@ -212,14 +225,7 @@
        [[end]]
  
        [[if function.feature_function]]




More information about the Python-modules-commits mailing list