Thu, 04 Oct 2012 14:08:31 +0200
simplified UCX_MAP_FOREACH
test/map_tests.c | file | annotate | diff | comparison | revisions | |
ucx/map.h | file | annotate | diff | comparison | revisions |
--- a/test/map_tests.c Thu Oct 04 11:37:23 2012 +0200 +++ b/test/map_tests.c Thu Oct 04 14:08:31 2012 +0200 @@ -111,7 +111,8 @@ int check = 0; int hit = 0; - UCX_MAP_FOREACH(int*, v, map, i) { + int* v; + UCX_MAP_FOREACH(v, i) { check += *v; hit++; }
--- a/ucx/map.h Thu Oct 04 11:37:23 2012 +0200 +++ b/ucx/map.h Thu Oct 04 14:08:31 2012 +0200 @@ -7,14 +7,14 @@ #include "ucx.h" #include "string.h" -#include <stddef.h> +#include <stdio.h> #ifdef __cplusplus extern "C" { #endif -#define UCX_MAP_FOREACH(type,elm,map,iter) \ - for(type elm;ucx_map_iter_next(&iter,(void*)&elm)==0;) +#define UCX_MAP_FOREACH(elm,iter) \ + for(elm;ucx_map_iter_next(&iter,(void*)&elm)==0;) typedef struct UcxMap UcxMap; typedef struct UcxKey UcxKey;