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

login
register
mail settings
Submitter André Sintzoff
Date April 18, 2013, 6:33 p.m.
Message ID <3a57c20af0527025bf5f.1366309995@amical.local>
Download mbox | patch
Permalink /patch/1430/
State Rejected, archived
Headers show

Comments

André Sintzoff - April 18, 2013, 6:33 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 3a57c20af0527025bf5ffefd6f5dbd6e0b4fcd94
# 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]

Patch

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