Fixed LUA compile

This commit is contained in:
Miodrag Milanovic 2015-01-10 15:06:17 +01:00
parent b3382b22d3
commit 022e6c7a5b
8 changed files with 12 additions and 11 deletions

View file

@ -31,8 +31,8 @@
#include <assert.h>
#define LUA_LIB
#include "lua/lua.h"
#include "lua/lauxlib.h"
#include "lua.h"
#include "lauxlib.h"
#if LUA_VERSION_NUM > 501
//

View file

@ -556,7 +556,7 @@ static int f_seek (lua_State *L) {
if (op)
return luaL_fileresult(L, 0, NULL); /* error */
else {
lua_pushnumber(L, (lua_Number)l_ftell(f));
lua_pushnumber(L, (lua_Number)(1.0 * l_ftell(f)));
return 1;
}
}

View file

@ -104,7 +104,7 @@ static int isneg (const char **s) {
static lua_Number readhexa (const char **s, lua_Number r, int *count) {
for (; lisxdigit(cast_uchar(**s)); (*s)++) { /* read integer part */
r = (r * cast_num(16.0)) + cast_num(luaO_hexavalue(cast_uchar(**s)));
r = (r * cast_num(16.0)) + cast_num(1.0*luaO_hexavalue(cast_uchar(**s)));
(*count)++;
}
return r;

View file

@ -120,7 +120,7 @@ static int os_getenv (lua_State *L) {
static int os_clock (lua_State *L) {
lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC);
lua_pushnumber(L, ((lua_Number)(1.0*clock()))/(lua_Number)CLOCKS_PER_SEC);
return 1;
}
@ -194,7 +194,7 @@ static const char *checkoption (lua_State *L, const char *conv, char *buff) {
static int os_date (lua_State *L) {
const char *s = luaL_optstring(L, 1, "%c");
time_t t = luaL_opt(L, (time_t)luaL_checknumber, 2, time(NULL));
time_t t = luaL_opt(L, luaL_checknumber, 2, time(NULL));
struct tm tmr, *stm;
if (*s == '!') { /* UTC? */
stm = l_gmtime(&t, &tmr);
@ -264,8 +264,8 @@ static int os_time (lua_State *L) {
static int os_difftime (lua_State *L) {
lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)),
(time_t)(luaL_optnumber(L, 2, 0))));
lua_pushnumber(L, difftime((luaL_checknumber(L, 1)),
(luaL_optnumber(L, 2, 0))));
return 1;
}

View file

@ -339,7 +339,7 @@ void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) {
Table *h = hvalue(rb);
tm = fasttm(L, h->metatable, TM_LEN);
if (tm) break; /* metamethod? break switch to call it */
setnvalue(ra, cast_num(luaH_getn(h))); /* else primitive len */
setnvalue(ra, cast_num(1.0*luaH_getn(h))); /* else primitive len */
return;
}
case LUA_TSTRING: {

View file

@ -643,6 +643,7 @@ INCPATH += \
-I$(SRC)/lib/util \
-I$(SRC)/lib \
-I$(3RDPARTY) \
-I$(3RDPARTY)/lua/src \
-I$(SRC)/osd \
-I$(SRC)/osd/$(OSD) \

View file

@ -9,7 +9,7 @@
***************************************************************************/
#include <limits>
#include "lua/lua.hpp"
#include "lua.hpp"
#include "luabridge/Source/LuaBridge/LuaBridge.h"
#include <signal.h>
#include "emu.h"

View file

@ -24,7 +24,7 @@
#undef None
#endif
#include "lua/lua.hpp"
#include "lua.hpp"
#include "luabridge/Source/LuaBridge/LuaBridge.h"
struct lua_State;