mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix compiler warnings.
Reported by gan74.
This commit is contained in:
parent
d13610a845
commit
fffd3eafc4
@ -128,7 +128,7 @@ LJLIB_CF(buffer_method_put) LJLIB_REC(.)
|
|||||||
lj_strfmt_putfnum((SBuf *)sbx, STRFMT_G14, numV(o));
|
lj_strfmt_putfnum((SBuf *)sbx, STRFMT_G14, numV(o));
|
||||||
} else if (tvisbuf(o)) {
|
} else if (tvisbuf(o)) {
|
||||||
SBufExt *sbx2 = bufV(o);
|
SBufExt *sbx2 = bufV(o);
|
||||||
if (sbx2 == sbx) lj_err_arg(L, arg+1, LJ_ERR_BUFFER_SELF);
|
if (sbx2 == sbx) lj_err_arg(L, (int)(arg+1), LJ_ERR_BUFFER_SELF);
|
||||||
lj_buf_putmem((SBuf *)sbx, sbx2->r, sbufxlen(sbx2));
|
lj_buf_putmem((SBuf *)sbx, sbx2->r, sbufxlen(sbx2));
|
||||||
} else if (!mo && !tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) {
|
} else if (!mo && !tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) {
|
||||||
/* Call __tostring metamethod inline. */
|
/* Call __tostring metamethod inline. */
|
||||||
@ -140,7 +140,7 @@ LJLIB_CF(buffer_method_put) LJLIB_REC(.)
|
|||||||
L->top = L->base + narg;
|
L->top = L->base + narg;
|
||||||
goto retry; /* Retry with the result. */
|
goto retry; /* Retry with the result. */
|
||||||
} else {
|
} else {
|
||||||
lj_err_argtype(L, arg+1, "string/number/__tostring");
|
lj_err_argtype(L, (int)(arg+1), "string/number/__tostring");
|
||||||
}
|
}
|
||||||
/* Probably not useful to inline other __tostring MMs, e.g. FFI numbers. */
|
/* Probably not useful to inline other __tostring MMs, e.g. FFI numbers. */
|
||||||
}
|
}
|
||||||
@ -169,7 +169,7 @@ LJLIB_CF(buffer_method_get) LJLIB_REC(.)
|
|||||||
for (arg = 1; arg < narg; arg++) {
|
for (arg = 1; arg < narg; arg++) {
|
||||||
TValue *o = &L->base[arg];
|
TValue *o = &L->base[arg];
|
||||||
MSize n = tvisnil(o) ? LJ_MAX_BUF :
|
MSize n = tvisnil(o) ? LJ_MAX_BUF :
|
||||||
(MSize) lj_lib_checkintrange(L, arg+1, 0, LJ_MAX_BUF);
|
(MSize) lj_lib_checkintrange(L, (int)(arg+1), 0, LJ_MAX_BUF);
|
||||||
MSize len = sbufxlen(sbx);
|
MSize len = sbufxlen(sbx);
|
||||||
if (n > len) n = len;
|
if (n > len) n = len;
|
||||||
setstrV(L, o, lj_str_new(L, sbx->r, n));
|
setstrV(L, o, lj_str_new(L, sbx->r, n));
|
||||||
@ -177,7 +177,7 @@ LJLIB_CF(buffer_method_get) LJLIB_REC(.)
|
|||||||
}
|
}
|
||||||
if (sbx->r == sbx->w && !sbufiscow(sbx)) sbx->r = sbx->w = sbx->b;
|
if (sbx->r == sbx->w && !sbufiscow(sbx)) sbx->r = sbx->w = sbx->b;
|
||||||
lj_gc_check(L);
|
lj_gc_check(L);
|
||||||
return narg-1;
|
return (int)(narg-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LJ_HASFFI
|
#if LJ_HASFFI
|
||||||
|
@ -1117,7 +1117,7 @@ static LJ_AINLINE TRef recff_sbufx_len(jit_State *J, TRef trr, TRef trw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Emit typecheck for string buffer. */
|
/* Emit typecheck for string buffer. */
|
||||||
static TRef recff_sbufx_check(jit_State *J, RecordFFData *rd, int arg)
|
static TRef recff_sbufx_check(jit_State *J, RecordFFData *rd, ptrdiff_t arg)
|
||||||
{
|
{
|
||||||
TRef trtype, ud = J->base[arg];
|
TRef trtype, ud = J->base[arg];
|
||||||
if (!tvisbuf(&rd->argv[arg])) lj_trace_err(J, LJ_TRERR_BADTYPE);
|
if (!tvisbuf(&rd->argv[arg])) lj_trace_err(J, LJ_TRERR_BADTYPE);
|
||||||
@ -1135,7 +1135,7 @@ static TRef recff_sbufx_write(jit_State *J, TRef ud)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check for integer in range for the buffer API. */
|
/* Check for integer in range for the buffer API. */
|
||||||
static TRef recff_sbufx_checkint(jit_State *J, RecordFFData *rd, int arg)
|
static TRef recff_sbufx_checkint(jit_State *J, RecordFFData *rd, ptrdiff_t arg)
|
||||||
{
|
{
|
||||||
TRef tr = J->base[arg];
|
TRef tr = J->base[arg];
|
||||||
TRef trlim = lj_ir_kint(J, LJ_MAX_BUF);
|
TRef trlim = lj_ir_kint(J, LJ_MAX_BUF);
|
||||||
|
@ -1964,7 +1964,7 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
|
|||||||
vbase = emitir(IRT(IR_ADD, IRT_PGC), vbase, lj_ir_kint(J, frofs-8*(1+LJ_FR2)));
|
vbase = emitir(IRT(IR_ADD, IRT_PGC), vbase, lj_ir_kint(J, frofs-8*(1+LJ_FR2)));
|
||||||
for (i = 0; i < nload; i++) {
|
for (i = 0; i < nload; i++) {
|
||||||
IRType t = itype2irt(&J->L->base[i-1-LJ_FR2-nvararg]);
|
IRType t = itype2irt(&J->L->base[i-1-LJ_FR2-nvararg]);
|
||||||
J->base[dst+i] = lj_record_vload(J, vbase, i, t);
|
J->base[dst+i] = lj_record_vload(J, vbase, (MSize)i, t);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
emitir(IRTGI(IR_LE), fr, lj_ir_kint(J, frofs));
|
emitir(IRTGI(IR_LE), fr, lj_ir_kint(J, frofs));
|
||||||
|
Loading…
Reference in New Issue
Block a user