chiark / gitweb /
*.c: Declare `PY_SSIZE_T_CLEAN'.
[catacomb-python] / group.c
diff --git a/group.c b/group.c
index 5cc40e54a364cecb0028ca35329e9afc5fb0c792..e591301f7929912765fd02b0fa74733e3fcc0967 100644 (file)
--- a/group.c
+++ b/group.c
@@ -184,7 +184,7 @@ static PyObject *meth__DHInfo_gendsa(PyObject *me,
   unsigned steps = 0;
   dsa_seed ds;
   char *k;
-  int ksz;
+  Py_ssize_t ksz;
   pgev evt = { 0 };
   char *kwlist[] =
     { "class", "pbits", "qbits", "seed", "event", "nsteps", 0 };
@@ -815,7 +815,7 @@ static PyObject *meth__GE_frombuf(PyObject *me, PyObject *arg)
 {
   buf b;
   char *p;
-  int n;
+  Py_ssize_t n;
   group *g;
   ge *x = 0;
 
@@ -836,7 +836,7 @@ static PyObject *meth__GE_fromraw(PyObject *me, PyObject *arg)
 {
   buf b;
   char *p;
-  int n;
+  Py_ssize_t n;
   group *g;
   ge *x = 0;
 
@@ -857,7 +857,7 @@ static PyObject *meth__GE_fromstring(PyObject *me, PyObject *arg)
 {
   mptext_stringctx sc;
   char *p;
-  int n;
+  Py_ssize_t n;
   group *g;
   ge *x = 0;
 
@@ -870,7 +870,7 @@ static PyObject *meth__GE_fromstring(PyObject *me, PyObject *arg)
   if (G_READ(g, x, &mptext_stringops, &sc))
     VALERR("bad group element string");
   return (Py_BuildValue("(Ns#)", ge_pywrap(me, x),
-                       sc.buf, (int)(sc.lim - sc.buf)));
+                       sc.buf, (Py_ssize_t)(sc.lim - sc.buf)));
 end:
   if (x) G_DESTROY(g, x);
   return (0);