diff options
Diffstat (limited to 'lib9p/map.h')
-rw-r--r-- | lib9p/map.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib9p/map.h b/lib9p/map.h index ea9cdb6..833f4f5 100644 --- a/lib9p/map.h +++ b/lib9p/map.h @@ -28,8 +28,8 @@ #define MAP_KV(TNAME) CAT3(_,TNAME,_kv) #define MAP_METHOD(TNAME, MNAME) CAT3(TNAME,_,MNAME) #define MAP_FOREACH(m, k, v) \ - for (size_t i = 0, typeof(m->items[0].key) k, typeof(&m->items[0].val) v; i < ARRAY_LEN(m->items); i++) \ - if ( ({ k = m->items[i].key; v = &m->items[i].val; m->items[i].set; }) ) + for (size_t i = 0; i < ARRAY_LEN((m)->items); i++) \ + if ( ({ k = (m)->items[i].key; v = &(m)->items[i].val; (m)->items[i].set; }) ) #endif /* This implementation is just an array that we brute-force search |