~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
key.c: Make `KeyDataStructured' constructor cleanup less bizarre.
[catacomb-python]
/
group.c
diff --git
a/group.c
b/group.c
index
b51cb6a
..
1e93ccc
100644
(file)
--- a/
group.c
+++ b/
group.c
@@
-589,7
+589,10
@@
static PyObject *ge_pyexp(PyObject *x, PyObject *n, PyObject *m)
mp *nn;
ge *z;
mp *nn;
ge *z;
- if (m != Py_None || !GE_PYCHECK(x) || (nn = getmp(n)) == 0)
+ if (m != Py_None || !GE_PYCHECK(x)) RETURN_NOTIMPL;
+ if (FE_PYCHECK(n) && FE_F(n)->ops->ty == FTY_PRIME)
+ nn = F_OUT(FE_F(n), MP_NEW, FE_X(n));
+ else if ((nn = implicitmp(n)) == 0)
RETURN_NOTIMPL;
z = G_CREATE(GE_G(x));
G_EXP(GE_G(x), z, GE_X(x), nn);
RETURN_NOTIMPL;
z = G_CREATE(GE_G(x));
G_EXP(GE_G(x), z, GE_X(x), nn);
@@
-666,6
+669,7
@@
static PyObject *ge_pystr(PyObject *me)
return (rc);
}
return (rc);
}
+#ifdef PY2
static PyObject *ge_pylong(PyObject *me)
{
mp *x = 0;
static PyObject *ge_pylong(PyObject *me)
{
mp *x = 0;
@@
-678,6
+682,7
@@
end:
mp_drop(x);
return (rc);
}
mp_drop(x);
return (rc);
}
+#endif
static PyObject *ge_pyint(PyObject *me)
{
static PyObject *ge_pyint(PyObject *me)
{
@@
-957,7
+962,9
@@
static const PyNumberMethods ge_pynumber = {
0, /* @nb_add@ */
0, /* @nb_subtract@ */
ge_pymul, /* @nb_multiply@ */
0, /* @nb_add@ */
0, /* @nb_subtract@ */
ge_pymul, /* @nb_multiply@ */
+#ifdef PY2
ge_pydiv, /* @nb_divide@ */
ge_pydiv, /* @nb_divide@ */
+#endif
0, /* @nb_remainder@ */
0, /* @nb_divmod@ */
ge_pyexp, /* @nb_power@ */
0, /* @nb_remainder@ */
0, /* @nb_divmod@ */
ge_pyexp, /* @nb_power@ */
@@
-971,17
+978,23
@@
static const PyNumberMethods ge_pynumber = {
0, /* @nb_and@ */
0, /* @nb_xor@ */
0, /* @nb_or@ */
0, /* @nb_and@ */
0, /* @nb_xor@ */
0, /* @nb_or@ */
+#ifdef PY2
0, /* @nb_coerce@ */
0, /* @nb_coerce@ */
+#endif
ge_pyint, /* @nb_int@ */
ge_pyint, /* @nb_int@ */
-
ge_pylong,
/* @nb_long@ */
+
PY23(ge_pylong, 0),
/* @nb_long@ */
0 /* meaningless */, /* @nb_float@ */
0 /* meaningless */, /* @nb_float@ */
+#ifdef PY2
0, /* @nb_oct@ */
0, /* @nb_hex@ */
0, /* @nb_oct@ */
0, /* @nb_hex@ */
+#endif
0, /* @nb_inplace_add@ */
0, /* @nb_inplace_subtract@ */
0, /* @nb_inplace_multiply@ */
0, /* @nb_inplace_add@ */
0, /* @nb_inplace_subtract@ */
0, /* @nb_inplace_multiply@ */
+#ifdef PY2
0, /* @nb_inplace_divide@ */
0, /* @nb_inplace_divide@ */
+#endif
0, /* @nb_inplace_remainder@ */
0, /* @nb_inplace_power@ */
0, /* @nb_inplace_lshift@ */
0, /* @nb_inplace_remainder@ */
0, /* @nb_inplace_power@ */
0, /* @nb_inplace_lshift@ */