chiark / gitweb /
event loop: make tv_now and now into globals
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 16 May 2011 10:09:13 +0000 (11:09 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jun 2011 11:07:26 +0000 (12:07 +0100)
This makes these values available to all functions in the rest of the
program, even if the particular event before/after function doesn't
pass them on.

We give variables new names so that we can introduce convenience
pointer aliases; that way, all the other references in the whole
program can remain unchanged when we remove now and tv_now from the
beforepoll/afterpoll parameter lists.

The pointer aliases are "static const *const" which is somewhat ugly.
We do this in the hope that the compiler will optimise out the actual
variable, which it couldn't do if the pointer alias had external
linkage.  The alternative would be a macro but we don't want to
local scopes (and not just in the current before/afterpoll api).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>

No differences found