Merge branch '1.2.x' into 1.3.x
authorMark Wooding <mdw@distorted.org.uk>
Wed, 27 Nov 2019 15:11:08 +0000 (15:11 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 27 Nov 2019 15:11:08 +0000 (15:11 +0000)
* 1.2.x: (89 commits)
  t/: Add a test suite.
  ec.c: Don't lose error status when constructing points from a sequence.
  ec.c: Free partially constructed points coordinatewise.
  *.c: Be more careful about `PySequence_Size'.
  key.c: Reformat the rest of the `KeyError' constructor.
  key.c: Parse `KeyError' constructor arguments by hand.
  catacomb-python.h: Add a macro for raising `OverflowError'.
  key.c: Collect `KeyError' argument count as a separate step.
  key.c: Use tuple functions on `KeyError' argument tuple.
  key.c: Rename sad-path label to `end'.
  key.c: Delete duplicate setting of `errstring'.
  util.c (mkexc): Populate dictionary before constructing exception class.
  key.c: Only set the error code.
  catacomb.c, util.c: Publish negative constants correctly.
  field.c: Delete the completely unused `getfe' function.
  key.c (convfilter): Fix sense of error tests.
  buffer.c, ec.c: Fix required size for EC `buffer' encoding.
  algorithms.c: Fix `max' property name in docstrings.
  catacomb/__init__.py (_HashBase): Check that integers are within bounds.
  debian/rules: Build using the provided Makefile.
  ...

1  2 
catacomb-python.h
catacomb.c
util.c

    goto end;                                                           \
  } while (0)
  #define VALERR(str) EXCERR(PyExc_ValueError, str)
+ #define OVFERR(str) EXCERR(PyExc_OverflowError, str)
  #define TYERR(str) EXCERR(PyExc_TypeError, str)
 +#define IXERR(str) EXCERR(PyExc_IndexError, str)
  #define ZDIVERR(str) EXCERR(PyExc_ZeroDivisionError, str)
  #define SYSERR(str) EXCERR(PyExc_SystemError, str)
  #define NIERR(str) EXCERR(PyExc_NotImplementedError, str)
@@@ -233,9 -234,8 +236,10 @@@ MODULES(DO
      return (d);                                                               \
    }
  
- struct nameval { const char *name; unsigned long value; };
 +#define KWLIST (/*unconst*/ char **)kwlist
 +
+ struct nameval { const char *name; unsigned f; unsigned long value; };
+ #define CF_SIGNED 1u
  extern void setconstants(PyObject *, const struct nameval *);
  
  extern PyObject *mexp_common(PyObject *, PyObject *, size_t,
diff --cc catacomb.c
Simple merge
diff --cc util.c
--- 1/util.c
--- 2/util.c
+++ b/util.c
@@@ -609,9 -743,7 +743,9 @@@ PyObject *gmapmeth_get(PyObject *me, Py
  {
    PyObject *k, *def = Py_None, *v;
  
-   if (!PyArg_ParseTupleAndKeywords(arg, kw, "OO:get",
 -  if (!PyArg_ParseTupleAndKeywords(arg, kw, "O|O:get", def_kwlist, &k, &def))
++  if (!PyArg_ParseTupleAndKeywords(arg, kw, "O|O:get",
 +                                 (/*unconst*/ char **)def_kwlist,
 +                                 &k, &def))
      return (0);
    if ((v = PyObject_GetItem(me, k)) != 0) return (v);
    PyErr_Clear();
@@@ -622,9 -754,8 +756,9 @@@ PyObject *gmapmeth_setdefault(PyObject 
  {
    PyObject *k, *def = Py_None, *v;
  
-   if (!PyArg_ParseTupleAndKeywords(arg, kw, "OO:setdefault",
+   if (!PyArg_ParseTupleAndKeywords(arg, kw, "O|O:setdefault",
 -                                 def_kwlist, &k, &def))
 +                                 (/*unconst*/ char **)def_kwlist,
 +                                 &k, &def))
      return (0);
    if ((v = PyObject_GetItem(me, k)) != 0) return (v);
    PyErr_Clear();
@@@ -636,9 -767,7 +770,9 @@@ PyObject *gmapmeth_pop(PyObject *me, Py
  {
    PyObject *k, *def = 0, *v;
  
-   if (!PyArg_ParseTupleAndKeywords(arg, kw, "OO:pop",
 -  if (!PyArg_ParseTupleAndKeywords(arg, kw, "O|O:pop", def_kwlist, &k, &def))
++  if (!PyArg_ParseTupleAndKeywords(arg, kw, "O|O:pop",
 +                                 (/*unconst*/ char **)def_kwlist,
 +                                 &k, &def))
      return (0);
    if ((v = PyObject_GetItem(me, k)) != 0) {
      PyObject_DelItem(me, k);