D6198: cext: make osutil.c PY_SSIZE_T_CLEAN

2019-04-04 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is needed to avoid a deprecation warning on Python 3.8.
  
  With this change, we no longer see deprecation warnings for
  this issue on Python 3.8.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6198

AFFECTED FILES
  mercurial/cext/osutil.c

CHANGE DETAILS

diff --git a/mercurial/cext/osutil.c b/mercurial/cext/osutil.c
--- a/mercurial/cext/osutil.c
+++ b/mercurial/cext/osutil.c
@@ -8,6 +8,7 @@
 */
 
 #define _ATFILE_SOURCE
+#define PY_SSIZE_T_CLEAN
 #include 
 #include 
 #include 
@@ -227,7 +228,7 @@
kind, py_st);
 }
 
-static PyObject *_listdir(char *path, int plen, int wantstat, char *skip)
+static PyObject *_listdir(char *path, Py_ssize_t plen, int wantstat, char 
*skip)
 {
PyObject *rval = NULL; /* initialize - return value */
PyObject *list;
@@ -1181,7 +1182,8 @@
PyObject *statobj = NULL; /* initialize - optional arg */
PyObject *skipobj = NULL; /* initialize - optional arg */
char *path, *skip = NULL;
-   int wantstat, plen;
+   Py_ssize_t plen;
+   int wantstat;
 
static char *kwlist[] = {"path", "stat", "skip", NULL};
 



To: indygreg, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6198: cext: make osutil.c PY_SSIZE_T_CLEAN

2019-04-05 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG668eff08387f: cext: make osutil.c PY_SSIZE_T_CLEAN 
(authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6198?vs=14654&id=14671

REVISION DETAIL
  https://phab.mercurial-scm.org/D6198

AFFECTED FILES
  mercurial/cext/osutil.c

CHANGE DETAILS

diff --git a/mercurial/cext/osutil.c b/mercurial/cext/osutil.c
--- a/mercurial/cext/osutil.c
+++ b/mercurial/cext/osutil.c
@@ -8,6 +8,7 @@
 */
 
 #define _ATFILE_SOURCE
+#define PY_SSIZE_T_CLEAN
 #include 
 #include 
 #include 
@@ -227,7 +228,7 @@
kind, py_st);
 }
 
-static PyObject *_listdir(char *path, int plen, int wantstat, char *skip)
+static PyObject *_listdir(char *path, Py_ssize_t plen, int wantstat, char 
*skip)
 {
PyObject *rval = NULL; /* initialize - return value */
PyObject *list;
@@ -1181,7 +1182,8 @@
PyObject *statobj = NULL; /* initialize - optional arg */
PyObject *skipobj = NULL; /* initialize - optional arg */
char *path, *skip = NULL;
-   int wantstat, plen;
+   Py_ssize_t plen;
+   int wantstat;
 
static char *kwlist[] = {"path", "stat", "skip", NULL};
 



To: indygreg, #hg-reviewers, pulkit
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel