projects
/
platform
/
upstream
/
pixman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4cbeb0a
)
test: Fix for strict aliasing issue in 'get_random_seed'
author
Siarhei Siamashka
<siarhei.siamashka@gmail.com>
Sat, 23 Jun 2012 01:08:28 +0000
(
04:08
+0300)
committer
Siarhei Siamashka
<siarhei.siamashka@gmail.com>
Fri, 29 Jun 2012 00:23:09 +0000
(
03:23
+0300)
Gets rid of gcc warning when compiled with -fstrict-aliasing option in CFLAGS
test/utils.c
patch
|
blob
|
history
diff --git
a/test/utils.c
b/test/utils.c
index
0abc32c
..
563b33d
100644
(file)
--- 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 ();
}