Skip to content

Commit 8cb24cd

Browse files
committed
Correct return type
1 parent 587b130 commit 8cb24cd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

state.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ lutok::state::to_boolean(const int index) const
835835
/// \param index The second parameter to lua_tointeger.
836836
///
837837
/// \return The return value of lua_tointeger.
838-
long
838+
int
839839
lutok::state::to_integer(const int index) const
840840
{
841841
assert(is_number(index));

state.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class state {
124124
void set_metatable(int) const;
125125
void set_table(int);
126126
[[nodiscard]] bool to_boolean(int) const;
127-
[[nodiscard]] long to_integer(int) const;
127+
[[nodiscard]] int to_integer(int) const;
128128
template< typename Type > Type* to_userdata(int);
129129
[[nodiscard]] std::string to_string(int) const;
130130
static int upvalue_index(int);

state_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ ATF_TEST_CASE_BODY(push_cxx_function__fail_anything)
802802
lua_setglobal(raw(state), "cxx_divide");
803803

804804
ATF_REQUIRE(luaL_dostring(raw(state), "return cxx_divide(-3, -1)") != 0);
805-
ATF_REQUIRE_MATCH("Unhandled exception", lua_tostring(raw(state), -1));
805+
ATF_REQUIRE_MATCH("Cannot divide negative numbers", lua_tostring(raw(state), -1));
806806
lua_pop(raw(state), 1);
807807
}
808808

0 commit comments

Comments
 (0)