Whamcloud - gitweb
libext2fs: hide struct ext2fs_hashmap as an internal implementation detail
authorTheodore Ts'o <tytso@mit.edu>
Fri, 10 May 2019 23:00:13 +0000 (19:00 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 12 May 2019 06:23:08 +0000 (02:23 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/hashmap.c
lib/ext2fs/hashmap.h

index 3d8ee81..ffe61ce 100644 (file)
@@ -1,6 +1,22 @@
 #include "hashmap.h"
 #include <string.h>
 
+struct ext2fs_hashmap {
+       uint32_t size;
+       uint32_t(*hash)(const void *key, size_t len);
+       void(*free)(void*);
+       struct ext2fs_hashmap_entry *first;
+       struct ext2fs_hashmap_entry *last;
+#if __GNUC_PREREQ (4, 8)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
+#endif
+       struct ext2fs_hashmap_entry *entries[0];
+#if __GNUC_PREREQ (4, 8)
+#pragma GCC diagnostic pop
+#endif
+};
+
 uint32_t ext2fs_djb2_hash(const void *str, size_t size)
 {
        int c;
index 656d3d9..dcfa745 100644 (file)
 #endif
 #endif
 
-struct ext2fs_hashmap {
-       uint32_t size;
-       uint32_t(*hash)(const void *key, size_t len);
-       void(*free)(void*);
-       struct ext2fs_hashmap_entry *first;
-       struct ext2fs_hashmap_entry *last;
-       struct ext2fs_hashmap_entry {
-               void *data;
-               const void *key;
-               size_t key_len;
-               struct ext2fs_hashmap_entry *next;
-               struct ext2fs_hashmap_entry *list_next;
-               struct ext2fs_hashmap_entry *list_prev;
-#if __GNUC_PREREQ (4, 8)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
-       } *entries[0];
-#if __GNUC_PREREQ (4, 8)
-#pragma GCC diagnostic pop
-#endif
+struct ext2fs_hashmap;
+
+struct ext2fs_hashmap_entry {
+       void *data;
+       const void *key;
+       size_t key_len;
+       struct ext2fs_hashmap_entry *next;
+       struct ext2fs_hashmap_entry *list_next;
+       struct ext2fs_hashmap_entry *list_prev;
 };
 
 struct ext2fs_hashmap *ext2fs_hashmap_create(