Mercurial > hg-stable
changeset 16693:f1aa3010642f
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.
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Sat, 12 May 2012 12:07:18 +0200 |
parents | b9969574540a |
children | 797b76205408 |
files | mercurial/diffhelpers.c |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/diffhelpers.c Sat May 12 11:45:22 2012 +0200 +++ b/mercurial/diffhelpers.c Sat May 12 12:07:18 2012 +0200 @@ -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 */