Mercurial > hg > octave-kai > gnulib-hg
changeset 373:24ac1fb08009
.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Fri, 27 Jan 1995 05:22:23 +0000 |
parents | 066ee41f8e97 |
children | 077af6bf388f |
files | lib/getdate.y lib/strtod.c lib/xstrtol.c lib/xstrtol.h |
diffstat | 4 files changed, 21 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/getdate.y +++ b/lib/getdate.y @@ -585,10 +585,14 @@ case MERam: if (Hours < 1 || Hours > 12) return -1; + if (Hours == 12) + Hours = 0; return (Hours * 60L + Minutes) * 60L + Seconds; case MERpm: if (Hours < 1 || Hours > 12) return -1; + if (Hours == 12) + Hours = 0; return ((Hours + 12) * 60L + Minutes) * 60L + Seconds; default: abort ();
--- a/lib/strtod.c +++ b/lib/strtod.c @@ -19,6 +19,10 @@ #endif #include <errno.h> +#ifndef errno +extern int errno; +#endif + #include <ctype.h> #include <math.h> @@ -34,7 +38,6 @@ #include <string.h> #else #define NULL 0 -extern int errno; #ifndef HUGE_VAL #define HUGE_VAL HUGE #endif
--- a/lib/xstrtol.c +++ b/lib/xstrtol.c @@ -98,6 +98,7 @@ ++(*p); break; + case 'B': case 'k': BKM_SCALE (tmp, 1024, LONGINT_OVERFLOW); ++(*p);
--- a/lib/xstrtol.h +++ b/lib/xstrtol.h @@ -27,9 +27,9 @@ strtol_error __xstrtol __P ((const char *s, char **ptr, int base, - __unsigned long int *val, int allow_bkm_suffix)); + __unsigned long int *val, const char *valid_suffixes)); -#define STRTOL_FATAL_ERROR(str, argument_type_string, err) \ +#define _STRTOL_ERROR(exit_code, str, argument_type_string, err) \ do \ { \ switch ((err)) \ @@ -38,20 +38,27 @@ abort (); \ \ case LONGINT_INVALID: \ - error (2, 0, "invalid %s `%s'", (argument_type_string), (str));\ + error ((exit_code), 0, "invalid %s `%s'", \ + (argument_type_string), (str)); \ break; \ \ case LONGINT_INVALID_SUFFIX_CHAR: \ - error (2, 0, "invalid character following %s `%s'", \ + error ((exit_code), 0, "invalid character following %s `%s'", \ (argument_type_string), (str)); \ break; \ \ case LONGINT_OVERFLOW: \ - error (2, 0, "%s `%s' larger than maximum long int", \ + error ((exit_code), 0, "%s `%s' larger than maximum long int",\ (argument_type_string), (str)); \ break; \ } \ } \ while (0) +#define STRTOL_FATAL_ERROR(str, argument_type_string, err) \ + _STRTOL_ERROR (2, str, argument_type_string, err) + +#define STRTOL_FAIL_WARN(str, argument_type_string, err) \ + _STRTOL_ERROR (0, str, argument_type_string, err) + #endif /* _xstrtol_h_ */