[PATCH 01/20] Delete mpn/generic/sizeinbase.c

Torbjorn Granlund tg at gmplib.org
Thu Jan 2 10:21:43 UTC 2014

nisse at lysator.liu.se (Niels Möller) writes:

  Torbjorn Granlund <tg at gmplib.org> writes:
  > Checked old mail, but it is only mentioned 7 months earlier, when Kevin
  > aded it.  It does not make sense as an internal function, the
  > MPN_SIZEINBASE macro plays its role.
  > I suppose we could preserve it, and make it public.
  Below a patch to that effect. I think it's good to make this function
  public. Needs documentation. *Maybe* it doesn't need its own tests, since
  it's the same as mpz_sizeinbase but with different argument type.
  diff -r ffe8c8da8c90 configure.ac
  --- a/configure.ac	Wed Jan 01 16:45:58 2014 +0100
  +++ b/configure.ac	Wed Jan 01 23:07:15 2014 +0100
  @@ -2800,7 +2800,8 @@
     mul mul_fft mul_n sqr mul_basecase sqr_basecase nussbaumer_mul	   \
     mulmid_basecase toom42_mulmid mulmid_n mulmid				   \
     random random2 pow_1							   \
  -  rootrem sqrtrem get_str set_str scan0 scan1 popcount hamdist cmp	   \
  +  rootrem sqrtrem sizeinbase get_str set_str				   \
  +  scan0 scan1 popcount hamdist cmp					   \
     perfsqr perfpow							   \
     gcd_1 gcd gcdext_1 gcdext gcd_subdiv_step				   \
     gcdext_lehmer								   \
  diff -r ffe8c8da8c90 gmp-h.in
  --- a/gmp-h.in	Wed Jan 01 16:45:58 2014 +0100
  +++ b/gmp-h.in	Wed Jan 01 23:07:15 2014 +0100
  @@ -1575,6 +1575,9 @@
   #define mpn_set_str __MPN(set_str)
   __GMP_DECLSPEC mp_size_t mpn_set_str (mp_ptr, const unsigned char *, size_t, int);
  +#define mpn_sizeinbase __MPN(sizeinbase)
  +__GMP_DECLSPEC size_t mpn_sizeinbase (mp_srcptr, mp_size_t, int);
   #define mpn_sqrtrem __MPN(sqrtrem)
   __GMP_DECLSPEC mp_size_t mpn_sqrtrem (mp_ptr, mp_ptr, mp_srcptr, mp_size_t);

This makes sense to me.  Please apply (and please write documentation!).

Please encrypt, key id 0xC8601622

More information about the gmp-devel mailing list