chiark / gitweb /
algorithms.c: Fix docstring for `GCHash.hashsz'.
[catacomb-python] / algorithms.c
index aeafad3c0336e6cc4dad12b93624b81dc6fb0ea3..06fdc3271200f7a99f36fe2786c024dc28bd2e6a 100644 (file)
@@ -487,7 +487,7 @@ PyObject *gccipher_pywrap(gccipher *cc)
   g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
   g->ty.ht_type.tp_free = 0;
   g->ty.ht_type.tp_new = gcipher_pynew;
-  PyType_Ready(&g->ty.ht_type);
+  typeready(&g->ty.ht_type);
   return ((PyObject *)g);
 }
 
@@ -731,7 +731,7 @@ PyObject *gchash_pywrap(gchash *ch)
   g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
   g->ty.ht_type.tp_free = 0;
   g->ty.ht_type.tp_new = ghash_pynew;
-  PyType_Ready(&g->ty.ht_type);
+  typeready(&g->ty.ht_type);
   return ((PyObject *)g);
 }
 
@@ -787,7 +787,7 @@ static PyObject *ghmeth_done(PyObject *me, PyObject *arg)
 static PyGetSetDef gchash_pygetset[] = {
 #define GETSETNAME(op, name) gch##op##_##name
   GET  (bufsz,                 "CH.bufsz -> hash buffer size, or zero")
-  GET  (hashsz,                "CH.blksz -> hash output size")
+  GET  (hashsz,                "CH.hashsz -> hash output size")
   GET  (name,                  "CH.name -> name of this kind of hash")
 #undef GETSETNAME
   { 0 }
@@ -986,7 +986,7 @@ PyObject *gcmac_pywrap(gcmac *cm)
   g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
   g->ty.ht_type.tp_free = 0;
   g->ty.ht_type.tp_new = gmac_pynew;
-  PyType_Ready(&g->ty.ht_type);
+  typeready(&g->ty.ht_type);
   return ((PyObject *)g);
 }
 
@@ -996,6 +996,7 @@ PyObject *gmac_pywrap(PyObject *cobj, gmac *m, unsigned f)
   if (!cobj) cobj = gcmac_pywrap((/*unconst*/ gcmac *)GM_CLASS(m));
   else Py_INCREF(cobj);
   g = newtype((PyTypeObject *)cobj, 0, 0);
+  g->ty.ht_type.tp_basicsize = sizeof(ghash_pyobj);
   g->ty.ht_name = PyString_FromFormat("%s(keyed)", m->ops->c->name);
   g->ty.ht_type.tp_name = PyString_AS_STRING(g->ty.ht_name);
   g->ty.ht_type.tp_base = gmhash_pytype;
@@ -1006,7 +1007,7 @@ PyObject *gmac_pywrap(PyObject *cobj, gmac *m, unsigned f)
   g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
   g->ty.ht_type.tp_free = 0;
   g->ty.ht_type.tp_new = gmhash_pynew;
-  PyType_Ready(&g->ty.ht_type);
+  typeready(&g->ty.ht_type);
   g->m = m;
   g->f = f;
   return ((PyObject *)g);
@@ -1275,7 +1276,7 @@ static PyObject *gcprp_pywrap(const prpinfo *prp)
   g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
   g->ty.ht_type.tp_free = 0;
   g->ty.ht_type.tp_new = gprp_pynew;
-  PyType_Ready(&g->ty.ht_type);
+  typeready(&g->ty.ht_type);
   return ((PyObject *)g);
 }