diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2012-03-04 19:27:57 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2012-03-04 19:27:57 +0100 |
commit | 181bfa62f2497ad5f799ccc2a8f9338d5c1b0c1b (patch) | |
tree | c1a2cecb81c9affdc7fc91280faf771f48d805c7 /demos | |
parent | a6647ab3624a70bd3f9d06a68190d20da1a1a814 (diff) | |
download | gmp-181bfa62f2497ad5f799ccc2a8f9338d5c1b0c1b.tar.gz |
gmp-h.in (__gmp_const): Remove.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/expr/expr-impl.h | 14 | ||||
-rw-r--r-- | demos/expr/expr.c | 6 | ||||
-rw-r--r-- | demos/expr/expr.h | 20 | ||||
-rw-r--r-- | demos/expr/exprf.c | 10 | ||||
-rw-r--r-- | demos/expr/exprfa.c | 6 | ||||
-rw-r--r-- | demos/expr/exprq.c | 10 | ||||
-rw-r--r-- | demos/expr/exprqa.c | 6 | ||||
-rw-r--r-- | demos/expr/exprz.c | 10 | ||||
-rw-r--r-- | demos/expr/exprza.c | 6 |
9 files changed, 44 insertions, 44 deletions
diff --git a/demos/expr/expr-impl.h b/demos/expr/expr-impl.h index 3461f7d37..aa2732b10 100644 --- a/demos/expr/expr-impl.h +++ b/demos/expr/expr-impl.h @@ -53,7 +53,7 @@ union mpX_t { }; typedef union mpX_t *mpX_ptr; -typedef __gmp_const union mpX_t *mpX_srcptr; +typedef const union mpX_t *mpX_srcptr; typedef void (*mpexpr_fun_one_t) (mpX_ptr); typedef unsigned long (*mpexpr_fun_ui_one_t) (mpX_ptr); @@ -76,31 +76,31 @@ typedef void (*mpexpr_fun_ternary_ui_t) (mpX_ptr, mpX_srcptr, mpX_srcptr, unsign typedef int (*mpexpr_fun_i_ternary_t) (mpX_srcptr, mpX_srcptr, mpX_srcptr); typedef int (*mpexpr_fun_i_ternary_ui_t) (mpX_srcptr, mpX_srcptr, unsigned long); -typedef size_t (*mpexpr_fun_number_t) (mpX_ptr, __gmp_const char *str, size_t len, int base); +typedef size_t (*mpexpr_fun_number_t) (mpX_ptr, const char *str, size_t len, int base); typedef void (*mpexpr_fun_swap_t) (mpX_ptr, mpX_ptr); typedef unsigned long (*mpexpr_fun_get_ui_t) (mpX_srcptr); typedef void (*mpexpr_fun_set_si_t) (mpX_srcptr, long); struct mpexpr_control_t { - __gmp_const struct mpexpr_operator_t *op; + const struct mpexpr_operator_t *op; int argcount; }; #define MPEXPR_VARIABLES 26 struct mpexpr_parse_t { - __gmp_const struct mpexpr_operator_t *table; + const struct mpexpr_operator_t *table; mpX_ptr res; int base; unsigned long prec; - __gmp_const char *e; + const char *e; size_t elen; mpX_srcptr *var; int error_code; int token; - __gmp_const struct mpexpr_operator_t *token_op; + const struct mpexpr_operator_t *token_op; union mpX_t *data_stack; int data_top; @@ -126,4 +126,4 @@ struct mpexpr_parse_t { int mpexpr_evaluate (struct mpexpr_parse_t *p); int mpexpr_va_to_var (void *var[], va_list ap); -size_t mpexpr_mpz_number (mpz_ptr res, __gmp_const char *e, size_t elen, int base); +size_t mpexpr_mpz_number (mpz_ptr res, const char *e, size_t elen, int base); diff --git a/demos/expr/expr.c b/demos/expr/expr.c index f78c32173..1788d2941 100644 --- a/demos/expr/expr.c +++ b/demos/expr/expr.c @@ -136,7 +136,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ static int lookahead (struct mpexpr_parse_t *p, int prefix) { - __gmp_const struct mpexpr_operator_t *op, *op_found; + const struct mpexpr_operator_t *op, *op_found; size_t oplen, oplen_found, wlen; int i; @@ -278,7 +278,7 @@ lookahead (struct mpexpr_parse_t *p, int prefix) a reference through CP. */ #define CONTROL_PUSH(opptr,args) \ do { \ - __gmp_const struct mpexpr_operator_t *op = opptr; \ + const struct mpexpr_operator_t *op = opptr; \ struct mpexpr_control_t *cp; \ CONTROL_SPACE (); \ p->control_top++; \ @@ -371,7 +371,7 @@ mpexpr_evaluate (struct mpexpr_parse_t *p) /* "done" is a special sentinel at the bottom of the control stack, precedence -1 is lower than any normal operator. */ { - static __gmp_const struct mpexpr_operator_t operator_done + static const struct mpexpr_operator_t operator_done = { "DONE", NULL, MPEXPR_TYPE_DONE, -1 }; p->control_alloc = 20; diff --git a/demos/expr/expr.h b/demos/expr/expr.h index 128150f86..eb9fc8f4c 100644 --- a/demos/expr/expr.h +++ b/demos/expr/expr.h @@ -101,23 +101,23 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ typedef void (*mpexpr_fun_t) (void); struct mpexpr_operator_t { - __gmp_const char *name; + const char *name; mpexpr_fun_t fun; int type; int precedence; }; -int mpf_expr_a (__gmp_const struct mpexpr_operator_t *, mpf_ptr, int, - unsigned long,__gmp_const char *, size_t, mpf_srcptr [26]); -int mpf_expr (mpf_ptr, int, __gmp_const char *, ...); +int mpf_expr_a (const struct mpexpr_operator_t *, mpf_ptr, int, + unsigned long,const char *, size_t, mpf_srcptr [26]); +int mpf_expr (mpf_ptr, int, const char *, ...); -int mpq_expr_a (__gmp_const struct mpexpr_operator_t *, mpq_ptr, - int, __gmp_const char *, size_t, mpq_srcptr [26]); -int mpq_expr (mpq_ptr, int, __gmp_const char *, ...); +int mpq_expr_a (const struct mpexpr_operator_t *, mpq_ptr, + int, const char *, size_t, mpq_srcptr [26]); +int mpq_expr (mpq_ptr, int, const char *, ...); -int mpz_expr_a (__gmp_const struct mpexpr_operator_t *, mpz_ptr, int, - __gmp_const char *, size_t, mpz_srcptr [26]); -int mpz_expr (mpz_ptr, int, __gmp_const char *, ...); +int mpz_expr_a (const struct mpexpr_operator_t *, mpz_ptr, int, + const char *, size_t, mpz_srcptr [26]); +int mpz_expr (mpz_ptr, int, const char *, ...); #endif diff --git a/demos/expr/exprf.c b/demos/expr/exprf.c index c67ee5178..777daec37 100644 --- a/demos/expr/exprf.c +++ b/demos/expr/exprf.c @@ -34,7 +34,7 @@ e_mpf_sgn (mpf_srcptr x) } -static __gmp_const struct mpexpr_operator_t _mpf_expr_standard_table[] = { +static const struct mpexpr_operator_t _mpf_expr_standard_table[] = { { "**", (mpexpr_fun_t) mpf_pow_ui, MPEXPR_TYPE_BINARY_UI | MPEXPR_TYPE_RIGHTASSOC, 220 }, @@ -88,13 +88,13 @@ static __gmp_const struct mpexpr_operator_t _mpf_expr_standard_table[] = { { NULL } }; -__gmp_const struct mpexpr_operator_t * __gmp_const mpf_expr_standard_table +const struct mpexpr_operator_t * const mpf_expr_standard_table = _mpf_expr_standard_table; int #if HAVE_STDARG -mpf_expr (mpf_ptr res, int base, __gmp_const char *e, ...) +mpf_expr (mpf_ptr res, int base, const char *e, ...) #else mpf_expr (va_alist) va_dcl @@ -108,11 +108,11 @@ mpf_expr (va_alist) #else mpf_ptr res; int base; - __gmp_const char *e; + const char *e; va_start (ap); res = va_arg (ap, mpf_ptr); base = va_arg (ap, int); - e = va_arg (ap, __gmp_const char *); + e = va_arg (ap, const char *); #endif TRACE (printf ("mpf_expr(): base %d, %s\n", base, e)); diff --git a/demos/expr/exprfa.c b/demos/expr/exprfa.c index 1cc00e0f0..4ab294e08 100644 --- a/demos/expr/exprfa.c +++ b/demos/expr/exprfa.c @@ -35,7 +35,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ static size_t -e_mpf_number (mpf_ptr res, __gmp_const char *e, size_t elen, int base) +e_mpf_number (mpf_ptr res, const char *e, size_t elen, int base) { char *edup; size_t i, ret, extra=0; @@ -151,9 +151,9 @@ e_mpf_set_or_swap (mpf_ptr w, mpf_ptr x) int -mpf_expr_a (__gmp_const struct mpexpr_operator_t *table, +mpf_expr_a (const struct mpexpr_operator_t *table, mpf_ptr res, int base, unsigned long prec, - __gmp_const char *e, size_t elen, + const char *e, size_t elen, mpf_srcptr var[26]) { struct mpexpr_parse_t p; diff --git a/demos/expr/exprq.c b/demos/expr/exprq.c index af91b0016..9b4b8574d 100644 --- a/demos/expr/exprq.c +++ b/demos/expr/exprq.c @@ -72,7 +72,7 @@ e_mpq_den (mpq_ptr w, mpq_srcptr x) } -static __gmp_const struct mpexpr_operator_t _mpq_expr_standard_table[] = { +static const struct mpexpr_operator_t _mpq_expr_standard_table[] = { { "**", (mpexpr_fun_t) e_mpq_pow_ui, MPEXPR_TYPE_BINARY_UI | MPEXPR_TYPE_RIGHTASSOC, 220 }, @@ -121,13 +121,13 @@ static __gmp_const struct mpexpr_operator_t _mpq_expr_standard_table[] = { { NULL } }; -__gmp_const struct mpexpr_operator_t * __gmp_const mpq_expr_standard_table +const struct mpexpr_operator_t * const mpq_expr_standard_table = _mpq_expr_standard_table; int #if HAVE_STDARG -mpq_expr (mpq_ptr res, int base, __gmp_const char *e, ...) +mpq_expr (mpq_ptr res, int base, const char *e, ...) #else mpq_expr (va_alist) va_dcl @@ -141,11 +141,11 @@ mpq_expr (va_alist) #else mpq_ptr res; int base; - __gmp_const char *e; + const char *e; va_start (ap); res = va_arg (ap, mpq_ptr); base = va_arg (ap, int); - e = va_arg (ap, __gmp_const char *); + e = va_arg (ap, const char *); #endif TRACE (printf ("mpq_expr(): base %d, %s\n", base, e)); diff --git a/demos/expr/exprqa.c b/demos/expr/exprqa.c index c56f1ca69..8eaf60248 100644 --- a/demos/expr/exprqa.c +++ b/demos/expr/exprqa.c @@ -46,7 +46,7 @@ e_mpq_set_si1 (mpq_ptr q, long num) /* The same as mpz, but putting the result in the numerator. Negatives and fractions aren't parsed here because '-' and '/' are operators. */ static size_t -e_mpq_number (mpq_ptr res, __gmp_const char *e, size_t elen, int base) +e_mpq_number (mpq_ptr res, const char *e, size_t elen, int base) { mpz_set_ui (mpq_denref (res), 1L); return mpexpr_mpz_number (mpq_numref (res), e, elen, base); @@ -61,9 +61,9 @@ e_mpq_init (mpq_ptr q, unsigned long prec) } int -mpq_expr_a (__gmp_const struct mpexpr_operator_t *table, +mpq_expr_a (const struct mpexpr_operator_t *table, mpq_ptr res, int base, - __gmp_const char *e, size_t elen, + const char *e, size_t elen, mpq_srcptr var[26]) { struct mpexpr_parse_t p; diff --git a/demos/expr/exprz.c b/demos/expr/exprz.c index 7c01b9dc5..ad5ee7dea 100644 --- a/demos/expr/exprz.c +++ b/demos/expr/exprz.c @@ -86,7 +86,7 @@ e_mpz_clrbit (mpz_ptr w, mpz_srcptr x, unsigned long n) mpz_clrbit (w, n); } -static __gmp_const struct mpexpr_operator_t _mpz_expr_standard_table[] = { +static const struct mpexpr_operator_t _mpz_expr_standard_table[] = { { "**", (mpexpr_fun_t) mpz_pow_ui, MPEXPR_TYPE_BINARY_UI | MPEXPR_TYPE_RIGHTASSOC, 220 }, @@ -172,13 +172,13 @@ static __gmp_const struct mpexpr_operator_t _mpz_expr_standard_table[] = { /* The table is available globally only through a pointer, so the table size can change without breaking binary compatibility. */ -__gmp_const struct mpexpr_operator_t * __gmp_const mpz_expr_standard_table +const struct mpexpr_operator_t * const mpz_expr_standard_table = _mpz_expr_standard_table; int #if HAVE_STDARG -mpz_expr (mpz_ptr res, int base, __gmp_const char *e, ...) +mpz_expr (mpz_ptr res, int base, const char *e, ...) #else mpz_expr (va_alist) va_dcl @@ -192,11 +192,11 @@ mpz_expr (va_alist) #else mpz_ptr res; int base; - __gmp_const char *e; + const char *e; va_start (ap); res = va_arg (ap, mpz_ptr); base = va_arg (ap, int); - e = va_arg (ap, __gmp_const char *); + e = va_arg (ap, const char *); #endif TRACE (printf ("mpz_expr(): base %d, %s\n", base, e)); diff --git a/demos/expr/exprza.c b/demos/expr/exprza.c index 81e16ce28..dc5442280 100644 --- a/demos/expr/exprza.c +++ b/demos/expr/exprza.c @@ -27,7 +27,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ /* No need to parse '-' since that's handled as an operator. This function also by mpq_expr_a, so it's not static. */ size_t -mpexpr_mpz_number (mpz_ptr res, __gmp_const char *e, size_t elen, int base) +mpexpr_mpz_number (mpz_ptr res, const char *e, size_t elen, int base) { char *edup; size_t i, ret; @@ -69,9 +69,9 @@ e_mpz_init (mpz_ptr z, unsigned long prec) } int -mpz_expr_a (__gmp_const struct mpexpr_operator_t *table, +mpz_expr_a (const struct mpexpr_operator_t *table, mpz_ptr res, int base, - __gmp_const char *e, size_t elen, + const char *e, size_t elen, mpz_srcptr var[26]) { struct mpexpr_parse_t p; |