t/t-bytes.py: Check that indexing, slicing, etc. return `C.ByteString'.
[catacomb-python] / share.c
diff --git a/share.c b/share.c
index 3d4817e..77da423 100644 (file)
--- a/share.c
+++ b/share.c
@@ -117,8 +117,8 @@ static PyObject *gfsharesplit_pynew(PyTypeObject *ty,
   unsigned t;
   grand *r = &rand_global;
   gfshare_pyobj *s;
-  char *kwlist[] = { "threshold", "secret", "rng", 0 };
-  if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&s#|O&:new", kwlist,
+  static const char *const kwlist[] = { "threshold", "secret", "rng", 0 };
+  if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&s#|O&:new", KWLIST,
                                   convuint, &t, &p, &n, convgrand, &r))
     goto end;
   if (!t || t > 255) VALERR("threshold must be nonzero and < 256");
@@ -203,8 +203,8 @@ static PyObject *gfsharejoin_pynew(PyTypeObject *ty,
 {
   unsigned t, sz;
   gfshare_pyobj *s;
-  char *kwlist[] = { "threshold", "size", 0 };
-  if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&O&:new", kwlist,
+  static const char *const kwlist[] = { "threshold", "size", 0 };
+  if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&O&:new", KWLIST,
                                   convuint, &t, convuint, &sz))
     goto end;
   if (!t || t > 255) VALERR("threshold must be nonzero and < 256");
@@ -409,8 +409,10 @@ static PyObject *sharesplit_pynew(PyTypeObject *ty,
   grand *r = &rand_global;
   mp *m = 0;
   share_pyobj *s;
-  char *kwlist[] = { "threshold", "secret", "modulus", "rng", 0 };
-  if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&O&|O&O&:new", kwlist,
+  static const char *const kwlist[] =
+    { "threshold", "secret", "modulus", "rng", 0 };
+
+  if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&O&|O&O&:new", KWLIST,
                                   convuint, &t, convmp, &sec,
                                   convmp, &m, convgrand, &r))
     goto end;
@@ -499,8 +501,8 @@ static PyObject *sharejoin_pynew(PyTypeObject *ty,
   unsigned t;
   mp *m = 0;
   share_pyobj *s;
-  char *kwlist[] = { "threshold", "modulus", 0 };
-  if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&O&:new", kwlist,
+  static const char *const kwlist[] = { "threshold", "modulus", 0 };
+  if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&O&:new", KWLIST,
                                   convuint, &t, convmp, &m))
     goto end;
   if (!t) VALERR("threshold must be nonzero");