chiark
/
gitweb
/
~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mp.c: Factor out and export `mphash'.
[catacomb-python]
/
mp.c
diff --git
a/mp.c
b/mp.c
index 88ee73813b538baa863097df8f07232a4fe66523..9330121968644f5eb33f83e9278f82c26d92485c 100644
(file)
--- a/
mp.c
+++ b/
mp.c
@@
-544,13
+544,15
@@
end:
return ((PyObject *)zz);
}
return ((PyObject *)zz);
}
-
static long mp_pyhash(PyObject *me
)
+
long mphash(mp *x
)
{
{
-
long h
;
-
PyObject *l = mp_topylong(MP_X(me));
h = PyObject_Hash(l);
+
PyObject *l = mp_topylong(x)
;
+
long
h = PyObject_Hash(l);
Py_DECREF(l); return (h);
}
Py_DECREF(l); return (h);
}
+static long mp_pyhash(PyObject *me) { return (mphash(MP_X(me))); }
+
static PyObject *mpmeth_jacobi(PyObject *me, PyObject *arg)
{
mp *y = 0;
static PyObject *mpmeth_jacobi(PyObject *me, PyObject *arg)
{
mp *y = 0;