aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2009-12-29 20:19:54 +0100
committerMike Pall <mike>2009-12-29 20:19:54 +0100
commit52eb88773e88464cb5cc69b485d742468f66f2a2 (patch)
treeb308e25d1e11e95e8afb8a98358a20bff9737a0a /src
parentd64b031269e0a84af720dfd701e54109af7019f4 (diff)
downloadluajit-52eb88773e88464cb5cc69b485d742468f66f2a2.tar.gz
luajit-52eb88773e88464cb5cc69b485d742468f66f2a2.tar.bz2
luajit-52eb88773e88464cb5cc69b485d742468f66f2a2.zip
Fix narrowing casts of pointer differences for x64.
Diffstat (limited to 'src')
-rw-r--r--src/lib_base.c2
-rw-r--r--src/lib_io.c4
-rw-r--r--src/lj_err.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/lib_base.c b/src/lib_base.c
index 34282cfc..d9b953ee 100644
--- a/src/lib_base.c
+++ b/src/lib_base.c
@@ -337,7 +337,7 @@ LJLIB_CF(dofile)
337 if (luaL_loadfile(L, fname ? strdata(fname) : NULL) != 0) 337 if (luaL_loadfile(L, fname ? strdata(fname) : NULL) != 0)
338 lua_error(L); 338 lua_error(L);
339 lua_call(L, 0, LUA_MULTRET); 339 lua_call(L, 0, LUA_MULTRET);
340 return (L->top - L->base) - 1; 340 return cast_int(L->top - L->base) - 1;
341} 341}
342 342
343/* -- Base library: GC control -------------------------------------------- */ 343/* -- Base library: GC control -------------------------------------------- */
diff --git a/src/lib_io.c b/src/lib_io.c
index d69b99a4..6fb91609 100644
--- a/src/lib_io.c
+++ b/src/lib_io.c
@@ -194,7 +194,7 @@ static int io_file_readchars(lua_State *L, FILE *fp, size_t n)
194 194
195static int io_file_read(lua_State *L, FILE *fp, int start) 195static int io_file_read(lua_State *L, FILE *fp, int start)
196{ 196{
197 int ok, n, nargs = (L->top - L->base) - start; 197 int ok, n, nargs = cast_int(L->top - L->base) - start;
198 clearerr(fp); 198 clearerr(fp);
199 if (nargs == 0) { 199 if (nargs == 0) {
200 ok = io_file_readline(L, fp); 200 ok = io_file_readline(L, fp);
@@ -242,7 +242,7 @@ static int io_file_write(lua_State *L, FILE *fp, int start)
242 } else if (tvisnum(tv)) { 242 } else if (tvisnum(tv)) {
243 status = status && (fprintf(fp, LUA_NUMBER_FMT, numV(tv)) > 0); 243 status = status && (fprintf(fp, LUA_NUMBER_FMT, numV(tv)) > 0);
244 } else { 244 } else {
245 lj_lib_checkstr(L, tv-L->base+1); 245 lj_err_argt(L, cast_int(tv - L->base) + 1, LUA_TSTRING);
246 } 246 }
247 } 247 }
248 return io_pushresult(L, status, NULL); 248 return io_pushresult(L, status, NULL);
diff --git a/src/lj_err.c b/src/lj_err.c
index 02a7c4cc..da2555f9 100644
--- a/src/lj_err.c
+++ b/src/lj_err.c
@@ -677,7 +677,7 @@ LJ_NORET LJ_NOINLINE static void err_argmsg(lua_State *L, int narg,
677 const char *fname = "?"; 677 const char *fname = "?";
678 const char *ftype = getfuncname(L, L->base - 1, &fname); 678 const char *ftype = getfuncname(L, L->base - 1, &fname);
679 if (narg < 0 && narg > LUA_REGISTRYINDEX) 679 if (narg < 0 && narg > LUA_REGISTRYINDEX)
680 narg = (L->top - L->base) + narg + 1; 680 narg = cast_int(L->top - L->base) + narg + 1;
681 if (ftype && ftype[3] == 'h' && --narg == 0) /* Check for "method". */ 681 if (ftype && ftype[3] == 'h' && --narg == 0) /* Check for "method". */
682 msg = lj_str_pushf(L, err2msg(LJ_ERR_BADSELF), fname, msg); 682 msg = lj_str_pushf(L, err2msg(LJ_ERR_BADSELF), fname, msg);
683 else 683 else