##// END OF EJS Templates
diffhelpers: use Py_ssize_t in addlines()...
Adrian Buehlmann -
r16694:797b7620 default
parent child Browse files
Show More
@@ -57,6 +57,12 b' fix_newline(PyObject *self, PyObject *ar'
57 57 return Py_BuildValue("l", 0);
58 58 }
59 59
60 #if (PY_VERSION_HEX < 0x02050000)
61 static const char *addlines_format = "OOiiOO";
62 #else
63 static const char *addlines_format = "OOnnOO";
64 #endif
65
60 66 /*
61 67 * read lines from fp into the hunk. The hunk is parsed into two arrays
62 68 * a and b. a gets the old state of the text, b gets the new state
@@ -68,13 +74,14 b' addlines(PyObject *self, PyObject *args)'
68 74 {
69 75
70 76 PyObject *fp, *hunk, *a, *b, *x;
71 int i;
72 int lena, lenb;
73 int num;
74 int todoa, todob;
77 Py_ssize_t i;
78 Py_ssize_t lena, lenb;
79 Py_ssize_t num;
80 Py_ssize_t todoa, todob;
75 81 char *s, c;
76 82 PyObject *l;
77 if (!PyArg_ParseTuple(args, "OOiiOO", &fp, &hunk, &lena, &lenb, &a, &b))
83 if (!PyArg_ParseTuple(args, addlines_format,
84 &fp, &hunk, &lena, &lenb, &a, &b))
78 85 return NULL;
79 86
80 87 while (1) {
General Comments 0
You need to be logged in to leave comments. Login now