From: Eric Sandeen Date: Sat, 23 Jun 2018 22:04:19 +0000 (-0400) Subject: libext2fs: remove c99 idiom to fix build X-Git-Tag: v1.44.3-rc1~22 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=60afa1d81664f8f7f39d5e4cf70b397e8d7154a7;p=tools%2Fe2fsprogs.git libext2fs: remove c99 idiom to fix build hashmap.c: In function ‘ext2fs_hashmap_free’: hashmap.c:72:2: error: ‘for’ loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < h->size; ++i) { ^ hashmap.c:72:2: note: use option -std=c99 or -std=gnu99 to compile your code make[2]: *** [hashmap.o] Error 1 Signed-off-by: Eric Sandeen Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/hashmap.c b/lib/ext2fs/hashmap.c index ade5d89..3d8ee81 100644 --- a/lib/ext2fs/hashmap.c +++ b/lib/ext2fs/hashmap.c @@ -69,7 +69,9 @@ void *ext2fs_hashmap_iter_in_order(struct ext2fs_hashmap *h, void ext2fs_hashmap_free(struct ext2fs_hashmap *h) { - for (size_t i = 0; i < h->size; ++i) { + size_t i; + + for (i = 0; i < h->size; ++i) { struct ext2fs_hashmap_entry *it = h->entries[i]; while (it) { struct ext2fs_hashmap_entry *tmp = it->next;