=================================================================== RCS file: /home/cvs/OpenXM_contrib/gmp/mpz/Attic/set_str.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.3 diff -u -p -r1.1.1.2 -r1.1.1.3 --- OpenXM_contrib/gmp/mpz/Attic/set_str.c 2000/09/09 14:12:57 1.1.1.2 +++ OpenXM_contrib/gmp/mpz/Attic/set_str.c 2003/08/25 16:06:34 1.1.1.3 @@ -4,7 +4,7 @@ the base in the C standard way, i.e. 0xhh...h means base 16, 0oo...o means base 8, otherwise assume base 10. -Copyright (C) 1991, 1993, 1994, 1996, 1997, 1998, 2000 Free Software +Copyright 1991, 1993, 1994, 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -31,13 +31,7 @@ MA 02111-1307, USA. */ #include "longlong.h" static int -#if __STDC__ digit_value_in_base (int c, int base) -#else -digit_value_in_base (c, base) - int c; - int base; -#endif { int digit; @@ -56,14 +50,7 @@ digit_value_in_base (c, base) } int -#if __STDC__ mpz_set_str (mpz_ptr x, const char *str, int base) -#else -mpz_set_str (x, str, base) - mpz_ptr x; - const char *str; - int base; -#endif { size_t str_size; char *s, *begs; @@ -110,8 +97,8 @@ mpz_set_str (x, str, base) } } - /* Skip leading zeros. */ - while (c == '0') + /* Skip leading zeros and white space. */ + while (c == '0' || isspace (c)) c = *str++; /* Make sure the string does not become empty, mpn_set_str would fail. */ if (c == 0) @@ -144,7 +131,7 @@ mpz_set_str (x, str, base) str_size = s - begs; xsize = (((mp_size_t) (str_size / __mp_bases[base].chars_per_bit_exactly)) - / BITS_PER_MP_LIMB + 2); + / GMP_NUMB_BITS + 2); if (x->_mp_alloc < xsize) _mpz_realloc (x, xsize);