Source-Changes-HG archive

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

[src/trunk]: src/lib lib: remove CONSTCOND comment



details:   https://anonhg.NetBSD.org/src/rev/8e83a6500003
branches:  trunk
changeset: 365707:8e83a6500003
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Apr 19 20:32:14 2022 +0000

description:
lib: remove CONSTCOND comment

Since 2021-01-31, lint doesn't need it anymore for the common pattern of
'do ... while (0)'.

diffstat:

 lib/libbluetooth/sdp.h                   |  30 +++++++++++++++---------------
 lib/libc/cdb/cdbw.c                      |   6 +++---
 lib/libc/citrus/citrus_ctype_template.h  |   6 +++---
 lib/libc/citrus/citrus_hash.h            |   6 +++---
 lib/libc/citrus/citrus_prop.c            |   8 ++++----
 lib/libc/citrus/modules/citrus_gbk2k.c   |   6 +++---
 lib/libc/citrus/modules/citrus_mskanji.c |   6 +++---
 lib/libc/citrus/modules/citrus_ues.c     |   6 +++---
 lib/libc/citrus/modules/citrus_utf1632.c |   6 +++---
 lib/libc/citrus/modules/citrus_utf7.c    |   6 +++---
 lib/libc/citrus/modules/citrus_zw.c      |   6 +++---
 lib/libc/db/btree/btree.h                |  10 +++++-----
 lib/libc/gdtoa/gdtoaimp.h                |   6 +++---
 lib/libc/gen/arc4random.c                |   6 +++---
 lib/libc/gen/fts.c                       |   6 +++---
 lib/libc/gen/getpwent.c                  |   6 +++---
 lib/libc/gen/popen.c                     |   8 ++++----
 lib/libc/gen/pwcache.c                   |   6 +++---
 lib/libc/gen/setmode.c                   |   6 +++---
 lib/libc/gen/sysctlgetmibinfo.c          |   6 +++---
 lib/libc/gen/syslog_private.h            |   4 ++--
 lib/libc/gen/unvis.c                     |   6 +++---
 lib/libc/include/isc/list.h              |  16 ++++++++--------
 lib/libc/locale/nb_lc_template.h         |   4 ++--
 lib/libc/locale/rune.c                   |   6 +++---
 lib/libc/nameser/ns_print.c              |   6 +++---
 lib/libc/net/getaddrinfo.c               |  12 ++++++------
 lib/libc/net/gethnamaddr.c               |  12 ++++++------
 lib/libc/net/hostent.h                   |   8 ++++----
 lib/libc/net/linkaddr.c                  |   6 +++---
 lib/libc/net/nsdispatch.c                |   6 +++---
 lib/libc/stdio/fileext.h                 |   6 +++---
 lib/libc/stdio/vfscanf.c                 |   6 +++---
 lib/libc/stdio/vfwprintf.c               |  20 ++++++++++----------
 lib/libc/stdio/vfwscanf.c                |   6 +++---
 lib/libc/stdio/vsnprintf_ss.c            |   6 +++---
 lib/libc/stdio/wcio.h                    |   8 ++++----
 lib/libc/stdlib/strfmon.c                |  14 +++++++-------
 lib/libc/thread-stub/thread-stub.c       |   6 +++---
 lib/libcurses/keymap.h                   |   6 +++---
 lib/libintl/plural_parser.c              |   8 ++++----
 lib/libisns/isns_config.h                |   6 +++---
 lib/libisns/isns_pdu.h                   |   4 ++--
 lib/libkvm/kvm_private.h                 |   4 ++--
 lib/libkvm/kvm_proc.c                    |  10 +++++-----
 lib/libm/complex/catrig.c                |   6 +++---
 lib/libm/complex/catrigf.c               |   6 +++---
 lib/libm/complex/catrigl.c               |  10 +++++-----
 lib/libm/src/math_private.h              |  24 ++++++++++++------------
 lib/libp2k/p2k.c                         |   6 +++---
 lib/libpanel/panel_impl.h                |  10 +++++-----
 lib/libpthread/pthread_cancelstub.c      |   6 +++---
 lib/libpthread/pthread_int.h             |   8 ++++----
 lib/libpthread/pthread_queue.h           |  14 +++++++-------
 lib/libpuffs/framebuf.c                  |   6 +++---
 lib/libpuffs/puffs.c                     |   8 ++++----
 lib/libresolv/dst_internal.h             |   6 +++---
 lib/libresolv/ns_sign.c                  |   6 +++---
 lib/libresolv/ns_verify.c                |   4 ++--
 lib/libresolv/res_findzonecut.c          |   6 +++---
 lib/libresolv/res_update.c               |   6 +++---
 lib/librumpuser/rumpuser_dl.c            |  10 +++++-----
 lib/librumpuser/rumpuser_int.h           |  10 +++++-----
 lib/librumpuser/rumpuser_port.h          |   4 ++--
 lib/libukfs/ukfs.c                       |   4 ++--
 lib/libukfs/ukfs.h                       |   4 ++--
 lib/libutil/stat_flags.c                 |   6 +++---
 67 files changed, 259 insertions(+), 259 deletions(-)

diffs (truncated from 2251 to 300 lines):

diff -r 642e012fb519 -r 8e83a6500003 lib/libbluetooth/sdp.h
--- a/lib/libbluetooth/sdp.h    Tue Apr 19 20:08:52 2022 +0000
+++ b/lib/libbluetooth/sdp.h    Tue Apr 19 20:32:14 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdp.h,v 1.2 2009/07/25 17:04:51 plunky Exp $   */
+/*     $NetBSD: sdp.h,v 1.3 2022/04/19 20:32:14 rillig Exp $   */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -497,22 +497,22 @@
 #define SDP_GET8(b, cp)                do {                    \
        (b) = *(const uint8_t *)(cp);                   \
        (cp) += sizeof(uint8_t);                        \
-} while (/* CONSTCOND */0)
+} while (0)
 
 #define SDP_GET16(s, cp)       do {                    \
        (s) = be16dec(cp);                              \
        (cp) += sizeof(uint16_t);                       \
-} while (/* CONSTCOND */0)
+} while (0)
 
 #define SDP_GET32(l, cp)       do {                    \
        (l) = be32dec(cp);                              \
        (cp) += sizeof(uint32_t);                       \
-} while (/* CONSTCOND */0)
+} while (0)
 
 #define SDP_GET64(l, cp)       do {                    \
        (l) = be64dec(cp);                              \
        (cp) += sizeof(uint64_t);                       \
-} while (/* CONSTCOND */0)
+} while (0)
 
 #if BYTE_ORDER == LITTLE_ENDIAN
 #define SDP_GET128(l, cp)      do {                    \
@@ -534,17 +534,17 @@
        (l)->b[1]  = *t_cp++;                           \
        (l)->b[0]  = *t_cp++;                           \
        (cp) += 16;                                     \
-} while (/* CONSTCOND */0)
+} while (0)
 
 #define SDP_GET_UUID128(l, cp) do {                    \
        memcpy(&((l)->b), (cp), 16);                    \
        (cp) += 16;                                     \
-} while (/* CONSTCOND */0)
+} while (0)
 #elif BYTE_ORDER == BIG_ENDIAN
 #define SDP_GET128(l, cp)      do {                    \
        memcpy(&((l)->b), (cp), 16);                    \
        (cp) += 16;                                     \
-} while (/* CONSTCOND */0)
+} while (0)
 
 #define SDP_GET_UUID128(l, cp) SDP_GET128(l, cp)
 #else
@@ -554,22 +554,22 @@
 #define SDP_PUT8(b, cp)                do {                    \
        *(uint8_t *)(cp) = (b);                         \
        (cp) += sizeof(uint8_t);                        \
-} while (/* CONSTCOND */0)
+} while (0)
 
 #define SDP_PUT16(s, cp)       do {                    \
        be16enc((cp), (s));                             \
        (cp) += sizeof(uint16_t);                       \
-} while (/* CONSTCOND */0)
+} while (0)
 
 #define SDP_PUT32(s, cp)       do {                    \
        be32enc((cp), (s));                             \
        (cp) += sizeof(uint32_t);                       \
-} while (/* CONSTCOND */0)
+} while (0)
 
 #define SDP_PUT64(s, cp)       do {                    \
        be64enc((cp), (s));                             \
        (cp) += sizeof(uint64_t);                       \
-} while (/* CONSTCOND */0)
+} while (0)
 
 #if BYTE_ORDER == LITTLE_ENDIAN
 #define SDP_PUT128(l, cp)      do {                    \
@@ -591,17 +591,17 @@
        *t_cp++ = (l)->b[1];                            \
        *t_cp   = (l)->b[0];                            \
        (cp) += 16;                                     \
-} while (/* CONSTCOND */0)
+} while (0)
 
 #define SDP_PUT_UUID128(l, cp) do {                    \
        memcpy((cp), &((l)->b), 16);                    \
        (cp) += 16;                                     \
-} while (/* CONSTCOND */0)
+} while (0)
 #elif BYTE_ORDER == BIG_ENDIAN
 #define SDP_PUT128(l, cp)      do {                    \
        memcpy((cp), &((l)->b), 16);                    \
        (cp) += 16;                                     \
-} while (/* CONSTCOND */0)
+} while (0)
 
 #define SDP_PUT_UUID128(l, cp) SDP_PUT128(l, cp)
 #else
diff -r 642e012fb519 -r 8e83a6500003 lib/libc/cdb/cdbw.c
--- a/lib/libc/cdb/cdbw.c       Tue Apr 19 20:08:52 2022 +0000
+++ b/lib/libc/cdb/cdbw.c       Tue Apr 19 20:32:14 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdbw.c,v 1.7 2021/01/07 14:41:50 joerg Exp $   */
+/*     $NetBSD: cdbw.c,v 1.8 2022/04/19 20:32:14 rillig Exp $  */
 /*-
  * Copyright (c) 2009, 2010, 2015 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,7 +36,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: cdbw.c,v 1.7 2021/01/07 14:41:50 joerg Exp $");
+__RCSID("$NetBSD: cdbw.c,v 1.8 2022/04/19 20:32:14 rillig Exp $");
 
 #include "namespace.h"
 
@@ -538,7 +538,7 @@
                        return -1;                              \
                cur_pos = 0;                                    \
        }                                                       \
-} while (/* CONSTCOND */ 0)
+} while (0)
 
 static int
 print_hash(struct cdbw *cdbw, struct state *state, int fd, const char *descr)
diff -r 642e012fb519 -r 8e83a6500003 lib/libc/citrus/citrus_ctype_template.h
--- a/lib/libc/citrus/citrus_ctype_template.h   Tue Apr 19 20:08:52 2022 +0000
+++ b/lib/libc/citrus/citrus_ctype_template.h   Tue Apr 19 20:32:14 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: citrus_ctype_template.h,v 1.38 2020/06/02 01:30:31 joerg Exp $ */
+/*     $NetBSD: citrus_ctype_template.h,v 1.39 2022/04/19 20:32:14 rillig Exp $        */
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -486,14 +486,14 @@
                        _FUNCNAME(unpack_state)(_CEI_TO_EI(_cei_),      \
                                                _pse_, _pspriv_);       \
                }                                                       \
-       } while (/*CONSTCOND*/0)
+       } while (0)
 
 #define _RESTART_END(_func_, _cei_, _pspriv_, _pse_)                   \
        if (_pspriv_ != NULL) {                                         \
                _FUNCNAME(pack_state)(_CEI_TO_EI(_cei_), _pspriv_,      \
                                      _pse_);                           \
        }                                                               \
-} while (/*CONSTCOND*/0)
+} while (0)
 
 int
 _FUNCNAME(ctype_getops)(_citrus_ctype_ops_rec_t *ops, size_t lenops,
diff -r 642e012fb519 -r 8e83a6500003 lib/libc/citrus/citrus_hash.h
--- a/lib/libc/citrus/citrus_hash.h     Tue Apr 19 20:08:52 2022 +0000
+++ b/lib/libc/citrus/citrus_hash.h     Tue Apr 19 20:32:14 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: citrus_hash.h,v 1.3 2004/01/02 21:49:35 itojun Exp $   */
+/*     $NetBSD: citrus_hash.h,v 1.4 2022/04/19 20:32:14 rillig Exp $   */
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -39,7 +39,7 @@
        int _ch_loop;                                           \
        for (_ch_loop = 0; _ch_loop < hashsize; _ch_loop++)     \
                LIST_INIT(&(head)->chh_table[_ch_loop]);        \
-} while (/*CONSTCOND*/0)
+} while (0)
 #define _CITRUS_HASH_REMOVE(elm, field) LIST_REMOVE(elm, field)
 #define _CITRUS_HASH_INSERT(head, elm, field, hashval)         \
 LIST_INSERT_HEAD(&(head)->chh_table[hashval], elm, field)
@@ -49,7 +49,7 @@
                if (matchfunc((elm), key)==0)                           \
                        break;                                          \
        }                                                               \
-} while (/*CONSTCOND*/0)
+} while (0)
 
 __BEGIN_DECLS
 int    _citrus_string_hash_func(const char *, int);
diff -r 642e012fb519 -r 8e83a6500003 lib/libc/citrus/citrus_prop.c
--- a/lib/libc/citrus/citrus_prop.c     Tue Apr 19 20:08:52 2022 +0000
+++ b/lib/libc/citrus/citrus_prop.c     Tue Apr 19 20:32:14 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_prop.c,v 1.5 2014/06/24 22:24:18 spz Exp $ */
+/* $NetBSD: citrus_prop.c,v 1.6 2022/04/19 20:32:14 rillig Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_prop.c,v 1.5 2014/06/24 22:24:18 spz Exp $");
+__RCSID("$NetBSD: citrus_prop.c,v 1.6 2022/04/19 20:32:14 rillig Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -401,13 +401,13 @@
        _DIAGASSERT(hint->cb._func_.func != NULL);      \
        errnum = (*hint->cb._func_.func)(context,       \
            hint->name, ostart.u._func_);               \
-} while (/*CONSTCOND*/0)
+} while (0)
 #define CALL1(_func_)                                  \
 do {                                                   \
        _DIAGASSERT(hint->cb._func_.func != NULL);      \
        errnum = (*hint->cb._func_.func)(context,       \
            hint->name, ostart.u._func_, oend.u._func_);\
-} while (/*CONSTCOND*/0)
+} while (0)
 
                switch (hint->type) {
 
diff -r 642e012fb519 -r 8e83a6500003 lib/libc/citrus/modules/citrus_gbk2k.c
--- a/lib/libc/citrus/modules/citrus_gbk2k.c    Tue Apr 19 20:08:52 2022 +0000
+++ b/lib/libc/citrus/modules/citrus_gbk2k.c    Tue Apr 19 20:32:14 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_gbk2k.c,v 1.8 2013/05/28 16:57:56 joerg Exp $ */
+/* $NetBSD: citrus_gbk2k.c,v 1.9 2022/04/19 20:32:14 rillig Exp $ */
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_gbk2k.c,v 1.8 2013/05/28 16:57:56 joerg Exp $");
+__RCSID("$NetBSD: citrus_gbk2k.c,v 1.9 2022/04/19 20:32:14 rillig Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -434,7 +434,7 @@
                 lenvar -= sizeof(#x)-1;                         \
                 p += sizeof(#x)-1;                              \
         }                                                       \
-} while (/*CONSTCOND*/0)
+} while (0)
        memset((void *)ei, 0, sizeof(*ei));
        ei->mb_cur_max = 4;
        while (lenvar>0) {
diff -r 642e012fb519 -r 8e83a6500003 lib/libc/citrus/modules/citrus_mskanji.c
--- a/lib/libc/citrus/modules/citrus_mskanji.c  Tue Apr 19 20:08:52 2022 +0000
+++ b/lib/libc/citrus/modules/citrus_mskanji.c  Tue Apr 19 20:32:14 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: citrus_mskanji.c,v 1.14 2013/05/28 16:57:56 joerg Exp $        */
+/*     $NetBSD: citrus_mskanji.c,v 1.15 2022/04/19 20:32:14 rillig Exp $       */
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -62,7 +62,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_mskanji.c,v 1.14 2013/05/28 16:57:56 joerg Exp $");
+__RCSID("$NetBSD: citrus_mskanji.c,v 1.15 2022/04/19 20:32:14 rillig Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -507,7 +507,7 @@
                lenvar -= sizeof(#x)-1;                         \
                p += sizeof(#x)-1;                              \
        }                                                       \
-} while (/*CONSTCOND*/0)
+} while (0)
        memset((void *)ei, 0, sizeof(*ei));
        while (lenvar > 0) {
                switch (_bcs_toupper(*p)) {
diff -r 642e012fb519 -r 8e83a6500003 lib/libc/citrus/modules/citrus_ues.c
--- a/lib/libc/citrus/modules/citrus_ues.c      Tue Apr 19 20:08:52 2022 +0000
+++ b/lib/libc/citrus/modules/citrus_ues.c      Tue Apr 19 20:32:14 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_ues.c,v 1.4 2013/05/28 16:57:56 joerg Exp $ */
+/* $NetBSD: citrus_ues.c,v 1.5 2022/04/19 20:32:14 rillig Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_ues.c,v 1.4 2013/05/28 16:57:56 joerg Exp $");
+__RCSID("$NetBSD: citrus_ues.c,v 1.5 2022/04/19 20:32:14 rillig Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -439,7 +439,7 @@
                 lenvar -= sizeof(#x)-1;                                \
                 p += sizeof(#x)-1;                             \
         }                                                      \
-} while (/*CONSTCOND*/0)
+} while (0)
        memset((void *)ei, 0, sizeof(*ei));
        while (lenvar > 0) {
                switch (_bcs_toupper(*p)) {



Home | Main Index | Thread Index | Old Index