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.
--- 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++) {