From: Mark Wooding Date: Sat, 23 Nov 2019 22:38:04 +0000 (+0000) Subject: mp.c: Export `implicitmp' and `implicitgf'. X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/commitdiff_plain/5b29dfaf13a37a2454103cf79db50c9dc8bb484d mp.c: Export `implicitmp' and `implicitgf'. The next few commits are going to be about shoring up implicit conversions in generic arithmetic operators, and, in particular, in forbidding obviously silly conversions, e.g., from floating-point numbers of strings to integers or polynomials. This is a first step towards that. No new callers yet, and no functional change. --- diff --git a/catacomb-python.h b/catacomb-python.h index 9b60ce4..67117fa 100644 --- a/catacomb-python.h +++ b/catacomb-python.h @@ -195,8 +195,10 @@ extern PyTypeObject *gf_pytype; extern mp *mp_frompylong(PyObject *); extern PyObject *mp_topylong(mp *); extern mp *tomp(PyObject *); +extern mp *implicitmp(PyObject *); extern mp *getmp(PyObject *); extern int convmp(PyObject *, void *); +extern mp *implicitgf(PyObject *); extern mp *getgf(PyObject *); extern int convgf(PyObject *, void *); extern PyObject *mp_pywrap(mp *); diff --git a/mp.c b/mp.c index e299a7d..f45268b 100644 --- a/mp.c +++ b/mp.c @@ -287,7 +287,7 @@ int convgf(PyObject *o, void *p) return (1); } -static mp *implicitmp(PyObject *o) +mp *implicitmp(PyObject *o) { if (!o || GF_PYCHECK(o) || @@ -298,7 +298,7 @@ static mp *implicitmp(PyObject *o) return (tomp(o)); } -static mp *implicitgf(PyObject *o) +mp *implicitgf(PyObject *o) { if (!o || MP_PYCHECK(o) ||