sim: use libiberty countargv in more places

A bunch of places open code the countargv implementation, or outright
duplicate it (as count_argc).  Replace all of those w/countargv.
This commit is contained in:
Mike Frysinger
2016-01-03 01:40:46 -05:00
parent aba6f46b23
commit 34fed69938
12 changed files with 44 additions and 65 deletions

View File

@@ -1,3 +1,8 @@
2016-01-03 Mike Frysinger <vapier@gentoo.org>
* sim-options.c (sim_parse_args): Replace for loop with a call
to countargv.
2016-01-03 Mike Frysinger <vapier@gentoo.org>
* nrun.c (myname): Mark const.

View File

@@ -474,8 +474,7 @@ sim_parse_args (SIM_DESC sd, char **argv)
SIM_RC result = SIM_RC_OK;
/* Count the number of arguments. */
for (argc = 0; argv[argc] != NULL; ++argc)
continue;
argc = countargv (argv);
/* Count the number of options. */
num_opts = 0;