Ticket #36: patch
| File patch, 2.0 kB (added by grep, 1 year ago) |
|---|
-
matchC.cc
old new 842 842 843 843 844 844 static PyObject* sortArray(PyObject* self, PyObject* args) { 845 846 long* a; 845 PyObject* obj; 846 void* buffer; 847 Py_ssize_t buffer_len; 847 848 848 unsigned long adr;849 long* a; 849 850 long l, r; // it's important that these are signed! 850 851 851 if (!PyArg_ParseTuple(args, " lii", &adr, &l, &r))852 if (!PyArg_ParseTuple(args, "Oii", &obj, &l, &r)) 852 853 return NULL; 854 if (PyObject_AsWriteBuffer(obj, &buffer, &buffer_len)) 855 return NULL; 853 856 854 a = (long*) adr;857 a = (long*) buffer; 855 858 856 859 sortCArray(a, l, r); 857 860 Py_INCREF(Py_None); … … 860 863 861 864 862 865 static PyObject* buildOutput(PyObject* self, PyObject* args) { 866 PyObject* obj; 867 void* buffer; 868 Py_ssize_t buffer_len; 863 869 864 870 long* a; 865 unsigned long adr,length;866 if (!PyArg_ParseTuple(args, " li", &adr, &length))871 unsigned long length; 872 if (!PyArg_ParseTuple(args, "Oi", &obj, &length)) 867 873 return NULL; 874 if (PyObject_AsWriteBuffer(obj, &buffer, &buffer_len)) 875 return NULL; 868 876 869 a = (long*) adr;877 a = (long*) buffer; 870 878 871 879 long *b = new long[length]; 872 880 long bIndex = 0;
