[Gmp-commit] /var/hg/gmp: Spacing and indentation cleanup.

mercurial at gmplib.org mercurial at gmplib.org
Sun Oct 16 16:27:27 CEST 2011


details:   /var/hg/gmp/rev/293172cd724d
changeset: 14346:293172cd724d
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Oct 16 16:26:36 2011 +0200
description:
Spacing and indentation cleanup.

diffstat:

 gmp-impl.h |  1535 ++++++++++++++++++++++++++++++-----------------------------
 1 files changed, 768 insertions(+), 767 deletions(-)

diffs (truncated from 2046 to 300 lines):

diff -r a01f95e7ccc3 -r 293172cd724d gmp-impl.h
--- a/gmp-impl.h	Sun Oct 16 15:50:49 2011 +0200
+++ b/gmp-impl.h	Sun Oct 16 16:26:36 2011 +0200
@@ -251,13 +251,13 @@
 #endif
 
 #if ! HAVE_MEMSET
-#define memset(p, c, n)                 \
-  do {                                  \
-    ASSERT ((n) >= 0);                  \
-    char *__memset__p = (p);            \
-    int  __i;                           \
-    for (__i = 0; __i < (n); __i++)     \
-      __memset__p[__i] = (c);           \
+#define memset(p, c, n)			\
+  do {					\
+    ASSERT ((n) >= 0);			\
+    char *__memset__p = (p);		\
+    int	 __i;				\
+    for (__i = 0; __i < (n); __i++)	\
+      __memset__p[__i] = (c);		\
   } while (0)
 #endif
 
@@ -340,9 +340,10 @@
 #define TMP_ALLOC(n)							\
   (LIKELY ((n) < 65536) ? TMP_SALLOC(n) : TMP_BALLOC(n))
 #define TMP_SFREE
-#define TMP_FREE							   \
-  do {									   \
-    if (UNLIKELY (__tmp_marker != 0)) __gmp_tmp_reentrant_free (__tmp_marker); \
+#define TMP_FREE							\
+  do {									\
+    if (UNLIKELY (__tmp_marker != 0))					\
+      __gmp_tmp_reentrant_free (__tmp_marker);				\
   } while (0)
 #endif
 
@@ -410,32 +411,32 @@
    warning from the compiler if TMP_FREE is used without a TMP_MARK.
    __tmp_marker_inscope does the same for TMP_ALLOC.  Runtime tests pick
    these things up too.  */
-#define TMP_DECL_NAME(marker, marker_name)                      \
-  int marker;                                                   \
-  int __tmp_marker_inscope;                                     \
-  const char *__tmp_marker_name = marker_name;                  \
-  struct tmp_debug_t  __tmp_marker_struct;                      \
-  /* don't demand NULL, just cast a zero */                     \
+#define TMP_DECL_NAME(marker, marker_name)				\
+  int marker;								\
+  int __tmp_marker_inscope;						\
+  const char *__tmp_marker_name = marker_name;				\
+  struct tmp_debug_t  __tmp_marker_struct;				\
+  /* don't demand NULL, just cast a zero */				\
   struct tmp_debug_t  *__tmp_marker = (struct tmp_debug_t *) 0
-#define TMP_MARK_NAME(marker, marker_name)                      \
-  do {                                                          \
-    marker = 1;                                                 \
-    __tmp_marker_inscope = 1;                                   \
-    __gmp_tmp_debug_mark  (ASSERT_FILE, ASSERT_LINE,            \
-                           &__tmp_marker, &__tmp_marker_struct, \
-                           __tmp_marker_name, marker_name);     \
+#define TMP_MARK_NAME(marker, marker_name)				\
+  do {									\
+    marker = 1;								\
+    __tmp_marker_inscope = 1;						\
+    __gmp_tmp_debug_mark  (ASSERT_FILE, ASSERT_LINE,			\
+			   &__tmp_marker, &__tmp_marker_struct,		\
+			   __tmp_marker_name, marker_name);		\
   } while (0)
 #define TMP_SALLOC(n)		TMP_ALLOC(n)
 #define TMP_BALLOC(n)		TMP_ALLOC(n)
-#define TMP_ALLOC(size)                                                 \
-  __gmp_tmp_debug_alloc (ASSERT_FILE, ASSERT_LINE,                      \
-                         __tmp_marker_inscope,                          \
-                         &__tmp_marker, __tmp_marker_name, size)
-#define TMP_FREE_NAME(marker, marker_name)                      \
-  do {                                                          \
-    __gmp_tmp_debug_free  (ASSERT_FILE, ASSERT_LINE,            \
-                           marker, &__tmp_marker,               \
-                           __tmp_marker_name, marker_name);     \
+#define TMP_ALLOC(size)							\
+  __gmp_tmp_debug_alloc (ASSERT_FILE, ASSERT_LINE,			\
+			 __tmp_marker_inscope,				\
+			 &__tmp_marker, __tmp_marker_name, size)
+#define TMP_FREE_NAME(marker, marker_name)				\
+  do {									\
+    __gmp_tmp_debug_free  (ASSERT_FILE, ASSERT_LINE,			\
+			   marker, &__tmp_marker,			\
+			   __tmp_marker_name, marker_name);		\
   } while (0)
 #endif /* WANT_TMP_DEBUG */
 
@@ -456,18 +457,18 @@
    involves copying a chunk of stack (various RISCs), or a call to a stack
    bounds check (mingw).  In any case, when debugging keep separate blocks
    so a redzoning malloc debugger can protect each individually.  */
-#define TMP_ALLOC_LIMBS_2(xp,xsize, yp,ysize)           \
-  do {                                                  \
-    if (WANT_TMP_DEBUG)                                 \
-      {                                                 \
-        (xp) = TMP_ALLOC_LIMBS (xsize);                 \
-        (yp) = TMP_ALLOC_LIMBS (ysize);                 \
-      }                                                 \
-    else                                                \
-      {                                                 \
-        (xp) = TMP_ALLOC_LIMBS ((xsize) + (ysize));     \
-        (yp) = (xp) + (xsize);                          \
-      }                                                 \
+#define TMP_ALLOC_LIMBS_2(xp,xsize, yp,ysize)				\
+  do {									\
+    if (WANT_TMP_DEBUG)							\
+      {									\
+	(xp) = TMP_ALLOC_LIMBS (xsize);					\
+	(yp) = TMP_ALLOC_LIMBS (ysize);					\
+      }									\
+    else								\
+      {									\
+	(xp) = TMP_ALLOC_LIMBS ((xsize) + (ysize));			\
+	(yp) = (xp) + (xsize);						\
+      }									\
   } while (0)
 
 
@@ -601,54 +602,54 @@
 
 /* Swap macros. */
 
-#define MP_LIMB_T_SWAP(x, y)                    \
-  do {                                          \
-    mp_limb_t __mp_limb_t_swap__tmp = (x);      \
-    (x) = (y);                                  \
-    (y) = __mp_limb_t_swap__tmp;                \
+#define MP_LIMB_T_SWAP(x, y)						\
+  do {									\
+    mp_limb_t __mp_limb_t_swap__tmp = (x);				\
+    (x) = (y);								\
+    (y) = __mp_limb_t_swap__tmp;					\
   } while (0)
-#define MP_SIZE_T_SWAP(x, y)                    \
-  do {                                          \
-    mp_size_t __mp_size_t_swap__tmp = (x);      \
-    (x) = (y);                                  \
-    (y) = __mp_size_t_swap__tmp;                \
+#define MP_SIZE_T_SWAP(x, y)						\
+  do {									\
+    mp_size_t __mp_size_t_swap__tmp = (x);				\
+    (x) = (y);								\
+    (y) = __mp_size_t_swap__tmp;					\
   } while (0)
 
-#define MP_PTR_SWAP(x, y)               \
-  do {                                  \
-    mp_ptr __mp_ptr_swap__tmp = (x);    \
-    (x) = (y);                          \
-    (y) = __mp_ptr_swap__tmp;           \
+#define MP_PTR_SWAP(x, y)						\
+  do {									\
+    mp_ptr __mp_ptr_swap__tmp = (x);					\
+    (x) = (y);								\
+    (y) = __mp_ptr_swap__tmp;						\
   } while (0)
-#define MP_SRCPTR_SWAP(x, y)                    \
-  do {                                          \
-    mp_srcptr __mp_srcptr_swap__tmp = (x);      \
-    (x) = (y);                                  \
-    (y) = __mp_srcptr_swap__tmp;                \
+#define MP_SRCPTR_SWAP(x, y)						\
+  do {									\
+    mp_srcptr __mp_srcptr_swap__tmp = (x);				\
+    (x) = (y);								\
+    (y) = __mp_srcptr_swap__tmp;					\
   } while (0)
 
-#define MPN_PTR_SWAP(xp,xs, yp,ys)      \
-  do {                                  \
-    MP_PTR_SWAP (xp, yp);               \
-    MP_SIZE_T_SWAP (xs, ys);            \
+#define MPN_PTR_SWAP(xp,xs, yp,ys)					\
+  do {									\
+    MP_PTR_SWAP (xp, yp);						\
+    MP_SIZE_T_SWAP (xs, ys);						\
   } while(0)
-#define MPN_SRCPTR_SWAP(xp,xs, yp,ys)   \
-  do {                                  \
-    MP_SRCPTR_SWAP (xp, yp);            \
-    MP_SIZE_T_SWAP (xs, ys);            \
+#define MPN_SRCPTR_SWAP(xp,xs, yp,ys)					\
+  do {									\
+    MP_SRCPTR_SWAP (xp, yp);						\
+    MP_SIZE_T_SWAP (xs, ys);						\
   } while(0)
 
-#define MPZ_PTR_SWAP(x, y)              \
-  do {                                  \
-    mpz_ptr __mpz_ptr_swap__tmp = (x);  \
-    (x) = (y);                          \
-    (y) = __mpz_ptr_swap__tmp;          \
+#define MPZ_PTR_SWAP(x, y)						\
+  do {									\
+    mpz_ptr __mpz_ptr_swap__tmp = (x);					\
+    (x) = (y);								\
+    (y) = __mpz_ptr_swap__tmp;						\
   } while (0)
-#define MPZ_SRCPTR_SWAP(x, y)                   \
-  do {                                          \
-    mpz_srcptr __mpz_srcptr_swap__tmp = (x);    \
-    (x) = (y);                                  \
-    (y) = __mpz_srcptr_swap__tmp;               \
+#define MPZ_SRCPTR_SWAP(x, y)						\
+  do {									\
+    mpz_srcptr __mpz_srcptr_swap__tmp = (x);				\
+    (x) = (y);								\
+    (y) = __mpz_srcptr_swap__tmp;					\
   } while (0)
 
 
@@ -666,26 +667,26 @@
   ((type *) (*__gmp_allocate_func) ((n) * sizeof (type)))
 #define __GMP_ALLOCATE_FUNC_LIMBS(n)   __GMP_ALLOCATE_FUNC_TYPE (n, mp_limb_t)
 
-#define __GMP_REALLOCATE_FUNC_TYPE(p, old_size, new_size, type) \
-  ((type *) (*__gmp_reallocate_func)                            \
+#define __GMP_REALLOCATE_FUNC_TYPE(p, old_size, new_size, type)		\
+  ((type *) (*__gmp_reallocate_func)					\
    (p, (old_size) * sizeof (type), (new_size) * sizeof (type)))
-#define __GMP_REALLOCATE_FUNC_LIMBS(p, old_size, new_size) \
+#define __GMP_REALLOCATE_FUNC_LIMBS(p, old_size, new_size)		\
   __GMP_REALLOCATE_FUNC_TYPE(p, old_size, new_size, mp_limb_t)
 
 #define __GMP_FREE_FUNC_TYPE(p,n,type) (*__gmp_free_func) (p, (n) * sizeof (type))
 #define __GMP_FREE_FUNC_LIMBS(p,n)     __GMP_FREE_FUNC_TYPE (p, n, mp_limb_t)
 
-#define __GMP_REALLOCATE_FUNC_MAYBE(ptr, oldsize, newsize)      \
-  do {                                                          \
-    if ((oldsize) != (newsize))                                 \
-      (ptr) = (*__gmp_reallocate_func) (ptr, oldsize, newsize); \
+#define __GMP_REALLOCATE_FUNC_MAYBE(ptr, oldsize, newsize)		\
+  do {									\
+    if ((oldsize) != (newsize))						\
+      (ptr) = (*__gmp_reallocate_func) (ptr, oldsize, newsize);		\
   } while (0)
 
-#define __GMP_REALLOCATE_FUNC_MAYBE_TYPE(ptr, oldsize, newsize, type)   \
-  do {                                                                  \
-    if ((oldsize) != (newsize))                                         \
-      (ptr) = (type *) (*__gmp_reallocate_func)                         \
-        (ptr, (oldsize) * sizeof (type), (newsize) * sizeof (type));    \
+#define __GMP_REALLOCATE_FUNC_MAYBE_TYPE(ptr, oldsize, newsize, type)	\
+  do {									\
+    if ((oldsize) != (newsize))						\
+      (ptr) = (type *) (*__gmp_reallocate_func)				\
+	(ptr, (oldsize) * sizeof (type), (newsize) * sizeof (type));	\
   } while (0)
 
 
@@ -1137,11 +1138,11 @@
 #define RNG_STATE(rstate) ((rstate)->_mp_seed->_mp_d)
 
 /* Write a given number of random bits to rp.  */
-#define _gmp_rand(rp, state, bits)                              \
-  do {                                                          \
-    gmp_randstate_ptr  __rstate = (state);                      \
-    (*((gmp_randfnptr_t *) RNG_FNPTR (__rstate))->randget_fn)   \
-       (__rstate, rp, bits);                                    \
+#define _gmp_rand(rp, state, bits)					\
+  do {									\
+    gmp_randstate_ptr  __rstate = (state);				\
+    (*((gmp_randfnptr_t *) RNG_FNPTR (__rstate))->randget_fn)		\
+      (__rstate, rp, bits);						\
   } while (0)
 
 __GMP_DECLSPEC void __gmp_randinit_mt_noseed __GMP_PROTO ((gmp_randstate_t));
@@ -1162,20 +1163,20 @@
 __GMP_DECLSPEC extern char             __gmp_rands_initialized;
 __GMP_DECLSPEC extern gmp_randstate_t  __gmp_rands;
 
-#define RANDS                                       \
-  ((__gmp_rands_initialized ? 0                     \
-    : (__gmp_rands_initialized = 1,                 \
-       __gmp_randinit_mt_noseed (__gmp_rands), 0)), \
+#define RANDS								\
+  ((__gmp_rands_initialized ? 0						\
+    : (__gmp_rands_initialized = 1,					\
+       __gmp_randinit_mt_noseed (__gmp_rands), 0)),			\
    __gmp_rands)
 
 /* this is used by the test programs, to free memory */
-#define RANDS_CLEAR()                   \
-  do {                                  \
-    if (__gmp_rands_initialized)        \
-      {                                 \
-        __gmp_rands_initialized = 0;    \
-        gmp_randclear (__gmp_rands);    \
-      }                                 \
+#define RANDS_CLEAR()							\
+  do {									\
+    if (__gmp_rands_initialized)					\
+      {									\
+	__gmp_rands_initialized = 0;					\


More information about the gmp-commit mailing list