mp.c: Export `implicitmp' and `implicitgf'.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 23 Nov 2019 22:38:04 +0000 (22:38 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 11 Apr 2020 11:49:31 +0000 (12:49 +0100)
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.

catacomb-python.h
mp.c

index 9b60ce4..67117fa 100644 (file)
@@ -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 (file)
--- 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) ||