Skip to content

Commit

Permalink
Merge pull request tomaka#28 from stbuehler/fix-unused-variables
Browse files Browse the repository at this point in the history
Fix unused parameter warnings
  • Loading branch information
Habbie authored Mar 23, 2017
2 parents 8a1b7fd + 4901e73 commit 7d4e6f4
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions include/LuaContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class LuaContext {
* @tparam TType Type whose function belongs to
*/
template<typename TType>
void unregisterFunction(const std::string& functionName)
void unregisterFunction(const std::string& /*functionName*/)
{
lua_pushlightuserdata(mState, const_cast<std::type_info*>(&typeid(TType)));
lua_pushnil(mState);
Expand Down Expand Up @@ -1245,7 +1245,7 @@ class LuaContext {
std::array<char,512> buffer;

// read function ; "data" must be an instance of Reader
static const char* read(lua_State* l, void* data, size_t* size) {
static const char* read(lua_State* /*l*/, void* data, size_t* size) {
assert(size != nullptr);
assert(data != nullptr);
Reader& me = *static_cast<Reader*>(data);
Expand Down Expand Up @@ -1596,7 +1596,7 @@ class LuaContext {
* This functions reads multiple values starting at "index" and passes them to the callback
*/
template<typename TRetValue, typename TCallback>
static auto readIntoFunction(lua_State* state, tag<TRetValue>, TCallback&& callback, int index)
static auto readIntoFunction(lua_State* /*state*/, tag<TRetValue>, TCallback&& callback, int /*index*/)
-> TRetValue
{
return callback();
Expand Down Expand Up @@ -1718,7 +1718,7 @@ static LuaContext::Metatable_t ATTR_UNUSED
/* PARTIAL IMPLEMENTATIONS */
/**************************************************/
template<>
inline auto LuaContext::readTopAndPop<void>(lua_State* state, PushedObject obj)
inline auto LuaContext::readTopAndPop<void>(lua_State* /*state*/, PushedObject /*obj*/)
-> void
{
}
Expand Down Expand Up @@ -1908,8 +1908,7 @@ struct LuaContext::Pusher<std::nullptr_t> {
static const int minSize = 1;
static const int maxSize = 1;

static PushedObject push(lua_State* state, std::nullptr_t value) noexcept {
assert(value == nullptr);
static PushedObject push(lua_State* state, std::nullptr_t) noexcept {
lua_pushnil(state);
return PushedObject{state, 1};
}
Expand Down Expand Up @@ -2378,11 +2377,11 @@ struct LuaContext::Pusher<std::tuple<TTypes...>> {
push2(state, std::move(value), std::integral_constant<int,N+1>{});
}

static int push2(lua_State* state, const std::tuple<TTypes...>&, std::integral_constant<int,sizeof...(TTypes)>) noexcept {
static int push2(lua_State* /*state*/, const std::tuple<TTypes...>&, std::integral_constant<int,sizeof...(TTypes)>) noexcept {
return 0;
}

static int push2(lua_State* state, std::tuple<TTypes...>&&, std::integral_constant<int,sizeof...(TTypes)>) noexcept {
static int push2(lua_State* /*state*/, std::tuple<TTypes...>&&, std::integral_constant<int,sizeof...(TTypes)>) noexcept {
return 0;
}
};
Expand Down Expand Up @@ -2700,7 +2699,7 @@ struct LuaContext::Reader<boost::variant<TTypes...>>
template<typename TIterBegin, typename TIterEnd>
struct VariantReader<TIterBegin, TIterEnd, typename std::enable_if<boost::mpl::distance<TIterBegin, TIterEnd>::type::value == 0>::type>
{
static auto read(lua_State* state, int index)
static auto read(lua_State* /*state*/, int /*index*/)
-> boost::optional<ReturnType>
{
return boost::none;
Expand All @@ -2725,7 +2724,7 @@ struct LuaContext::Reader<boost::variant<TTypes...>>
template<>
struct LuaContext::Reader<std::tuple<>>
{
static auto read(lua_State* state, int index, int maxSize = 0)
static auto read(lua_State* /*state*/, int /*index*/, int /*maxSize*/ = 0)
-> boost::optional<std::tuple<>>
{
return std::tuple<>{};
Expand Down

0 comments on commit 7d4e6f4

Please sign in to comment.