]> Savannah Git Hosting - gnulib.git/commit
getopt: merge from glibc: repetition reduction
authorZack Weinberg <zackw@panix.com>
Thu, 6 Apr 2017 18:14:14 +0000 (11:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 6 Apr 2017 22:42:03 +0000 (15:42 -0700)
commitd72c5a7bed87ea43863479657285c19dc968c1dd
treeb9716c476f2f0e193fa58f308ddc05238bc8edef
parentdcfe5a0e9cae998ae4e6480f357ff4af5e60fdf8
getopt: merge from glibc: repetition reduction

The definitions of the entry point functions 'getopt' and
'__posix_getopt' can be made substantially less repetitive with a
helper macro.

While I was merging the const-correctness changes from gnulib into
glibc I noticed there are still some unnecessary casts in
_getopt_internal_r.

* lib/getopt.c (getopt, __posix_getopt): Eliminate repetition with
a macro.  Consistently cast 'argv' to 'char **' when calling
_getopt_internal.
(_getopt_internal_r): Remove unnecessary casts when calling exchange.
ChangeLog
lib/getopt.c