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: remove redundant parentheses aroun...



details:   https://anonhg.NetBSD.org/src/rev/3f70290e6fef
branches:  trunk
changeset: 979463:3f70290e6fef
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 29 12:29:03 2020 +0000

description:
lint: remove redundant parentheses around return value

diffstat:

 usr.bin/xlint/lint1/scan.l |  200 ++++++++++++++++++++++----------------------
 1 files changed, 100 insertions(+), 100 deletions(-)

diffs (truncated from 433 to 300 lines):

diff -r 7c9e67e86ae5 -r 3f70290e6fef usr.bin/xlint/lint1/scan.l
--- a/usr.bin/xlint/lint1/scan.l        Tue Dec 29 12:18:42 2020 +0000
+++ b/usr.bin/xlint/lint1/scan.l        Tue Dec 29 12:29:03 2020 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.96 2020/12/29 12:18:42 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.97 2020/12/29 12:29:03 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: scan.l,v 1.96 2020/12/29 12:18:42 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.97 2020/12/29 12:29:03 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -101,66 +101,66 @@
 
 %%
 
-{L}({L}|{D})*                  return (name());
-0[bB]{BD}+[lLuU]*              return (icon(2));
-0{OD}*[lLuU]*                  return (icon(8));
-{NZD}{D}*[lLuU]*               return (icon(10));
-0[xX]{HD}+[lLuU]*              return (icon(16));
+{L}({L}|{D})*                  return name();
+0[bB]{BD}+[lLuU]*              return icon(2);
+0{OD}*[lLuU]*                  return icon(8);
+{NZD}{D}*[lLuU]*               return icon(10);
+0[xX]{HD}+[lLuU]*              return icon(16);
 {D}+\.{D}*{EX}?{TL}    |
 {D}+{EX}{TL}           |
 0[xX]{HD}+\.{HD}*{HX}{TL} |
 0[xX]{HD}+{HX}{TL}     |
-\.{D}+{EX}?{TL}                return (fcon());
-"="                            return (operator(T_ASSIGN, ASSIGN));
-"*="                           return (operator(T_OPASS, MULASS));
-"/="                           return (operator(T_OPASS, DIVASS));
-"%="                           return (operator(T_OPASS, MODASS));
-"+="                           return (operator(T_OPASS, ADDASS));
-"-="                           return (operator(T_OPASS, SUBASS));
-"<<="                          return (operator(T_OPASS, SHLASS));
-">>="                          return (operator(T_OPASS, SHRASS));
-"&="                           return (operator(T_OPASS, ANDASS));
-"^="                           return (operator(T_OPASS, XORASS));
-"|="                           return (operator(T_OPASS, ORASS));
-"||"                           return (operator(T_LOGOR, LOGOR));
-"&&"                           return (operator(T_LOGAND, LOGAND));
-"|"                            return (operator(T_OR, OR));
-"&"                            return (operator(T_AND, AND));
-"^"                            return (operator(T_XOR, XOR));
-"=="                           return (operator(T_EQOP, EQ));
-"!="                           return (operator(T_EQOP, NE));
-"<"                            return (operator(T_RELOP, LT));
-">"                            return (operator(T_RELOP, GT));
-"<="                           return (operator(T_RELOP, LE));
-">="                           return (operator(T_RELOP, GE));
-"<<"                           return (operator(T_SHFTOP, SHL));
-">>"                           return (operator(T_SHFTOP, SHR));
-"++"                           return (operator(T_INCDEC, INC));
-"--"                           return (operator(T_INCDEC, DEC));
-"->"                           return (operator(T_STROP, ARROW));
-"."                            return (operator(T_STROP, POINT));
-"+"                            return (operator(T_ADDOP, PLUS));
-"-"                            return (operator(T_ADDOP, MINUS));
-"*"                            return (operator(T_MULT, MULT));
-"/"                            return (operator(T_DIVOP, DIV));
-"%"                            return (operator(T_DIVOP, MOD));
-"!"                            return (operator(T_UNOP, NOT));
-"~"                            return (operator(T_UNOP, COMPL));
-"\""                           return (string());
-"L\""                          return (wcstrg());
-";"                            return (T_SEMI);
-"{"                            return (T_LBRACE);
-"}"                            return (T_RBRACE);
-","                            return (T_COMMA);
-":"                            return (T_COLON);
-"?"                            return (T_QUEST);
-"["                            return (T_LBRACK);
-"]"                            return (T_RBRACK);
-"("                            return (T_LPARN);
-")"                            return (T_RPARN);
-"..."                          return (T_ELLIPSE);
-"'"                            return (ccon());
-"L'"                           return (wccon());
+\.{D}+{EX}?{TL}                return fcon();
+"="                            return operator(T_ASSIGN, ASSIGN);
+"*="                           return operator(T_OPASS, MULASS);
+"/="                           return operator(T_OPASS, DIVASS);
+"%="                           return operator(T_OPASS, MODASS);
+"+="                           return operator(T_OPASS, ADDASS);
+"-="                           return operator(T_OPASS, SUBASS);
+"<<="                          return operator(T_OPASS, SHLASS);
+">>="                          return operator(T_OPASS, SHRASS);
+"&="                           return operator(T_OPASS, ANDASS);
+"^="                           return operator(T_OPASS, XORASS);
+"|="                           return operator(T_OPASS, ORASS);
+"||"                           return operator(T_LOGOR, LOGOR);
+"&&"                           return operator(T_LOGAND, LOGAND);
+"|"                            return operator(T_OR, OR);
+"&"                            return operator(T_AND, AND);
+"^"                            return operator(T_XOR, XOR);
+"=="                           return operator(T_EQOP, EQ);
+"!="                           return operator(T_EQOP, NE);
+"<"                            return operator(T_RELOP, LT);
+">"                            return operator(T_RELOP, GT);
+"<="                           return operator(T_RELOP, LE);
+">="                           return operator(T_RELOP, GE);
+"<<"                           return operator(T_SHFTOP, SHL);
+">>"                           return operator(T_SHFTOP, SHR);
+"++"                           return operator(T_INCDEC, INC);
+"--"                           return operator(T_INCDEC, DEC);
+"->"                           return operator(T_STROP, ARROW);
+"."                            return operator(T_STROP, POINT);
+"+"                            return operator(T_ADDOP, PLUS);
+"-"                            return operator(T_ADDOP, MINUS);
+"*"                            return operator(T_MULT, MULT);
+"/"                            return operator(T_DIVOP, DIV);
+"%"                            return operator(T_DIVOP, MOD);
+"!"                            return operator(T_UNOP, NOT);
+"~"                            return operator(T_UNOP, COMPL);
+"\""                           return string();
+"L\""                          return wcstrg();
+";"                            return T_SEMI;
+"{"                            return T_LBRACE;
+"}"                            return T_RBRACE;
+","                            return T_COMMA;
+":"                            return T_COLON;
+"?"                            return T_QUEST;
+"["                            return T_LBRACK;
+"]"                            return T_RBRACK;
+"("                            return T_LPARN;
+")"                            return T_RPARN;
+"..."                          return T_ELLIPSE;
+"'"                            return ccon();
+"L'"                           return wccon();
 ^#.*$                          directive();
 \n                             incline();
 \t|" "|\f|\v                   ;
@@ -427,7 +427,7 @@
                sb = xmalloc(sizeof (sbuf_t));
                (void)memset(sb, 0, sizeof (*sb));
        }
-       return (sb);
+       return sb;
 }
 
 /*
@@ -453,7 +453,7 @@
 
        if ((c = input()) != EOF && (c &= CHAR_MASK) == '\n')
                incline();
-       return (c);
+       return c;
 }
 
 static int
@@ -467,7 +467,7 @@
                v = (v << sizeof (v)) + *us;
                v ^= v >> (sizeof (v) * CHAR_BIT - sizeof (v));
        }
-       return (v % HSHSIZ1);
+       return v % HSHSIZ1;
 }
 
 /*
@@ -499,7 +499,7 @@
        sb->sb_hash = hash(yytext);
        if ((sym = search(sb)) != NULL && sym->s_keyw) {
                freesb(sb);
-               return (keyw(sym));
+               return keyw(sym);
        }
 
        sb->sb_sym = sym;
@@ -519,7 +519,7 @@
        }
 
        yylval.y_sb = sb;
-       return (tok);
+       return tok;
 }
 
 static sym_t *
@@ -532,13 +532,13 @@
                        if (sym->s_keyw) {
                                struct kwtab *kw = sym->s_keyw;
                                if (!kw->kw_attr || attron)
-                                       return (sym);
+                                       return sym;
                        } else if (!attron && sym->s_kind == symtyp)
                                return sym;
                }
        }
 
-       return (NULL);
+       return NULL;
 }
 
 static int
@@ -553,7 +553,7 @@
        } else if (t == T_QUAL) {
                yylval.y_tqual = sym->s_tqual;
        }
-       return (t);
+       return t;
 }
 
 /*
@@ -753,7 +753,7 @@
        yylval.y_val->v_ansiu = ansiu;
        yylval.y_val->v_quad = (int64_t)uq;
 
-       return (T_CON);
+       return T_CON;
 }
 
 /*
@@ -767,8 +767,8 @@
 {
 
        if (t == PTR || tspec_is_uint(t))
-               return (0);
-       return (msb(q, t, len));
+               return 0;
+       return msb(q, t, len);
 }
 
 int
@@ -777,7 +777,7 @@
 
        if (len <= 0)
                len = size(t);
-       return ((q & qbmasks[len - 1]) != 0);
+       return (q & qbmasks[len - 1]) != 0;
 }
 
 /*
@@ -795,7 +795,7 @@
        } else {
                q |= qumasks[len];
        }
-       return (q);
+       return q;
 }
 
 /*
@@ -879,7 +879,7 @@
                yylval.y_val->v_ldbl = d;
        }
 
-       return (T_CON);
+       return T_CON;
 }
 
 static int
@@ -887,7 +887,7 @@
 {
 
        yylval.y_op = o;
-       return (t);
+       return t;
 }
 
 /*
@@ -930,7 +930,7 @@
        yylval.y_val->v_tspec = INT;
        yylval.y_val->v_quad = val;
 
-       return (T_CON);
+       return T_CON;
 }
 
 /*
@@ -977,7 +977,7 @@
        yylval.y_val->v_tspec = WCHAR;
        yylval.y_val->v_quad = wc;
 
-       return (T_CON);
+       return T_CON;
 }
 
 /*
@@ -1003,53 +1003,53 @@
                pbc = -1;
        }
        if (c == d)
-               return (-1);
+               return -1;
        switch (c) {
        case '\n':
                if (tflag) {
                        /* newline in string or char constant */
                        error(254);
-                       return (-2);
+                       return -2;
                }



Home | Main Index | Thread Index | Old Index