From patchwork Tue Aug 18 18:52:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [V3] parsers.c: avoid implicit conversion loses integer precision warnings From: =?utf-8?q?Andr=C3=A9_Sintzoff?= X-Patchwork-Id: 10231 Message-Id: To: mercurial-devel@selenic.com Date: Tue, 18 Aug 2015 20:52:38 +0200 # HG changeset patch # User André Sintzoff # Date 1439902654 -7200 # Tue Aug 18 14:57:34 2015 +0200 # Node ID ae1dbf8a309b47660abbce73b4a7351518ffe433 # Parent 9e7d805925c87cfa0ca30819e8273ac37fd77a62 parsers.c: avoid implicit conversion loses integer precision warnings These warnings are raised by Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) and were introduced in ff89383a97db diff -r 9e7d805925c8 -r ae1dbf8a309b mercurial/parsers.c --- a/mercurial/parsers.c Fri Aug 14 12:36:41 2015 +0900 +++ b/mercurial/parsers.c Tue Aug 18 14:57:34 2015 +0200 @@ -1125,13 +1125,13 @@ Py_ssize_t k; Py_ssize_t i; int r; - int minidx; + long minidx; int parents[2]; /* Internal data structure: * tovisit: array of length len+1 (all revs + nullrev), filled upto lentovisit * seen: array of length len+1 (all revs + nullrev) 0: not seen, 1 seen*/ - int *tovisit = NULL; + long *tovisit = NULL; long lentovisit = 0; char *seen = NULL; @@ -1151,7 +1151,7 @@ } /* Initialize internal datastructures */ - tovisit = (int *)malloc((len + 1) * sizeof(int)); + tovisit = (long *)malloc((len + 1) * sizeof(long)); if (tovisit == NULL) { PyErr_NoMemory(); goto bail;