X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/blobdiff_plain/c461c9b380b56a41399e5f540e4bb97cfd9ceffe..77f2f48ef941f17978c7fce1468885bc8c89969a:/algorithms.c diff --git a/algorithms.c b/algorithms.c index aeafad3..06fdc32 100644 --- a/algorithms.c +++ b/algorithms.c @@ -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); }