diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-08-06 23:33:33 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-08-06 23:33:33 +0000 |
commit | 3d9f627799755b6588edd7ae1fba1d740179e595 (patch) | |
tree | dfd4b8df7aa40b7bc9cdd94835869cad2e965985 | |
parent | 22bc497dda9cf129165c5d704814a666ea4063c3 (diff) | |
download | fsf-binutils-gdb-3d9f627799755b6588edd7ae1fba1d740179e595.zip fsf-binutils-gdb-3d9f627799755b6588edd7ae1fba1d740179e595.tar.gz fsf-binutils-gdb-3d9f627799755b6588edd7ae1fba1d740179e595.tar.bz2 |
* lexsup.c (is_num): Reindent.
(parse_args): Mention program name in error message.
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/lexsup.c | 32 |
2 files changed, 24 insertions, 13 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index e9c7c5d..4c7f4f3 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,8 @@ 1999-08-06 Ian Lance Taylor <ian@zembu.com> + * lexsup.c (is_num): Reindent. + (parse_args): Mention program name in error message. + * emultempl/ostring.sed: Rename from stringify.sed. * emultempl/astring.sed: New file. * Makefile.am (stringify.sed): New target. @@ -18,7 +21,7 @@ 1999-08-05 Donn Terry <donn@interix.com> * emulparams/i386pe.sh: Define ENTRY, SUBSYSTEM, and - INITIAL_SYMBOL_CHAQR. + INITIAL_SYMBOL_CHAR. * emulparams/i386pe_posix.sh: New file. * Makefile.am (YACC): If bison is not in the source tree, use @YACC@ rather than bison -y. diff --git a/ld/lexsup.c b/ld/lexsup.c index 8f4785b..f8388ac 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -55,6 +55,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA that might disagree about consts. */ unsigned long strtoul (); +static int is_num PARAMS ((const char *, int, int, int)); static void set_default_dirlist PARAMS ((char *dirlist_ptr)); static void set_section_start PARAMS ((char *sect, char *valstr)); static void help PARAMS ((void)); @@ -371,22 +372,27 @@ static const struct ld_option ld_options[] = #define OPTION_COUNT ((int) (sizeof ld_options / sizeof ld_options[0])) -/* Test "string" for containing a string of digits that form a number -between "min" and "max". The return value is the number or "err". */ -static -int is_num( char *string, int min, int max, int err) +/* Test STRING for containing a string of digits that form a number + between MIN and MAX. The return value is the number or ERR. */ + +static int +is_num (string, min, max, err) + const char *string; + int min; + int max; + int err; { int result = 0; - for ( ; *string; ++string) - { - if (!isdigit(*string)) + for (; *string; ++string) { - result = err; - break; + if (! isdigit (*string)) + { + result = err; + break; + } + result = result * 10 + (*string - '0'); } - result = result * 10 + (*string - '0'); - } if (result < min || result > max) result = err; @@ -987,7 +993,9 @@ the GNU General Public License. This program has absolutely no warranty.\n")); words = is_num (optarg, 1, 10, 0); if (words == 0) { - fprintf (stderr, _("Invalid argument to option \"mpc860c0\"\n")); + fprintf (stderr, + _("%s: Invalid argument to option \"mpc860c0\"\n"), + program_name); xexit (1); } link_info.mpc860c0 = words * 4; /* convert words to bytes */ |