simplified UCX_MAP_FOREACH

Thu, 04 Oct 2012 14:08:31 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 04 Oct 2012 14:08:31 +0200
changeset 41
7f90a03e186e
parent 40
583718dd4cf3
child 42
ff3dd1ee7dee

simplified UCX_MAP_FOREACH

test/map_tests.c file | annotate | diff | comparison | revisions
ucx/map.h file | annotate | diff | comparison | revisions
     1.1 --- a/test/map_tests.c	Thu Oct 04 11:37:23 2012 +0200
     1.2 +++ b/test/map_tests.c	Thu Oct 04 14:08:31 2012 +0200
     1.3 @@ -111,7 +111,8 @@
     1.4      int check = 0;
     1.5      int hit = 0;
     1.6  
     1.7 -    UCX_MAP_FOREACH(int*, v, map, i) {
     1.8 +    int* v;
     1.9 +    UCX_MAP_FOREACH(v, i) {
    1.10          check += *v;
    1.11          hit++;
    1.12      }
     2.1 --- a/ucx/map.h	Thu Oct 04 11:37:23 2012 +0200
     2.2 +++ b/ucx/map.h	Thu Oct 04 14:08:31 2012 +0200
     2.3 @@ -7,14 +7,14 @@
     2.4  
     2.5  #include "ucx.h"
     2.6  #include "string.h"
     2.7 -#include <stddef.h>
     2.8 +#include <stdio.h>
     2.9  
    2.10  #ifdef	__cplusplus
    2.11  extern "C" {
    2.12  #endif
    2.13  
    2.14 -#define UCX_MAP_FOREACH(type,elm,map,iter) \
    2.15 -        for(type elm;ucx_map_iter_next(&iter,(void*)&elm)==0;)
    2.16 +#define UCX_MAP_FOREACH(elm,iter) \
    2.17 +        for(elm;ucx_map_iter_next(&iter,(void*)&elm)==0;)
    2.18  
    2.19  typedef struct UcxMap          UcxMap;
    2.20  typedef struct UcxKey          UcxKey;

mercurial