parsers: silence warning of implicit integer conversion issued by clang stable
authorYuya Nishihara <yuya@tcha.org>
Mon, 20 Jul 2015 23:38:56 +0900
branchstable
changeset 25860 895f04955a49
parent 25859 1619563959b3
child 25861 11ab8714f529
parsers: silence warning of implicit integer conversion issued by clang "-Wshorten-64-to-32" is enabled by default on Mac OS X. Because "len" should be represented in 32bit integer, this patch simply cast ssize_t to int.
mercurial/parsers.c
--- a/mercurial/parsers.c	Sun Jul 19 15:27:28 2015 +0900
+++ b/mercurial/parsers.c	Mon Jul 20 23:38:56 2015 +0900
@@ -1156,7 +1156,8 @@
 	if (minrevallphases != -1) {
 		int parents[2];
 		for (i = minrevallphases; i < len; i++) {
-			if (index_get_parents(self, i, parents, len - 1) < 0)
+			if (index_get_parents(self, i, parents,
+					      (int)len - 1) < 0)
 				goto release_phasesetlist;
 			set_phase_from_parents(phases, parents[0], parents[1], i);
 		}
@@ -1256,7 +1257,7 @@
 			continue;
 		}
 
-		if (index_get_parents(self, i, parents, len - 1) < 0)
+		if (index_get_parents(self, i, parents, (int)len - 1) < 0)
 			goto bail;
 		for (j = 0; j < 2; j++) {
 			if (parents[j] >= 0)