]> granicus.if.org Git - libevent/commitdiff
Clean up syntax on TAILQ_ENTRY() usage
authorGilad Benjamini <gilad@altornetworks.com>
Fri, 13 Aug 2010 21:08:59 +0000 (17:08 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 13 Aug 2010 21:08:59 +0000 (17:08 -0400)
Though the C standards allow it, it's apparently possible to get MSVC
upset by saying "struct { int field; } (declarator);" instead of
"struct {int field; } declarator;", so let's just not do that.

Bugfix for 3044492

(commit msg by nickm)

defer-internal.h
event-internal.h
evrpc-internal.h
http-internal.h
include/event2/event_struct.h

index 6d21913ced4b8637ff924a3727333b597d635352..67e4d2ac8299f91b2e8446f0118492e82492476f 100644 (file)
@@ -41,7 +41,7 @@ typedef void (*deferred_cb_fn)(struct deferred_cb *, void *);
  * an event_base's event_loop, rather than running immediately. */
 struct deferred_cb {
        /** Links to the adjacent active (pending) deferred_cb objects. */
-       TAILQ_ENTRY (deferred_cb) (cb_next);
+       TAILQ_ENTRY (deferred_cb) cb_next;
        /** True iff this deferred_cb is pending in an event_base. */
        unsigned queued : 1;
        /** The function to execute when the callback runs. */
index 6c463e8515d1a3e6cbb7d511538a6d47187ba6e8..d1620c5ebfa71b4187ff9e52efc47ff47797562f 100644 (file)
@@ -272,7 +272,7 @@ struct event_base {
 };
 
 struct event_config_entry {
-       TAILQ_ENTRY(event_config_entry) (next);
+       TAILQ_ENTRY(event_config_entry) next;
 
        const char *avoid_method;
 };
index c4f7209e50f1ab6f83c20f5a2d0fda4b3c8567d1..8497d29882ea62d7b5cf7255e3554e5d1d6689a8 100644 (file)
@@ -35,7 +35,7 @@ struct evrpc_request_wrapper;
 #define EVRPC_URI_PREFIX "/.rpc."
 
 struct evrpc_hook {
-       TAILQ_ENTRY(evrpc_hook) (next);
+       TAILQ_ENTRY(evrpc_hook) next;
 
        /* returns EVRPC_TERMINATE; if the rpc should be aborted.
         * a hook is is allowed to rewrite the evbuffer
@@ -95,14 +95,14 @@ struct evrpc_pool {
 };
 
 struct evrpc_hook_ctx {
-       TAILQ_ENTRY(evrpc_hook_ctx) (next);
+       TAILQ_ENTRY(evrpc_hook_ctx) next;
 
        void *ctx;
        void (*cb)(void *, enum EVRPC_HOOK_RESULT);
 };
 
 struct evrpc_meta {
-       TAILQ_ENTRY(evrpc_meta) (next);
+       TAILQ_ENTRY(evrpc_meta) next;
        char *key;
 
        void *data;
index 0380d035ce22f7d511dcc5352870d7e80397b9d2..073dd48888662bc8f6048d96db152755b767bd6b 100644 (file)
@@ -58,7 +58,7 @@ struct event_base;
 
 struct evhttp_connection {
        /* we use tailq only if they were created for an http server */
-       TAILQ_ENTRY(evhttp_connection) (next);
+       TAILQ_ENTRY(evhttp_connection) next;
 
        evutil_socket_t fd;
        struct bufferevent *bufev;
@@ -114,7 +114,7 @@ TAILQ_HEAD(evconq, evhttp_connection);
 
 /* each bound socket is stored in one of these */
 struct evhttp_bound_socket {
-       TAILQ_ENTRY(evhttp_bound_socket) (next);
+       TAILQ_ENTRY(evhttp_bound_socket) next;
 
        struct evconnlistener *listener;
 };
index 7910e6375f4889a41587647ff39a064d8437ac0b..80900ea3488e95e7d019a08e6206b5d5574d5692 100644 (file)
@@ -71,11 +71,11 @@ struct {                                                            \
 
 struct event_base;
 struct event {
-       TAILQ_ENTRY (event) (ev_active_next);
-       TAILQ_ENTRY (event) (ev_next);
+       TAILQ_ENTRY(event) ev_active_next;
+       TAILQ_ENTRY(event) ev_next;
        /* for managing timeouts */
        union {
-               TAILQ_ENTRY (event) (ev_next_with_common_timeout);
+               TAILQ_ENTRY(event) ev_next_with_common_timeout;
                int min_heap_idx;
        } ev_timeout_pos;
        evutil_socket_t ev_fd;
@@ -85,13 +85,13 @@ struct event {
        union {
                /* used for io events */
                struct {
-                       TAILQ_ENTRY (event) (ev_io_next);
+                       TAILQ_ENTRY(event) ev_io_next;
                        struct timeval ev_timeout;
                } ev_io;
 
                /* used by signal events */
                struct {
-                       TAILQ_ENTRY (event) (ev_signal_next);
+                       TAILQ_ENTRY(event) ev_signal_next;
                        short ev_ncalls;
                        /* Allows deletes in callback */
                        short *ev_pncalls;