comparison mercurial/mpatch.c @ 16758:9a8ab5c47f84

mpatch: use Py_ssize_t for string length
author Adrian Buehlmann <adrian@cadifra.com>
date Sun, 20 May 2012 01:28:31 +0200
parents 923bd97b86a0
children 09e41ac6289d
comparison
equal deleted inserted replaced
16757:923bd97b86a0 16758:9a8ab5c47f84
18 18
19 This software may be used and distributed according to the terms 19 This software may be used and distributed according to the terms
20 of the GNU General Public License, incorporated herein by reference. 20 of the GNU General Public License, incorporated herein by reference.
21 */ 21 */
22 22
23 #define PY_SSIZE_T_CLEAN
23 #include <Python.h> 24 #include <Python.h>
24 #include <stdlib.h> 25 #include <stdlib.h>
25 #include <string.h> 26 #include <string.h>
26 27
27 #include "util.h" 28 #include "util.h"
353 /* calculate size of a patched file directly */ 354 /* calculate size of a patched file directly */
354 static PyObject * 355 static PyObject *
355 patchedsize(PyObject *self, PyObject *args) 356 patchedsize(PyObject *self, PyObject *args)
356 { 357 {
357 long orig, start, end, len, outlen = 0, last = 0; 358 long orig, start, end, len, outlen = 0, last = 0;
358 int patchlen; 359 Py_ssize_t patchlen;
359 char *bin, *binend, *data; 360 char *bin, *binend, *data;
360 361
361 if (!PyArg_ParseTuple(args, "ls#", &orig, &bin, &patchlen)) 362 if (!PyArg_ParseTuple(args, "ls#", &orig, &bin, &patchlen))
362 return NULL; 363 return NULL;
363 364