git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use random_*() instead of rand(), for thread safety.
[sliver-openvswitch.git]
/
tests
/
test-hindex.c
diff --git
a/tests/test-hindex.c
b/tests/test-hindex.c
index
b5fe9f0
..
7a3ef72
100644
(file)
--- a/
tests/test-hindex.c
+++ b/
tests/test-hindex.c
@@
-21,6
+21,7
@@
#include "hindex.h"
#include <string.h>
#include "hash.h"
#include "hindex.h"
#include <string.h>
#include "hash.h"
+#include "random.h"
#include "util.h"
#undef NDEBUG
#include "util.h"
#undef NDEBUG
@@
-108,7
+109,7
@@
static void
shuffle(int *p, size_t n)
{
for (; n > 1; n--, p++) {
shuffle(int *p, size_t n)
{
for (; n > 1; n--, p++) {
- int *q = &p[rand
() % n
];
+ int *q = &p[rand
om_range(n)
];
int tmp = *p;
*p = *q;
*q = tmp;
int tmp = *p;
*p = *q;
*q = tmp;