Patchwork [V2] parsers: remove warning: format ‘%ld’ expects argument of type ‘long int’

login
register
mail settings
Submitter André Sintzoff
Date April 18, 2013, 7:19 p.m.
Message ID <a5c02eac79f98a988235.1366312797@amical.local>
Download mbox | patch
Permalink /patch/1432/
State Accepted, archived
Headers show

Comments

André Sintzoff - April 18, 2013, 7:19 p.m.
# HG changeset patch
# User André Sintzoff <andre.sintzoff@gmail.com>
# Date 1366309718 -7200
#      Jeu avr 18 20:28:38 2013 +0200
# Node ID a5c02eac79f98a9882354555bc75763d87a6d627
# Parent  7d31f2e42a8afb54c8fae87e8e3e29a63578aea4
parsers: remove warning: format ‘%ld’ expects argument of type ‘long int’

gcc 4.6.3 on 12.04 Ubuntu machine emits warnings:
mercurial/parsers.c: In function ‘find_deepest’:
mercurial/parsers.c:1288:9: warning: format ‘%ld’ expects argument of type
                    ‘long int’, but argument 3 has type ‘Py_ssize_t’ [-Wformat]
mercurial/parsers.c:1288:9: warning: format ‘%ld’ expects argument of type
                    ‘long int’, but argument 4 has type ‘Py_ssize_t’ [-Wformat]
Matt Mackall - April 18, 2013, 10:42 p.m.
On Thu, 2013-04-18 at 21:19 +0200, André Sintzoff wrote:
> # HG changeset patch
> # User André Sintzoff <andre.sintzoff@gmail.com>
> # Date 1366309718 -7200
> #      Jeu avr 18 20:28:38 2013 +0200
> # Node ID a5c02eac79f98a9882354555bc75763d87a6d627
> # Parent  7d31f2e42a8afb54c8fae87e8e3e29a63578aea4
> parsers: remove warning: format ‘%ld’ expects argument of type ‘long int’

Queued for default, thanks.

Patch

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -1285,7 +1285,7 @@ 
 	if (revcount > capacity) {
 		PyErr_Format(PyExc_OverflowError,
 			     "bitset size (%ld) > capacity (%ld)",
-			     revcount, capacity);
+			     (long)revcount, (long)capacity);
 		return NULL;
 	}