Fix some things that confuse MSVC.

develop
Alexander Gavrilov 2012-05-05 20:46:28 +04:00
parent e3440126a3
commit 81f2240c23
4 changed files with 7 additions and 7 deletions

@ -520,7 +520,7 @@ static int dfhack_matinfo_matches(lua_State *state)
else if (lua_istable(state, 2)) else if (lua_istable(state, 2))
{ {
df::dfhack_material_category tmp; df::dfhack_material_category tmp;
Lua::CheckDFObject(state, &tmp, 2, false); Lua::CheckDFAssign(state, &tmp, 2, false);
lua_pushboolean(state, info.matches(tmp)); lua_pushboolean(state, info.matches(tmp));
} }
else else
@ -733,7 +733,7 @@ static int maps_getTileBlock(lua_State *L)
if (lua_gettop(L) == 1) if (lua_gettop(L) == 1)
{ {
df::coord pos; df::coord pos;
Lua::CheckDFObject(L, &pos, 1); Lua::CheckDFAssign(L, &pos, 1);
block = Maps::getTileBlock(pos); block = Maps::getTileBlock(pos);
} }
else else

@ -829,7 +829,7 @@ bool DFHack::Lua::AssignDFObject(color_ostream &out, lua_State *state,
return doAssignDFObject(&out, state, type, target, val_index, exact_type, perr, false); return doAssignDFObject(&out, state, type, target, val_index, exact_type, perr, false);
} }
void DFHack::Lua::CheckDFObject(lua_State *state, type_identity *type, void DFHack::Lua::CheckDFAssign(lua_State *state, type_identity *type,
void *target, int val_index, bool exact_type) void *target, int val_index, bool exact_type)
{ {
doAssignDFObject(NULL, state, type, target, val_index, exact_type, false, true); doAssignDFObject(NULL, state, type, target, val_index, exact_type, false, true);

@ -119,7 +119,7 @@ namespace DFHack {namespace Lua {
* Assign the value at val_index to the target of given identity using df.assign(). * Assign the value at val_index to the target of given identity using df.assign().
* Otherwise throws an error. * Otherwise throws an error.
*/ */
DFHACK_EXPORT void CheckDFObject(lua_State *state, type_identity *type, DFHACK_EXPORT void CheckDFAssign(lua_State *state, type_identity *type,
void *target, int val_index, bool exact_type = false); void *target, int val_index, bool exact_type = false);
/** /**
@ -161,8 +161,8 @@ namespace DFHack {namespace Lua {
* Throws in case of an error. * Throws in case of an error.
*/ */
template<class T> template<class T>
void CheckDFObject(lua_State *state, T *target, int val_index, bool exact_type = false) { void CheckDFAssign(lua_State *state, T *target, int val_index, bool exact_type = false) {
CheckDFObject(state, df::identity_traits<T>::get(), target, val_index, exact_type); CheckDFAssign(state, df::identity_traits<T>::get(), target, val_index, exact_type);
} }
/** /**

@ -559,7 +559,7 @@ bool Buildings::setSize(df::building *bld, df::coord2d size, int direction)
bool ok = checkBuildingTiles(bld, true); bool ok = checkBuildingTiles(bld, true);
if (type != building_type::Construction) if (type != Construction)
bld->setMaterialAmount(computeMaterialAmount(bld)); bld->setMaterialAmount(computeMaterialAmount(bld));
return ok; return ok;