]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
With COCCI defined, avoid PERIODIC_EVENT.
authorNick Mathewson <nickm@torproject.org>
Wed, 9 Oct 2019 14:34:43 +0000 (10:34 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 22 Oct 2019 13:32:05 +0000 (09:32 -0400)
Coccinelle doesn't understand the particular pattern of token
pasting we have going on here.

src/core/mainloop/mainloop.c
src/core/mainloop/periodic.h
src/core/or/or_periodic.c
src/feature/dirauth/dirauth_periodic.c
src/feature/relay/relay_periodic.c

index c051b11566673296e7421240f9c2cfd18f248e18..6e78a5bb26a81775e8fcec59134048c8a4725bcb 100644 (file)
@@ -1363,8 +1363,10 @@ CALLBACK(second_elapsed);
 #undef CALLBACK
 
 /* Now we declare an array of periodic_event_item_t for each periodic event */
-#define CALLBACK(name, r, f) \
+#ifndef COCCI
+#define CALLBACK(name, r, f)                            \
   PERIODIC_EVENT(name, PERIODIC_EVENT_ROLE_ ## r, f)
+#endif
 #define FL(name) (PERIODIC_EVENT_FLAG_ ## name)
 
 STATIC periodic_event_item_t mainloop_periodic_events[] = {
index a9aa46196979483f14d468866555746cd6de2eba..0f80748f5593980339f071a4f3d45b68b5348eeb 100644 (file)
@@ -71,8 +71,10 @@ typedef struct periodic_event_item_t {
 } periodic_event_item_t;
 
 /** events will get their interval from first execution */
+#ifndef COCCI
 #define PERIODIC_EVENT(fn, r, f) { fn##_callback, 0, NULL, #fn, r, f, 0 }
 #define END_OF_PERIODIC_EVENTS { NULL, 0, NULL, NULL, 0, 0, 0 }
+#endif
 
 /* Return true iff the given event was setup before thus is enabled to be
  * scheduled. */
index fe28c99192f7edc3abf4669eace90ef2a915ce17..879d142cb2d337baacca678672b7b24d728e029c 100644 (file)
 
 #include "feature/relay/routermode.h"
 
+#ifndef COCCI
 #define DECLARE_EVENT(name, roles, flags)         \
   static periodic_event_item_t name ## _event =   \
     PERIODIC_EVENT(name,                          \
                    PERIODIC_EVENT_ROLE_##roles,   \
                    flags)
+#endif
 
 #define FL(name) (PERIODIC_EVENT_FLAG_ ## name)
 
index 02727d61b4aeb280211b623bf8f1492fd6630537..c02b9ac862340814424b7f93cbdbcfb0cfe21e5e 100644 (file)
 
 #include "core/mainloop/periodic.h"
 
+#ifndef COCCI
 #define DECLARE_EVENT(name, roles, flags)         \
   static periodic_event_item_t name ## _event =   \
     PERIODIC_EVENT(name,                          \
                    PERIODIC_EVENT_ROLE_##roles,   \
                    flags)
+#endif
 
 #define FL(name) (PERIODIC_EVENT_FLAG_##name)
 
index b48b4958958b4e0e940259987918d03980271ab1..7dc4cb4530287299d4eee468bbfe0c92da4cb313 100644 (file)
 #include "feature/nodelist/routerinfo_st.h"
 #include "feature/control/control_events.h"
 
+#ifndef COCCI
 #define DECLARE_EVENT(name, roles, flags)         \
   static periodic_event_item_t name ## _event =   \
     PERIODIC_EVENT(name,                          \
                    PERIODIC_EVENT_ROLE_##roles,   \
                    flags)
+#endif
 
 #define FL(name) (PERIODIC_EVENT_FLAG_##name)