diff mercurial/parsers.c @ 26080:83c9edcac05c

reachableroots: silence warning of implicit integer narrowing issued by clang Tested with CFLAGS=-Wshorten-64-to-32 CC=clang which is the default of Mac OS X. Because a valid revnum shouldn't exceed INT_MAX, we don't need long width for large tovisit array.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 14 Aug 2015 12:25:14 +0900
parents cefd5c8bab5d
children ce26928cbe41
line wrap: on
line diff
--- a/mercurial/parsers.c	Fri Aug 14 12:22:08 2015 +0900
+++ b/mercurial/parsers.c	Fri Aug 14 12:25:14 2015 +0900
@@ -1187,7 +1187,7 @@
 			goto bail;
 		}
 		if (!(revstates[revnum + 1] & RS_SEEN)) {
-			tovisit[lentovisit++] = revnum;
+			tovisit[lentovisit++] = (int)revnum;
 			revstates[revnum + 1] |= RS_SEEN;
 		}
 	}
@@ -1228,7 +1228,7 @@
 	/* Find all the nodes in between the roots we found and the heads
 	 * and add them to the reachable set */
 	if (includepath == 1) {
-		int minidx = minroot;
+		long minidx = minroot;
 		if (minidx < 0)
 			minidx = 0;
 		for (i = minidx; i < len; i++) {