summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiarhei Siamashka <siarhei.siamashka@gmail.com>2012-06-23 04:08:28 +0300
committerSiarhei Siamashka <siarhei.siamashka@gmail.com>2012-06-29 03:23:09 +0300
commit387e9bcddb90bd2c7d1dfb81c073196f9f81042d (patch)
treeb15377a3f2ce7add3b36a3a40de08a6d08069357
parent4cbeb0aedccde5d2eb87daec08040a8bf161f6d7 (diff)
test: Fix for strict aliasing issue in 'get_random_seed'
Gets rid of gcc warning when compiled with -fstrict-aliasing option in CFLAGS
-rw-r--r--test/utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/utils.c b/test/utils.c
index 0abc32c6..563b33d5 100644
--- a/test/utils.c
+++ b/test/utils.c
@@ -686,9 +686,9 @@ gettime (void)
uint32_t
get_random_seed (void)
{
- double d = gettime();
-
- lcg_srand (*(uint32_t *)&d);
+ union { double d; uint32_t u32; } t;
+ t.d = gettime();
+ lcg_srand (t.u32);
return lcg_rand_u32 ();
}