From 81f2240c237253a7a2264c1b9682a291337667b0 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sat, 5 May 2012 20:46:28 +0400 Subject: [PATCH] Fix some things that confuse MSVC. --- library/LuaApi.cpp | 4 ++-- library/LuaTools.cpp | 2 +- library/include/LuaTools.h | 6 +++--- library/modules/Buildings.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index ea723df64..6a8100a34 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -520,7 +520,7 @@ static int dfhack_matinfo_matches(lua_State *state) else if (lua_istable(state, 2)) { df::dfhack_material_category tmp; - Lua::CheckDFObject(state, &tmp, 2, false); + Lua::CheckDFAssign(state, &tmp, 2, false); lua_pushboolean(state, info.matches(tmp)); } else @@ -733,7 +733,7 @@ static int maps_getTileBlock(lua_State *L) if (lua_gettop(L) == 1) { df::coord pos; - Lua::CheckDFObject(L, &pos, 1); + Lua::CheckDFAssign(L, &pos, 1); block = Maps::getTileBlock(pos); } else diff --git a/library/LuaTools.cpp b/library/LuaTools.cpp index 10ff51ba1..794cb52a6 100644 --- a/library/LuaTools.cpp +++ b/library/LuaTools.cpp @@ -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); } -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) { doAssignDFObject(NULL, state, type, target, val_index, exact_type, false, true); diff --git a/library/include/LuaTools.h b/library/include/LuaTools.h index 669d4d38b..c3a7921c3 100644 --- a/library/include/LuaTools.h +++ b/library/include/LuaTools.h @@ -119,7 +119,7 @@ namespace DFHack {namespace Lua { * Assign the value at val_index to the target of given identity using df.assign(). * 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); /** @@ -161,8 +161,8 @@ namespace DFHack {namespace Lua { * Throws in case of an error. */ template - void CheckDFObject(lua_State *state, T *target, int val_index, bool exact_type = false) { - CheckDFObject(state, df::identity_traits::get(), target, val_index, exact_type); + void CheckDFAssign(lua_State *state, T *target, int val_index, bool exact_type = false) { + CheckDFAssign(state, df::identity_traits::get(), target, val_index, exact_type); } /** diff --git a/library/modules/Buildings.cpp b/library/modules/Buildings.cpp index e587a4916..cdaa016fb 100644 --- a/library/modules/Buildings.cpp +++ b/library/modules/Buildings.cpp @@ -559,7 +559,7 @@ bool Buildings::setSize(df::building *bld, df::coord2d size, int direction) bool ok = checkBuildingTiles(bld, true); - if (type != building_type::Construction) + if (type != Construction) bld->setMaterialAmount(computeMaterialAmount(bld)); return ok;