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: clean up option parsing



details:   https://anonhg.NetBSD.org/src/rev/417316131ed3
branches:  trunk
changeset: 961793:417316131ed3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Apr 18 20:15:17 2021 +0000

description:
lint: clean up option parsing

diffstat:

 usr.bin/xlint/lint1/main1.c |  6 ++----
 usr.bin/xlint/lint2/main2.c |  6 +++---
 2 files changed, 5 insertions(+), 7 deletions(-)

diffs (56 lines):

diff -r 2c83791e835b -r 417316131ed3 usr.bin/xlint/lint1/main1.c
--- a/usr.bin/xlint/lint1/main1.c       Sun Apr 18 20:02:56 2021 +0000
+++ b/usr.bin/xlint/lint1/main1.c       Sun Apr 18 20:15:17 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main1.c,v 1.43 2021/04/14 20:06:40 rillig Exp $        */
+/*     $NetBSD: main1.c,v 1.44 2021/04/18 20:15:17 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: main1.c,v 1.43 2021/04/14 20:06:40 rillig Exp $");
+__RCSID("$NetBSD: main1.c,v 1.44 2021/04/18 20:15:17 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -240,10 +240,8 @@
                                ERR_SET(msg, &msgset);
                        }
                        break;
-               case '?':
                default:
                        usage();
-                       break;
                }
        }
        argc -= optind;
diff -r 2c83791e835b -r 417316131ed3 usr.bin/xlint/lint2/main2.c
--- a/usr.bin/xlint/lint2/main2.c       Sun Apr 18 20:02:56 2021 +0000
+++ b/usr.bin/xlint/lint2/main2.c       Sun Apr 18 20:15:17 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main2.c,v 1.15 2021/04/02 12:16:50 rillig Exp $        */
+/*     $NetBSD: main2.c,v 1.16 2021/04/18 20:15:17 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: main2.c,v 1.15 2021/04/02 12:16:50 rillig Exp $");
+__RCSID("$NetBSD: main2.c,v 1.16 2021/04/18 20:15:17 rillig Exp $");
 #endif
 
 #include <stdio.h>
@@ -145,7 +145,7 @@
                        libs[i] = xstrdup(optarg);
                        libs[i + 1] = NULL;
                        break;
-               case '?':
+               default:
                        usage();
                }
        }



Home | Main Index | Thread Index | Old Index