Message94666
According to man pages on the Web, the kevent structure is:
struct kevent {
uintptr_t ident; /* identifier for this event */
short filter; /* filter for event */
u_short flags; /* action flags for kqueue */
u_int fflags; /* filter flag value */
intptr_t data; /* filter data value */
void *udata; /* opaque user data identifier */
};
So the `ident` field is indeed an uintptr_t.
However the patch is slightly wrong IMO:
- you should not blindly use `long long`. Python already defines a
"Py_uintptr_t" type. If you need more information you should conditional
compilation such as in (for the off_t type)
http://svn.python.org/view/python/trunk/Modules/_io/_iomodule.h?view=markup
- in tests, you should use sys.maxsize (which gives you the max value of
a ssize_t integer) rather than choosing based on platform.architecture():
>>> sys.maxsize
9223372036854775807
>>> 2**64*1
18446744073709551616L
>>> sys.maxsize*2 + 1
18446744073709551615L
PS : a patch against trunk or py3k is preferred, but in this case it
would probably apply cleanly anyway |
|
Date |
User |
Action |
Args |
2009-10-29 13:29:43 | pitrou | set | recipients:
+ pitrou, loewis, therve, christian.heimes, mbroughton |
2009-10-29 13:29:43 | pitrou | set | messageid: <1256822983.89.0.678272373714.issue7211@psf.upfronthosting.co.za> |
2009-10-29 13:29:42 | pitrou | link | issue7211 messages |
2009-10-29 13:29:41 | pitrou | create | |
|