Module Name: src Committed By: rillig Date: Sat Apr 10 19:18:45 UTC 2021
Modified Files: src/external/bsd/libevent/dist: bufferevent_ratelim.c evdns.c event-internal.h event_tagging.c evmap.c evthread-internal.h ht-internal.h log-internal.h select.c util-internal.h src/external/bsd/libevent/dist/include/event2: rpc.h src/external/bsd/libevent/dist/test: regress_http.c tinytest_macros.h Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/libevent/dist/bufferevent_ratelim.c \ src/external/bsd/libevent/dist/event_tagging.c \ src/external/bsd/libevent/dist/evmap.c \ src/external/bsd/libevent/dist/evthread-internal.h cvs rdiff -u -r1.6 -r1.7 src/external/bsd/libevent/dist/evdns.c \ src/external/bsd/libevent/dist/log-internal.h \ src/external/bsd/libevent/dist/util-internal.h cvs rdiff -u -r1.4 -r1.5 src/external/bsd/libevent/dist/event-internal.h \ src/external/bsd/libevent/dist/select.c cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libevent/dist/ht-internal.h cvs rdiff -u -r1.5 -r1.6 src/external/bsd/libevent/dist/include/event2/rpc.h cvs rdiff -u -r1.8 -r1.9 src/external/bsd/libevent/dist/test/regress_http.c cvs rdiff -u -r1.5 -r1.6 \ src/external/bsd/libevent/dist/test/tinytest_macros.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/libevent/dist/bufferevent_ratelim.c diff -u src/external/bsd/libevent/dist/bufferevent_ratelim.c:1.5 src/external/bsd/libevent/dist/bufferevent_ratelim.c:1.6 --- src/external/bsd/libevent/dist/bufferevent_ratelim.c:1.5 Sat Apr 10 19:02:37 2021 +++ src/external/bsd/libevent/dist/bufferevent_ratelim.c Sat Apr 10 19:18:45 2021 @@ -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 @@ bufferevent_get_rlim_max_(struct buffere do { \ if (max_so_far > (x)) \ max_so_far = (x); \ - } while (/*CONSTCOND*/0); + } while (0); if (!bev->rate_limiting) return max_so_far; Index: src/external/bsd/libevent/dist/event_tagging.c diff -u src/external/bsd/libevent/dist/event_tagging.c:1.5 src/external/bsd/libevent/dist/event_tagging.c:1.6 --- src/external/bsd/libevent/dist/event_tagging.c:1.5 Wed Apr 7 03:36:48 2021 +++ src/external/bsd/libevent/dist/event_tagging.c Sat Apr 10 19:18:45 2021 @@ -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 <pro...@citi.umich.edu> @@ -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 @@ evtag_init(void) 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 @@ do { \ *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. Index: src/external/bsd/libevent/dist/evmap.c diff -u src/external/bsd/libevent/dist/evmap.c:1.5 src/external/bsd/libevent/dist/evmap.c:1.6 --- src/external/bsd/libevent/dist/evmap.c:1.5 Sat Apr 10 19:02:37 2021 +++ src/external/bsd/libevent/dist/evmap.c Sat Apr 10 19:18:45 2021 @@ -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 @@ HT_GENERATE(event_io_map, event_map_entr 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 { \ Index: src/external/bsd/libevent/dist/evthread-internal.h diff -u src/external/bsd/libevent/dist/evthread-internal.h:1.5 src/external/bsd/libevent/dist/evthread-internal.h:1.6 --- src/external/bsd/libevent/dist/evthread-internal.h:1.5 Sat Apr 10 19:02:37 2021 +++ src/external/bsd/libevent/dist/evthread-internal.h Sat Apr 10 19:18:45 2021 @@ -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 @@ void *evthread_setup_global_lock_(void * 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); Index: src/external/bsd/libevent/dist/evdns.c diff -u src/external/bsd/libevent/dist/evdns.c:1.6 src/external/bsd/libevent/dist/evdns.c:1.7 --- src/external/bsd/libevent/dist/evdns.c:1.6 Sat Apr 10 19:02:37 2021 +++ src/external/bsd/libevent/dist/evdns.c Sat Apr 10 19:18:45 2021 @@ -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 @@ name_parse(u8 *packet, int length, int * 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; Index: src/external/bsd/libevent/dist/log-internal.h diff -u src/external/bsd/libevent/dist/log-internal.h:1.6 src/external/bsd/libevent/dist/log-internal.h:1.7 --- src/external/bsd/libevent/dist/log-internal.h:1.6 Wed Apr 7 03:36:48 2021 +++ src/external/bsd/libevent/dist/log-internal.h Sat Apr 10 19:18:45 2021 @@ -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 <pro...@citi.umich.edu> @@ -84,7 +84,7 @@ void event_logv_(int severity, const cha } \ } while (0) #else -#define event_debug(x) do {;} while (/*CONSTCOND*/0) +#define event_debug(x) do {;} while (0) #endif #undef EV_CHECK_FMT Index: src/external/bsd/libevent/dist/util-internal.h diff -u src/external/bsd/libevent/dist/util-internal.h:1.6 src/external/bsd/libevent/dist/util-internal.h:1.7 --- src/external/bsd/libevent/dist/util-internal.h:1.6 Sat Apr 10 19:02:37 2021 +++ src/external/bsd/libevent/dist/util-internal.h Sat Apr 10 19:18:45 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: util-internal.h,v 1.6 2021/04/10 19:02:37 rillig Exp $ */ +/* $NetBSD: util-internal.h,v 1.7 2021/04/10 19:18:45 rillig Exp $ */ /* * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson @@ -97,7 +97,7 @@ extern "C" { */ #define EVUTIL_NIL_CONDITION_(condition) do { \ (void)sizeof(!(condition)); \ -} while(/*CONSTCOND*/0) +} while(0) /* Internal use only: macros to match patterns of error codes in a cross-platform way. We need these macros because of two historical Index: src/external/bsd/libevent/dist/event-internal.h diff -u src/external/bsd/libevent/dist/event-internal.h:1.4 src/external/bsd/libevent/dist/event-internal.h:1.5 --- src/external/bsd/libevent/dist/event-internal.h:1.4 Wed Apr 7 03:36:48 2021 +++ src/external/bsd/libevent/dist/event-internal.h Sat Apr 10 19:18:45 2021 @@ -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 <pro...@citi.umich.edu> @@ -397,7 +397,7 @@ struct event_config { (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) \ Index: src/external/bsd/libevent/dist/select.c diff -u src/external/bsd/libevent/dist/select.c:1.4 src/external/bsd/libevent/dist/select.c:1.5 --- src/external/bsd/libevent/dist/select.c:1.4 Wed Apr 7 03:36:48 2021 +++ src/external/bsd/libevent/dist/select.c Sat Apr 10 19:18:45 2021 @@ -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 @@ check_selectop(struct selectop *sop) /* 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 Index: src/external/bsd/libevent/dist/ht-internal.h diff -u src/external/bsd/libevent/dist/ht-internal.h:1.3 src/external/bsd/libevent/dist/ht-internal.h:1.4 --- src/external/bsd/libevent/dist/ht-internal.h:1.3 Tue Jan 31 23:17:39 2017 +++ src/external/bsd/libevent/dist/ht-internal.h Sat Apr 10 19:18:45 2021 @@ -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 @@ ht_string_hash_(const char *s) #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 Index: src/external/bsd/libevent/dist/include/event2/rpc.h diff -u src/external/bsd/libevent/dist/include/event2/rpc.h:1.5 src/external/bsd/libevent/dist/include/event2/rpc.h:1.6 --- src/external/bsd/libevent/dist/include/event2/rpc.h:1.5 Wed Apr 7 03:36:48 2021 +++ src/external/bsd/libevent/dist/include/event2/rpc.h Sat Apr 10 19:18:45 2021 @@ -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 <pro...@citi.umich.edu> @@ -285,7 +285,7 @@ void *evrpc_get_reply(struct evrpc_req_g #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; Index: src/external/bsd/libevent/dist/test/regress_http.c diff -u src/external/bsd/libevent/dist/test/regress_http.c:1.8 src/external/bsd/libevent/dist/test/regress_http.c:1.9 --- src/external/bsd/libevent/dist/test/regress_http.c:1.8 Sat Apr 10 19:02:37 2021 +++ src/external/bsd/libevent/dist/test/regress_http.c Sat Apr 10 19:18:45 2021 @@ -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 <pro...@citi.umich.edu> @@ -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 @@ http_parse_uri_test(void *ptr) 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 @@ http_parse_uri_test(void *ptr) #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 @@ http_parse_uri_test(void *ptr) 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"); Index: src/external/bsd/libevent/dist/test/tinytest_macros.h diff -u src/external/bsd/libevent/dist/test/tinytest_macros.h:1.5 src/external/bsd/libevent/dist/test/tinytest_macros.h:1.6 --- src/external/bsd/libevent/dist/test/tinytest_macros.h:1.5 Wed Apr 7 03:36:48 2021 +++ src/external/bsd/libevent/dist/test/tinytest_macros.h Sat Apr 10 19:18:45 2021 @@ -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;" */