pyke/pyke.h: Add a `MEMBER' variant with explicit member name.
[catacomb-python] / ec.c
diff --git a/ec.c b/ec.c
index ba629e4..03e9d16 100644 (file)
--- a/ec.c
+++ b/ec.c
@@ -225,29 +225,26 @@ end:
   return (rc);
 }
 
-static PyObject *epmeth_oncurvep(PyObject *me, PyObject *arg)
+static PyObject *epmeth_oncurvep(PyObject *me)
 {
-  if (!PyArg_ParseTuple(arg, ":oncurvep")) return (0);
   return (getbool(EC_ATINF(ECPT_P(me)) ||
                  !EC_CHECK(ECPT_C(me), ECPT_P(me))));
 }
 
-static PyObject *epmeth_dbl(PyObject *me, PyObject *arg)
+static PyObject *epmeth_dbl(PyObject *me)
 {
   ec p = EC_INIT;
-  if (!PyArg_ParseTuple(arg, ":dbl")) return (0);
   EC_DBL(ECPT_C(me), &p, ECPT_P(me));
   return (ecpt_pywrap(ECPT_COBJ(me), &p));
 }
 
-static PyObject *epmeth_tobuf(PyObject *me, PyObject *arg)
+static PyObject *epmeth_tobuf(PyObject *me)
 {
   buf b;
   ec p = EC_INIT;
   PyObject *rc;
   size_t n;
 
-  if (!PyArg_ParseTuple(arg, ":tobuf")) return (0);
   getecptout(&p, me);
   if (EC_ATINF(&p))
     n = 2;
@@ -262,7 +259,7 @@ static PyObject *epmeth_tobuf(PyObject *me, PyObject *arg)
   return (rc);
 }
 
-static PyObject *epmeth_toraw(PyObject *me, PyObject *arg)
+static PyObject *epmeth_toraw(PyObject *me)
 {
   buf b;
   PyObject *rc;
@@ -271,7 +268,6 @@ static PyObject *epmeth_toraw(PyObject *me, PyObject *arg)
   ec pp = EC_INIT;
   int len;
 
-  if (!PyArg_ParseTuple(arg, ":toraw")) return (0);
   len = c->f->noctets * 2 + 1;
   rc = bytestring_pywrap(0, len);
   p = PyString_AS_STRING(rc);
@@ -641,7 +637,7 @@ static const PyGetSetDef ecptnc_pygetset[] = {
 
 static const PyMethodDef ecptnc_pymethods[] = {
 #define METHNAME(func) epmeth_##func
-  METH (tobuf,         "X.tobuf() -> BIN")
+  NAMETH(tobuf,                "X.tobuf() -> BIN")
   CMTH (frombuf,       "frombuf(STR) -> (P, REST)")
   CMTH (parse,         "parse(STR) -> (P, REST)")
 #undef METHNAME
@@ -757,10 +753,10 @@ static const PyGetSetDef ecpt_pygetset[] = {
 
 static const PyMethodDef ecpt_pymethods[] = {
 #define METHNAME(func) epmeth_##func
-  METH (toraw,         "X.toraw() -> BIN")
+  NAMETH(toraw,                "X.toraw() -> BIN")
   KWMETH(ec2osp,       "X.ec2osp([flags = EC_EXPLY]) -> BIN")
-  METH (dbl,           "X.dbl() -> X + X")
-  METH (oncurvep,      "X.oncurvep() -> BOOL")
+  NAMETH(dbl,          "X.dbl() -> X + X")
+  NAMETH(oncurvep,     "X.oncurvep() -> BOOL")
   CMTH (fromraw,       "fromraw(STR) -> (P, REST)")
   KWCMTH(os2ecp,       "os2ecp(STR, [flags = ...]) -> (P, REST)")
 #undef METHNAME