# HG changeset patch # User Adrian Buehlmann # Date 1336817238 -7200 # Node ID f1aa3010642fe599929e4a44b90016401f875a2e # Parent b9969574540a48babeb6c1d963519acd5483613b diffhelpers: use Py_ssize_t in _fix_newline() Eliminates mercurial/diffhelpers.c(23) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data mercurial/diffhelpers.c(26) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data mercurial/diffhelpers.c(27) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data mercurial/diffhelpers.c(30) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data when compiling for Windows x64 target using the Microsoft compiler. diff --git a/mercurial/diffhelpers.c b/mercurial/diffhelpers.c --- a/mercurial/diffhelpers.c +++ b/mercurial/diffhelpers.c @@ -20,14 +20,14 @@ /* fixup the last lines of a and b when the patch has no newline at eof */ static void _fix_newline(PyObject *hunk, PyObject *a, PyObject *b) { - int hunksz = PyList_Size(hunk); + Py_ssize_t hunksz = PyList_Size(hunk); PyObject *s = PyList_GET_ITEM(hunk, hunksz-1); char *l = PyBytes_AsString(s); - int alen = PyList_Size(a); - int blen = PyList_Size(b); + Py_ssize_t alen = PyList_Size(a); + Py_ssize_t blen = PyList_Size(b); char c = l[0]; PyObject *hline; - int sz = PyBytes_GET_SIZE(s); + Py_ssize_t sz = PyBytes_GET_SIZE(s); if (sz > 1 && l[sz-2] == '\r') /* tolerate CRLF in last line */