Eliminate some Visual Studio warnings, rename itemnames->resourcenames.

This commit is contained in:
Enno Rehling 2014-06-29 15:41:04 -07:00
parent 16be68ada3
commit 7249630e3c
4 changed files with 8 additions and 8 deletions

View File

@ -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;
}

View File

@ -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) {

View File

@ -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;
}

View File

@ -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) {