summaryrefslogtreecommitdiff
path: root/lib9p/map.h
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-05 08:14:27 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-05 08:14:27 -0600
commitcc3a585e37cf58b61cbea599cc4de93cf713834b (patch)
tree8f73af6ff3922acdefeb7a8475e364f1945a48a3 /lib9p/map.h
parent4f7cf6b416ccede492ace64533ab35a9a289f463 (diff)
compiles
Diffstat (limited to 'lib9p/map.h')
-rw-r--r--lib9p/map.h4
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