[Gmp-commit] /var/hg/gmp: Remove K&R stringize support.

mercurial at gmplib.org mercurial at gmplib.org
Tue Jun 23 19:16:30 UTC 2015


details:   /var/hg/gmp/rev/8e615fc4e075
changeset: 16722:8e615fc4e075
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Tue Jun 23 21:16:26 2015 +0200
description:
Remove K&R stringize support.

diffstat:

 ChangeLog           |  10 ++++++++++
 configure.ac        |   2 --
 gmp-impl.h          |  10 +---------
 tests/devel/try.c   |  14 --------------
 tests/mpf/t-fits.c  |   4 ----
 tests/mpz/t-fits.c  |   4 ----
 tests/t-constants.c |   9 ---------
 7 files changed, 11 insertions(+), 42 deletions(-)

diffs (151 lines):

diff -r ad29a3fa44e7 -r 8e615fc4e075 ChangeLog
--- a/ChangeLog	Tue Jun 23 20:49:50 2015 +0200
+++ b/ChangeLog	Tue Jun 23 21:16:26 2015 +0200
@@ -1,3 +1,13 @@
+2015-06-23  Torbjörn Granlund  <torbjorng at google.com>
+
+	* gmp-impl.h: Remove K&R stringize support.
+	* tests/devel/try.c: Likewise.
+	* tests/t-constants.c: Likewise.
+	* tests/mpf/t-fits.c: Likewise.
+	* tests/mpz/t-fits.c: Likewise.
+
+	* configure.ac (AC_C_STRINGIZE): Remove.
+
 2015-06-15 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* tests/devel/try.c: Support mpn_sqrt (sqrtrem with remainder = NULL).
diff -r ad29a3fa44e7 -r 8e615fc4e075 configure.ac
--- a/configure.ac	Tue Jun 23 20:49:50 2015 +0200
+++ b/configure.ac	Tue Jun 23 21:16:26 2015 +0200
@@ -2708,8 +2708,6 @@
 AC_CHECK_TYPES([intmax_t, long double, long long, ptrdiff_t, quad_t,
 		uint_least32_t, intptr_t])
 
-AC_C_STRINGIZE
-
 # FIXME: Really want #ifndef __cplusplus around the #define volatile
 # replacement autoconf gives, since volatile is always available in C++.
 # But we don't use it in C++ currently.
diff -r ad29a3fa44e7 -r 8e615fc4e075 gmp-impl.h
--- a/gmp-impl.h	Tue Jun 23 20:49:50 2015 +0200
+++ b/gmp-impl.h	Tue Jun 23 21:16:26 2015 +0200
@@ -2327,11 +2327,7 @@
 /* ASSERT() is a private assertion checking scheme, similar to <assert.h>.
    ASSERT() does the check only if WANT_ASSERT is selected, ASSERT_ALWAYS()
    does it always.  Generally assertions are meant for development, but
-   might help when looking for a problem later too.
-
-   Note that strings shouldn't be used within the ASSERT expression,
-   eg. ASSERT(strcmp(s,"notgood")!=0), since the quotes upset the "expr"
-   used in the !HAVE_STRINGIZE case (ie. K&R).  */
+   might help when looking for a problem later too.  */
 
 #ifdef __LINE__
 #define ASSERT_LINE  __LINE__
@@ -2348,11 +2344,7 @@
 __GMP_DECLSPEC void __gmp_assert_header (const char *, int);
 __GMP_DECLSPEC void __gmp_assert_fail (const char *, int, const char *) ATTRIBUTE_NORETURN;
 
-#if HAVE_STRINGIZE
 #define ASSERT_FAIL(expr)  __gmp_assert_fail (ASSERT_FILE, ASSERT_LINE, #expr)
-#else
-#define ASSERT_FAIL(expr)  __gmp_assert_fail (ASSERT_FILE, ASSERT_LINE, "expr")
-#endif
 
 #define ASSERT_ALWAYS(expr)						\
   do {									\
diff -r ad29a3fa44e7 -r 8e615fc4e075 tests/devel/try.c
--- a/tests/devel/try.c	Tue Jun 23 20:49:50 2015 +0200
+++ b/tests/devel/try.c	Tue Jun 23 21:16:26 2015 +0200
@@ -735,21 +735,12 @@
 
 #define COPY(index)  memcpy (p, &param[index], sizeof (*p))
 
-#if HAVE_STRINGIZE
 #define REFERENCE(fun)                  \
   p->reference = (tryfun_t) fun;        \
   p->reference_name = #fun
 #define VALIDATE(fun)           \
   p->validate = fun;            \
   p->validate_name = #fun
-#else
-#define REFERENCE(fun)                  \
-  p->reference = (tryfun_t) fun;        \
-  p->reference_name = "fun"
-#define VALIDATE(fun)           \
-  p->validate = fun;            \
-  p->validate_name = "fun"
-#endif
 
 
   p = &param[TYPE_ADD_N];
@@ -1729,13 +1720,8 @@
   mp_size_t   minsize;
 };
 
-#if HAVE_STRINGIZE
 #define TRY(fun)        #fun, (tryfun_t) fun
 #define TRY_FUNFUN(fun) #fun, (tryfun_t) fun##_fun
-#else
-#define TRY(fun)        "fun", (tryfun_t) fun
-#define TRY_FUNFUN(fun) "fun", (tryfun_t) fun/**/_fun
-#endif
 
 const struct choice_t choice_array[] = {
   { TRY(mpn_add),       TYPE_ADD    },
diff -r ad29a3fa44e7 -r 8e615fc4e075 tests/mpf/t-fits.c
--- a/tests/mpf/t-fits.c	Tue Jun 23 20:49:50 2015 +0200
+++ b/tests/mpf/t-fits.c	Tue Jun 23 21:16:26 2015 +0200
@@ -38,11 +38,7 @@
       error = 1;                                                         \
     }
 
-#if HAVE_STRINGIZE
 #define EXPECT(fun,answer)  EXPECT_S(fun,#fun,answer)
-#else
-#define EXPECT(fun,answer)  EXPECT_S(fun,"fun",answer)
-#endif
 
 int
 main (void)
diff -r ad29a3fa44e7 -r 8e615fc4e075 tests/mpz/t-fits.c
--- a/tests/mpz/t-fits.c	Tue Jun 23 20:49:50 2015 +0200
+++ b/tests/mpz/t-fits.c	Tue Jun 23 21:16:26 2015 +0200
@@ -39,11 +39,7 @@
       error = 1;                                                        \
     }
 
-#if HAVE_STRINGIZE
 #define EXPECT(fun,answer)  EXPECT_S(fun,#fun,answer)
-#else
-#define EXPECT(fun,answer)  EXPECT_S(fun,"fun",answer)
-#endif
 
 int
 main (void)
diff -r ad29a3fa44e7 -r 8e615fc4e075 tests/t-constants.c
--- a/tests/t-constants.c	Tue Jun 23 20:49:50 2015 +0200
+++ b/tests/t-constants.c	Tue Jun 23 21:16:26 2015 +0200
@@ -176,21 +176,12 @@
   } while (0)
 
 
-#if HAVE_STRINGIZE
 #define CHECK_LIMB(x,y)      CHECK_LIMB_S (x, #x, y, #y)
 #define CHECK_INT(x,y)       CHECK_INT_S (x, #x, y, #y)
 #define CHECK_CONDITION(x)   CHECK_CONDITION_S (x, #x)
 #define CHECK_BITS(c,t)      CHECK_BITS_S (c, #c, t)
 #define CHECK_MAX(m,n,t,f)   CHECK_MAX_S (m, #m, n, #n, t, f)
 #define CHECK_HIGHBIT(n,t,f) CHECK_HIGHBIT_S (n, #n, t, f)
-#else
-#define CHECK_LIMB(x,y)      CHECK_LIMB_S (x, "x", y, "y")
-#define CHECK_INT(x,y)       CHECK_INT_S (x, "x", y, "y")
-#define CHECK_CONDITION(x)   CHECK_CONDITION_S (x, "x")
-#define CHECK_BITS(c,t)      CHECK_BITS_S (c, "c", t)
-#define CHECK_MAX(m,n,t,f)   CHECK_MAX_S (m, "m", n, "n", t, f)
-#define CHECK_HIGHBIT(n,t,f) CHECK_HIGHBIT_S (n, "n", t, f)
-#endif
 
 
 /* The tests below marked "Bad!" fail on Cray T90 systems, where int, short


More information about the gmp-commit mailing list