Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/libevent/dist libevent: remove remaining CONSTC...



details:   https://anonhg.NetBSD.org/src/rev/bc2388410dfa
branches:  trunk
changeset: 961101:bc2388410dfa
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Apr 10 19:18:45 2021 +0000

description:
libevent: remove remaining CONSTCOND comments

Since lint1/tree.c 1.202 from 2021-01-31, lint no longer needs the
/*CONSTCOND*/ for do-while-0 "loops".

The comments from this commit were in do-while-0 loops that do not
follow the canonical form, therefore the previous commit did not catch
them.  Some of them have a trailing semicolon (which defies the whole
purpose of the do-while-0 loop), some are missing the space between
'while (0)', some start in column 1 instead of 9.

This reduces the local modifications, compared to the upstream code.

No functional change.

diffstat:

 external/bsd/libevent/dist/bufferevent_ratelim.c  |   4 ++--
 external/bsd/libevent/dist/evdns.c                |  10 +++++-----
 external/bsd/libevent/dist/event-internal.h       |   4 ++--
 external/bsd/libevent/dist/event_tagging.c        |   8 ++++----
 external/bsd/libevent/dist/evmap.c                |   6 +++---
 external/bsd/libevent/dist/evthread-internal.h    |   4 ++--
 external/bsd/libevent/dist/ht-internal.h          |   6 +++---
 external/bsd/libevent/dist/include/event2/rpc.h   |   4 ++--
 external/bsd/libevent/dist/log-internal.h         |   4 ++--
 external/bsd/libevent/dist/select.c               |   6 +++---
 external/bsd/libevent/dist/test/regress_http.c    |  10 +++++-----
 external/bsd/libevent/dist/test/tinytest_macros.h |   4 ++--
 external/bsd/libevent/dist/util-internal.h        |   4 ++--
 13 files changed, 37 insertions(+), 37 deletions(-)

diffs (truncated from 313 to 300 lines):

diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/bufferevent_ratelim.c
--- a/external/bsd/libevent/dist/bufferevent_ratelim.c  Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/bufferevent_ratelim.c  Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bufferevent_ratelim.c,v 1.5 2021/04/10 19:02:37 rillig Exp $   */
+/*     $NetBSD: bufferevent_ratelim.c,v 1.6 2021/04/10 19:18:45 rillig Exp $   */
 
 /*
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -213,7 +213,7 @@
        do {                                    \
                if (max_so_far > (x))           \
                        max_so_far = (x);       \
-       } while (/*CONSTCOND*/0);
+       } while (0);
 
        if (!bev->rate_limiting)
                return max_so_far;
diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/evdns.c
--- a/external/bsd/libevent/dist/evdns.c        Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/evdns.c        Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: evdns.c,v 1.6 2021/04/10 19:02:37 rillig Exp $ */
+/*     $NetBSD: evdns.c,v 1.7 2021/04/10 19:18:45 rillig Exp $ */
 
 /* Copyright 2006-2007 Niels Provos
  * Copyright 2007-2012 Nick Mathewson and Niels Provos
@@ -52,7 +52,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: evdns.c,v 1.6 2021/04/10 19:02:37 rillig Exp $");
+__RCSID("$NetBSD: evdns.c,v 1.7 2021/04/10 19:18:45 rillig Exp $");
 #include "evconfig-private.h"
 
 #include <sys/types.h>
@@ -982,9 +982,9 @@
        int name_end = -1;
        int j = *idx;
        int ptr_count = 0;
-#define GET32(x) do { if (j + 4 > length) goto err; memcpy(&t32_, packet + j, 4); j += 4; x = ntohl(t32_); } while (/*CONSTCOND*/0)
-#define GET16(x) do { if (j + 2 > length) goto err; memcpy(&t_, packet + j, 2); j += 2; x = ntohs(t_); } while (/*CONSTCOND*/0)
-#define GET8(x) do { if (j >= length) goto err; x = packet[j++]; } while (/*CONSTCOND*/0)
+#define GET32(x) do { if (j + 4 > length) goto err; memcpy(&t32_, packet + j, 4); j += 4; x = ntohl(t32_); } while (0)
+#define GET16(x) do { if (j + 2 > length) goto err; memcpy(&t_, packet + j, 2); j += 2; x = ntohs(t_); } while (0)
+#define GET8(x) do { if (j >= length) goto err; x = packet[j++]; } while (0)
 
        char *cp = name_out;
        const char *const end = name_out + name_out_len;
diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/event-internal.h
--- a/external/bsd/libevent/dist/event-internal.h       Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/event-internal.h       Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: event-internal.h,v 1.4 2021/04/07 03:36:48 christos Exp $      */
+/*     $NetBSD: event-internal.h,v 1.5 2021/04/10 19:18:45 rillig Exp $        */
 
 /*
  * Copyright (c) 2000-2007 Niels Provos <provos%citi.umich.edu@localhost>
@@ -397,7 +397,7 @@
        (elm)->field.tqe_next = (listelm);                              \
        *(listelm)->field.tqe_prev = (elm);                             \
        (listelm)->field.tqe_prev = &(elm)->field.tqe_next;             \
-} while (/*CONSTCOND*/0)
+} while (0)
 #endif
 
 #define N_ACTIVE_CALLBACKS(base)                                       \
diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/event_tagging.c
--- a/external/bsd/libevent/dist/event_tagging.c        Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/event_tagging.c        Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: event_tagging.c,v 1.5 2021/04/07 03:36:48 christos Exp $       */
+/*     $NetBSD: event_tagging.c,v 1.6 2021/04/10 19:18:45 rillig Exp $ */
 
 /*
  * Copyright (c) 2003-2009 Niels Provos <provos%citi.umich.edu@localhost>
@@ -29,7 +29,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: event_tagging.c,v 1.5 2021/04/07 03:36:48 christos Exp $");
+__RCSID("$NetBSD: event_tagging.c,v 1.6 2021/04/10 19:18:45 rillig Exp $");
 #include "evconfig-private.h"
 
 #ifdef EVENT__HAVE_SYS_TYPES_H
@@ -143,7 +143,7 @@
        data[0] = (data[0] & 0x0f) | ((nibbles & 0x0f) << 4);           \
                                                                        \
        return ((off + 1) / 2);                                         \
-} while (/*CONSTCOND*/0)
+} while (0)
 
 static inline int
 encode_int_internal(ev_uint8_t *data, ev_uint32_t number)
@@ -355,7 +355,7 @@
        *pnumber = number;                                              \
                                                                        \
        return (int)(len);                                              \
-} while (/*CONSTCOND*/0)
+} while (0)
 
 /* Internal: decode an integer from an evbuffer, without draining it.
  *  Only integers up to 32-bits are supported.
diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/evmap.c
--- a/external/bsd/libevent/dist/evmap.c        Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/evmap.c        Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: evmap.c,v 1.5 2021/04/10 19:02:37 rillig Exp $ */
+/*     $NetBSD: evmap.c,v 1.6 2021/04/10 19:18:45 rillig Exp $ */
 
 /*
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -27,7 +27,7 @@
  */
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: evmap.c,v 1.5 2021/04/10 19:02:37 rillig Exp $");
+__RCSID("$NetBSD: evmap.c,v 1.6 2021/04/10 19:18:45 rillig Exp $");
 #include "evconfig-private.h"
 
 #ifdef _WIN32
@@ -121,7 +121,7 @@
                key_.fd = slot;                                         \
                ent_ = HT_FIND(event_io_map, map, &key_);               \
                (x) = ent_ ? &ent_->ent.type : NULL;                    \
-       } while (/*CONSTCOND*/0);
+       } while (0);
 
 #define GET_IO_SLOT_AND_CTOR(x, map, slot, type, ctor, fdinfo_len)     \
        do {                                                            \
diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/evthread-internal.h
--- a/external/bsd/libevent/dist/evthread-internal.h    Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/evthread-internal.h    Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: evthread-internal.h,v 1.5 2021/04/10 19:02:37 rillig Exp $     */
+/*     $NetBSD: evthread-internal.h,v 1.6 2021/04/10 19:18:45 rillig Exp $     */
 
 /*
  * Copyright (c) 2008-2012 Niels Provos, Nick Mathewson
@@ -384,7 +384,7 @@
                        event_warn("Couldn't allocate %s", #lockvar);   \
                        return -1;                                      \
                }                                                       \
-       } while (/*CONSTCOND*/0);
+       } while (0);
 
 int event_global_setup_locks_(const int enable_locks);
 int evsig_global_setup_locks_(const int enable_locks);
diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/ht-internal.h
--- a/external/bsd/libevent/dist/ht-internal.h  Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/ht-internal.h  Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ht-internal.h,v 1.3 2017/01/31 23:17:39 christos Exp $ */
+/*     $NetBSD: ht-internal.h,v 1.4 2021/04/10 19:18:45 rillig Exp $   */
 /* Copyright 2002 Christopher Clark */
 /* Copyright 2005-2012 Nick Mathewson */
 /* Copyright 2009-2012 Niels Provos and Nick Mathewson */
@@ -104,9 +104,9 @@
 
 #ifndef HT_NO_CACHE_HASH_VALUES
 #define HT_SET_HASH_(elm, field, hashfn)        \
-       do { (elm)->field.hte_hash = hashfn(elm); } while (/*CONSTCOND*/0)
+       do { (elm)->field.hte_hash = hashfn(elm); } while (0)
 #define HT_SET_HASHVAL_(elm, field, val)       \
-       do { (elm)->field.hte_hash = (val); } while (/*CONSTCOND*/0)
+       do { (elm)->field.hte_hash = (val); } while (0)
 #define HT_ELT_HASH_(elm, field, hashfn)       \
        ((elm)->field.hte_hash)
 #else
diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/include/event2/rpc.h
--- a/external/bsd/libevent/dist/include/event2/rpc.h   Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/include/event2/rpc.h   Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpc.h,v 1.5 2021/04/07 03:36:48 christos Exp $ */
+/*     $NetBSD: rpc.h,v 1.6 2021/04/10 19:18:45 rillig Exp $   */
 
 /*
  * Copyright (c) 2006-2007 Niels Provos <provos%citi.umich.edu@localhost>
@@ -285,7 +285,7 @@
 #define EVRPC_REQUEST_DONE(rpc_req) do { \
   struct evrpc_req_generic *req_ = (struct evrpc_req_generic *)(rpc_req); \
   evrpc_request_done(req_);                                    \
-} while (/*CONSTCOND*/0)
+} while (0)
 
 
 struct evrpc_base;
diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/log-internal.h
--- a/external/bsd/libevent/dist/log-internal.h Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/log-internal.h Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: log-internal.h,v 1.6 2021/04/07 03:36:48 christos Exp $        */
+/*     $NetBSD: log-internal.h,v 1.7 2021/04/10 19:18:45 rillig Exp $  */
 
 /*
  * Copyright (c) 2000-2007 Niels Provos <provos%citi.umich.edu@localhost>
@@ -84,7 +84,7 @@
        }                                       \
        } while (0)
 #else
-#define event_debug(x) do {;} while (/*CONSTCOND*/0)
+#define event_debug(x) do {;} while (0)
 #endif
 
 #undef EV_CHECK_FMT
diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/select.c
--- a/external/bsd/libevent/dist/select.c       Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/select.c       Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: select.c,v 1.4 2021/04/07 03:36:48 christos Exp $      */
+/*     $NetBSD: select.c,v 1.5 2021/04/10 19:18:45 rillig Exp $        */
 /*     $OpenBSD: select.c,v 1.2 2002/06/25 15:50:15 mickey Exp $       */
 
 /*
@@ -29,7 +29,7 @@
  */
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: select.c,v 1.4 2021/04/07 03:36:48 christos Exp $");
+__RCSID("$NetBSD: select.c,v 1.5 2021/04/10 19:18:45 rillig Exp $");
 #include "evconfig-private.h"
 
 #ifdef EVENT__HAVE_SELECT
@@ -136,7 +136,7 @@
        /* nothing to be done here */
 }
 #else
-#define check_selectop(sop) do { (void) sop; } while (/*CONSTCOND*/0)
+#define check_selectop(sop) do { (void) sop; } while (0)
 #endif
 
 static int
diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/test/regress_http.c
--- a/external/bsd/libevent/dist/test/regress_http.c    Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/test/regress_http.c    Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: regress_http.c,v 1.8 2021/04/10 19:02:37 rillig Exp $  */
+/*     $NetBSD: regress_http.c,v 1.9 2021/04/10 19:18:45 rillig Exp $  */
 
 /*
  * Copyright (c) 2003-2007 Niels Provos <provos%citi.umich.edu@localhost>
@@ -36,7 +36,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: regress_http.c,v 1.8 2021/04/10 19:02:37 rillig Exp $");
+__RCSID("$NetBSD: regress_http.c,v 1.9 2021/04/10 19:18:45 rillig Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -2541,7 +2541,7 @@
        tt_want(ret == url_tmp);                                        \
        if (strcmp(ret,want) != 0)                                      \
                TT_FAIL(("\"%s\" != \"%s\"",ret,want));                 \
-       } while(/*CONSTCOND*/0)
+       } while(0)
 
        tt_want(evhttp_uri_join(NULL, 0, 0) == NULL);
        tt_want(evhttp_uri_join(NULL, url_tmp, 0) == NULL);
@@ -2551,7 +2551,7 @@
 #define BAD(s) do {                                                    \
                if (URI_PARSE(s) != NULL)                               \
                        TT_FAIL(("Expected error parsing \"%s\"",s));   \
-       } while(/*CONSTCOND*/0)
+       } while(0)
        /* Nonconformant URIs we can parse: parsing */
 #define NCF(s) do {                                                    \
                uri = URI_PARSE(s);                                     \
@@ -2566,7 +2566,7 @@
                                sizeof(url_tmp)));                      \
                        evhttp_uri_free(uri);                           \
                }                                                       \
-       } while(/*CONSTCOND*/0)
+       } while(0)
 
        NCF("http://www.test.com/ why hello");
        NCF("http://www.test.com/why-hello\x01";);
diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/test/tinytest_macros.h
--- a/external/bsd/libevent/dist/test/tinytest_macros.h Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/test/tinytest_macros.h Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tinytest_macros.h,v 1.5 2021/04/07 03:36:48 christos Exp $     */
+/*     $NetBSD: tinytest_macros.h,v 1.6 2021/04/10 19:18:45 rillig Exp $       */
 
 /* tinytest_macros.h -- Copyright 2009-2012 Nick Mathewson
  *
@@ -30,7 +30,7 @@
 
 /* Helpers for defining statement-like macros */
 #define TT_STMT_BEGIN do {
-#define TT_STMT_END } while (/*CONSTCOND*/0)
+#define TT_STMT_END } while (0)
 
 /* Redefine this if your test functions want to abort with something besides
  * "goto end;" */
diff -r c48fdb1cfa21 -r bc2388410dfa external/bsd/libevent/dist/util-internal.h
--- a/external/bsd/libevent/dist/util-internal.h        Sat Apr 10 19:02:37 2021 +0000
+++ b/external/bsd/libevent/dist/util-internal.h        Sat Apr 10 19:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util-internal.h,v 1.6 2021/04/10 19:02:37 rillig Exp $ */



Home | Main Index | Thread Index | Old Index