[Gmp-commit] /var/hg/gmp: gmp-h.in (__gmp_const): Remove.
mercurial at gmplib.org
mercurial at gmplib.org
Sun Mar 4 19:32:26 CET 2012
details: /var/hg/gmp/rev/d287cfaf6732
changeset: 14729:d287cfaf6732
user: Marco Bodrato <bodrato at mail.dm.unipi.it>
date: Sun Mar 04 19:27:57 2012 +0100
description:
gmp-h.in (__gmp_const): Remove.
diffstat:
ChangeLog | 3 +-
demos/expr/expr-impl.h | 14 +++++-----
demos/expr/expr.c | 6 ++--
demos/expr/expr.h | 20 +++++++-------
demos/expr/exprf.c | 10 +++---
demos/expr/exprfa.c | 6 ++--
demos/expr/exprq.c | 10 +++---
demos/expr/exprqa.c | 6 ++--
demos/expr/exprz.c | 10 +++---
demos/expr/exprza.c | 6 ++--
gmp-h.in | 67 +++++++++++++++++++++++--------------------------
11 files changed, 78 insertions(+), 80 deletions(-)
diffs (truncated from 563 to 300 lines):
diff -r 7c3a4a2d0d0b -r d287cfaf6732 ChangeLog
--- a/ChangeLog Sun Mar 04 11:26:53 2012 +0100
+++ b/ChangeLog Sun Mar 04 19:27:57 2012 +0100
@@ -4,9 +4,10 @@
* tests/mpz/t-invert.c: Avoid testing mod 0.
* doc/gmp.texi (mpz_invert): Specify mod 0 is not handled.
- * gmp-h.in (__gmp_signed): Remove.
+ * gmp-h.in (__gmp_signed, __gmp_const): Remove.
(__GMP_HAVE_TOKEN_PASTE, __GMP_HAVE_CONST): Remove.
* gmp-impl.h: Strip __GMP_HAVE_TOKEN_PASTE and __GMP_HAVE_CONST.
+ * demos/expr/: Strip __gmp_const usage from all files.
* tests/mpz/t-powm.c (allsizes_seen): Require unsigned*.
diff -r 7c3a4a2d0d0b -r d287cfaf6732 demos/expr/expr-impl.h
--- a/demos/expr/expr-impl.h Sun Mar 04 11:26:53 2012 +0100
+++ b/demos/expr/expr-impl.h Sun Mar 04 19:27:57 2012 +0100
@@ -53,7 +53,7 @@
};
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 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 @@
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 -r 7c3a4a2d0d0b -r d287cfaf6732 demos/expr/expr.c
--- a/demos/expr/expr.c Sun Mar 04 11:26:53 2012 +0100
+++ b/demos/expr/expr.c Sun Mar 04 19:27:57 2012 +0100
@@ -136,7 +136,7 @@
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 @@
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 @@
/* "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 -r 7c3a4a2d0d0b -r d287cfaf6732 demos/expr/expr.h
--- a/demos/expr/expr.h Sun Mar 04 11:26:53 2012 +0100
+++ b/demos/expr/expr.h Sun Mar 04 19:27:57 2012 +0100
@@ -101,23 +101,23 @@
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 -r 7c3a4a2d0d0b -r d287cfaf6732 demos/expr/exprf.c
--- a/demos/expr/exprf.c Sun Mar 04 11:26:53 2012 +0100
+++ b/demos/expr/exprf.c Sun Mar 04 19:27:57 2012 +0100
@@ -34,7 +34,7 @@
}
-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 @@
{ 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 @@
#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 -r 7c3a4a2d0d0b -r d287cfaf6732 demos/expr/exprfa.c
--- a/demos/expr/exprfa.c Sun Mar 04 11:26:53 2012 +0100
+++ b/demos/expr/exprfa.c Sun Mar 04 19:27:57 2012 +0100
@@ -35,7 +35,7 @@
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 @@
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 -r 7c3a4a2d0d0b -r d287cfaf6732 demos/expr/exprq.c
--- a/demos/expr/exprq.c Sun Mar 04 11:26:53 2012 +0100
+++ b/demos/expr/exprq.c Sun Mar 04 19:27:57 2012 +0100
@@ -72,7 +72,7 @@
}
-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 @@
{ 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 @@
#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 -r 7c3a4a2d0d0b -r d287cfaf6732 demos/expr/exprqa.c
--- a/demos/expr/exprqa.c Sun Mar 04 11:26:53 2012 +0100
+++ b/demos/expr/exprqa.c Sun Mar 04 19:27:57 2012 +0100
@@ -46,7 +46,7 @@
/* 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 @@
}
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 -r 7c3a4a2d0d0b -r d287cfaf6732 demos/expr/exprz.c
--- a/demos/expr/exprz.c Sun Mar 04 11:26:53 2012 +0100
+++ b/demos/expr/exprz.c Sun Mar 04 19:27:57 2012 +0100
@@ -86,7 +86,7 @@
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 @@
/* 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 @@
#else
mpz_ptr res;
More information about the gmp-commit
mailing list