From 8e611d759dc0879251c065fe13e394a2a3437519 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 16 Feb 2014 13:47:53 -0800 Subject: [PATCH] eliminate intellisense warnings. OCD kind of stuff. Visual Studio complains about these, but they aren't really anything severe. --- core/src/bindings/bind_faction.c | 4 ++-- core/src/bindings/bind_gmtool.c | 2 +- core/src/bindings/bind_unit.c | 4 ++-- core/src/kernel/battle.c | 2 +- core/src/kernel/building.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/bindings/bind_faction.c b/core/src/bindings/bind_faction.c index 775cb5ab8..53a4f4fc7 100644 --- a/core/src/bindings/bind_faction.c +++ b/core/src/bindings/bind_faction.c @@ -127,11 +127,11 @@ static int tolua_faction_set_magic(lua_State * L) { faction *self = (faction *) tolua_tousertype(L, 1, 0); const char *type = tolua_tostring(L, 2, 0); - magic_t mtype; + int mtype; for (mtype = 0; mtype != MAXMAGIETYP; ++mtype) { if (strcmp(magic_school[mtype], type) == 0) { - self->magiegebiet = mtype; + self->magiegebiet = (magic_t)mtype; break; } } diff --git a/core/src/bindings/bind_gmtool.c b/core/src/bindings/bind_gmtool.c index 01e4dff80..9a1483b76 100644 --- a/core/src/bindings/bind_gmtool.c +++ b/core/src/bindings/bind_gmtool.c @@ -23,7 +23,7 @@ static int tolua_run_mapper(lua_State * L) static int tolua_highlight_region(lua_State * L) { - region *r = tolua_tousertype(L, 1, 0); + region *r = (region *)tolua_tousertype(L, 1, 0); int select = tolua_toboolean(L, 2, 0); highlight_region(r, select); return 0; diff --git a/core/src/bindings/bind_unit.c b/core/src/bindings/bind_unit.c index e19684bdc..cbb840305 100755 --- a/core/src/bindings/bind_unit.c +++ b/core/src/bindings/bind_unit.c @@ -273,7 +273,7 @@ static int tolua_unit_get_magic(lua_State * L) static void unit_setmagic(unit * u, const char *type) { sc_mage *mage = get_mage(u); - magic_t mtype; + int mtype; for (mtype = 0; mtype != MAXMAGIETYP; ++mtype) { if (strcmp(magic_school[mtype], type) == 0) break; @@ -281,7 +281,7 @@ static void unit_setmagic(unit * u, const char *type) if (mtype == MAXMAGIETYP) return; if (mage == NULL) { - mage = create_mage(u, mtype); + mage = create_mage(u, (magic_t)mtype); } } diff --git a/core/src/kernel/battle.c b/core/src/kernel/battle.c index b38443fd6..039e7d35a 100644 --- a/core/src/kernel/battle.c +++ b/core/src/kernel/battle.c @@ -3404,7 +3404,7 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack) for (itm = u->items; itm; itm = itm->next) { if (itm->type->rtype->atype) { if (i_canuse(u, itm->type)) { - struct armor *adata = malloc(sizeof(armor)), **aptr; + struct armor *adata = (struct armor *)malloc(sizeof(armor)), **aptr; adata->atype = itm->type->rtype->atype; adata->count = itm->number; for (aptr = &fig->armors; *aptr; aptr = &(*aptr)->next) { diff --git a/core/src/kernel/building.c b/core/src/kernel/building.c index 4b0c08eae..f8a749187 100644 --- a/core/src/kernel/building.c +++ b/core/src/kernel/building.c @@ -376,7 +376,7 @@ const building_type *findbuildingtype(const char *name, quicklist *ql = buildingtypes; int qi; - bn = calloc(sizeof(local_names), 1); + bn = (local_names *)calloc(sizeof(local_names), 1); bn->next = bnames; bn->lang = lang;