Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/xlint lint: simplify code for adding '-l' and ...



details:   https://anonhg.NetBSD.org/src/rev/55d96fb23063
branches:  trunk
changeset: 985335:55d96fb23063
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Aug 19 16:15:31 2021 +0000

description:
lint: simplify code for adding '-l' and '-L' to libraries

No functional change.

diffstat:

 usr.bin/xlint/xlint/xlint.c |  18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diffs (45 lines):

diff -r 9885e9e1cac8 -r 55d96fb23063 usr.bin/xlint/xlint/xlint.c
--- a/usr.bin/xlint/xlint/xlint.c       Thu Aug 19 16:05:56 2021 +0000
+++ b/usr.bin/xlint/xlint/xlint.c       Thu Aug 19 16:15:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.74 2021/08/19 16:05:56 rillig Exp $ */
+/* $NetBSD: xlint.c,v 1.75 2021/08/19 16:15:31 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: xlint.c,v 1.74 2021/08/19 16:05:56 rillig Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.75 2021/08/19 16:15:31 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -554,22 +554,16 @@
                if (arg[0] == '-') {
                        char ***list;
 
-                       list = NULL;    /* XXXGCC -Wuninitialized */
-
                        /* option */
-                       switch (arg[1]) {
-                       case 'l':
+                       if (arg[1] == 'l')
                                list = &libs;
-                               break;
-
-                       case 'L':
+                       else if (arg[1] == 'L')
                                list = &libsrchpath;
-                               break;
-
-                       default:
+                       else {
                                usage();
                                /* NOTREACHED */
                        }
+
                        if (arg[2] != '\0')
                                list_add_copy(list, arg + 2);
                        else if (argc > 1) {



Home | Main Index | Thread Index | Old Index