projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
1fd0650
)
replaced some glib function calls to g_hash_table_*()
author
Holger Schemel
<info@artsoft.org>
Wed, 21 Feb 2024 23:34:24 +0000
(
00:34
+0100)
committer
Holger Schemel
<info@artsoft.org>
Wed, 21 Feb 2024 23:34:24 +0000
(
00:34
+0100)
src/game_bd/bd_cavedb.c
patch
|
blob
|
history
diff --git
a/src/game_bd/bd_cavedb.c
b/src/game_bd/bd_cavedb.c
index 8f24ab86fb08c9822eeb472ca60ef5083dd79932..804cd06e42599fb6ee863de5ed59c1319a8a2f6c 100644
(file)
--- a/
src/game_bd/bd_cavedb.c
+++ b/
src/game_bd/bd_cavedb.c
@@
-930,7
+930,7
@@
GdElement gd_element_get_hammered(GdElement elem)
void gd_cave_db_init(void)
{
int i;
void gd_cave_db_init(void)
{
int i;
-
GHashT
able *pointers;
+
struct hasht
able *pointers;
boolean lowercase_names = TRUE;
/* TRANSLATORS: some languages (for example, german) do not have lowercase nouns. */
boolean lowercase_names = TRUE;
/* TRANSLATORS: some languages (for example, german) do not have lowercase nouns. */
@@
-1000,7
+1000,7
@@
void gd_cave_db_init(void)
*/
/* check the cave property database for faults. */
*/
/* check the cave property database for faults. */
- pointers =
g_hash_table_new(g_direct_hash, g_direct_equal
);
+ pointers =
create_hashtable(get_hash_from_integer, hash_key_integers_are_equal, NULL, NULL
);
for (i = 0; gd_cave_properties[i].identifier != NULL; i++)
{
for (i = 0; gd_cave_properties[i].identifier != NULL; i++)
{
@@
-1078,7
+1078,8
@@
void gd_cave_db_init(void)
i, gd_cave_properties[i].name);
}
i, gd_cave_properties[i].name);
}
- another_prop = g_hash_table_lookup(pointers, GINT_TO_POINTER(gd_cave_properties[i].offset + 1));
+ another_prop = hashtable_search(pointers, INT_TO_PTR(gd_cave_properties[i].offset + 1));
+
if (another_prop != NULL)
{
Error("property %s has the same pointer as property %s",
if (another_prop != NULL)
{
Error("property %s has the same pointer as property %s",
@@
-1087,11
+1088,11
@@
void gd_cave_db_init(void)
else
{
/* value is the identifier, so we can report the OLD one if the check fails */
else
{
/* value is the identifier, so we can report the OLD one if the check fails */
-
g_hash_table_insert(pointers, GINT_TO_POINTE
R(gd_cave_properties[i].offset + 1),
-
gd_cave_properties[i].identifier);
+
hashtable_insert(pointers, INT_TO_PT
R(gd_cave_properties[i].offset + 1),
+ gd_cave_properties[i].identifier);
}
}
}
}
}
}
-
g_hash_
table_destroy(pointers);
+
hash
table_destroy(pointers);
}
}