[Gmp-commit] /var/hg/gmp: Clean out __GMP_PROTO.

mercurial at gmplib.org mercurial at gmplib.org
Sat Mar 3 15:40:47 CET 2012


details:   /var/hg/gmp/rev/2e930396711c
changeset: 14714:2e930396711c
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Mar 03 15:40:45 2012 +0100
description:
Clean out __GMP_PROTO.

diffstat:

 ChangeLog                    |    6 +
 demos/expr/expr-impl.h       |   52 +-
 demos/expr/expr.h            |   26 +-
 demos/pexpr.c                |   26 +-
 demos/primes.c               |    6 +-
 gmp-h.in                     |  682 +++++++++++++++++++++---------------------
 gmp-impl.h                   |  604 +++++++++++++++++++-------------------
 memory.c                     |    7 +-
 mini-gmp/mini-gmp.c          |    3 +-
 mini-gmp/mini-gmp.h          |   16 +-
 mini-gmp/tests/mini-random.h |   16 +-
 mpf/ceilfloor.c              |    2 +-
 mpn/generic/mod_1.c          |    8 +-
 mpn/generic/mul_fft.c        |   10 +-
 mpn/generic/random2.c        |    2 +-
 mpn/x86/fat/fat.c            |    4 +-
 mpn/x86_64/fat/fat.c         |    2 +-
 mpq/aors.c                   |    4 +-
 mpz/aorsmul.c                |    2 +-
 mpz/cfdiv_q_2exp.c           |    2 +-
 mpz/cfdiv_r_2exp.c           |    2 +-
 mpz/millerrabin.c            |    6 +-
 mpz/pprime_p.c               |    2 +-
 mpz/rrandomb.c               |    2 +-
 printf/printffuns.c          |    2 +-
 rand/randlc2x.c              |    2 +-
 rand/randmt.c                |    2 +-
 rand/randmt.h                |    8 +-
 scanf/fscanffuns.c           |    6 +-
 tests/devel/try.c            |    6 +-
 tests/misc.c                 |    4 +-
 tests/misc/t-scanf.c         |    2 +-
 tests/mpf/reuse.c            |   14 +-
 tests/mpn/t-aors_1.c         |    5 +-
 tests/mpn/t-hgcd.c           |   12 +-
 tests/mpn/t-hgcd_appr.c      |   19 +-
 tests/mpn/t-instrument.c     |    8 +-
 tests/mpq/t-get_d.c          |    2 +-
 tests/mpq/t-md_2exp.c        |    2 +-
 tests/mpz/convert.c          |    2 +-
 tests/mpz/logic.c            |    4 +-
 tests/mpz/reuse.c            |   14 +-
 tests/mpz/t-addsub.c         |    4 +-
 tests/mpz/t-cdiv_ui.c        |    4 +-
 tests/mpz/t-fdiv.c           |    4 +-
 tests/mpz/t-fdiv_ui.c        |    4 +-
 tests/mpz/t-gcd.c            |    6 +-
 tests/mpz/t-mul.c            |    6 +-
 tests/mpz/t-powm.c           |    2 +-
 tests/mpz/t-powm_ui.c        |    4 +-
 tests/mpz/t-remove.c         |    4 +-
 tests/mpz/t-root.c           |    2 +-
 tests/mpz/t-sqrtrem.c        |    4 +-
 tests/mpz/t-tdiv.c           |    4 +-
 tests/mpz/t-tdiv_ui.c        |    4 +-
 tests/tests.h                |  567 ++++++++++++++--------------------
 tune/common.c                |    3 +-
 tune/speed-ext.c             |    6 +-
 tune/speed.c                 |    5 -
 tune/speed.h                 |  649 +++++++++++++++++++--------------------
 tune/time.c                  |    4 +-
 tune/tuneup.c                |   11 +-
 62 files changed, 1381 insertions(+), 1522 deletions(-)

diffs (truncated from 5325 to 300 lines):

diff -r 17c03ad3e866 -r 2e930396711c ChangeLog
--- a/ChangeLog	Sat Mar 03 00:54:45 2012 +0100
+++ b/ChangeLog	Sat Mar 03 15:40:45 2012 +0100
@@ -1,3 +1,9 @@
+2012-03-03  Torbjorn Granlund  <tege at gmplib.org>
+
+	* gmp-h.in (__GMP_PROTO): Remove.
+	* Strip __GMP_PROTO usage from all files.
+	* Strip prototype parameter names from all files.
+
 2012-03-01 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* doc/gmp.texi (mpz_invert): Correctly document result range.
diff -r 17c03ad3e866 -r 2e930396711c demos/expr/expr-impl.h
--- a/demos/expr/expr-impl.h	Sat Mar 03 00:54:45 2012 +0100
+++ b/demos/expr/expr-impl.h	Sat Mar 03 15:40:45 2012 +0100
@@ -55,36 +55,31 @@
 typedef union mpX_t *mpX_ptr;
 typedef __gmp_const union mpX_t *mpX_srcptr;
 
-typedef void (*mpexpr_fun_one_t) __GMP_PROTO ((mpX_ptr));
-typedef unsigned long (*mpexpr_fun_ui_one_t) __GMP_PROTO ((mpX_ptr));
+typedef void (*mpexpr_fun_one_t) (mpX_ptr);
+typedef unsigned long (*mpexpr_fun_ui_one_t) (mpX_ptr);
 
-typedef void (*mpexpr_fun_0ary_t) __GMP_PROTO ((mpX_ptr));
-typedef int  (*mpexpr_fun_i_0ary_t) __GMP_PROTO ((void));
+typedef void (*mpexpr_fun_0ary_t) (mpX_ptr);
+typedef int  (*mpexpr_fun_i_0ary_t) (void);
 
-typedef void (*mpexpr_fun_unary_t) __GMP_PROTO ((mpX_ptr, mpX_srcptr));
-typedef void (*mpexpr_fun_unary_ui_t) __GMP_PROTO ((mpX_ptr, unsigned long));
-typedef int  (*mpexpr_fun_i_unary_t) __GMP_PROTO ((mpX_srcptr));
-typedef int  (*mpexpr_fun_i_unary_ui_t) __GMP_PROTO ((unsigned long));
+typedef void (*mpexpr_fun_unary_t) (mpX_ptr, mpX_srcptr);
+typedef void (*mpexpr_fun_unary_ui_t) (mpX_ptr, unsigned long);
+typedef int  (*mpexpr_fun_i_unary_t) (mpX_srcptr);
+typedef int  (*mpexpr_fun_i_unary_ui_t) (unsigned long);
 
-typedef void (*mpexpr_fun_binary_t) __GMP_PROTO ((mpX_ptr, mpX_srcptr, mpX_srcptr));
-typedef void (*mpexpr_fun_binary_ui_t) __GMP_PROTO ((mpX_ptr, mpX_srcptr, unsigned long));
-typedef int  (*mpexpr_fun_i_binary_t) __GMP_PROTO ((mpX_srcptr, mpX_srcptr));
-typedef int  (*mpexpr_fun_i_binary_ui_t) __GMP_PROTO ((mpX_srcptr, unsigned long));
+typedef void (*mpexpr_fun_binary_t) (mpX_ptr, mpX_srcptr, mpX_srcptr);
+typedef void (*mpexpr_fun_binary_ui_t) (mpX_ptr, mpX_srcptr, unsigned long);
+typedef int  (*mpexpr_fun_i_binary_t) (mpX_srcptr, mpX_srcptr);
+typedef int  (*mpexpr_fun_i_binary_ui_t) (mpX_srcptr, unsigned long);
 
-typedef void (*mpexpr_fun_ternary_t)
-     __GMP_PROTO ((mpX_ptr, mpX_srcptr, mpX_srcptr, mpX_srcptr));
-typedef void (*mpexpr_fun_ternary_ui_t)
-     __GMP_PROTO ((mpX_ptr, mpX_srcptr, mpX_srcptr, unsigned long));
-typedef int (*mpexpr_fun_i_ternary_t)
-     __GMP_PROTO ((mpX_srcptr, mpX_srcptr, mpX_srcptr));
-typedef int (*mpexpr_fun_i_ternary_ui_t)
-     __GMP_PROTO ((mpX_srcptr, mpX_srcptr, unsigned long));
+typedef void (*mpexpr_fun_ternary_t) (mpX_ptr, mpX_srcptr, mpX_srcptr, mpX_srcptr);
+typedef void (*mpexpr_fun_ternary_ui_t) (mpX_ptr, mpX_srcptr, mpX_srcptr, unsigned long);
+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)
-     __GMP_PROTO ((mpX_ptr, __gmp_const char *str, size_t len, int base));
-typedef void (*mpexpr_fun_swap_t) __GMP_PROTO ((mpX_ptr, mpX_ptr));
-typedef unsigned long (*mpexpr_fun_get_ui_t) __GMP_PROTO ((mpX_srcptr));
-typedef void (*mpexpr_fun_set_si_t) __GMP_PROTO ((mpX_srcptr, long));
+typedef size_t (*mpexpr_fun_number_t) (mpX_ptr, __gmp_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;
@@ -129,7 +124,6 @@
 };
 
 
-int mpexpr_evaluate __GMP_PROTO ((struct mpexpr_parse_t *p));
-int mpexpr_va_to_var __GMP_PROTO ((void *var[], va_list ap));
-size_t mpexpr_mpz_number __GMP_PROTO ((mpz_ptr res,
-                                  __gmp_const char *e, size_t elen, int base));
+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);
diff -r 17c03ad3e866 -r 2e930396711c demos/expr/expr.h
--- a/demos/expr/expr.h	Sat Mar 03 00:54:45 2012 +0100
+++ b/demos/expr/expr.h	Sat Mar 03 15:40:45 2012 +0100
@@ -98,7 +98,7 @@
 #define MPEXPR_TYPE_OPERATOR       0x2000
 
 
-typedef void (*mpexpr_fun_t) __GMP_PROTO ((void));
+typedef void (*mpexpr_fun_t) (void);
 
 struct mpexpr_operator_t {
   __gmp_const char  *name;
@@ -108,22 +108,16 @@
 };
 
 
-int mpf_expr_a __GMP_PROTO ((__gmp_const struct mpexpr_operator_t *table,
-			mpf_ptr res, int base, unsigned long prec,
-			__gmp_const char *e, size_t elen,
-			mpf_srcptr var[26]));
-int mpf_expr __GMP_PROTO ((mpf_ptr res, int base, __gmp_const char *e, ...));
+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 mpq_expr_a __GMP_PROTO ((__gmp_const struct mpexpr_operator_t *table,
-			mpq_ptr res, int base,
-			__gmp_const char *e, size_t elen,
-			mpq_srcptr var[26]));
-int mpq_expr __GMP_PROTO ((mpq_ptr res, int base, __gmp_const char *e, ...));
+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 mpz_expr_a __GMP_PROTO ((__gmp_const struct mpexpr_operator_t *table,
-			mpz_ptr res, int base,
-			__gmp_const char *e, size_t elen,
-			mpz_srcptr var[26]));
-int mpz_expr __GMP_PROTO ((mpz_ptr res, int base, __gmp_const char *e, ...));
+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 *, ...);
 
 #endif
diff -r 17c03ad3e866 -r 2e930396711c demos/pexpr.c
--- a/demos/pexpr.c	Sat Mar 03 00:54:45 2012 +0100
+++ b/demos/pexpr.c	Sat Mar 03 15:40:45 2012 +0100
@@ -109,21 +109,21 @@
 
 typedef struct expr *expr_t;
 
-void cleanup_and_exit __GMP_PROTO ((int));
+void cleanup_and_exit (int);
 
-char *skipspace __GMP_PROTO ((char *));
-void makeexp __GMP_PROTO ((expr_t *, enum op_t, expr_t, expr_t));
-void free_expr __GMP_PROTO ((expr_t));
-char *expr __GMP_PROTO ((char *, expr_t *));
-char *term __GMP_PROTO ((char *, expr_t *));
-char *power __GMP_PROTO ((char *, expr_t *));
-char *factor __GMP_PROTO ((char *, expr_t *));
-int match __GMP_PROTO ((char *, char *));
-int matchp __GMP_PROTO ((char *, char *));
-int cputime __GMP_PROTO ((void));
+char *skipspace (char *);
+void makeexp (expr_t *, enum op_t, expr_t, expr_t);
+void free_expr (expr_t);
+char *expr (char *, expr_t *);
+char *term (char *, expr_t *);
+char *power (char *, expr_t *);
+char *factor (char *, expr_t *);
+int match (char *, char *);
+int matchp (char *, char *);
+int cputime (void);
 
-void mpz_eval_expr __GMP_PROTO ((mpz_ptr, expr_t));
-void mpz_eval_mod_expr __GMP_PROTO ((mpz_ptr, expr_t, mpz_ptr));
+void mpz_eval_expr (mpz_ptr, expr_t);
+void mpz_eval_mod_expr (mpz_ptr, expr_t, mpz_ptr);
 
 char *error;
 int flag_print = 1;
diff -r 17c03ad3e866 -r 2e930396711c demos/primes.c
--- a/demos/primes.c	Sat Mar 03 00:54:45 2012 +0100
+++ b/demos/primes.c	Sat Mar 03 15:40:45 2012 +0100
@@ -61,9 +61,9 @@
 struct primes *primes;
 unsigned long n_primes;
 
-void find_primes __GMP_PROTO ((unsigned char *, mpz_t, unsigned long, mpz_t));
-void sieve_region __GMP_PROTO ((unsigned char *, mpz_t, unsigned long));
-void make_primelist __GMP_PROTO ((unsigned long));
+void find_primes (unsigned char *, mpz_t, unsigned long, mpz_t);
+void sieve_region ((unsigned char *, mpz_t, unsigned long);
+void make_primelist (unsigned long);
 
 int flag_print = 1;
 int flag_count = 0;
diff -r 17c03ad3e866 -r 2e930396711c gmp-h.in
--- a/gmp-h.in	Sat Mar 03 00:54:45 2012 +0100
+++ b/gmp-h.in	Sat Mar 03 15:40:45 2012 +0100
@@ -295,12 +295,6 @@
 #endif
 
 
-#if __GMP_HAVE_PROTOTYPES
-#define __GMP_PROTO(x) x
-#else
-#define __GMP_PROTO(x) ()
-#endif
-
 #ifndef __MPN
 #if __GMP_HAVE_TOKEN_PASTE
 #define __MPN(x) __gmpn_##x
@@ -538,14 +532,14 @@
 #endif
 
 #define mp_set_memory_functions __gmp_set_memory_functions
-__GMP_DECLSPEC void mp_set_memory_functions __GMP_PROTO ((void *(*) (size_t),
+__GMP_DECLSPEC void mp_set_memory_functions (void *(*) (size_t),
 				      void *(*) (void *, size_t, size_t),
-				      void (*) (void *, size_t))) __GMP_NOTHROW;
+				      void (*) (void *, size_t)) __GMP_NOTHROW;
 
 #define mp_get_memory_functions __gmp_get_memory_functions
-__GMP_DECLSPEC void mp_get_memory_functions __GMP_PROTO ((void *(**) (size_t),
+__GMP_DECLSPEC void mp_get_memory_functions (void *(**) (size_t),
                                       void *(**) (void *, size_t, size_t),
-                                      void (**) (void *, size_t))) __GMP_NOTHROW;
+                                      void (**) (void *, size_t)) __GMP_NOTHROW;
 
 #define mp_bits_per_limb __gmp_bits_per_limb
 __GMP_DECLSPEC extern __gmp_const int mp_bits_per_limb;
@@ -561,93 +555,91 @@
 
 /* obsolete */
 #define gmp_randinit __gmp_randinit
-__GMP_DECLSPEC void gmp_randinit __GMP_PROTO ((gmp_randstate_t, gmp_randalg_t, ...));
+__GMP_DECLSPEC void gmp_randinit (gmp_randstate_t, gmp_randalg_t, ...);
 
 #define gmp_randinit_default __gmp_randinit_default
-__GMP_DECLSPEC void gmp_randinit_default __GMP_PROTO ((gmp_randstate_t));
+__GMP_DECLSPEC void gmp_randinit_default (gmp_randstate_t);
 
 #define gmp_randinit_lc_2exp __gmp_randinit_lc_2exp
-__GMP_DECLSPEC void gmp_randinit_lc_2exp __GMP_PROTO ((gmp_randstate_t,
-						       mpz_srcptr, unsigned long int,
-						       mp_bitcnt_t));
+__GMP_DECLSPEC void gmp_randinit_lc_2exp (gmp_randstate_t, mpz_srcptr, unsigned long int, mp_bitcnt_t);
 
 #define gmp_randinit_lc_2exp_size __gmp_randinit_lc_2exp_size
-__GMP_DECLSPEC int gmp_randinit_lc_2exp_size __GMP_PROTO ((gmp_randstate_t, mp_bitcnt_t));
+__GMP_DECLSPEC int gmp_randinit_lc_2exp_size (gmp_randstate_t, mp_bitcnt_t);
 
 #define gmp_randinit_mt __gmp_randinit_mt
-__GMP_DECLSPEC void gmp_randinit_mt __GMP_PROTO ((gmp_randstate_t));
+__GMP_DECLSPEC void gmp_randinit_mt (gmp_randstate_t);
 
 #define gmp_randinit_set __gmp_randinit_set
-__GMP_DECLSPEC void gmp_randinit_set __GMP_PROTO ((gmp_randstate_t, __gmp_const __gmp_randstate_struct *));
+__GMP_DECLSPEC void gmp_randinit_set (gmp_randstate_t, __gmp_const __gmp_randstate_struct *);
 
 #define gmp_randseed __gmp_randseed
-__GMP_DECLSPEC void gmp_randseed __GMP_PROTO ((gmp_randstate_t, mpz_srcptr));
+__GMP_DECLSPEC void gmp_randseed (gmp_randstate_t, mpz_srcptr);
 
 #define gmp_randseed_ui __gmp_randseed_ui
-__GMP_DECLSPEC void gmp_randseed_ui __GMP_PROTO ((gmp_randstate_t, unsigned long int));
+__GMP_DECLSPEC void gmp_randseed_ui (gmp_randstate_t, unsigned long int);
 
 #define gmp_randclear __gmp_randclear
-__GMP_DECLSPEC void gmp_randclear __GMP_PROTO ((gmp_randstate_t));
+__GMP_DECLSPEC void gmp_randclear (gmp_randstate_t);
 
 #define gmp_urandomb_ui __gmp_urandomb_ui
-__GMP_DECLSPEC unsigned long gmp_urandomb_ui __GMP_PROTO ((gmp_randstate_t, unsigned long));
+__GMP_DECLSPEC unsigned long gmp_urandomb_ui (gmp_randstate_t, unsigned long);
 
 #define gmp_urandomm_ui __gmp_urandomm_ui
-__GMP_DECLSPEC unsigned long gmp_urandomm_ui __GMP_PROTO ((gmp_randstate_t, unsigned long));
+__GMP_DECLSPEC unsigned long gmp_urandomm_ui (gmp_randstate_t, unsigned long);
 
 
 /**************** Formatted output routines.  ****************/
 
 #define gmp_asprintf __gmp_asprintf
-__GMP_DECLSPEC int gmp_asprintf __GMP_PROTO ((char **, __gmp_const char *, ...));
+__GMP_DECLSPEC int gmp_asprintf (char **, __gmp_const char *, ...);
 
 #define gmp_fprintf __gmp_fprintf
 #ifdef _GMP_H_HAVE_FILE
-__GMP_DECLSPEC int gmp_fprintf __GMP_PROTO ((FILE *, __gmp_const char *, ...));
+__GMP_DECLSPEC int gmp_fprintf (FILE *, __gmp_const char *, ...);
 #endif
 
 #define gmp_obstack_printf __gmp_obstack_printf
 #if defined (_GMP_H_HAVE_OBSTACK)
-__GMP_DECLSPEC int gmp_obstack_printf __GMP_PROTO ((struct obstack *, __gmp_const char *, ...));
+__GMP_DECLSPEC int gmp_obstack_printf (struct obstack *, __gmp_const char *, ...);
 #endif
 
 #define gmp_obstack_vprintf __gmp_obstack_vprintf
 #if defined (_GMP_H_HAVE_OBSTACK) && defined (_GMP_H_HAVE_VA_LIST)
-__GMP_DECLSPEC int gmp_obstack_vprintf __GMP_PROTO ((struct obstack *, __gmp_const char *, va_list));
+__GMP_DECLSPEC int gmp_obstack_vprintf (struct obstack *, __gmp_const char *, va_list);
 #endif
 
 #define gmp_printf __gmp_printf
-__GMP_DECLSPEC int gmp_printf __GMP_PROTO ((__gmp_const char *, ...));
+__GMP_DECLSPEC int gmp_printf (__gmp_const char *, ...);
 
 #define gmp_snprintf __gmp_snprintf
-__GMP_DECLSPEC int gmp_snprintf __GMP_PROTO ((char *, size_t, __gmp_const char *, ...));
+__GMP_DECLSPEC int gmp_snprintf (char *, size_t, __gmp_const char *, ...);
 
 #define gmp_sprintf __gmp_sprintf


More information about the gmp-commit mailing list