summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2003-03-26 10:01:02 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2003-03-26 10:01:02 +0000
commitda7e020cc83099ec84b97885a5f99baeb70e99c7 (patch)
treef91454b4accc821a49c544fe113c6838ca627685
parent133dd811b96ef442ba4270210f922f6195db17d0 (diff)
downloadmpfr-da7e020cc83099ec84b97885a5f99baeb70e99c7.tar.gz
changed back "unsigned char *" to "char *"
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2278 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--mpfr.h6
-rw-r--r--mpfr.texi6
-rw-r--r--set_str.c10
-rw-r--r--set_str_raw.c8
4 files changed, 16 insertions, 14 deletions
diff --git a/mpfr.h b/mpfr.h
index d422d348d..4d328706e 100644
--- a/mpfr.h
+++ b/mpfr.h
@@ -175,9 +175,9 @@ void mpfr_clear _PROTO ((mpfr_ptr));
void mpfr_nextabove _PROTO ((mpfr_ptr));
void mpfr_nextbelow _PROTO ((mpfr_ptr));
void mpfr_nexttoward _PROTO ((mpfr_ptr, mpfr_srcptr));
-void mpfr_set_str_raw _PROTO ((mpfr_ptr, __gmp_const unsigned char *));
-int mpfr_set_str _PROTO ((mpfr_ptr, __gmp_const unsigned char *, int, mp_rnd_t));
-int mpfr_init_set_str _PROTO ((mpfr_ptr, __gmp_const unsigned char *, int, mp_rnd_t));
+void mpfr_set_str_raw _PROTO ((mpfr_ptr, __gmp_const char *));
+int mpfr_set_str _PROTO ((mpfr_ptr, __gmp_const char *, int, mp_rnd_t));
+int mpfr_init_set_str _PROTO ((mpfr_ptr, __gmp_const char *, int, mp_rnd_t));
char* mpfr_get_str _PROTO ((char *, mp_exp_t *, int, size_t, mpfr_srcptr, mp_rnd_t));
#ifdef _MPFR_H_HAVE_FILE
size_t mpfr_inp_str _PROTO ((mpfr_ptr, FILE *, int, mp_rnd_t));
diff --git a/mpfr.texi b/mpfr.texi
index b2c4a244f..a8915657b 100644
--- a/mpfr.texi
+++ b/mpfr.texi
@@ -806,7 +806,7 @@ width of the long double type; the @code{mpfr_set_ld} function assumes
it has at most 113 bits, and an exponent of at most 15 bits.
@end deftypefun
-@deftypefun int mpfr_set_str (mpfr_t @var{x}, const unsigned char *@var{s}, int @var{base}, mp_rnd_t @var{rnd})
+@deftypefun int mpfr_set_str (mpfr_t @var{x}, const char *@var{s}, int @var{base}, mp_rnd_t @var{rnd})
Set @var{x} to the value of the string @var{s} in base @var{base} (between
2 and 36), rounded in direction @var{rnd} to the precision of @var{x}.
See the documentation of @code{mpfr_inp_str} for a detailed description
@@ -818,7 +818,7 @@ Special values can be read as follows: @code{NaN}, @code{Inf}, @code{+Inf}
and @code{-Inf} (possibly in lower case when the base is less than 24).
@end deftypefun
-@deftypefun void mpfr_set_str_raw (mpfr_t @var{x}, const unsigned char *@var{s})
+@deftypefun void mpfr_set_str_raw (mpfr_t @var{x}, const char *@var{s})
Set @var{x} to the value of the binary number in string @var{s}, which has to
be of the
form +/-xxxx.xxxxxxEyy. The exponent is read in decimal, but is interpreted
@@ -872,7 +872,7 @@ The return value if zero if @var{rop}=@var{op}, positive if @var{rop}>@var{op},
and negative when @var{rop}<@var{op}.
@end deftypefn
-@deftypefun int mpfr_init_set_str (mpfr_t @var{x}, const unsigned char *@var{s}, int @var{base}, mp_rnd_t @var{rnd})
+@deftypefun int mpfr_init_set_str (mpfr_t @var{x}, const char *@var{s}, int @var{base}, mp_rnd_t @var{rnd})
Initialize @var{x} and set its value from
the string @var{s} in base @var{base},
rounded to direction @var{rnd}.
diff --git a/set_str.c b/set_str.c
index a017a9f7c..6197bee24 100644
--- a/set_str.c
+++ b/set_str.c
@@ -68,7 +68,7 @@ digit_value_in_base (int c, int base)
mpf_set_str)
*/
int
-mpfr_set_str (mpfr_t x, __gmp_const unsigned char *str, int base, mp_rnd_t rnd)
+mpfr_set_str (mpfr_t x, __gmp_const char *str, int base, mp_rnd_t rnd)
{
mp_limb_t *y; /* current value of x */
mp_exp_t exp_y; /* such as x = y*base^exp_y */
@@ -81,9 +81,9 @@ mpfr_set_str (mpfr_t x, __gmp_const unsigned char *str, int base, mp_rnd_t rnd)
mantissa 0.xxx...xxx */
mp_exp_t binexp = 0; /* binary exponent (for base 16) */
mp_exp_t prec_x; /* working precision for x */
- unsigned char *str1; /* copy of str */
+ char *str1; /* copy of str */
size_t size_str1; /* number of characters in str1 */
- unsigned char *mant_s; /* pointer in str1 */
+ char *mant_s; /* pointer in str1 */
int negative; /* 1 if str<=0, 0 otherwise */
size_t i, j;
long err = 0;
@@ -216,7 +216,7 @@ mpfr_set_str (mpfr_t x, __gmp_const unsigned char *str, int base, mp_rnd_t rnd)
pr = prec_s;
/* convert str into binary */
- i = mpn_set_str (y, mant_s, pr, base);
+ i = mpn_set_str (y, (unsigned char *) mant_s, pr, base);
/* normalize y */
count_leading_zeros (j, *(y + i - 1));
@@ -377,7 +377,7 @@ mpfr_set_str (mpfr_t x, __gmp_const unsigned char *str, int base, mp_rnd_t rnd)
}
int
-mpfr_init_set_str (mpfr_ptr x, __gmp_const unsigned char *str, int base, mp_rnd_t rnd)
+mpfr_init_set_str (mpfr_ptr x, __gmp_const char *str, int base, mp_rnd_t rnd)
{
mpfr_init (x);
return mpfr_set_str (x, str, base, rnd);
diff --git a/set_str_raw.c b/set_str_raw.c
index 86c7b5e0f..9b455920b 100644
--- a/set_str_raw.c
+++ b/set_str_raw.c
@@ -33,11 +33,13 @@ MA 02111-1307, USA. */
to hold all the bits of str. */
void
-mpfr_set_str_raw (mpfr_ptr x, __gmp_const unsigned char *str)
+mpfr_set_str_raw (mpfr_ptr x, __gmp_const char *str)
{
char *str2, *str0, negative = 0;
- unsigned long j, l, k = 0, xsize, cnt, alloc; mp_limb_t *xp;
- long expn = 0, e; char *endstr2;
+ unsigned long j, l, k = 0, xsize, cnt, alloc;
+ mp_limb_t *xp;
+ long expn = 0, e;
+ char *endstr2;
xp = MPFR_MANT(x);
xsize = 1 + (MPFR_PREC(x) - 1) / BITS_PER_MP_LIMB;