From: Christian Grothoff Date: Wed, 9 Jun 2010 11:23:09 +0000 (+0000) Subject: stdconst X-Git-Tag: initial-import-from-subversion-38251~21440 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=457cd711331dd77e9f012c147dee7ce2922bf9d5;p=oweals%2Fgnunet.git stdconst --- diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c index 676416c63..25ba4db2a 100644 --- a/src/util/crypto_random.c +++ b/src/util/crypto_random.c @@ -66,7 +66,7 @@ GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i) if ((invokeCount++ % 256) == 0) gcry_fast_random_poll (); #endif - ul = ((uint32_t)-1) - (((uint32_t)-1) % i); + ul = UINT32_MAX - (UINT32_MAX % i); do { gcry_randomize ((unsigned char *) &ret, @@ -132,7 +132,7 @@ GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max) GNUNET_assert (max > 0); if (mode == GNUNET_CRYPTO_QUALITY_STRONG) { - ul = ((uint64_t)-1LL) - (((uint64_t)-1LL) % max); + ul = UINT64_MAX - (UINT64_MAX % max); do { gcry_randomize ((unsigned char *) &ret,