changeset 16837:1b9d54c00d50

base85: use Py_ssize_t for string lengths
author Adrian Buehlmann <adrian@cadifra.com>
date Thu, 24 May 2012 01:30:12 +0200
parents 1ba3e17186c8
children d37d221334be
files mercurial/base85.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/base85.c	Tue May 22 15:17:37 2012 -0700
+++ b/mercurial/base85.c	Thu May 24 01:30:12 2012 +0200
@@ -9,6 +9,7 @@
  Largely based on git's implementation
 */
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
 #include "util.h"
@@ -33,7 +34,7 @@
 	const unsigned char *text;
 	PyObject *out;
 	char *dst;
-	int len, olen, i;
+	Py_ssize_t len, olen, i;
 	unsigned int acc, val, ch;
 	int pad = 0;
 
@@ -81,7 +82,8 @@
 	PyObject *out;
 	const char *text;
 	char *dst;
-	int len, i, j, olen, c, cap;
+	Py_ssize_t len, i, j, olen, cap;
+	int c;
 	unsigned int acc;
 
 	if (!PyArg_ParseTuple(args, "s#", &text, &len))