aboutsummaryrefslogtreecommitdiff
path: root/src/lib_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib_buffer.c')
-rw-r--r--src/lib_buffer.c8
1 files changed, 4 insertions, 4 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