]> granicus.if.org Git - libevent/commitdiff
Clean up formatting: function/keyword spacing consistency.
authorNick Mathewson <nickm@torproject.org>
Fri, 19 Feb 2010 08:39:50 +0000 (03:39 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 19 Feb 2010 08:39:50 +0000 (03:39 -0500)
- Keywords always have a space before a paren.  Functions never do.

- No more than 3 blank lines in a row.

20 files changed:
bufferevent_filter.c
devpoll.c
evdns.c
event-internal.h
evutil.c
include/event2/rpc.h
minheap-internal.h
sample/event-test.c
sample/signal-test.c
sample/time-test.c
strlcpy.c
test/bench.c
test/bench_cascade.c
test/bench_http.c
test/regress.c
test/regress_dns.c
test/test-eof.c
test/test-time.c
test/test-weof.c
win32select.c

index 5461e0c7b736aa82e24d2136a4d6e09fa3fb18f0..16f17b5aacb2d325e1151ba559eebb827074350c 100644 (file)
@@ -456,7 +456,7 @@ be_filter_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op,
     union bufferevent_ctrl_data *data)
 {
        struct bufferevent_filtered *bevf;
-       switch(op) {
+       switch (op) {
        case BEV_CTRL_GET_UNDERLYING:
                bevf = upcast(bev);
                data->ptr = bevf->underlying;
index 527e77d379a891babb4a06aed7dd5cb7abbe4e0c..438d45d8981b89fb51afbb3d90dc736913f20797 100644 (file)
--- a/devpoll.c
+++ b/devpoll.c
@@ -86,10 +86,10 @@ devpoll_commit(struct devpollop *devpollop)
         */
        if (pwrite(devpollop->dpfd, devpollop->changes,
                sizeof(struct pollfd) * devpollop->nchanges, 0) == -1)
-               return(-1);
+               return (-1);
 
        devpollop->nchanges = 0;
-       return(0);
+       return (0);
 }
 
 static int
@@ -110,7 +110,7 @@ devpoll_queue(struct devpollop *devpollop, int fd, int events) {
        pfd->events = events;
        pfd->revents = 0;
 
-       return(0);
+       return (0);
 }
 
 static void *
diff --git a/evdns.c b/evdns.c
index 944cb350b9be9b2335fcdb1b26b33e78469bbc6a..a597929fbe81ee5a1d7d527a733320e9e4e1ba80 100644 (file)
--- a/evdns.c
+++ b/evdns.c
@@ -880,7 +880,7 @@ name_parse(u8 *packet, int length, int *idx, char *name_out, int name_out_len) {
        /* means that the next 14 bits are a pointer within the current */
        /* packet. */
 
-       for(;;) {
+       for (;;) {
                u8 label_len;
                if (j >= length) return -1;
                GET8(label_len);
@@ -1441,7 +1441,7 @@ dnslabel_table_add(struct dnslabel_table *table, const char *label, off_t pos)
                return (-1);
        v = mm_strdup(label);
        if (v == NULL)
-               return (-1);
+               return(-1);
        p = table->n_labels++;
        table->labels[p].v = v;
        table->labels[p].pos = pos;
@@ -3366,7 +3366,6 @@ evdns_resolv_conf_parse(int flags, const char *const filename) {
 }
 
 
-
 #ifdef WIN32
 /* Add multiple nameservers from a space-or-comma-separated list. */
 static int
index 7d7a2826b7aa3528e63e91793a4b50d8fc5ba86d..840f180e86944c9529dc5a128728ef0493f757ba 100644 (file)
@@ -228,9 +228,9 @@ struct event_config {
 #define        TAILQ_END(head)                 NULL
 #define        TAILQ_NEXT(elm, field)          ((elm)->field.tqe_next)
 #define TAILQ_FOREACH(var, head, field)                                        \
-       for((var) = TAILQ_FIRST(head);                                  \
-           (var) != TAILQ_END(head);                                   \
-           (var) = TAILQ_NEXT(var, field))
+       for ((var) = TAILQ_FIRST(head);                                 \
+            (var) != TAILQ_END(head);                                  \
+            (var) = TAILQ_NEXT(var, field))
 #define        TAILQ_INSERT_BEFORE(listelm, elm, field) do {                   \
        (elm)->field.tqe_prev = (listelm)->field.tqe_prev;              \
        (elm)->field.tqe_next = (listelm);                              \
index 3f172474816848297ae4ae5a0a79e3e14943dee8..a4dc2ef6ad8219829c92cb301c97f37b291020c1 100644 (file)
--- a/evutil.c
+++ b/evutil.c
@@ -328,7 +328,7 @@ evutil_gettimeofday(struct timeval *tv, struct timezone *tz)
 {
        struct _timeb tb;
 
-       if(tv == NULL)
+       if (tv == NULL)
                return -1;
 
        _ftime(&tb);
index ad18e4c346e877eb6b88ad79d3554a5a555aa531..b735a1c039033e3c9da33081468404cb317599d8 100644 (file)
@@ -142,7 +142,6 @@ extern "C" {
 #define EVTAG_ARRAY_LEN(msg, member) ((msg)->member##_length)
 
 
-
 struct evbuffer;
 struct event_base;
 struct evrpc_req_generic;
index 747f635a56726caf64654dfc49e189e0876038a0..bd849bdfc198ce55d7f39ef83d551ae164c31184 100644 (file)
@@ -115,7 +115,7 @@ int min_heap_erase(min_heap_t* s, struct event* e)
 
 int min_heap_reserve(min_heap_t* s, unsigned n)
 {
-       if(s->a < n)
+       if (s->a < n)
        {
                struct event** p;
                unsigned a = s->a ? s->a * 2 : 8;
@@ -147,7 +147,7 @@ void min_heap_shift_down_(min_heap_t* s, unsigned hole_index, struct event* e)
     while(min_child <= s->n)
        {
        min_child -= min_child == s->n || min_heap_elem_greater(s->p[min_child], s->p[min_child - 1]);
-       if(!(min_heap_elem_greater(e, s->p[min_child])))
+       if (!(min_heap_elem_greater(e, s->p[min_child])))
            break;
        (s->p[hole_index] = s->p[min_child])->ev_timeout_pos.min_heap_idx = hole_index;
        hole_index = min_child;
index a057aa5525a90efabc37bdd071b62fedf8f0342f..4dc41f4990768bd97028238a4ed8de8aaa34787e 100644 (file)
@@ -47,7 +47,7 @@ fifo_read(int fd, short event, void *arg)
        len = ReadFile((HANDLE)fd, buf, sizeof(buf) - 1, &dwBytesRead, NULL);
 
        /* Check for end of file. */
-       if(len && dwBytesRead == 0) {
+       if (len && dwBytesRead == 0) {
                fprintf(stderr, "End Of File");
                event_del(ev);
                return;
@@ -71,7 +71,7 @@ fifo_read(int fd, short event, void *arg)
 }
 
 int
-main (int argc, char **argv)
+main(int argc, char **argv)
 {
        struct event evfifo;
 #ifdef WIN32
@@ -85,7 +85,7 @@ main (int argc, char **argv)
                        FILE_ATTRIBUTE_NORMAL,  /* normal file */
                        NULL);                  /* no attr. template */
 
-       if(socket == INVALID_HANDLE_VALUE)
+       if (socket == INVALID_HANDLE_VALUE)
                return 1;
 
 #else
index e8e39de975078f1380d640705454b07b3edd9205..7b4bbe51161bac6926e869efa3742859b81cd724 100644 (file)
@@ -46,7 +46,7 @@ signal_cb(int fd, short event, void *arg)
 }
 
 int
-main (int argc, char **argv)
+main(int argc, char **argv)
 {
        struct event signal_int;
        struct event_base* base;
index 0254018133309720aacf77f5441afb5d9d19cb30..619bec3847ebdf1fd2d8db4f6085d3bb7347fee1 100644 (file)
@@ -64,7 +64,7 @@ timeout_cb(evutil_socket_t fd, short event, void *arg)
 }
 
 int
-main (int argc, char **argv)
+main(int argc, char **argv)
 {
        struct event timeout;
        struct timeval tv;
index 51c37dd1462faeb8219e1d61240b938713ef0029..97f81b9065a455dce7330d87e05459b3214be04c 100644 (file)
--- a/strlcpy.c
+++ b/strlcpy.c
@@ -69,6 +69,6 @@ _event_strlcpy(dst, src, siz)
                        ;
        }
 
-       return(s - src - 1);    /* count does not include NUL */
+       return (s - src - 1);   /* count does not include NUL */
 }
 #endif
index 570897b41337c3c2939a805a134a476332cf1673..a2d37ba0d10204b301e1b90ced6fdc870ed8c874 100644 (file)
@@ -61,7 +61,6 @@ static int num_pipes, num_active, num_writes;
 static struct event *events;
 
 
-
 static void
 read_cb(int fd, short which, void *arg)
 {
@@ -118,7 +117,7 @@ run_once(void)
 }
 
 int
-main (int argc, char **argv)
+main(int argc, char **argv)
 {
 #ifndef WIN32
        struct rlimit rl;
index 0990c75e72c3e9ea8a65e7149be105fc8e4f257b..1d7892c53bae8643233b0d3e69ac7e8e941c703b 100644 (file)
@@ -127,7 +127,7 @@ run_once(int num_pipes)
 }
 
 int
-main (int argc, char **argv)
+main(int argc, char **argv)
 {
 #ifndef WIN32
        struct rlimit rl;
index 1f67698a0dbd3f33ef1756990b36e5e259ada4cc..f3ceabb9572d2099d2d620b4a4c0d541759bc519 100644 (file)
@@ -83,7 +83,7 @@ http_ref_cb(struct evhttp_request *req, void *arg)
 #endif
 
 int
-main (int argc, char **argv)
+main(int argc, char **argv)
 {
        struct event_base *base = event_base_new();
        struct evhttp *http = evhttp_new(base);
index d9245821676b99ffff6ee590b367b4563c6d83a2..0f4a6876a87da440a04a7f341cdadebcc7bbe24e 100644 (file)
@@ -84,7 +84,6 @@ static struct timeval tset;
 static struct timeval tcalled;
 
 
-
 #define TEST1  "this is a test"
 #define SECONDS        1
 
@@ -1594,7 +1593,6 @@ end:
 }
 
 
-
 static void
 test_methods(void *ptr)
 {
index 1d5883e10864c56345c408d6b7b375fd217ab2e8..854f8df2f44ac95fe98c77cb7d4ac3bb5e426f65 100644 (file)
@@ -711,7 +711,7 @@ dumb_bytes_fn(char *p, size_t n)
        unsigned i;
        /* This gets us 6 bits of entropy per transaction ID, which means we
         * will have probably have collisions and need to pick again. */
-       for(i=0;i<n;++i)
+       for (i=0;i<n;++i)
                p[i] = (char)(rand() & 7);
 }
 #endif
@@ -740,7 +740,7 @@ dns_inflight_test(void *arg)
        tt_assert(! evdns_base_set_option(dns, "max-inflight:", "3"));
        tt_assert(! evdns_base_set_option(dns, "randomize-case:", "0"));
 
-       for(i=0;i<20;++i)
+       for (i=0;i<20;++i)
                evdns_base_resolve_ipv4(dns, "foof.example.com", 0, generic_dns_callback, &r[i]);
 
        n_replies_left = 20;
index 47c6c8b0fa44785cff0805494d065600eae4c22c..d0c600c10601b9d2fc390e440b065374be621cc8 100644 (file)
@@ -58,7 +58,7 @@ read_cb(int fd, short event, void *arg)
 #endif
 
 int
-main (int argc, char **argv)
+main(int argc, char **argv)
 {
        struct event ev;
        const char *test = "test string";
index a50d2957a7328d48392af3f4e3e15e2cbb5450dd..17a019a627a11e082ac2b0c22d7885d4a62f639d 100644 (file)
@@ -58,7 +58,7 @@ time_cb(int fd, short event, void *arg)
 }
 
 int
-main (int argc, char **argv)
+main(int argc, char **argv)
 {
        struct timeval tv;
        int i;
index 6dc752e172557032eb9fafd1ea1b0819bb777ee0..a6aa5ea762c5ea8f43c8fdb833137a80de6ebd76 100644 (file)
@@ -59,7 +59,7 @@ write_cb(int fd, short event, void *arg)
 }
 
 int
-main (int argc, char **argv)
+main(int argc, char **argv)
 {
        struct event ev;
 
index 98fde72f3885bc90f864aa35a58231dc77fddd0f..59870090c672e938e5eca21a4953b1dbb84a7310 100644 (file)
@@ -320,7 +320,7 @@ win32_dispatch(struct event_base *base, struct timeval *tv)
 
        event_debug(("%s: select returned %d", __func__, res));
 
-       if(res <= 0) {
+       if (res <= 0) {
                evsig_process(base);
                return res;
        } else if (base->sig.evsig_caught) {