version 1.1.1.2, 2000/09/09 14:12:54 |
version 1.1.1.3, 2003/08/25 16:06:33 |
|
|
i.e. 0xhh...h means base 16, 0oo...o means base 8, otherwise |
i.e. 0xhh...h means base 16, 0oo...o means base 8, otherwise |
assume base 10. |
assume base 10. |
|
|
Copyright (C) 1991, 1993, 1994, 1995, 2000 Free Software Foundation, Inc. |
Copyright 1991, 1993, 1994, 1995, 2000, 2001, 2002 Free Software Foundation, |
|
Inc. |
|
|
This file is part of the GNU MP Library. |
This file is part of the GNU MP Library. |
|
|
Line 28 MA 02111-1307, USA. */ |
|
Line 29 MA 02111-1307, USA. */ |
|
#include "gmp-impl.h" |
#include "gmp-impl.h" |
|
|
int |
int |
#if __STDC__ |
|
mpz_init_set_str (mpz_ptr x, const char *str, int base) |
mpz_init_set_str (mpz_ptr x, const char *str, int base) |
#else |
|
mpz_init_set_str (x, str, base) |
|
mpz_ptr x; |
|
const char *str; |
|
int base; |
|
#endif |
|
{ |
{ |
x->_mp_alloc = 1; |
x->_mp_alloc = 1; |
x->_mp_d = (mp_ptr) (*_mp_allocate_func) (BYTES_PER_MP_LIMB); |
x->_mp_d = (mp_ptr) (*__gmp_allocate_func) (BYTES_PER_MP_LIMB); |
|
|
/* if str has no digits mpz_set_str leaves x->_mp_size unset */ |
/* if str has no digits mpz_set_str leaves x->_mp_size unset */ |
x->_mp_size = 0; |
x->_mp_size = 0; |
|
|
|
#ifdef __CHECKER__ |
|
/* let the low limb look initialized, for the benefit of mpz_get_ui etc */ |
|
x->_mp_d[0] = 0; |
|
#endif |
|
|
return mpz_set_str (x, str, base); |
return mpz_set_str (x, str, base); |
} |
} |