Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/lint1 lint: fix lint warning 161 "constant in ...



details:   https://anonhg.NetBSD.org/src/rev/0a41f41891b8
branches:  trunk
changeset: 979605:0a41f41891b8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 02 18:26:44 2021 +0000

description:
lint: fix lint warning 161 "constant in conditional context"

diffstat:

 usr.bin/xlint/lint1/decl.c  |  14 +++++++-------
 usr.bin/xlint/lint1/emit1.c |   8 ++++----
 usr.bin/xlint/lint1/lint1.h |   4 ++--
 usr.bin/xlint/lint1/tree.c  |  12 ++++++------
 4 files changed, 19 insertions(+), 19 deletions(-)

diffs (171 lines):

diff -r 7ff2436c2e99 -r 0a41f41891b8 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sat Jan 02 18:06:01 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sat Jan 02 18:26:44 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.101 2021/01/02 18:06:01 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.102 2021/01/02 18:26:44 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.101 2021/01/02 18:06:01 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.102 2021/01/02 18:26:44 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -661,7 +661,7 @@
                /* there is nothing after external declarations */
                /* FALLTHROUGH */
        default:
-               lint_assert(0);
+               lint_assert(/*CONSTCOND*/0);
        }
        free(di);
 }
@@ -1566,7 +1566,7 @@
                }
                break;
        default:
-               lint_assert(0);
+               lint_assert(/*CONSTCOND*/0);
        }
        sym->s_scl = sc;
 
@@ -1749,7 +1749,7 @@
        case STRTAG:    s = "struct";   break;
        case UNIONTAG:  s = "union";    break;
        case ENUMTAG:   s = "enum";     break;
-       default:        lint_assert(0);
+       default:        lint_assert(/*CONSTCOND*/0);
        }
        return s;
 }
@@ -2629,7 +2629,7 @@
                                 */
                                break;
                        default:
-                               lint_assert(0);
+                               lint_assert(/*CONSTCOND*/0);
                        }
 
                } else if (dcs->d_rdcsym->s_blklev == blklev) {
@@ -3074,7 +3074,7 @@
                warning(235, sym->s_name);
                break;
        default:
-               lint_assert(0);
+               lint_assert(/*CONSTCOND*/0);
        }
 }
 
diff -r 7ff2436c2e99 -r 0a41f41891b8 usr.bin/xlint/lint1/emit1.c
--- a/usr.bin/xlint/lint1/emit1.c       Sat Jan 02 18:06:01 2021 +0000
+++ b/usr.bin/xlint/lint1/emit1.c       Sat Jan 02 18:26:44 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.31 2021/01/01 09:28:22 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.32 2021/01/02 18:26:44 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit1.c,v 1.31 2021/01/01 09:28:22 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.32 2021/01/02 18:26:44 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -128,7 +128,7 @@
                case DCOMPLEX:  t = 'X';        s = '\0';       break;
                case LCOMPLEX:  t = 'X';        s = 'l';        break;
                default:
-                       lint_assert(0);
+                       lint_assert(/*CONSTCOND*/0);
                }
                if (tp->t_const)
                        outchar('c');
@@ -268,7 +268,7 @@
                outchar('e');
                break;
        default:
-               lint_assert(0);
+               lint_assert(/*CONSTCOND*/0);
        }
        if (llibflg && def != DECL) {
                /*
diff -r 7ff2436c2e99 -r 0a41f41891b8 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Sat Jan 02 18:06:01 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Sat Jan 02 18:26:44 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.47 2021/01/02 01:06:15 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.48 2021/01/02 18:26:44 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -70,7 +70,7 @@
                curr_pos.p_uniq++;                                      \
                if (curr_pos.p_file == csrc_pos.p_file)                 \
                        csrc_pos.p_uniq++;                              \
-       } while (0)
+       } while (/*CONSTCOND*/0)
 
 /*
  * Strings cannot be referenced to simply by a pointer to its first
diff -r 7ff2436c2e99 -r 0a41f41891b8 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sat Jan 02 18:06:01 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sat Jan 02 18:26:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.115 2021/01/02 03:49:25 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.116 2021/01/02 18:26:44 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.115 2021/01/02 03:49:25 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.116 2021/01/02 18:26:44 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -1968,7 +1968,7 @@
                case LCOMPLEX:
                        max = LDBL_MAX;         min = -LDBL_MAX;        break;
                default:
-                       lint_assert(0);
+                       lint_assert(/*CONSTCOND*/0);
                }
                if (v->v_ldbl > max || v->v_ldbl < min) {
                        lint_assert(nt != LDOUBLE);
@@ -2805,7 +2805,7 @@
                q = utyp ? (int64_t)(ul | ur) : sl | sr;
                break;
        default:
-               lint_assert(0);
+               lint_assert(/*CONSTCOND*/0);
        }
 
        /* XXX does not work for quads. */
@@ -2864,7 +2864,7 @@
                v->v_quad = l || r;
                break;
        default:
-               lint_assert(0);
+               lint_assert(/*CONSTCOND*/0);
        }
 
        return getcnode(tn->tn_type, v);
@@ -2943,7 +2943,7 @@
                v->v_quad = l != r;
                break;
        default:
-               lint_assert(0);
+               lint_assert(/*CONSTCOND*/0);
        }
 
        lint_assert(fpe || !isnan((double)v->v_ldbl));



Home | Main Index | Thread Index | Old Index