summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lua/src
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/lua/src')
-rw-r--r--3rdparty/lua/src/liolib.c2
-rw-r--r--3rdparty/lua/src/lobject.c2
-rw-r--r--3rdparty/lua/src/loslib.c8
-rw-r--r--3rdparty/lua/src/lvm.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/3rdparty/lua/src/liolib.c b/3rdparty/lua/src/liolib.c
index 2a4ec4aa344..ab89e3508f4 100644
--- a/3rdparty/lua/src/liolib.c
+++ b/3rdparty/lua/src/liolib.c
@@ -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;
}
}
diff --git a/3rdparty/lua/src/lobject.c b/3rdparty/lua/src/lobject.c
index 882d994d413..5def409f05d 100644
--- a/3rdparty/lua/src/lobject.c
+++ b/3rdparty/lua/src/lobject.c
@@ -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;
diff --git a/3rdparty/lua/src/loslib.c b/3rdparty/lua/src/loslib.c
index 052ba174413..41aeeef81d1 100644
--- a/3rdparty/lua/src/loslib.c
+++ b/3rdparty/lua/src/loslib.c
@@ -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;
}
diff --git a/3rdparty/lua/src/lvm.c b/3rdparty/lua/src/lvm.c
index 141b9fd19c3..25fa82e7137 100644
--- a/3rdparty/lua/src/lvm.c
+++ b/3rdparty/lua/src/lvm.c
@@ -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: {