Skip to content

Commit

Permalink
Fixed another 64 bit bug.
Browse files Browse the repository at this point in the history
The getValue clause checks if T is compatible with lua_Integer, but an explicit cast is still needed when lua_Integer is bigger than T.
  • Loading branch information
Jakob Ovrum committed Jul 26, 2011
1 parent 4f0d97f commit ea2d9c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions luad/stack.d
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ T getValue(T, alias typeMismatchHandler = defaultTypeMismatch)(lua_State* L, int
return lua_toboolean(L, idx);

else static if(is(T : lua_Integer))
return lua_tointeger(L, idx);
return cast(T)lua_tointeger(L, idx);

else static if(is(T : lua_Number))
return lua_tonumber(L, idx);
return cast(T)lua_tonumber(L, idx);

else static if(is(T : string))
{
Expand Down

1 comment on commit ea2d9c5

@Trass3r
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.