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: Describe `MP' and `GF' conversion semantics.
[catacomb-python]
/
field.c
diff --git
a/field.c
b/field.c
index 0a5d908f805dcff2ffe04b2f8d29899bcc14fcec..1f316f3bd8f2fbfb9dce6ff3a30fb0a0b6f53a39 100644
(file)
--- a/
field.c
+++ b/
field.c
@@
-229,15
+229,7
@@
end:
}
static long fe_pyhash(PyObject *me)
}
static long fe_pyhash(PyObject *me)
-{
- size_t sz = FE_F(me)->noctets;
- uint32 h = 0xe0c127ca + FE_F(me)->ops->ty;
- octet *p = xmalloc(sz);
- mp_storeb(FE_X(me), p, sz);
- h = unihash_hash(&unihash_global, h, p, sz);
- xfree(p);
- return (h % LONG_MAX);
-}
+ { return (mphash(FE_X(me))); }
static int fe_pycoerce(PyObject **x, PyObject **y)
{
static int fe_pycoerce(PyObject **x, PyObject **y)
{
@@
-345,8
+337,8
@@
static PyObject *feget__value(PyObject *me, void *hunoz)
static PyGetSetDef fe_pygetset[] = {
#define GETSETNAME(op, name) fe##op##_##name
GET (field, "X.field -> field containing X")
static PyGetSetDef fe_pygetset[] = {
#define GETSETNAME(op, name) fe##op##_##name
GET (field, "X.field -> field containing X")
- GET (value, "X.value -> `natural'
integer
representation of X")
- GET (_value, "X._value -> internal
integer
representation of X")
+ GET (value, "X.value -> `natural'
MP/GF
representation of X")
+ GET (_value, "X._value -> internal
MP/GF
representation of X")
#undef GETSETNAME
{ 0 }
};
#undef GETSETNAME
{ 0 }
};