diff --git a/src/kernel/item.c b/src/kernel/item.c index 729a94679..c21942fae 100644 --- a/src/kernel/item.c +++ b/src/kernel/item.c @@ -622,7 +622,7 @@ const potion_type *oldpotiontype[MAXPOTIONS + 1]; /*** alte items ***/ -const char *itemnames[MAX_RESOURCES] = { +static const char *resourcenames[MAX_RESOURCES] = { "iron", "stone", "horse", "ao_healing", "aots", "roi", "rop", "ao_chastity", "laen", "fairyboot", "aoc", "pegasus", @@ -635,14 +635,14 @@ const char *itemnames[MAX_RESOURCES] = { const resource_type *get_resourcetype(resource_t type) { static int update; - static const struct resource_type *rtypes[MAX_RESOURCES]; + static struct resource_type * rtypes[MAX_RESOURCES]; if (update!=num_resources) { memset(rtypes, 0, sizeof(rtypes)); update = num_resources; } const resource_type *rtype = rtypes[type]; if (!rtype) { - rtype = rtypes[type] = rt_find(itemnames[type]); + rtype = rtypes[type] = rt_find(resourcenames[type]); } return rtype; } diff --git a/src/kernel/jsonconf.test.c b/src/kernel/jsonconf.test.c index 7dba7e145..e59996d47 100644 --- a/src/kernel/jsonconf.test.c +++ b/src/kernel/jsonconf.test.c @@ -27,7 +27,7 @@ static void check_flag(CuTest *tc, const char *name, int flag) { rc = rc_find("orc"); CuAssertPtrNotNull(tc, rc); CuAssertIntEquals(tc, flag, rc->flags); - CuAssertIntEquals(tc, 1, rc->speed); + CuAssertDblEquals(tc, 1.0f, rc->speed, 0.0f); } static void test_flags(CuTest *tc) { diff --git a/src/kernel/move.c b/src/kernel/move.c index df9fc4af0..b47395587 100644 --- a/src/kernel/move.c +++ b/src/kernel/move.c @@ -849,11 +849,11 @@ static unit *bewegung_blockiert_von(unit * reisender, region * r) if (gamecookie < 0 || gamecookie != global.cookie) { base_prob = - get_param_flt(global.parameters, "rules.guard.base_stop_prob", .3); + get_param_flt(global.parameters, "rules.guard.base_stop_prob", .3f); skill_prob = - get_param_flt(global.parameters, "rules.guard.skill_stop_prob", .1); + get_param_flt(global.parameters, "rules.guard.skill_stop_prob", .1f); amulet_prob = - get_param_flt(global.parameters, "rules.guard.amulet_stop_prob", .1); + get_param_flt(global.parameters, "rules.guard.amulet_stop_prob", .1f); gamecookie = global.cookie; } diff --git a/src/sqlite.c b/src/sqlite.c index d33b03555..37ac8f24f 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -114,7 +114,7 @@ static int insert_faction(sqlite3 *db, int game_id, faction *f) { sqlite3_bind_text(stmt, 2, f->race->_name[0], -1, SQLITE_STATIC); sqlite3_step(stmt); sqlite3_finalize(stmt); - return sqlite3_last_insert_rowid(db); + return (int)sqlite3_last_insert_rowid(db); } static void update_faction(sqlite3 *db, const faction *f) {