X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnu%2Fstrtol.c;h=33d413ac7a523aba2758743d2b242d275579b3af;hb=daa269958ad8d50ef8154ccb65e58acaf7a6dd99;hp=aee2ece31ccf85bdc1199de8be3f843f42144f4d;hpb=ee168310ec4227174ace489bf5f81f8c2f91cde0;p=debian%2Ftar diff --git a/gnu/strtol.c b/gnu/strtol.c index aee2ece3..33d413ac 100644 --- a/gnu/strtol.c +++ b/gnu/strtol.c @@ -2,8 +2,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Convert string representation of a number into an integer value. - Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005, - 2006, 2007, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2013 Free Software + Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. @@ -42,7 +42,7 @@ # include "../locale/localeinfo.h" #endif -/* Nonzero if we are defining `strtoul' or `strtoull', operating on +/* Nonzero if we are defining 'strtoul' or 'strtoull', operating on unsigned integers. */ #ifndef UNSIGNED # define UNSIGNED 0 @@ -112,8 +112,8 @@ # endif #endif -/* If QUAD is defined, we are defining `strtoll' or `strtoull', - operating on `long long int's. */ +/* If QUAD is defined, we are defining 'strtoll' or 'strtoull', + operating on 'long long int's. */ #ifdef QUAD # define LONG long long # define STRTOL_LONG_MIN LLONG_MIN @@ -143,11 +143,11 @@ ? (t) 0 \ : TYPE_SIGNED_MAGNITUDE (t) \ ? ~ (t) 0 \ - : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) + : ~ TYPE_MAXIMUM (t))) # define TYPE_MAXIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) -1 \ - : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) # ifndef ULLONG_MAX # define ULLONG_MAX TYPE_MAXIMUM (unsigned long long) @@ -188,9 +188,8 @@ # define LOCALE_PARAM_PROTO #endif -#include - #ifdef USE_WIDE_CHAR +# include # include # define L_(Ch) L##Ch # define UCHAR_TYPE wint_t @@ -230,7 +229,7 @@ -/* Convert NPTR to an `unsigned long int' or `long int' in base BASE. +/* Convert NPTR to an 'unsigned long int' or 'long int' in base BASE. If BASE is 0 the base is determined by the presence of a leading zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. If BASE is < 2 or > 36, it is reset to 10. @@ -383,7 +382,7 @@ INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr, #if !UNSIGNED /* Check for a value that is within the range of - `unsigned LONG int', but outside the range of `LONG int'. */ + 'unsigned LONG int', but outside the range of 'LONG int'. */ if (overflow == 0 && i > (negative ? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1 @@ -408,7 +407,7 @@ noconv: /* We must handle a special case here: the base is 0 or 16 and the first two characters are '0' and 'x', but the rest are no hexadecimal digits. This is no error case. We return 0 and - ENDPTR points to the `x`. */ + ENDPTR points to the 'x'. */ if (endptr != NULL) { if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X')