Skip to content

Commit

Permalink
Remove meaningless error
Browse files Browse the repository at this point in the history
  • Loading branch information
satoren committed Jun 11, 2016
1 parent b0f434e commit a48b20b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion include/kaguya/detail/lua_ref_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ namespace kaguya
if (!isNilref())
{
luaL_unref(state_, LUA_REGISTRYINDEX, ref_);
state_ = 0;
ref_ = LUA_REFNIL;
}
}
Expand Down
8 changes: 4 additions & 4 deletions include/kaguya/lua_ref.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ namespace kaguya
void typecheck()
{
int t = type();
if (t != TYPE_USERDATA && t != TYPE_NIL)
if (t != TYPE_USERDATA && t != TYPE_NIL && t != TYPE_NONE)
{
except::typeMismatchError(state(), "not user data");
Ref::RegistoryRef::unref();
Expand Down Expand Up @@ -395,7 +395,7 @@ namespace kaguya
void typecheck()
{
int t = type();
if (t != TYPE_TABLE && t != TYPE_NIL)
if (t != TYPE_TABLE && t != TYPE_NIL && t != TYPE_NONE)
{
except::typeMismatchError(state(), "not table");
Ref::RegistoryRef::unref();
Expand Down Expand Up @@ -458,7 +458,7 @@ namespace kaguya
void typecheck()
{
int t = type();
if (t != TYPE_FUNCTION && t != TYPE_NIL)
if (t != TYPE_FUNCTION && t != TYPE_NIL && t != TYPE_NONE)
{
except::typeMismatchError(state(), "not function");
RegistoryRef::unref();
Expand Down Expand Up @@ -656,7 +656,7 @@ namespace kaguya
void typecheck()
{
int t = type();
if (t != TYPE_THREAD && t != TYPE_NIL)
if (t != TYPE_THREAD && t != TYPE_NIL && t != TYPE_NONE)
{
except::typeMismatchError(state(), "not lua thread");
RegistoryRef::unref();
Expand Down
1 change: 1 addition & 0 deletions include/kaguya/type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ namespace kaguya
public:
enum value_type
{
TYPE_NONE = LUA_TNONE,//!< none type
TYPE_NIL = LUA_TNIL,//!< nil type
TYPE_BOOL = LUA_TBOOLEAN,//!< boolean type
TYPE_LIGHTUSERDATA = LUA_TLIGHTUSERDATA,//!< light userdata type
Expand Down

0 comments on commit a48b20b

Please sign in to comment.