summaryrefslogtreecommitdiff
path: root/mpz/n_pow_ui.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2002-02-20 00:54:44 +0100
committerKevin Ryde <user42@zip.com.au>2002-02-20 00:54:44 +0100
commit2e20b0ea56ea17788f5726dddbaad14c5849270f (patch)
treed0c84fe0eb7bafc124b0a01f914308867e4212f7 /mpz/n_pow_ui.c
parent4ae588f4afa6a8b89b5102aec62c689475bf8194 (diff)
downloadgmp-2e20b0ea56ea17788f5726dddbaad14c5849270f.tar.gz
* mpz/n_pow_ui.c (SWAP_RP_TP): Use ASSERT_CODE on ralloc and talloc,
to ensure they needn't live past the initial allocs in a normal build.
Diffstat (limited to 'mpz/n_pow_ui.c')
-rw-r--r--mpz/n_pow_ui.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/mpz/n_pow_ui.c b/mpz/n_pow_ui.c
index 327c39281..b8ef1b31b 100644
--- a/mpz/n_pow_ui.c
+++ b/mpz/n_pow_ui.c
@@ -1,6 +1,6 @@
/* mpz_n_pow_ui -- mpn raised to ulong.
-Copyright 2001 Free Software Foundation, Inc.
+Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -133,12 +133,16 @@ MA 02111-1307, USA. */
} while (0)
-/* We're only interested in ralloc and talloc for assertions and tracing.
- gcc 2.95 recognises those variables are dead in a normal build and
- eliminates them. Something explicit could be done to avoid touching them
- if other compilers don't manage this. */
+/* ralloc and talloc are only wanted for ASSERTs, after the initial space
+ allocations. Avoid writing values to them in a normal build, to ensure
+ the compiler lets them go dead. gcc already figures this out itself
+ actually. */
-#define SWAP_RP_TP MPN_PTR_SWAP (rp,ralloc, tp,talloc)
+#define SWAP_RP_TP \
+ do { \
+ MP_PTR_SWAP (rp, tp); \
+ ASSERT_CODE (MP_SIZE_T_SWAP (ralloc, talloc)); \
+ } while (0)
void