Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / sgen / sgen-hash-table.h
index e6cfe43a5a051b65ee7408724afa9e84c0a24b85..389fca32a030da39da1e4b6e08f6fa9e32e9180f 100644 (file)
@@ -1,3 +1,7 @@
+/**
+ * \file
+ */
+
 #ifndef __MONO_SGENHASHTABLE_H__
 #define __MONO_SGENHASHTABLE_H__
 
@@ -42,9 +46,9 @@ void sgen_init_hash_table (void);
 
 #define sgen_hash_table_num_entries(h) ((h)->num_entries)
 
-#define sgen_hash_table_key_for_value_pointer(v)       (((SgenHashTableEntry*)((char*)(v) - G_STRUCT_OFFSET (SgenHashTableEntry, data)))->key)
+#define sgen_hash_table_key_for_value_pointer(v)       ((GCObject *)(((SgenHashTableEntry*)((char*)(v) - G_STRUCT_OFFSET (SgenHashTableEntry, data)))->key))
 
-#define SGEN_HASH_TABLE_FOREACH(h,k,v) do {                            \
+#define SGEN_HASH_TABLE_FOREACH(h,tk,k,tv,v) do {                              \
                SgenHashTable *__hash_table = (h);                      \
                SgenHashTableEntry **__table = __hash_table->table;     \
                guint __i;                                              \
@@ -53,8 +57,8 @@ void sgen_init_hash_table (void);
                        for (__iter = &__table [__i]; *__iter; __iter = __next) {       \
                                SgenHashTableEntry *__entry = *__iter;  \
                                __next = &__entry->next;        \
-                               (k) = __entry->key;                     \
-                               (v) = (gpointer)__entry->data;
+                               (k) = (tk)__entry->key;                 \
+                               (v) = (tv)__entry->data;
 
 /* The loop must be continue'd after using this! */
 #define SGEN_HASH_TABLE_FOREACH_REMOVE(free)   do {                    \