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: change return type of eqptrtype to...



details:   https://anonhg.NetBSD.org/src/rev/305dafd81a8a
branches:  trunk
changeset: 958559:305dafd81a8a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 10 14:09:57 2021 +0000

description:
lint: change return type of eqptrtype to bool

diffstat:

 usr.bin/xlint/lint1/decl.c     |  28 ++++++++++++++--------------
 usr.bin/xlint/lint1/externs1.h |   4 ++--
 2 files changed, 16 insertions(+), 16 deletions(-)

diffs (77 lines):

diff -r 9048b1f13a4d -r 305dafd81a8a usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sun Jan 10 14:07:34 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sun Jan 10 14:09:57 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.116 2021/01/10 14:07:34 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.117 2021/01/10 14:09:57 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.116 2021/01/10 14:07:34 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.117 2021/01/10 14:09:57 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -2073,28 +2073,28 @@
        return 0;
 }
 
-static int
-qualifiers_correspond(type_t *tp1, type_t *tp2, int ignqual)
+static bool
+qualifiers_correspond(const type_t *tp1, const type_t *tp2, int ignqual)
 {
        if (tp1->t_const != tp2->t_const && !ignqual && !tflag)
-               return 0;
+               return false;
 
        if (tp1->t_volatile != tp2->t_volatile && !ignqual && !tflag)
-               return 0;
-
-       return 1;
+               return false;
+
+       return true;
 }
 
-int
-eqptrtype(type_t *tp1, type_t *tp2, int ignqual)
+bool
+eqptrtype(const type_t *tp1, const type_t *tp2, int ignqual)
 {
        if (tp1->t_tspec != VOID && tp2->t_tspec != VOID)
-               return 0;
+               return false;
 
        if (!qualifiers_correspond(tp1, tp2, ignqual))
-               return 0;
-
-       return 1;
+               return false;
+
+       return true;
 }
 
 
diff -r 9048b1f13a4d -r 305dafd81a8a usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Sun Jan 10 14:07:34 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Sun Jan 10 14:09:57 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs1.h,v 1.52 2021/01/10 14:07:34 rillig Exp $     */
+/*     $NetBSD: externs1.h,v 1.53 2021/01/10 14:09:57 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -174,7 +174,7 @@
 extern void    decl1ext(sym_t *, int);
 extern void    copy_usage_info(sym_t *, sym_t *);
 extern int     check_redeclaration(sym_t *, int *);
-extern int     eqptrtype(type_t *, type_t *, int);
+extern bool    eqptrtype(const type_t *, const type_t *, int);
 extern int     eqtype(type_t *, type_t *, int, int, int *);
 extern void    complete_type(sym_t *, sym_t *);
 extern sym_t   *declare_argument(sym_t *, int);



Home | Main Index | Thread Index | Old Index