[PATCH] base85: use z modifier to print Py_ssize_t

David Soria Parra dsoria at gmx.net
Mon Jun 4 03:34:41 CDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/04/2012 09:29 AM, Adrian Buehlmann wrote:
> On 2012-06-04 09:15, David Soria Parra wrote:
>> # HG changeset patch # User David Soria Parra <dsp at php.net> # 
>> Date 1338794040 -7200 # Node ID 
>> 5d6ccf796a9410cbef419478e5bca67722f214ea # Parent 
>> 0a0cf3f26938ff7a084f2dcc9e59152ac6060e1e base85: use z modifier 
>> to print Py_ssize_t
>> 
>> Python converts to z modifiert to PY_SIZE_FORMAT_T internally. 
>> Using the z modifier is the right way to print Py_ssize_t 
>> arguments. This squelches a conversion warning.
> 
> Thanks.
> 
> Using the zd format specifier was my first idea as well, but that 
> format doesn't exist in Python 2.4 (it was introduced with Python 
> 2.5):
> 

I see. We define Py_ssize_t as an int (see mercurial/util.h) in case
we are on Python 2.4 or below. We can ifdef the line and use %d on
Python 2.4 or below and %zd on all others.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPzHMhAAoJEKSanlo0ToXKwygP/05ziAyjeGc7RevADh/3gS5N
MPAGDIan414JEqRGgTqYfaXJ5ou+SW85xK4hLD6PTboALrcNLMusLIKP/n04j/W5
oTkXTSYpfYooYqpQ2PDyiOP1nK7Gpd+NSywXahZJ8xPSqreK9TFXZcjHW9TIYLQb
tznCjLrLvneyiE2W1nJ8/E5i9vxmuEpVzWEqoS+zZO4fc1mYctet7oF25JC+OmDW
4B/267NHxDkV2hBMDRe2xOKoRmZ2pgGO3CnkJUyMipEQ6y10p/w9WoU4MQhMbJON
cvUYIOXlxKQ39LhH/O2Y7UlAhSxkWWHYosStkYAQaNP7YDJE1IADrTmIA33wxL0c
73nEntFUkTtnpYbXIRyKTnE0AKzgAd/wwcHxm9qblsb/R7VqoQSmnifctIOfKdpt
N91ryvGBni8mn4aTFK7qDqcCAOpUL2NqxxzUwENgeJvzE80IuJIzy3pcwFRIkTov
rPNEH6BsD+Rv6/jpBVDDJFxND8/ycRRkk8rdnQoDnk9zV5Oa7jTiZAUYsp0oM6PY
FCt2Exe6NvzUL4klHW1pYqXPmnb6vhmVIUTnDCzApzSCYEEijCGqyxnyLDSamrYI
IGWBbRDnvd10/UdHokB/XTdCRUg0wIzNz23q+f+MrLeKQRGciBcBDGLfllvoa0Y3
7S0jMYN30BHGwnhn6rRp
=rvLM
-----END PGP SIGNATURE-----


More information about the Mercurial-devel mailing list