diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2020-02-14 19:17:35 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2020-02-14 19:17:35 +0000 |
commit | bc4062bb18aea0a207a6548f253569ad526be7b1 (patch) | |
tree | 2b64c0ad313ddcd984dea2192d436399477a92ed | |
parent | 3306acf9cb9b6fe591d34780d838f8f88c7f09bb (diff) |
no need to declare "extern optarg" and "extern optind"
when <unistd.h> is included;
patch from Jan Stary <hans at stare dot cz>;
OK millert
-rw-r--r-- | games/fortune/strfile/strfile.c | 4 | ||||
-rw-r--r-- | games/hunt/hunt/hunt.c | 4 | ||||
-rw-r--r-- | games/hunt/huntd/driver.c | 4 | ||||
-rw-r--r-- | games/robots/main.c | 3 | ||||
-rw-r--r-- | regress/lib/libc/db/dbtest.c | 4 | ||||
-rw-r--r-- | regress/lib/libc/getaddrinfo/gaitest.c | 4 | ||||
-rw-r--r-- | regress/lib/libc/regex/main.c | 4 | ||||
-rw-r--r-- | regress/lib/libutil/fmt_scaled/fmt_test.c | 4 |
8 files changed, 8 insertions, 23 deletions
diff --git a/games/fortune/strfile/strfile.c b/games/fortune/strfile/strfile.c index 76623d0d458..cee8c248c36 100644 --- a/games/fortune/strfile/strfile.c +++ b/games/fortune/strfile/strfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strfile.c,v 1.29 2017/06/04 13:39:25 fcambus Exp $ */ +/* $OpenBSD: strfile.c,v 1.30 2020/02/14 19:17:33 schwarze Exp $ */ /* $NetBSD: strfile.c,v 1.4 1995/04/24 12:23:09 cgd Exp $ */ /*- @@ -252,8 +252,6 @@ main(int ac, char *av[]) void getargs(int argc, char *argv[]) { - extern char *optarg; - extern int optind; int ch; while ((ch = getopt(argc, argv, "c:hiorsx")) != -1) { diff --git a/games/hunt/hunt/hunt.c b/games/hunt/hunt/hunt.c index f0e3af65eb6..4de62e353a9 100644 --- a/games/hunt/hunt/hunt.c +++ b/games/hunt/hunt/hunt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hunt.c,v 1.22 2017/04/08 22:50:41 gsoares Exp $ */ +/* $OpenBSD: hunt.c,v 1.23 2020/02/14 19:17:33 schwarze Exp $ */ /* $NetBSD: hunt.c,v 1.8 1998/09/13 15:27:28 hubertf Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. @@ -85,8 +85,6 @@ int main(int ac, char **av) { int c; - extern int optind; - extern char *optarg; long enter_status; int option; struct servent *se; diff --git a/games/hunt/huntd/driver.c b/games/hunt/huntd/driver.c index a854f92b88d..2efec81aaab 100644 --- a/games/hunt/huntd/driver.c +++ b/games/hunt/huntd/driver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: driver.c,v 1.29 2017/01/21 08:22:57 krw Exp $ */ +/* $OpenBSD: driver.c,v 1.30 2020/02/14 19:17:33 schwarze Exp $ */ /* $NetBSD: driver.c,v 1.5 1997/10/20 00:37:16 lukem Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. @@ -80,8 +80,6 @@ main(int ac, char **av) static fd_set read_fds; static FLAG first = TRUE; static FLAG server = FALSE; - extern int optind; - extern char *optarg; extern char *__progname; int c; static struct timeval linger = { 0, 0 }; diff --git a/games/robots/main.c b/games/robots/main.c index be6ef3151b7..76454474b76 100644 --- a/games/robots/main.c +++ b/games/robots/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.28 2019/06/28 13:32:52 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.29 2020/02/14 19:17:33 schwarze Exp $ */ /* $NetBSD: main.c,v 1.5 1995/04/22 10:08:54 cgd Exp $ */ /* @@ -56,7 +56,6 @@ main(int ac, char *av[]) int score_err = 0; /* hold errno from score file open */ int ch; int ret; - extern int optind; char *home; #ifdef FANCY char *sp; diff --git a/regress/lib/libc/db/dbtest.c b/regress/lib/libc/db/dbtest.c index 6a79e4c1875..57bb900f7a6 100644 --- a/regress/lib/libc/db/dbtest.c +++ b/regress/lib/libc/db/dbtest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dbtest.c,v 1.16 2017/07/27 15:08:37 bluhm Exp $ */ +/* $OpenBSD: dbtest.c,v 1.17 2020/02/14 19:17:33 schwarze Exp $ */ /* $NetBSD: dbtest.c,v 1.8 1996/05/03 21:57:48 cgd Exp $ */ /*- @@ -76,8 +76,6 @@ int XXlineno; /* Fast breakpoint for gdb. */ int main(int argc, char *argv[]) { - extern int optind; - extern char *optarg; enum S command, state; DB *dbp; DBT data, key, keydata; diff --git a/regress/lib/libc/getaddrinfo/gaitest.c b/regress/lib/libc/getaddrinfo/gaitest.c index 12a44984599..2508c05e020 100644 --- a/regress/lib/libc/getaddrinfo/gaitest.c +++ b/regress/lib/libc/getaddrinfo/gaitest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gaitest.c,v 1.6 2009/06/09 18:15:08 phessler Exp $ */ +/* $OpenBSD: gaitest.c,v 1.7 2020/02/14 19:17:33 schwarze Exp $ */ /* $NetBSD: gaitest.c,v 1.3 2002/07/05 15:47:43 itojun Exp $ */ /* @@ -119,8 +119,6 @@ main(argc, argv) struct addrinfo *res; int error, i; char *p, *q; - extern int optind; - extern char *optarg; int c; char nbuf[10]; diff --git a/regress/lib/libc/regex/main.c b/regress/lib/libc/regex/main.c index d6787d88fc4..50c3f7589e0 100644 --- a/regress/lib/libc/regex/main.c +++ b/regress/lib/libc/regex/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.10 2016/07/13 06:17:11 guenther Exp $ */ +/* $OpenBSD: main.c,v 1.11 2020/02/14 19:17:34 schwarze Exp $ */ /* $NetBSD: main.c,v 1.2 1995/04/20 22:39:51 cgd Exp $ */ #include <stdio.h> @@ -41,8 +41,6 @@ main(int argc, char *argv[]) int c; int errflg = 0; register int i; - extern int optind; - extern char *optarg; progname = argv[0]; diff --git a/regress/lib/libutil/fmt_scaled/fmt_test.c b/regress/lib/libutil/fmt_scaled/fmt_test.c index 947d403440c..fd9d1c81bfb 100644 --- a/regress/lib/libutil/fmt_scaled/fmt_test.c +++ b/regress/lib/libutil/fmt_scaled/fmt_test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fmt_test.c,v 1.15 2017/03/16 02:42:31 dtucker Exp $ */ +/* $OpenBSD: fmt_test.c,v 1.16 2020/02/14 19:17:34 schwarze Exp $ */ /* * Combined tests for fmt_scaled and scan_scaled. @@ -36,8 +36,6 @@ __dead static void usage(int stat) int main(int argc, char **argv) { - extern char *optarg; - extern int optind; int i, ch; while ((ch = getopt(argc, argv, "hv")) != -1) { |