diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib_buffer.c | 8 | ||||
-rw-r--r-- | src/lj_ffrecord.c | 4 | ||||
-rw-r--r-- | src/lj_record.c | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/lib_buffer.c b/src/lib_buffer.c index aad8e7eb..d6ff1346 100644 --- a/src/lib_buffer.c +++ b/src/lib_buffer.c | |||
@@ -128,7 +128,7 @@ LJLIB_CF(buffer_method_put) LJLIB_REC(.) | |||
128 | lj_strfmt_putfnum((SBuf *)sbx, STRFMT_G14, numV(o)); | 128 | lj_strfmt_putfnum((SBuf *)sbx, STRFMT_G14, numV(o)); |
129 | } else if (tvisbuf(o)) { | 129 | } else if (tvisbuf(o)) { |
130 | SBufExt *sbx2 = bufV(o); | 130 | SBufExt *sbx2 = bufV(o); |
131 | if (sbx2 == sbx) lj_err_arg(L, arg+1, LJ_ERR_BUFFER_SELF); | 131 | if (sbx2 == sbx) lj_err_arg(L, (int)(arg+1), LJ_ERR_BUFFER_SELF); |
132 | lj_buf_putmem((SBuf *)sbx, sbx2->r, sbufxlen(sbx2)); | 132 | lj_buf_putmem((SBuf *)sbx, sbx2->r, sbufxlen(sbx2)); |
133 | } else if (!mo && !tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) { | 133 | } else if (!mo && !tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) { |
134 | /* Call __tostring metamethod inline. */ | 134 | /* Call __tostring metamethod inline. */ |
@@ -140,7 +140,7 @@ LJLIB_CF(buffer_method_put) LJLIB_REC(.) | |||
140 | L->top = L->base + narg; | 140 | L->top = L->base + narg; |
141 | goto retry; /* Retry with the result. */ | 141 | goto retry; /* Retry with the result. */ |
142 | } else { | 142 | } else { |
143 | lj_err_argtype(L, arg+1, "string/number/__tostring"); | 143 | lj_err_argtype(L, (int)(arg+1), "string/number/__tostring"); |
144 | } | 144 | } |
145 | /* Probably not useful to inline other __tostring MMs, e.g. FFI numbers. */ | 145 | /* Probably not useful to inline other __tostring MMs, e.g. FFI numbers. */ |
146 | } | 146 | } |
@@ -169,7 +169,7 @@ LJLIB_CF(buffer_method_get) LJLIB_REC(.) | |||
169 | for (arg = 1; arg < narg; arg++) { | 169 | for (arg = 1; arg < narg; arg++) { |
170 | TValue *o = &L->base[arg]; | 170 | TValue *o = &L->base[arg]; |
171 | MSize n = tvisnil(o) ? LJ_MAX_BUF : | 171 | MSize n = tvisnil(o) ? LJ_MAX_BUF : |
172 | (MSize) lj_lib_checkintrange(L, arg+1, 0, LJ_MAX_BUF); | 172 | (MSize) lj_lib_checkintrange(L, (int)(arg+1), 0, LJ_MAX_BUF); |
173 | MSize len = sbufxlen(sbx); | 173 | MSize len = sbufxlen(sbx); |
174 | if (n > len) n = len; | 174 | if (n > len) n = len; |
175 | setstrV(L, o, lj_str_new(L, sbx->r, n)); | 175 | setstrV(L, o, lj_str_new(L, sbx->r, n)); |
@@ -177,7 +177,7 @@ LJLIB_CF(buffer_method_get) LJLIB_REC(.) | |||
177 | } | 177 | } |
178 | if (sbx->r == sbx->w && !sbufiscow(sbx)) sbx->r = sbx->w = sbx->b; | 178 | if (sbx->r == sbx->w && !sbufiscow(sbx)) sbx->r = sbx->w = sbx->b; |
179 | lj_gc_check(L); | 179 | lj_gc_check(L); |
180 | return narg-1; | 180 | return (int)(narg-1); |
181 | } | 181 | } |
182 | 182 | ||
183 | #if LJ_HASFFI | 183 | #if LJ_HASFFI |
diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c index 60c1d84f..022de1aa 100644 --- a/src/lj_ffrecord.c +++ b/src/lj_ffrecord.c | |||
@@ -1117,7 +1117,7 @@ static LJ_AINLINE TRef recff_sbufx_len(jit_State *J, TRef trr, TRef trw) | |||
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | /* Emit typecheck for string buffer. */ | 1119 | /* Emit typecheck for string buffer. */ |
1120 | static TRef recff_sbufx_check(jit_State *J, RecordFFData *rd, int arg) | 1120 | static TRef recff_sbufx_check(jit_State *J, RecordFFData *rd, ptrdiff_t arg) |
1121 | { | 1121 | { |
1122 | TRef trtype, ud = J->base[arg]; | 1122 | TRef trtype, ud = J->base[arg]; |
1123 | if (!tvisbuf(&rd->argv[arg])) lj_trace_err(J, LJ_TRERR_BADTYPE); | 1123 | 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) | |||
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | /* Check for integer in range for the buffer API. */ | 1137 | /* Check for integer in range for the buffer API. */ |
1138 | static TRef recff_sbufx_checkint(jit_State *J, RecordFFData *rd, int arg) | 1138 | static TRef recff_sbufx_checkint(jit_State *J, RecordFFData *rd, ptrdiff_t arg) |
1139 | { | 1139 | { |
1140 | TRef tr = J->base[arg]; | 1140 | TRef tr = J->base[arg]; |
1141 | TRef trlim = lj_ir_kint(J, LJ_MAX_BUF); | 1141 | TRef trlim = lj_ir_kint(J, LJ_MAX_BUF); |
diff --git a/src/lj_record.c b/src/lj_record.c index 92bdbfc9..5d02d24a 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -1964,7 +1964,7 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults) | |||
1964 | vbase = emitir(IRT(IR_ADD, IRT_PGC), vbase, lj_ir_kint(J, frofs-8*(1+LJ_FR2))); | 1964 | vbase = emitir(IRT(IR_ADD, IRT_PGC), vbase, lj_ir_kint(J, frofs-8*(1+LJ_FR2))); |
1965 | for (i = 0; i < nload; i++) { | 1965 | for (i = 0; i < nload; i++) { |
1966 | IRType t = itype2irt(&J->L->base[i-1-LJ_FR2-nvararg]); | 1966 | IRType t = itype2irt(&J->L->base[i-1-LJ_FR2-nvararg]); |
1967 | J->base[dst+i] = lj_record_vload(J, vbase, i, t); | 1967 | J->base[dst+i] = lj_record_vload(J, vbase, (MSize)i, t); |
1968 | } | 1968 | } |
1969 | } else { | 1969 | } else { |
1970 | emitir(IRTGI(IR_LE), fr, lj_ir_kint(J, frofs)); | 1970 | emitir(IRTGI(IR_LE), fr, lj_ir_kint(J, frofs)); |