Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.h @ 16629:1435866c1937
parser: use PyInt_FromSsize_t in index_stats
Eliminates
mercurial/parsers.c(515) : warning C4244: 'function' : conversion from
'Py_ssize_t' to 'long', possible loss of data
mercurial/parsers.c(520) : warning C4244: 'function' : conversion from
'Py_ssize_t' to 'long', possible loss of data
mercurial/parsers.c(521) : warning C4244: 'function' : conversion from
'Py_ssize_t' to 'long', possible loss of data
when compiling for Windows x64 target using the Microsoft compiler.
PyInt_FromSsize_t does not exist for Python 2.4 and earlier, so we define a
fallback in util.h to use PyInt_FromLong when compiling for Python 2.4.
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Wed, 09 May 2012 09:58:50 +0200 |
parents | d126a0d16856 |
children | 9535a0dc41f2 |
line wrap: on
line diff
--- a/mercurial/util.h Fri May 11 10:53:12 2012 -0700 +++ b/mercurial/util.h Wed May 09 09:58:50 2012 +0200 @@ -109,6 +109,7 @@ typedef int Py_ssize_t; typedef Py_ssize_t (*lenfunc)(PyObject *); typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t); +#define PyInt_FromSsize_t PyInt_FromLong #if !defined(PY_SSIZE_T_MIN) #define PY_SSIZE_T_MAX INT_MAX