Patchwork parsers.c: avoid implicit conversion loses integer precision warning

login
register
mail settings
Submitter André Sintzoff
Date April 4, 2015, 9:34 a.m.
Message ID <d0cfb8f1e143f8d3f4cd.1428140092@zibeline.local>
Download mbox | patch
Permalink /patch/8498/
State Accepted
Headers show

Comments

André Sintzoff - April 4, 2015, 9:34 a.m.
# HG changeset patch
# User André Sintzoff <andre.sintzoff@gmail.com>
# Date 1428139635 -7200
#      Sat Apr 04 11:27:15 2015 +0200
# Node ID d0cfb8f1e143f8d3f4cd87577d094d4c76734d70
# Parent  4a4018831d2ebc3c9cae9c6613e6a2497b4f0993
parsers.c: avoid implicit conversion loses integer precision warning

This warning is raised by Apple LLVM version 6.0 (clang-600.0.57)
(based on LLVM 3.5svn) and was introduced in 670aaee7931c
Matt Mackall - April 6, 2015, 8:51 p.m.
On Sat, 2015-04-04 at 11:34 +0200, André Sintzoff wrote:
> # HG changeset patch
> # User André Sintzoff <andre.sintzoff@gmail.com>
> # Date 1428139635 -7200
> #      Sat Apr 04 11:27:15 2015 +0200
> # Node ID d0cfb8f1e143f8d3f4cd87577d094d4c76734d70
> # Parent  4a4018831d2ebc3c9cae9c6613e6a2497b4f0993
> parsers.c: avoid implicit conversion loses integer precision warning

Queued for default, thanks.

Patch

diff -r 4a4018831d2e -r d0cfb8f1e143 mercurial/parsers.c
--- a/mercurial/parsers.c	Wed Apr 01 00:44:33 2015 -0700
+++ b/mercurial/parsers.c	Sat Apr 04 11:27:15 2015 +0200
@@ -189,7 +189,7 @@ 
 			      &PyFunction_Type, &normcase_fallback))
 		goto quit;
 
-	spec = PyInt_AS_LONG(spec_obj);
+	spec = (int)PyInt_AS_LONG(spec_obj);
 	switch (spec) {
 	case NORMCASE_LOWER:
 		table = lowertable;