comparison mercurial/cext/revlog.c @ 42067:b01bbb8ff1f2

cext: make revlog.c PY_SSIZE_T_CLEAN Without this, Python 3.8 emits a deprecation warning, as using int for # values is deprecated. Many existing modules use PY_SSIZE_T_CLEAN, so this shouldn't be contentious. I audited the file for all # formatters and verified we are using Py_ssize_t everywhere now. Differential Revision: https://phab.mercurial-scm.org/D6196
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 04 Apr 2019 15:18:06 -0700
parents 4948b327d3b9
children 509a0477b3a6
comparison
equal deleted inserted replaced
42066:65ed223619ec 42067:b01bbb8ff1f2
5 5
6 This software may be used and distributed according to the terms of 6 This software may be used and distributed according to the terms of
7 the GNU General Public License, incorporated herein by reference. 7 the GNU General Public License, incorporated herein by reference.
8 */ 8 */
9 9
10 #define PY_SSIZE_T_CLEAN
10 #include <Python.h> 11 #include <Python.h>
11 #include <assert.h> 12 #include <assert.h>
12 #include <ctype.h> 13 #include <ctype.h>
13 #include <limits.h> 14 #include <limits.h>
14 #include <stddef.h> 15 #include <stddef.h>
1945 } 1946 }
1946 1947
1947 static PyObject *index_partialmatch(indexObject *self, PyObject *args) 1948 static PyObject *index_partialmatch(indexObject *self, PyObject *args)
1948 { 1949 {
1949 const char *fullnode; 1950 const char *fullnode;
1950 int nodelen; 1951 Py_ssize_t nodelen;
1951 char *node; 1952 char *node;
1952 int rev, i; 1953 int rev, i;
1953 1954
1954 if (!PyArg_ParseTuple(args, PY23("s#", "y#"), &node, &nodelen)) 1955 if (!PyArg_ParseTuple(args, PY23("s#", "y#"), &node, &nodelen))
1955 return NULL; 1956 return NULL;