Skip to content

Commit

Permalink
Merge pull request #5 from decimad/master
Browse files Browse the repository at this point in the history
Repo Sync
  • Loading branch information
Wohlstand committed Apr 28, 2016
2 parents da16ef1 + 5317207 commit 6f0cb70
Show file tree
Hide file tree
Showing 26 changed files with 329 additions and 337 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ include_directories(
${LUA_INCLUDE_DIRS})

add_subdirectory(src)
add_subdirectory(test)

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
if(LUABIND_BUILD_TESTING)
Expand Down
2 changes: 1 addition & 1 deletion luabind/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
// C code has undefined behavior, lua is written in C).

#ifdef LUABIND_DYNAMIC_LINK
# if defined (BOOST_WINDOWS)
# if defined (_WIN32)
# ifdef LUABIND_BUILDING
# define LUABIND_API __declspec(dllexport)
# else
Expand Down
2 changes: 1 addition & 1 deletion luabind/detail/call_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace luabind
push_arguments<PolicyList, 1>(L, std::forward<Args>(args)...);

if(Function(L, sizeof...(Args), 0)) {
assert(lua_gettop(L)==top-NumParams+1);
assert(lua_gettop(L)==int(top-NumParams+1));
call_error(L);
}
// pops the return values from the function call
Expand Down
4 changes: 2 additions & 2 deletions luabind/detail/call_shared.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ namespace luabind {
throw cast_failed(L, typeid(T));
#else
cast_failed_callback_fun e = get_cast_failed_callback();
if (e) e(L, typeid(Ret));
if (e) e(L, typeid(T));

assert(0 && "the lua function's return value could not be converted."
" If you want to handle the error you can use luabind::set_error_callback()");
" If you want to handle the error you can use luabind::set_cast_failed_callback()");
std::terminate();
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion luabind/detail/class_rep.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ namespace luabind { namespace detail
class_id_map* m_classes;
};

bool is_class_rep(lua_State* L, int index);
LUABIND_API bool is_class_rep(lua_State* L, int index);

}}

Expand Down
1 change: 1 addition & 0 deletions luabind/detail/conversion_policies/conversion_policies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <luabind/detail/conversion_policies/lua_proxy_converter.hpp>
#include <luabind/detail/conversion_policies/native_converter.hpp>
#include <luabind/detail/conversion_policies/function_converter.hpp>
#include <luabind/shared_ptr_converter.hpp>

namespace luabind {

Expand Down
5 changes: 5 additions & 0 deletions luabind/detail/conversion_policies/native_converter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ namespace luabind {
: default_converter<char const*>
{};

template <std::size_t N>
struct default_converter <char(&)[N]>
: default_converter<char const*>
{};

template <std::size_t N>
struct default_converter <const char(&)[N]>
: default_converter<char const*>
Expand Down
2 changes: 1 addition & 1 deletion luabind/detail/crtp_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace luabind {

CRTP operator++(int)
{
CRTP tmp(*this);
CRTP tmp(upcast());
upcast().increment();
return tmp;
}
Expand Down
9 changes: 6 additions & 3 deletions luabind/detail/format_signature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,12 @@ LUABIND_TYPE_TO_STRING(luabind::argument)
, true
, typename meta::pop_front<Signature>::type()
);
lua_pushstring(L, ")");

lua_concat(L, static_cast<int>(meta::size<Signature>::value) * 2 + 2);
lua_pushstring(L, ")");
size_t sz = meta::size<Signature>::value;
size_t ncat = sz * 2 + 2;
if (sz == 1)
++ncat;
lua_concat(L, ncat);
}

} // namespace detail
Expand Down
Loading

0 comments on commit 6f0cb70

Please sign in to comment.