X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-hmap.c;h=c202eae14cd3e2314de77dfa5d49f7535c1f8d76;hb=add037c6b692db9c66dd0c16dff2d4b1b46c7499;hp=cf6ee1c9399a6b065ad74b7da18aefca4fa2d4ec;hpb=34e63086edddcae06d7c1a4fa84fec0861e50758;p=sliver-openvswitch.git diff --git a/tests/test-hmap.c b/tests/test-hmap.c index cf6ee1c93..c202eae14 100644 --- a/tests/test-hmap.c +++ b/tests/test-hmap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 2009, 2010 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ check_hmap(struct hmap *hmap, const int values[], size_t n, hmap_values = xmalloc(sizeof *sort_values * n); i = 0; - HMAP_FOR_EACH (e, struct element, node, hmap) { + HMAP_FOR_EACH (e, node, hmap) { assert(i < n); hmap_values[i++] = e->value; } @@ -77,8 +77,7 @@ check_hmap(struct hmap *hmap, const int values[], size_t n, for (i = 0; i < n; i++) { size_t count = 0; - HMAP_FOR_EACH_WITH_HASH (e, struct element, node, - hash(values[i]), hmap) { + HMAP_FOR_EACH_WITH_HASH (e, node, hash(values[i]), hmap) { count += e->value == values[i]; } assert(count == 1); @@ -124,7 +123,7 @@ print_hmap(const char *name, struct hmap *hmap) struct element *e; printf("%s:", name); - HMAP_FOR_EACH (e, struct element, node, hmap) { + HMAP_FOR_EACH (e, node, hmap) { printf(" %d(%zu)", e->value, e->node.hash & hmap->mask); } printf("\n"); @@ -157,7 +156,7 @@ good_hash(int value) } static size_t -constant_hash(int value UNUSED) +constant_hash(int value OVS_UNUSED) { return 123; } @@ -242,7 +241,7 @@ test_hmap_for_each_safe(hash_func *hash) i = 0; n_remaining = n; - HMAP_FOR_EACH_SAFE (e, next, struct element, node, &hmap) { + HMAP_FOR_EACH_SAFE (e, next, node, &hmap) { assert(i < n); if (pattern & (1ul << e->value)) { size_t j;