return (MP_COPY(PFILT_F(o)->m));
else if (ECPT_PYCHECK(o)) {
ec p = EC_INIT;
+ if (EC_ATINF(ECPT_P(o))) return (0);
getecptout(&p, o);
x = MP_COPY(p.x);
EC_DESTROY(&p);
PyObject *q = 0, *x, *z = 0;
mp *xx;
mp **v = 0;
- int i = 0, n = c->k;
+ Py_ssize_t i = 0, n = c->k;
Py_INCREF(me);
if (PyTuple_Size(arg) == n)
static PyObject *mpcrt_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
{
mpcrt_mod *v = 0;
- int n, i = 0, j;
+ Py_ssize_t n, i = 0, j;
char *kwlist[] = { "mv", 0 };
PyObject *q = 0, *x;
mp *xx = MP_NEW, *y = MP_NEW, *g = MP_NEW;
convgf, &p, convgf, &beta))
goto end;
gg = PyObject_New(gfn_pyobj, ty);
+ gg->p = 0;
if (gfn_create(p, beta, &gg->ntop, &gg->pton)) {
- FREEOBJ(gg);
+ Py_DECREF(gg);
gg = 0;
VALERR("can't invert transformation matrix");
}
end: \
mp_drop(xx); \
if (!z) return (0); \
- return (mp_pywrap(z)); \
+ return (gf_pywrap(z)); \
}
XFORMOP(pton, PTON)
XFORMOP(ntop, NTOP)
static void gfn_pydealloc(PyObject *me)
{
- gfn_destroy(GFN_PTON(me));
- gfn_destroy(GFN_NTOP(me));
+ if (GFN_P(me)) {
+ MP_DROP(GFN_P(me));
+ gfn_destroy(GFN_PTON(me));
+ gfn_destroy(GFN_NTOP(me));
+ }
FREEOBJ(me);
}