[pypy-commit] pypy kqueue: Cosmetical changes.
oberstet
noreply at buildbot.pypy.org
Sun Mar 4 20:39:33 CET 2012
Author: Tobias Oberstein <tobias.oberstein at gmail.com>
Branch: kqueue
Changeset: r53198:1205ef1c2c35
Date: 2012-03-04 14:28 +0100
http://bitbucket.org/pypy/pypy/changeset/1205ef1c2c35/
Log: Cosmetical changes.
diff --git a/pypy/module/select/__init__.py b/pypy/module/select/__init__.py
--- a/pypy/module/select/__init__.py
+++ b/pypy/module/select/__init__.py
@@ -26,7 +26,7 @@
interpleveldefs["kqueue"] = "interp_kqueue.W_Kqueue"
interpleveldefs["kevent"] = "interp_kqueue.W_Kevent"
from pypy.module.select.interp_kqueue import symbol_map
- for symbol in symbol_map.keys():
+ for symbol in symbol_map:
interpleveldefs[symbol] = "space.wrap(interp_kqueue.%s)" % symbol
def buildloaders(cls):
diff --git a/pypy/module/select/interp_kqueue.py b/pypy/module/select/interp_kqueue.py
--- a/pypy/module/select/interp_kqueue.py
+++ b/pypy/module/select/interp_kqueue.py
@@ -8,9 +8,6 @@
from pypy.translator.tool.cbuild import ExternalCompilationInfo
-# http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
-# /usr/include/sys/event.h
-#
eci = ExternalCompilationInfo(
includes = ["sys/types.h",
"sys/event.h",
@@ -22,15 +19,6 @@
_compilation_info_ = eci
-# struct kevent {
-# uintptr_t ident; /* identifier for this event */
-# short filter; /* filter for event */
-# u_short flags;
-# u_int fflags;
-# intptr_t data;
-# void *udata; /* opaque user data identifier */
-# };
-#
CConfig.kevent = rffi_platform.Struct("struct kevent", [
("ident", rffi.UINT),
("filter", rffi.SHORT),
@@ -40,10 +28,7 @@
("udata", rffi.VOIDP),
])
-# struct timespec {
-# time_t tv_sec; /* seconds */
-# long tv_nsec; /* and nanoseconds */
-# };
+
CConfig.timespec = rffi_platform.Struct("struct timespec", [
("tv_sec", rffi.TIME_T),
("tv_nsec", rffi.LONG),
@@ -56,21 +41,17 @@
"KQ_FILTER_AIO": "EVFILT_AIO",
"KQ_FILTER_VNODE": "EVFILT_VNODE",
"KQ_FILTER_PROC": "EVFILT_PROC",
-# "KQ_FILTER_NETDEV": None, # deprecated on FreeBSD .. no longer defined .. what to do?
+# "KQ_FILTER_NETDEV": None, # deprecated on FreeBSD .. no longer defined
"KQ_FILTER_SIGNAL": "EVFILT_SIGNAL",
"KQ_FILTER_TIMER": "EVFILT_TIMER",
-
"KQ_EV_ADD": "EV_ADD",
"KQ_EV_DELETE": "EV_DELETE",
"KQ_EV_ENABLE": "EV_ENABLE",
"KQ_EV_DISABLE": "EV_DISABLE",
"KQ_EV_ONESHOT": "EV_ONESHOT",
"KQ_EV_CLEAR": "EV_CLEAR",
-
- # for the next 2 Python docs: "internal event" .. not defined on FreeBSD .. what to do?
-# "KQ_EV_SYSFLAGS": None,
-# "KQ_EV_FLAG1": None,
-
+# "KQ_EV_SYSFLAGS": None, # Python docs says "internal event" .. not defined on FreeBSD
+# "KQ_EV_FLAG1": None, # Python docs says "internal event" .. not defined on FreeBSD
"KQ_EV_EOF": "EV_EOF",
"KQ_EV_ERROR": "EV_ERROR"
}
@@ -87,8 +68,6 @@
globals()[symbol] = cconfig[symbol_map[symbol]]
-# int kqueue(void);
-#
syscall_kqueue = rffi.llexternal(
"kqueue",
[],
@@ -96,11 +75,6 @@
compilation_info=eci
)
-# int kevent(int kq,
-# const struct kevent *changelist, int nchanges,
-# struct kevent *eventlist, int nevents,
-# const struct timespec *timeout);
-#
syscall_kevent = rffi.llexternal(
"kevent",
[rffi.INT,
@@ -205,7 +179,7 @@
if nfds < 0:
raise exception_from_errno(space, space.w_IOError)
else:
- w_elist = [None] * nfds
+ elist_w = [None] * nfds
for i in xrange(nfds):
evt = eventlist[i]
@@ -219,9 +193,9 @@
w_event.event.c_data = evt.c_data
w_event.event.c_udata = evt.c_udata
- w_elist[i] = w_event
+ elist_w[i] = w_event
- return space.newlist(w_elist)
+ return space.newlist(elist_w)
More information about the pypy-commit
mailing list