summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Sluift/Lua/Value.cpp')
-rw-r--r--Sluift/Lua/Value.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Sluift/Lua/Value.cpp b/Sluift/Lua/Value.cpp
index 3164ec6..4f8078e 100644
--- a/Sluift/Lua/Value.cpp
+++ b/Sluift/Lua/Value.cpp
@@ -7,6 +7,9 @@
#include "Value.h"
+extern "C" {
#include <lualib.h>
+}
#include <boost/variant/apply_visitor.hpp>
+#include <boost/numeric/conversion/cast.hpp>
#include <Swiften/Base/foreach.h>
@@ -36,13 +39,13 @@ namespace {
void operator()(const std::vector<Value>& values) const {
- lua_createtable(state, values.size(), 0);
+ lua_createtable(state, boost::numeric_cast<int>(values.size()), 0);
for(size_t i = 0; i < values.size(); ++i) {
boost::apply_visitor(PushVisitor(state), values[i]);
- lua_rawseti(state, -2, i + 1);
+ lua_rawseti(state, -2, boost::numeric_cast<int>(i + 1));
}
}
void operator()(const std::map<std::string, boost::shared_ptr<Value> >& table) const {
- lua_createtable(state, 0, table.size());
+ lua_createtable(state, 0, boost::numeric_cast<int>(table.size()));
for(std::map<std::string, boost::shared_ptr<Value> >::const_iterator i = table.begin(); i != table.end(); ++i) {
boost::apply_visitor(PushVisitor(state), *i->second);