Show More
@@ -38,7 +38,7 b' struct flist {' | |||||
38 | struct frag *base, *head, *tail; |
|
38 | struct frag *base, *head, *tail; | |
39 | }; |
|
39 | }; | |
40 |
|
40 | |||
41 |
static struct flist *lalloc( |
|
41 | static struct flist *lalloc(Py_ssize_t size) | |
42 | { |
|
42 | { | |
43 | struct flist *a = NULL; |
|
43 | struct flist *a = NULL; | |
44 |
|
44 | |||
@@ -68,7 +68,7 b' static void lfree(struct flist *a)' | |||||
68 | } |
|
68 | } | |
69 | } |
|
69 | } | |
70 |
|
70 | |||
71 |
static |
|
71 | static Py_ssize_t lsize(struct flist *a) | |
72 | { |
|
72 | { | |
73 | return a->tail - a->head; |
|
73 | return a->tail - a->head; | |
74 | } |
|
74 | } | |
@@ -197,7 +197,7 b' static struct flist *combine(struct flis' | |||||
197 | } |
|
197 | } | |
198 |
|
198 | |||
199 | /* decode a binary patch into a hunk list */ |
|
199 | /* decode a binary patch into a hunk list */ | |
200 |
static struct flist *decode(const char *bin, |
|
200 | static struct flist *decode(const char *bin, Py_ssize_t len) | |
201 | { |
|
201 | { | |
202 | struct flist *l; |
|
202 | struct flist *l; | |
203 | struct frag *lt; |
|
203 | struct frag *lt; | |
@@ -236,9 +236,9 b' static struct flist *decode(const char *' | |||||
236 | } |
|
236 | } | |
237 |
|
237 | |||
238 | /* calculate the size of resultant text */ |
|
238 | /* calculate the size of resultant text */ | |
239 |
static |
|
239 | static Py_ssize_t calcsize(Py_ssize_t len, struct flist *l) | |
240 | { |
|
240 | { | |
241 |
|
|
241 | Py_ssize_t outlen = 0, last = 0; | |
242 | struct frag *f = l->head; |
|
242 | struct frag *f = l->head; | |
243 |
|
243 | |||
244 | while (f != l->tail) { |
|
244 | while (f != l->tail) { | |
@@ -258,7 +258,7 b' static int calcsize(int len, struct flis' | |||||
258 | return outlen; |
|
258 | return outlen; | |
259 | } |
|
259 | } | |
260 |
|
260 | |||
261 |
static int apply(char *buf, const char *orig, |
|
261 | static int apply(char *buf, const char *orig, Py_ssize_t len, struct flist *l) | |
262 | { |
|
262 | { | |
263 | struct frag *f = l->head; |
|
263 | struct frag *f = l->head; | |
264 | int last = 0; |
|
264 | int last = 0; | |
@@ -283,10 +283,9 b' static int apply(char *buf, const char *' | |||||
283 | } |
|
283 | } | |
284 |
|
284 | |||
285 | /* recursively generate a patch of all bins between start and end */ |
|
285 | /* recursively generate a patch of all bins between start and end */ | |
286 |
static struct flist *fold(PyObject *bins, |
|
286 | static struct flist *fold(PyObject *bins, Py_ssize_t start, Py_ssize_t end) | |
287 | { |
|
287 | { | |
288 | int len; |
|
288 | Py_ssize_t len, blen; | |
289 | Py_ssize_t blen; |
|
|||
290 | const char *buffer; |
|
289 | const char *buffer; | |
291 |
|
290 | |||
292 | if (start + 1 == end) { |
|
291 | if (start + 1 == end) { | |
@@ -312,8 +311,7 b' patches(PyObject *self, PyObject *args)' | |||||
312 | struct flist *patch; |
|
311 | struct flist *patch; | |
313 | const char *in; |
|
312 | const char *in; | |
314 | char *out; |
|
313 | char *out; | |
315 |
|
|
314 | Py_ssize_t len, outlen, inlen; | |
316 | Py_ssize_t inlen; |
|
|||
317 |
|
315 | |||
318 | if (!PyArg_ParseTuple(args, "OO:mpatch", &text, &bins)) |
|
316 | if (!PyArg_ParseTuple(args, "OO:mpatch", &text, &bins)) | |
319 | return NULL; |
|
317 | return NULL; |
General Comments 0
You need to be logged in to leave comments.
Login now