gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r11678 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r11678 - gnunet/src/util
Date: Fri, 11 Jun 2010 23:58:28 +0200

Author: grothoff
Date: 2010-06-11 23:58:28 +0200 (Fri, 11 Jun 2010)
New Revision: 11678

Modified:
   gnunet/src/util/crypto_hash.c
   gnunet/src/util/test_time.c
Log:
use constants instead of casting -1

Modified: gnunet/src/util/crypto_hash.c
===================================================================
--- gnunet/src/util/crypto_hash.c       2010-06-11 21:57:37 UTC (rev 11677)
+++ gnunet/src/util/crypto_hash.c       2010-06-11 21:58:28 UTC (rev 11678)
@@ -688,7 +688,7 @@
 {
   int i;
   for (i = (sizeof (GNUNET_HashCode) / sizeof (uint32_t)) - 1; i >= 0; i--)
-    result->bits[i] = GNUNET_CRYPTO_random_u32 (mode, (uint32_t) - 1);
+    result->bits[i] = GNUNET_CRYPTO_random_u32 (mode, UINT32_MAX);
 }
 
 void

Modified: gnunet/src/util/test_time.c
===================================================================
--- gnunet/src/util/test_time.c 2010-06-11 21:57:37 UTC (rev 11677)
+++ gnunet/src/util/test_time.c 2010-06-11 21:58:28 UTC (rev 11678)
@@ -65,7 +65,7 @@
   GNUNET_assert (last.value == GNUNET_TIME_UNIT_FOREVER_ABS.value);
 
   /* check overflow for r2a */
-  rel.value = ((uint64_t) - 1LL) - 1024;
+  rel.value = (UINT64_MAX) - 1024;
   GNUNET_log_skip (1, GNUNET_NO);
   last = GNUNET_TIME_relative_to_absolute (rel);
   GNUNET_log_skip (0, GNUNET_NO);
@@ -124,7 +124,7 @@
   future = GNUNET_TIME_absolute_add (forever, GNUNET_TIME_UNIT_ZERO);
   GNUNET_assert (future.value == forever.value);
 
-  rel.value = ((uint64_t) - 1LL) - 1024;
+  rel.value = (UINT64_MAX) - 1024;
   now.value = rel.value;
   future = GNUNET_TIME_absolute_add (now, rel);
   GNUNET_assert (future.value == forever.value);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]