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)
commit698280de07c723fed8c707e56bce81b66fee9c52
tree769d7e063b836c7058663a77833efcc44e5c34d8
parent0ade8ecc54f6e5c005fb0244d21f19c31ebe2170
event loop: make tv_now and now into globals

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>
secnet.c
secnet.h