# HG changeset patch # User Raphaël Gomès # Date 2021-12-06 10:10:59 # Node ID 5140461ee9473314a2c6ba195fe198a5ca5517fb # Parent e6aecc37bfbf69161ed53e9d5a7d9f2702e3faea fsmonitor: incorporate fixes for Python 3.10 (issue6612) Differential Revision: https://phab.mercurial-scm.org/D11862 diff --git a/hgext/fsmonitor/pywatchman/bser.c b/hgext/fsmonitor/pywatchman/bser.c --- a/hgext/fsmonitor/pywatchman/bser.c +++ b/hgext/fsmonitor/pywatchman/bser.c @@ -28,6 +28,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWI OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define PY_SSIZE_T_CLEAN #include #include #ifdef _MSC_VER @@ -1052,7 +1053,7 @@ static int pdu_info_helper( int64_t* total_len_out) { const char* start = NULL; const char* data = NULL; - int datalen = 0; + Py_ssize_t datalen = 0; const char* end; int64_t expected_len; off_t position; @@ -1101,7 +1102,7 @@ static PyObject* bser_pdu_len(PyObject* static PyObject* bser_loads(PyObject* self, PyObject* args, PyObject* kw) { const char* data = NULL; - int datalen = 0; + Py_ssize_t datalen = 0; const char* start; const char* end; int64_t expected_len;