X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/blobdiff_plain/c461c9b380b56a41399e5f540e4bb97cfd9ceffe..828b13882f35b28275cf4062296b0419e0f0a7d1:/algorithms.c diff --git a/algorithms.c b/algorithms.c index aeafad3..60cfd58 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); } @@ -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); }