diff options
author | Kevin Ryde <user42@zip.com.au> | 2004-05-10 01:27:34 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2004-05-10 01:27:34 +0200 |
commit | 1b751a8e4ee63b223b97e35a69f68b476f9806b2 (patch) | |
tree | 8cdc28aa1c83ed09896d42b1de42d7b68ac3ec18 /demos | |
parent | 05643760e994d1aefd0429c8565e2f67a8a4e20d (diff) | |
download | gmp-1b751a8e4ee63b223b97e35a69f68b476f9806b2.tar.gz |
* demos/expr/exprza.c, demos/expr/exprqa.c: Use wrappers for mpX_init,
to make parameters match.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/expr/exprqa.c | 17 | ||||
-rw-r--r-- | demos/expr/exprza.c | 10 |
2 files changed, 19 insertions, 8 deletions
diff --git a/demos/expr/exprqa.c b/demos/expr/exprqa.c index 0d9a63787..2fbabf1bc 100644 --- a/demos/expr/exprqa.c +++ b/demos/expr/exprqa.c @@ -1,7 +1,6 @@ -/* mpq expression evaluation */ +/* mpq expression evaluation -/* -Copyright 2000, 2001 Free Software Foundation, Inc. +Copyright 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -18,8 +17,7 @@ License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -MA 02111-1307, USA. -*/ +MA 02111-1307, USA. */ #include <stdio.h> @@ -57,6 +55,13 @@ e_mpq_number (mpq_ptr res, __gmp_const char *e, size_t elen, int base) } +/* ignoring prec */ +static void +e_mpq_init (mpq_ptr q, unsigned long prec) +{ + mpq_init (q); +} + int mpq_expr_a (__gmp_const struct mpexpr_operator_t *table, mpq_ptr res, int base, @@ -75,7 +80,7 @@ mpq_expr_a (__gmp_const struct mpexpr_operator_t *table, p.mpX_clear = (mpexpr_fun_one_t) mpq_clear; p.mpX_ulong_p = (mpexpr_fun_i_unary_t) e_mpq_ulong_p; p.mpX_get_ui = (mpexpr_fun_get_ui_t) e_mpq_get_ui_fits; - p.mpX_init = (mpexpr_fun_unary_ui_t) mpq_init; + p.mpX_init = (mpexpr_fun_unary_ui_t) e_mpq_init; p.mpX_number = (mpexpr_fun_number_t) e_mpq_number; p.mpX_set = (mpexpr_fun_unary_t) mpq_set; p.mpX_set_or_swap = (mpexpr_fun_unary_t) mpq_swap; diff --git a/demos/expr/exprza.c b/demos/expr/exprza.c index 3816ab5ae..bb3471eee 100644 --- a/demos/expr/exprza.c +++ b/demos/expr/exprza.c @@ -1,6 +1,6 @@ /* mpz expression evaluation -Copyright 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -63,6 +63,12 @@ mpexpr_mpz_number (mpz_ptr res, __gmp_const char *e, size_t elen, int base) return ret; } +/* ignoring prec */ +static void +e_mpz_init (mpz_ptr z, unsigned long prec) +{ + mpz_init (z); +} int mpz_expr_a (__gmp_const struct mpexpr_operator_t *table, @@ -82,7 +88,7 @@ mpz_expr_a (__gmp_const struct mpexpr_operator_t *table, p.mpX_clear = (mpexpr_fun_one_t) mpz_clear; p.mpX_ulong_p = (mpexpr_fun_i_unary_t) mpz_fits_ulong_p; p.mpX_get_ui = (mpexpr_fun_get_ui_t) mpz_get_ui; - p.mpX_init = (mpexpr_fun_unary_ui_t) mpz_init; + p.mpX_init = (mpexpr_fun_unary_ui_t) e_mpz_init; p.mpX_number = (mpexpr_fun_number_t) mpexpr_mpz_number; p.mpX_set = (mpexpr_fun_unary_t) mpz_set; p.mpX_set_or_swap = (mpexpr_fun_unary_t) mpz_swap; |