diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-10-09 11:07:18 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-10-22 09:32:13 -0400 |
commit | 67247fa9ac7c2c5b19c0a2b6884ab21f83cc5e5d (patch) | |
tree | 9c20e31df5afb70dec22d014ec1c91b8130bde57 | |
parent | 4fad456148738712e48582b22496e6baf0dfc1f8 (diff) | |
download | tor-67247fa9ac7c2c5b19c0a2b6884ab21f83cc5e5d.tar.gz tor-67247fa9ac7c2c5b19c0a2b6884ab21f83cc5e5d.zip |
Use various COCCI tests to get mainloop.c to parse.
-rw-r--r-- | src/core/mainloop/mainloop.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c index 6e78a5bb26..dae82fba67 100644 --- a/src/core/mainloop/mainloop.c +++ b/src/core/mainloop/mainloop.c @@ -1338,9 +1338,11 @@ get_signewnym_epoch(void) static int periodic_events_initialized = 0; /* Declare all the timer callback functions... */ +#ifndef COCCI #undef CALLBACK #define CALLBACK(name) \ static int name ## _callback(time_t, const or_options_t *) + CALLBACK(add_entropy); CALLBACK(check_expired_networkstatus); CALLBACK(clean_caches); @@ -1363,11 +1365,10 @@ CALLBACK(second_elapsed); #undef CALLBACK /* Now we declare an array of periodic_event_item_t for each periodic event */ -#ifndef COCCI #define CALLBACK(name, r, f) \ PERIODIC_EVENT(name, PERIODIC_EVENT_ROLE_ ## r, f) -#endif #define FL(name) (PERIODIC_EVENT_FLAG_ ## name) +#endif STATIC periodic_event_item_t mainloop_periodic_events[] = { @@ -1418,8 +1419,10 @@ STATIC periodic_event_item_t mainloop_periodic_events[] = { END_OF_PERIODIC_EVENTS }; +#ifndef COCCI #undef CALLBACK #undef FL +#endif /* These are pointers to members of periodic_events[] that are used to * implement particular callbacks. We keep them separate here so that we @@ -1518,8 +1521,10 @@ initialize_periodic_events(void) /* Set up all periodic events. We'll launch them by roles. */ +#ifndef COCCI #define NAMED_CALLBACK(name) \ STMT_BEGIN name ## _event = periodic_events_find( #name ); STMT_END +#endif NAMED_CALLBACK(prune_old_routers); NAMED_CALLBACK(fetch_networkstatus); |