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
Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch
[sliver-openvswitch.git]
/
tests
/
test-hmap.c
diff --git
a/tests/test-hmap.c
b/tests/test-hmap.c
index
c202eae
..
dd79dc9
100644
(file)
--- a/
tests/test-hmap.c
+++ b/
tests/test-hmap.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2008, 2009, 2010 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010
, 2013
Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-21,6
+21,7
@@
#include "hmap.h"
#include <string.h>
#include "hash.h"
#include "hmap.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;
@@
-124,7
+125,7
@@
print_hmap(const char *name, struct hmap *hmap)
printf("%s:", name);
HMAP_FOR_EACH (e, node, hmap) {
printf("%s:", name);
HMAP_FOR_EACH (e, node, hmap) {
- printf(" %d(%
zu
)", e->value, e->node.hash & hmap->mask);
+ printf(" %d(%
"PRIuSIZE"
)", e->value, e->node.hash & hmap->mask);
}
printf("\n");
}
}
printf("\n");
}