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: reduce indentation and braces in m...
details:   https://anonhg.NetBSD.org/src/rev/b39eaa27fee7
branches:  trunk
changeset: 1019788:b39eaa27fee7
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Mar 20 13:22:06 2021 +0000
description:
lint: reduce indentation and braces in merge_type_specifiers
No functional change.
diffstat:
 usr.bin/xlint/lint1/decl.c |  31 +++++++++++++++----------------
 1 files changed, 15 insertions(+), 16 deletions(-)
diffs (52 lines):
diff -r 18f29955a76f -r b39eaa27fee7 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sat Mar 20 13:06:05 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sat Mar 20 13:22:06 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.150 2021/03/20 13:06:05 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.151 2021/03/20 13:22:06 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.150 2021/03/20 13:06:05 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.151 2021/03/20 13:22:06 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -870,20 +870,19 @@
 merge_type_specifiers(tspec_t t, tspec_t s)
 {
 
-       if (s == SIGNED || s == UNSIGN) {
-               if (t == CHAR) {
-                       t = s == SIGNED ? SCHAR : UCHAR;
-               } else if (t == SHORT) {
-                       t = s == SIGNED ? SHORT : USHORT;
-               } else if (t == INT) {
-                       t = s == SIGNED ? INT : UINT;
-               } else if (t == LONG) {
-                       t = s == SIGNED ? LONG : ULONG;
-               } else if (t == QUAD) {
-                       t = s == SIGNED ? QUAD : UQUAD;
-               }
-       }
-
+       if (s != SIGNED && s != UNSIGN)
+               return t;
+
+       if (t == CHAR)
+               return s == SIGNED ? SCHAR : UCHAR;
+       if (t == SHORT)
+               return s == SIGNED ? SHORT : USHORT;
+       if (t == INT)
+               return s == SIGNED ? INT : UINT;
+       if (t == LONG)
+               return s == SIGNED ? LONG : ULONG;
+       if (t == QUAD)
+               return s == SIGNED ? QUAD : UQUAD;
        return t;
 }
 
Home |
Main Index |
Thread Index |
Old Index