aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-06-11 21:58:28 +0000
committerChristian Grothoff <christian@grothoff.org>2010-06-11 21:58:28 +0000
commitbe537ba3666dee493c43afc5c011c6d1d9b6a23a (patch)
tree26c06e549bdf9a5c6f984d240158af58928627b8 /src
parent719fb963b47d487112879ff2cb9d10cff88b84f5 (diff)
downloadgnunet-be537ba3666dee493c43afc5c011c6d1d9b6a23a.tar.gz
gnunet-be537ba3666dee493c43afc5c011c6d1d9b6a23a.zip
use constants instead of casting -1
Diffstat (limited to 'src')
-rw-r--r--src/util/crypto_hash.c2
-rw-r--r--src/util/test_time.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index 60104b604..73b9c9654 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -688,7 +688,7 @@ GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode,
688{ 688{
689 int i; 689 int i;
690 for (i = (sizeof (GNUNET_HashCode) / sizeof (uint32_t)) - 1; i >= 0; i--) 690 for (i = (sizeof (GNUNET_HashCode) / sizeof (uint32_t)) - 1; i >= 0; i--)
691 result->bits[i] = GNUNET_CRYPTO_random_u32 (mode, (uint32_t) - 1); 691 result->bits[i] = GNUNET_CRYPTO_random_u32 (mode, UINT32_MAX);
692} 692}
693 693
694void 694void
diff --git a/src/util/test_time.c b/src/util/test_time.c
index ec8d3e9ad..84147ecf9 100644
--- a/src/util/test_time.c
+++ b/src/util/test_time.c
@@ -65,7 +65,7 @@ check ()
65 GNUNET_assert (last.value == GNUNET_TIME_UNIT_FOREVER_ABS.value); 65 GNUNET_assert (last.value == GNUNET_TIME_UNIT_FOREVER_ABS.value);
66 66
67 /* check overflow for r2a */ 67 /* check overflow for r2a */
68 rel.value = ((uint64_t) - 1LL) - 1024; 68 rel.value = (UINT64_MAX) - 1024;
69 GNUNET_log_skip (1, GNUNET_NO); 69 GNUNET_log_skip (1, GNUNET_NO);
70 last = GNUNET_TIME_relative_to_absolute (rel); 70 last = GNUNET_TIME_relative_to_absolute (rel);
71 GNUNET_log_skip (0, GNUNET_NO); 71 GNUNET_log_skip (0, GNUNET_NO);
@@ -124,7 +124,7 @@ check ()
124 future = GNUNET_TIME_absolute_add (forever, GNUNET_TIME_UNIT_ZERO); 124 future = GNUNET_TIME_absolute_add (forever, GNUNET_TIME_UNIT_ZERO);
125 GNUNET_assert (future.value == forever.value); 125 GNUNET_assert (future.value == forever.value);
126 126
127 rel.value = ((uint64_t) - 1LL) - 1024; 127 rel.value = (UINT64_MAX) - 1024;
128 now.value = rel.value; 128 now.value = rel.value;
129 future = GNUNET_TIME_absolute_add (now, rel); 129 future = GNUNET_TIME_absolute_add (now, rel);
130 GNUNET_assert (future.value == forever.value); 130 GNUNET_assert (future.value == forever.value);