Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint lint: remove redundant parentheses around retu...



details:   https://anonhg.NetBSD.org/src/rev/6a81ea63bc46
branches:  trunk
changeset: 958236:6a81ea63bc46
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 29 11:35:11 2020 +0000

description:
lint: remove redundant parentheses around return value

diffstat:

 usr.bin/xlint/common/mem.c    |   12 +-
 usr.bin/xlint/common/tyname.c |    6 +-
 usr.bin/xlint/lint1/cgram.y   |   12 +-
 usr.bin/xlint/lint1/decl.c    |  110 +++++++++++-----------
 usr.bin/xlint/lint1/emit1.c   |    6 +-
 usr.bin/xlint/lint1/err.c     |   12 +-
 usr.bin/xlint/lint1/init.c    |   16 +-
 usr.bin/xlint/lint1/main1.c   |    6 +-
 usr.bin/xlint/lint1/mem1.c    |   30 +++---
 usr.bin/xlint/lint1/tree.c    |  193 +++++++++++++++++++++--------------------
 usr.bin/xlint/lint2/chk.c     |   54 +++++-----
 usr.bin/xlint/lint2/emit2.c   |    6 +-
 usr.bin/xlint/lint2/hash.c    |   10 +-
 usr.bin/xlint/lint2/mem2.c    |    6 +-
 usr.bin/xlint/lint2/msg.c     |   10 +-
 usr.bin/xlint/lint2/read.c    |   24 ++--
 usr.bin/xlint/xlint/xlint.c   |   18 +-
 17 files changed, 266 insertions(+), 265 deletions(-)

diffs (truncated from 2138 to 300 lines):

diff -r 990ab0399310 -r 6a81ea63bc46 usr.bin/xlint/common/mem.c
--- a/usr.bin/xlint/common/mem.c        Tue Dec 29 11:07:47 2020 +0000
+++ b/usr.bin/xlint/common/mem.c        Tue Dec 29 11:35:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mem.c,v 1.10 2020/12/28 22:16:42 rillig Exp $  */
+/*     $NetBSD: mem.c,v 1.11 2020/12/29 11:35:11 rillig Exp $  */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem.c,v 1.10 2020/12/28 22:16:42 rillig Exp $");
+__RCSID("$NetBSD: mem.c,v 1.11 2020/12/29 11:35:11 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -56,7 +56,7 @@
 
        if ((p = malloc(s)) == NULL)
                nomem();
-       return (p);
+       return p;
 }
 
 void *
@@ -66,7 +66,7 @@
 
        if ((p = calloc(n, s)) == NULL)
                nomem();
-       return (p);
+       return p;
 }
 
 void *
@@ -79,7 +79,7 @@
                nomem();
        }
        p = n;
-       return (p);
+       return p;
 }
 
 char *
@@ -89,7 +89,7 @@
 
        if ((s2 = strdup(s)) == NULL)
                nomem();
-       return (s2);
+       return s2;
 }
 
 void
diff -r 990ab0399310 -r 6a81ea63bc46 usr.bin/xlint/common/tyname.c
--- a/usr.bin/xlint/common/tyname.c     Tue Dec 29 11:07:47 2020 +0000
+++ b/usr.bin/xlint/common/tyname.c     Tue Dec 29 11:35:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tyname.c,v 1.13 2018/09/07 15:16:15 christos Exp $     */
+/*     $NetBSD: tyname.c,v 1.14 2020/12/29 11:35:11 rillig Exp $       */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tyname.c,v 1.13 2018/09/07 15:16:15 christos Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.14 2020/12/29 11:35:11 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -235,5 +235,5 @@
        default:
                LERROR("tyname(%d)", t);
        }
-       return (buf);
+       return buf;
 }
diff -r 990ab0399310 -r 6a81ea63bc46 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Tue Dec 29 11:07:47 2020 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Tue Dec 29 11:35:11 2020 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.111 2020/12/29 10:24:22 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.112 2020/12/29 11:35:11 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.111 2020/12/29 10:24:22 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.112 2020/12/29 11:35:11 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -2026,7 +2026,7 @@
        error(249, yytext);
        if (++sytxerr >= 5)
                norecover();
-       return (0);
+       return 0;
 }
 
 static __inline int uq_gt(uint64_t, uint64_t);
@@ -2036,14 +2036,14 @@
 uq_gt(uint64_t a, uint64_t b)
 {
 
-       return (a > b);
+       return a > b;
 }
 
 static __inline int
 q_gt(int64_t a, int64_t b)
 {
 
-       return (a > b);
+       return a > b;
 }
 
 #define        q_lt(a, b)      q_gt(b, a)
@@ -2096,7 +2096,7 @@
                }
        }
        free(v);
-       return (i);
+       return i;
 }
 
 static void
diff -r 990ab0399310 -r 6a81ea63bc46 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Tue Dec 29 11:07:47 2020 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Tue Dec 29 11:35:11 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.75 2020/12/29 10:24:22 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.76 2020/12/29 11:35:11 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.75 2020/12/29 10:24:22 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.76 2020/12/29 11:35:11 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -140,7 +140,7 @@
 gettyp(tspec_t t)
 {
 
-       return (&typetab[t]);
+       return &typetab[t];
 }
 
 type_t *
@@ -150,7 +150,7 @@
 
        ntp = getblk(sizeof (type_t));
        STRUCT_ASSIGN(*ntp, *tp);
-       return (ntp);
+       return ntp;
 }
 
 /*
@@ -164,7 +164,7 @@
 
        ntp = tgetblk(sizeof (type_t));
        STRUCT_ASSIGN(*ntp, *tp);
-       return (ntp);
+       return ntp;
 }
 
 /*
@@ -177,15 +177,15 @@
        tspec_t t;
 
        if ((t = tp->t_tspec) == VOID) {
-               return (1);
+               return 1;
        } else if (t == ARRAY) {
-               return (tp->t_aincompl);
+               return tp->t_aincompl;
        } else if (t == STRUCT || t == UNION) {
-               return (tp->t_str->sincompl);
+               return tp->t_str->sincompl;
        } else if (t == ENUM) {
-               return (tp->t_enum->eincompl);
+               return tp->t_enum->eincompl;
        }
-       return (0);
+       return 0;
 }
 
 /*
@@ -389,7 +389,7 @@
                                warning(5, ttab[t].tt_name);
                        td = duptyp(gettyp(mrgtspec(t2, t)));
                        td->t_typedef = 1;
-                       return (td);
+                       return td;
                }
                break;
        case SHORT:
@@ -398,7 +398,7 @@
                        warning(5, "short");
                        td = duptyp(gettyp(t2 == INT ? SHORT : USHORT));
                        td->t_typedef = 1;
-                       return (td);
+                       return td;
                }
                break;
        case LONG:
@@ -423,7 +423,7 @@
                        }
                        td = duptyp(td);
                        td->t_typedef = 1;
-                       return (td);
+                       return td;
                }
                break;
                /* LINTED206: (enumeration values not handled in switch) */
@@ -465,7 +465,7 @@
        /* Anything other is not accepted. */
 
        dcs->d_terr = 1;
-       return (td);
+       return td;
 }
 
 /*
@@ -877,7 +877,7 @@
                }
        }
 
-       return (t);
+       return t;
 }
 
 /*
@@ -925,7 +925,7 @@
                        LERROR("length(%d)", elsz);
                break;
        }
-       return (elem * elsz);
+       return elem * elsz;
 }
 
 /*
@@ -958,7 +958,7 @@
        }
        if (a < CHAR_BIT || a > WORST_ALIGN(1) * CHAR_BIT)
                LERROR("getbound()");
-       return (a);
+       return a;
 }
 
 /*
@@ -971,11 +971,11 @@
        sym_t   *l;
 
        if ((l = l1) == NULL)
-               return (l2);
+               return l2;
        while (l1->s_nxt != NULL)
                l1 = l1->s_nxt;
        l1->s_nxt = l2;
-       return (l);
+       return l;
 }
 
 /*
@@ -1210,7 +1210,7 @@
         */
        bitfieldtype_ok = 0;
 
-       return (dsym);
+       return dsym;
 }
 
 /*
@@ -1255,7 +1255,7 @@
        dsym->s_type->t_isfield = 1;
        dsym->s_type->t_flen = len;
        dsym->s_field = 1;
-       return (dsym);
+       return dsym;
 }
 
 /*
@@ -1274,7 +1274,7 @@
                for (p = p2; p->p_nxt != NULL; p = p->p_nxt)
                        continue;
                p->p_nxt = p1;
-               return (p2);
+               return p2;



Home | Main Index | Thread Index | Old Index