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 unnecessary CONS...



details:   https://anonhg.NetBSD.org/src/rev/bd78b7187d43
branches:  trunk
changeset: 954475:bd78b7187d43
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Apr 10 19:02:37 2021 +0000

description:
libevent: remove unnecessary CONSTCOND comments

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

This reduces the local modifications.

No functional change.

diffstat:

 external/bsd/libevent/dist/bufferevent-internal.h |  10 ++--
 external/bsd/libevent/dist/bufferevent.c          |   6 +-
 external/bsd/libevent/dist/bufferevent_ratelim.c  |   4 +-
 external/bsd/libevent/dist/evbuffer-internal.h    |  12 +++---
 external/bsd/libevent/dist/evdns.c                |  10 ++--
 external/bsd/libevent/dist/evmap.c                |   8 ++--
 external/bsd/libevent/dist/evthread-internal.h    |  42 +++++++++++-----------
 external/bsd/libevent/dist/ratelim-internal.h     |   6 +-
 external/bsd/libevent/dist/test/regress.c         |   6 +-
 external/bsd/libevent/dist/test/regress.h         |   4 +-
 external/bsd/libevent/dist/test/regress_buffer.c  |   6 +-
 external/bsd/libevent/dist/test/regress_http.c    |  10 ++--
 external/bsd/libevent/dist/test/regress_util.c    |   8 ++--
 external/bsd/libevent/dist/util-internal.h        |   4 +-
 14 files changed, 68 insertions(+), 68 deletions(-)

diffs (truncated from 572 to 300 lines):

diff -r 80f0861612a1 -r bd78b7187d43 external/bsd/libevent/dist/bufferevent-internal.h
--- a/external/bsd/libevent/dist/bufferevent-internal.h Sat Apr 10 18:36:27 2021 +0000
+++ b/external/bsd/libevent/dist/bufferevent-internal.h Sat Apr 10 19:02:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bufferevent-internal.h,v 1.4 2021/04/07 03:36:48 christos Exp $        */
+/*     $NetBSD: bufferevent-internal.h,v 1.5 2021/04/10 19:02:37 rillig Exp $  */
 
 /*
  * Copyright (c) 2008-2012 Niels Provos and Nick Mathewson
@@ -461,14 +461,14 @@
        do {                                                            \
                if (evutil_timerisset(&(bev)->timeout_read))            \
                        event_add(&(bev)->ev_read, &(bev)->timeout_read); \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 /** Internal use: We have just successfully written data from an inbuf, so
  * reset the read timeout (if any). */
 #define BEV_RESET_GENERIC_WRITE_TIMEOUT(bev)                           \
        do {                                                            \
                if (evutil_timerisset(&(bev)->timeout_write))           \
                        event_add(&(bev)->ev_write, &(bev)->timeout_write); \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 #define BEV_DEL_GENERIC_READ_TIMEOUT(bev)      \
                event_del(&(bev)->ev_read)
 #define BEV_DEL_GENERIC_WRITE_TIMEOUT(bev)     \
@@ -487,13 +487,13 @@
 #define BEV_LOCK(b) do {                                               \
                struct bufferevent_private *locking =  BEV_UPCAST(b);   \
                EVLOCK_LOCK(locking->lock, 0);                          \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 /** Internal: Release the lock (if any) on a bufferevent */
 #define BEV_UNLOCK(b) do {                                             \
                struct bufferevent_private *locking =  BEV_UPCAST(b);   \
                EVLOCK_UNLOCK(locking->lock, 0);                        \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 #endif
 
 
diff -r 80f0861612a1 -r bd78b7187d43 external/bsd/libevent/dist/bufferevent.c
--- a/external/bsd/libevent/dist/bufferevent.c  Sat Apr 10 18:36:27 2021 +0000
+++ b/external/bsd/libevent/dist/bufferevent.c  Sat Apr 10 19:02:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bufferevent.c,v 1.5 2021/04/07 03:36:48 christos Exp $ */
+/*     $NetBSD: bufferevent.c,v 1.6 2021/04/10 19:02:37 rillig Exp $   */
 
 /*
  * Copyright (c) 2002-2007 Niels Provos <provos%citi.umich.edu@localhost>
@@ -29,7 +29,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bufferevent.c,v 1.5 2021/04/07 03:36:48 christos Exp $");
+__RCSID("$NetBSD: bufferevent.c,v 1.6 2021/04/10 19:02:37 rillig Exp $");
 #include "evconfig-private.h"
 
 #include <sys/types.h>
@@ -238,7 +238,7 @@
                            (bevp)->bev.ev_base,                        \
                        &(bevp)->deferred))                             \
                        bufferevent_incref_(&(bevp)->bev);              \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 
 void
diff -r 80f0861612a1 -r bd78b7187d43 external/bsd/libevent/dist/bufferevent_ratelim.c
--- a/external/bsd/libevent/dist/bufferevent_ratelim.c  Sat Apr 10 18:36:27 2021 +0000
+++ b/external/bsd/libevent/dist/bufferevent_ratelim.c  Sat Apr 10 19:02:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bufferevent_ratelim.c,v 1.4 2021/04/07 03:36:48 christos Exp $ */
+/*     $NetBSD: bufferevent_ratelim.c,v 1.5 2021/04/10 19:02:37 rillig Exp $   */
 
 /*
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -484,7 +484,7 @@
                    bev = LIST_NEXT(bev, rate_limiting->next_in_group)) { \
                        block ;                                         \
                }                                                       \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 static void
 bev_group_unsuspend_reading_(struct bufferevent_rate_limit_group *g)
diff -r 80f0861612a1 -r bd78b7187d43 external/bsd/libevent/dist/evbuffer-internal.h
--- a/external/bsd/libevent/dist/evbuffer-internal.h    Sat Apr 10 18:36:27 2021 +0000
+++ b/external/bsd/libevent/dist/evbuffer-internal.h    Sat Apr 10 19:02:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: evbuffer-internal.h,v 1.5 2021/04/07 03:36:48 christos Exp $   */
+/*     $NetBSD: evbuffer-internal.h,v 1.6 2021/04/10 19:02:37 rillig Exp $     */
 
 /*
  * Copyright (c) 2000-2007 Niels Provos <provos%citi.umich.edu@localhost>
@@ -287,19 +287,19 @@
 #define EVBUFFER_LOCK(buffer)                                          \
        do {                                                            \
                EVLOCK_LOCK((buffer)->lock, 0);                         \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 #define EVBUFFER_UNLOCK(buffer)                                                \
        do {                                                            \
                EVLOCK_UNLOCK((buffer)->lock, 0);                       \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 #define EVBUFFER_LOCK2(buffer1, buffer2)                               \
        do {                                                            \
                EVLOCK_LOCK2((buffer1)->lock, (buffer2)->lock, 0, 0);   \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 #define EVBUFFER_UNLOCK2(buffer1, buffer2)                             \
        do {                                                            \
                EVLOCK_UNLOCK2((buffer1)->lock, (buffer2)->lock, 0, 0); \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 /** Increase the reference count of buf by one. */
 void evbuffer_incref_(struct evbuffer *buf);
@@ -332,7 +332,7 @@
 #define WSABUF_FROM_EVBUFFER_IOV(i,ei) do {            \
                (i)->buf = (ei)->iov_base;              \
                (i)->len = (unsigned long)(ei)->iov_len;        \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 /* XXXX the cast above is safe for now, but not if we allow mmaps on win64.
  * See note in buffer_iocp's launch_write function */
 
diff -r 80f0861612a1 -r bd78b7187d43 external/bsd/libevent/dist/evdns.c
--- a/external/bsd/libevent/dist/evdns.c        Sat Apr 10 18:36:27 2021 +0000
+++ b/external/bsd/libevent/dist/evdns.c        Sat Apr 10 19:02:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: evdns.c,v 1.5 2021/04/07 03:36:48 christos Exp $       */
+/*     $NetBSD: evdns.c,v 1.6 2021/04/10 19:02:37 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.5 2021/04/07 03:36:48 christos Exp $");
+__RCSID("$NetBSD: evdns.c,v 1.6 2021/04/10 19:02:37 rillig Exp $");
 #include "evconfig-private.h"
 
 #include <sys/types.h>
@@ -1080,7 +1080,7 @@
                if (name_parse(packet, length, &j, tmp_name,    \
                        sizeof(tmp_name))<0)                    \
                        goto err;                               \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
        reply.type = req->request_type;
 
@@ -1629,14 +1629,14 @@
                t_ = htons(x);                                          \
                memcpy(buf + j, &t_, 2);                                \
                j += 2;                                                 \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 #define APPEND32(x) do {                                               \
                if (j + 4 > (off_t)buf_len)                             \
                        goto overflow;                                  \
                t32_ = htonl(x);                                        \
                memcpy(buf + j, &t32_, 4);                              \
                j += 4;                                                 \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
        if (name_len > 255) return -2;
 
diff -r 80f0861612a1 -r bd78b7187d43 external/bsd/libevent/dist/evmap.c
--- a/external/bsd/libevent/dist/evmap.c        Sat Apr 10 18:36:27 2021 +0000
+++ b/external/bsd/libevent/dist/evmap.c        Sat Apr 10 19:02:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: evmap.c,v 1.4 2021/04/07 03:36:48 christos Exp $       */
+/*     $NetBSD: evmap.c,v 1.5 2021/04/10 19:02:37 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.4 2021/04/07 03:36:48 christos Exp $");
+__RCSID("$NetBSD: evmap.c,v 1.5 2021/04/10 19:02:37 rillig Exp $");
 #include "evconfig-private.h"
 
 #ifdef _WIN32
@@ -141,7 +141,7 @@
                            HT_FOI_INSERT_(map_node, map, &key_, ent_, ptr) \
                                });                                     \
                (x) = &ent_->ent.type;                                  \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 void evmap_io_initmap_(struct event_io_map *ctx)
 {
@@ -180,7 +180,7 @@
                        (ctor)((struct type *)(map)->entries[slot]);    \
                }                                                       \
                (x) = (struct type *)((map)->entries[slot]);            \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 /* If we aren't using hashtables, then define the IO_SLOT macros and functions
    as thin aliases over the SIGNAL_SLOT versions. */
diff -r 80f0861612a1 -r bd78b7187d43 external/bsd/libevent/dist/evthread-internal.h
--- a/external/bsd/libevent/dist/evthread-internal.h    Sat Apr 10 18:36:27 2021 +0000
+++ b/external/bsd/libevent/dist/evthread-internal.h    Sat Apr 10 19:02:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: evthread-internal.h,v 1.4 2021/04/07 03:36:48 christos Exp $   */
+/*     $NetBSD: evthread-internal.h,v 1.5 2021/04/10 19:02:37 rillig Exp $     */
 
 /*
  * Copyright (c) 2008-2012 Niels Provos, Nick Mathewson
@@ -89,21 +89,21 @@
                void *lock_tmp_ = (lockvar);                            \
                if (lock_tmp_ && evthread_lock_fns_.free)               \
                        evthread_lock_fns_.free(lock_tmp_, (locktype)); \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 /** Acquire a lock. */
 #define EVLOCK_LOCK(lockvar,mode)                                      \
        do {                                                            \
                if (lockvar)                                            \
                        evthread_lock_fns_.lock(mode, lockvar);         \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 /** Release a lock */
 #define EVLOCK_UNLOCK(lockvar,mode)                                    \
        do {                                                            \
                if (lockvar)                                            \
                        evthread_lock_fns_.unlock(mode, lockvar);       \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 /** Helper: put lockvar1 and lockvar2 into pointerwise ascending order. */
 #define EVLOCK_SORTLOCKS_(lockvar1, lockvar2)                          \
@@ -113,18 +113,18 @@
                        lockvar1 = lockvar2;                            \
                        lockvar2 = tmp;                                 \
                }                                                       \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 /** Lock an event_base, if it is set up for locking.  Acquires the lock
     in the base structure whose field is named 'lockvar'. */
 #define EVBASE_ACQUIRE_LOCK(base, lockvar) do {                                \
                EVLOCK_LOCK((base)->lockvar, 0);                        \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 /** Unlock an event_base, if it is set up for locking. */
 #define EVBASE_RELEASE_LOCK(base, lockvar) do {                                \
                EVLOCK_UNLOCK((base)->lockvar, 0);                      \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 /** If lock debugging is enabled, and lock is non-null, assert that 'lock' is
  * locked and held by us. */
@@ -133,7 +133,7 @@
                if ((lock) && evthread_lock_debugging_enabled_) {       \
                        EVUTIL_ASSERT(evthread_is_debug_lock_held_(lock)); \
                }                                                       \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 /** Try to grab the lock for 'lockvar' without blocking, and return 1 if we
  * manage to get it. */
@@ -156,13 +156,13 @@
        do {                                                            \
                (condvar) = evthread_cond_fns_.alloc_condition ?        \
                    evthread_cond_fns_.alloc_condition(0) : NULL;       \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 /** Deallocate and free a condition variable in condvar */
 #define EVTHREAD_FREE_COND(cond)                                       \
        do {                                                            \
                if (cond)                                               \
                        evthread_cond_fns_.free_condition((cond));      \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 /** Signal one thread waiting on cond */
 #define EVTHREAD_COND_SIGNAL(cond)                                     \
        ( (cond) ? evthread_cond_fns_.signal_condition((cond), 0) : 0 )
@@ -222,32 +222,32 @@
                void *lock_tmp_ = (lockvar);                            \
                if (lock_tmp_)                                          \
                        evthreadimpl_lock_free_(lock_tmp_, (locktype)); \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 /** Acquire a lock. */
 #define EVLOCK_LOCK(lockvar,mode)                                      \
        do {                                                            \



Home | Main Index | Thread Index | Old Index