]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
tests: Use inline function for dummy definition of test_randomize.
authorNiels Möller <nisse@lysator.liu.se>
Mon, 17 Jan 2022 20:19:31 +0000 (21:19 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 17 Jan 2022 20:19:31 +0000 (21:19 +0100)
ChangeLog
testsuite/testutils.h

index 13866547e9b1ae1947b927e16780bdd1cdbe5fd3..6061d8206898d555741eb17838dd122f5d56df3e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@
        * testsuite/ecdsa-keygen-test.c (ecc_valid_p): ... old copy.
        * testsuite/gostdsa-keygen-test.c (ecc_valid_p): ... old copy.
        * testsuite/testutils.h: Declare it.
+       (test_randomize) [NETTLE_USE_MINI_GMP]: Use inline function rather
+       than macro for dummy definition, to avoid compile time warnings.
 
 2022-01-10  Niels Möller  <nisse@lysator.liu.se>
 
index 385b9abca15a8a36bc3596d5e42b1963d4536507..cb4423e44a79c387aaad118ace62352a6c59bb90 100644 (file)
@@ -163,10 +163,11 @@ void gmp_randinit_default (struct knuth_lfib_ctx *ctx);
 void mpz_urandomb (mpz_t r, struct knuth_lfib_ctx *ctx, mp_bitcnt_t bits);
 /* This is cheating */
 #define mpz_rrandomb mpz_urandomb
-#define test_randomize(rands) 0
+static inline int
+test_randomize (gmp_randstate_t rands UNUSED) { return 0; }
 #else /* !NETTLE_USE_MINI_GMP */
 int
-test_randomize(gmp_randstate_t rands);
+test_randomize (gmp_randstate_t rands);
 
 #endif /* !NETTLE_USE_MINI_GMP */