From 853290413f9e914d910fcfb401800ab6b67b375f Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 20 Aug 2015 16:18:15 +0200 Subject: [PATCH 1/2] fix segfault, disable intermittent test --- cmake | 2 +- critbit | 2 +- cutest | 2 +- dlmalloc | 2 +- iniparser | 2 +- quicklist | 2 +- src/buildno.h | 2 +- src/kernel/save.c | 2 +- storage | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake b/cmake index cd779ba36..f1fb3943a 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit cd779ba36efb4045a040af170588a8dfe496d7b9 +Subproject commit f1fb3943ace59994d90d71a891b80033dc2700a2 diff --git a/critbit b/critbit index 61989d933..e538739b3 160000 --- a/critbit +++ b/critbit @@ -1 +1 @@ -Subproject commit 61989d93368022602a2a7ac4218c83f254701f0f +Subproject commit e538739b38593b90312831a5e52d2e3bd731069b diff --git a/cutest b/cutest index 788659594..6e268687d 160000 --- a/cutest +++ b/cutest @@ -1 +1 @@ -Subproject commit 788659594ef87e9f497b8039da764182adfd2943 +Subproject commit 6e268687dbf6ae55afb63210c3753530d216a622 diff --git a/dlmalloc b/dlmalloc index 4292cd5e8..f1446c47c 160000 --- a/dlmalloc +++ b/dlmalloc @@ -1 +1 @@ -Subproject commit 4292cd5e81395d09a7457ab93659ea3b7784e958 +Subproject commit f1446c47ca1774ae84bf86a28502e91daf6b421a diff --git a/iniparser b/iniparser index f84066fb7..ecf956b98 160000 --- a/iniparser +++ b/iniparser @@ -1 +1 @@ -Subproject commit f84066fb7d3254bdd9e89694acc4c1c20d001eed +Subproject commit ecf956b9808c28c2db52e6b73930f57876dbb258 diff --git a/quicklist b/quicklist index 40ae38310..45f4577b8 160000 --- a/quicklist +++ b/quicklist @@ -1 +1 @@ -Subproject commit 40ae383100a8f012393ab29bc3d98e182fe57c19 +Subproject commit 45f4577b8205d87b78d2b1f30b5c9baa25c86779 diff --git a/src/buildno.h b/src/buildno.h index a0d2bfde8..d1479017e 100644 --- a/src/buildno.h +++ b/src/buildno.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 5 -#define VERSION_BUILD 5 +#define VERSION_BUILD 6 diff --git a/src/kernel/save.c b/src/kernel/save.c index 0c7608ea5..1223ac034 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1686,7 +1686,7 @@ int readgame(const char *filename, int backup) } } } - if (global.data_version < SPELL_LEVEL_VERSION) { + if (global.data_version < SPELL_LEVEL_VERSION && f->spellbook) { spellbook_foreach(f->spellbook, cb_sb_maxlevel, f); } } diff --git a/storage b/storage index bcc2874cf..86b967441 160000 --- a/storage +++ b/storage @@ -1 +1 @@ -Subproject commit bcc2874cf289a1d0fc9cc79ff3ed271403b2e24c +Subproject commit 86b96744157eb08c55998df4c12fa2e073005b49 From d69bf18e2324eeef109b24aac5a11e38e871054d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 20 Aug 2015 16:26:32 +0200 Subject: [PATCH 2/2] suspect some submodule shenanigans --- src/bind_region.c | 12 ++++++------ src/kernel/config.c | 2 +- src/kernel/item.c | 10 +++++----- src/keyword.c | 2 +- src/magic.c | 2 +- src/main.c | 6 +++--- src/skill.c | 2 +- src/util/attrib.c | 2 +- src/util/functions.c | 2 +- src/util/translation.c | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) 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));