changeset 17356:511dfb34b412

parsers: fix an integer size warning issued by clang
author Bryan O'Sullivan <bryano@fb.com>
date Mon, 13 Aug 2012 14:04:52 -0700
parents c25531ed58b0
children d7753a0bb0cd
files mercurial/parsers.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/parsers.c	Tue Jul 10 08:43:32 2012 -0700
+++ b/mercurial/parsers.c	Mon Aug 13 14:04:52 2012 -0700
@@ -9,6 +9,7 @@
 
 #include <Python.h>
 #include <ctype.h>
+#include <stddef.h>
 #include <string.h>
 
 #include "util.h"
@@ -72,7 +73,7 @@
 	for (start = cur = str, zero = NULL; cur < str + len; cur++) {
 		PyObject *file = NULL, *node = NULL;
 		PyObject *flags = NULL;
-		int nlen;
+		ptrdiff_t nlen;
 
 		if (!*cur) {
 			zero = cur;
@@ -94,7 +95,7 @@
 
 		nlen = cur - zero - 1;
 
-		node = unhexlify(zero + 1, nlen > 40 ? 40 : nlen);
+		node = unhexlify(zero + 1, nlen > 40 ? 40 : (int)nlen);
 		if (!node)
 			goto bail;