Show More
@@ -9,6 +9,7 b'' | |||
|
9 | 9 | Based roughly on Python difflib |
|
10 | 10 | */ |
|
11 | 11 | |
|
12 | #define PY_SSIZE_T_CLEAN | |
|
12 | 13 | #include <Python.h> |
|
13 | 14 | #include <stdlib.h> |
|
14 | 15 | #include <string.h> |
@@ -17,7 +18,8 b'' | |||
|
17 | 18 | #include "util.h" |
|
18 | 19 | |
|
19 | 20 | struct line { |
|
20 |
int hash |
|
|
21 | int hash, n, e; | |
|
22 | Py_ssize_t len; | |
|
21 | 23 | const char *l; |
|
22 | 24 | }; |
|
23 | 25 | |
@@ -31,7 +33,7 b' struct hunk {' | |||
|
31 | 33 | struct hunk *next; |
|
32 | 34 | }; |
|
33 | 35 | |
|
34 |
static int splitlines(const char *a, |
|
|
36 | static int splitlines(const char *a, Py_ssize_t len, struct line **lr) | |
|
35 | 37 | { |
|
36 | 38 | unsigned hash; |
|
37 | 39 | int i; |
@@ -338,7 +340,8 b' static PyObject *bdiff(PyObject *self, P' | |||
|
338 | 340 | PyObject *result = NULL; |
|
339 | 341 | struct line *al, *bl; |
|
340 | 342 | struct hunk l, *h; |
|
341 |
int an, bn, |
|
|
343 | int an, bn, count; | |
|
344 | Py_ssize_t len = 0, la, lb; | |
|
342 | 345 | PyThreadState *_save; |
|
343 | 346 | |
|
344 | 347 | if (!PyArg_ParseTuple(args, "s#s#:bdiff", &sa, &la, &sb, &lb)) |
@@ -407,7 +410,7 b' static PyObject *fixws(PyObject *self, P' | |||
|
407 | 410 | PyObject *s, *result = NULL; |
|
408 | 411 | char allws, c; |
|
409 | 412 | const char *r; |
|
410 |
|
|
|
413 | Py_ssize_t i, rlen, wlen = 0; | |
|
411 | 414 | char *w; |
|
412 | 415 | |
|
413 | 416 | if (!PyArg_ParseTuple(args, "Sb:fixws", &s, &allws)) |
General Comments 0
You need to be logged in to leave comments.
Login now