diff --git a/src/bind_region.c b/src/bind_region.c index 792f15ac0..d4979d467 100644 --- a/src/bind_region.c +++ b/src/bind_region.c @@ -355,7 +355,7 @@ static int tolua_region_get_resource(lua_State * L) const char *type; const resource_type *rtype; int result = 0; - const void * matches; + void * match; critbit_tree * cb = special_resources(); r = (region *)tolua_tousertype(L, 1, 0); @@ -363,8 +363,8 @@ static int tolua_region_get_resource(lua_State * L) type = tolua_tostring(L, 2, 0); LUA_ASSERT(type != NULL, "invalid parameter"); - if (cb_find_prefix(cb, type, strlen(type) + 1, &matches, 1, 0)) { - cb_get_kv(matches, &result, sizeof(result)); + if (cb_find_prefix(cb, type, strlen(type) + 1, &match, 1, 0)) { + cb_get_kv(match, &result, sizeof(result)); switch (result) { case 0: case 1: @@ -399,10 +399,10 @@ static int tolua_region_set_resource(lua_State * L) const char *type = tolua_tostring(L, 2, 0); int result, value = (int)tolua_tonumber(L, 3, 0); critbit_tree * cb = special_resources(); - const void * matches; + void * match; - if (cb_find_prefix(cb, type, strlen(type) + 1, &matches, 1, 0)) { - cb_get_kv(matches, &result, sizeof(result)); + if (cb_find_prefix(cb, type, strlen(type) + 1, &match, 1, 0)) { + cb_get_kv(match, &result, sizeof(result)); switch (result) { case 0: case 1: diff --git a/src/kernel/config.c b/src/kernel/config.c index 7cdf44ea8..83a0f4428 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -688,7 +688,7 @@ param_t findparam(const char *s, const struct locale * lang) if (str && *str) { int i; - const void * match; + void * match; void **tokens = get_translations(lang, UT_PARAMS); critbit_tree *cb = (critbit_tree *)*tokens; if (!cb) { diff --git a/src/kernel/item.c b/src/kernel/item.c index 229fd3568..ff481e048 100644 --- a/src/kernel/item.c +++ b/src/kernel/item.c @@ -379,11 +379,11 @@ const potion_type *resource2potion(const resource_type * rtype) resource_type *rt_find(const char *name) { - const void * matches; + void * match; resource_type *result = 0; - if (cb_find_prefix(&cb_resources, name, strlen(name) + 1, &matches, 1, 0)) { - cb_get_kv(matches, &result, sizeof(result)); + if (cb_find_prefix(&cb_resources, name, strlen(name) + 1, &match, 1, 0)) { + cb_get_kv(match, &result, sizeof(result)); } return result; } @@ -1064,7 +1064,7 @@ const resource_type *findresourcetype(const char *name, const struct locale *lan char buffer[128]; if (transliterate(buffer, sizeof(buffer), name)) { - const void * match; + void * match; if (!cb->root) { /* first-time initialization of resource names for this locale */ cb_foreach(&cb_resources, "", 0, add_resourcename_cb, (void *)lang); @@ -1117,7 +1117,7 @@ const item_type *finditemtype(const char *name, const struct locale *lang) assert(name); if (transliterate(buffer, sizeof(buffer), name)) { - const void * match; + void * match; if (!cb->root) { /* first-time initialization of item names for this locale */ cb_foreach(&cb_resources, "", 0, add_itemname_cb, (void *)lang); diff --git a/src/keyword.c b/src/keyword.c index 1ffdc4c3c..683b1d2c2 100644 --- a/src/keyword.c +++ b/src/keyword.c @@ -58,7 +58,7 @@ keyword_t get_keyword(const char *s, const struct locale *lang) { if (str) { int i; - const void *match; + void *match; void **tokens = get_translations(lang, UT_KEYWORDS); critbit_tree *cb = (critbit_tree *)*tokens; if (cb && cb_find_prefix(cb, str, strlen(str), &match, 1, 0)) { diff --git a/src/magic.c b/src/magic.c index 9ad9e0ad9..b449a4cd9 100644 --- a/src/magic.c +++ b/src/magic.c @@ -2966,7 +2966,7 @@ spellbook * get_spellbook(const char * name) { char buffer[64]; spellbook * result; - const void * match; + void * match; if (cb_find_prefix(&cb_spellbooks, name, strlen(name), &match, 1, 0)) { cb_get_kv(match, &result, sizeof(result)); diff --git a/src/main.c b/src/main.c index 8b1c8d984..547e15548 100644 --- a/src/main.c +++ b/src/main.c @@ -80,13 +80,13 @@ static void load_inifile(dictionary * d) str = iniparser_getstring(d, "eressea:locales", "de,en"); make_locales(str); - if (global.inifile) iniparser_free(global.inifile); + if (global.inifile) iniparser_freedict(global.inifile); global.inifile = d; } static void parse_config(const char *filename) { - dictionary *d = iniparser_new(filename); + dictionary *d = iniparser_load(filename); if (d) { load_inifile(d); log_debug("reading from configuration file %s\n", filename); @@ -318,7 +318,7 @@ int main(int argc, char **argv) lua_done(L); log_close(); if (global.inifile) { - iniparser_free(global.inifile); + iniparser_freedict(global.inifile); } return 0; } diff --git a/src/skill.c b/src/skill.c index 7b4551683..3bee18005 100644 --- a/src/skill.c +++ b/src/skill.c @@ -97,7 +97,7 @@ skill_t get_skill(const char *s, const struct locale * lang) char * str = transliterate(buffer, sizeof(buffer) - sizeof(int), s); if (str) { int i; - const void * match; + void * match; void **tokens = get_translations(lang, UT_SKILLS); struct critbit_tree *cb = (critbit_tree *)*tokens; if (cb && cb_find_prefix(cb, str, strlen(str), &match, 1, 0)) { diff --git a/src/util/attrib.c b/src/util/attrib.c index dd1120b5c..cf2c4f000 100644 --- a/src/util/attrib.c +++ b/src/util/attrib.c @@ -299,7 +299,7 @@ int a_read(struct storage *store, attrib ** attribs, void *owner) na = a_new(at); } else { - const void * kv = 0; + void * kv = 0; cb_find_prefix(&cb_deprecated, zText, strlen(zText) + 1, &kv, 1, 0); if (kv) { cb_get_kv(kv, &reader, sizeof(reader)); diff --git a/src/util/functions.c b/src/util/functions.c index 8b999695e..9d0afb63d 100644 --- a/src/util/functions.c +++ b/src/util/functions.c @@ -30,7 +30,7 @@ static critbit_tree cb_functions; pf_generic get_function(const char *name) { - const void * matches; + void * matches; pf_generic result; if (cb_find_prefix(&cb_functions, name, strlen(name) + 1, &matches, 1, 0)) { cb_get_kv(matches, &result, sizeof(result)); diff --git a/src/util/translation.c b/src/util/translation.c index 804aaf4c0..d73074294 100644 --- a/src/util/translation.c +++ b/src/util/translation.c @@ -168,7 +168,7 @@ void add_function(const char *symbol, evalfun parse) static evalfun find_function(const char *symbol) { - const void * matches; + void * matches; if (cb_find_prefix(&functions, symbol, strlen(symbol) + 1, &matches, 1, 0)) { evalfun result; cb_get_kv(matches, &result, sizeof(result));