aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-08-31 16:46:07 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-08-31 16:46:07 -0300
commite1d072571ec6f9d830e575a2ecdc95fd43428e53 (patch)
tree830fab7f2acb9adaee2d63073d339cc9557a5437 /lvm.c
parent7651a5c6b2ee6ec59cadec6199319d482071f176 (diff)
downloadlua-e1d072571ec6f9d830e575a2ecdc95fd43428e53.tar.gz
lua-e1d072571ec6f9d830e575a2ecdc95fd43428e53.tar.bz2
lua-e1d072571ec6f9d830e575a2ecdc95fd43428e53.zip
better syntax for type casts
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lvm.c b/lvm.c
index b043c916..b9d36938 100644
--- a/lvm.c
+++ b/lvm.c
@@ -293,8 +293,8 @@ void luaV_strconc (lua_State *L, int total, StkId top) {
293 luaG_concaterror(L, top-2, top-1); 293 luaG_concaterror(L, top-2, top-1);
294 } else if (tsvalue(top-1)->tsv.len > 0) { /* if len=0, do nothing */ 294 } else if (tsvalue(top-1)->tsv.len > 0) { /* if len=0, do nothing */
295 /* at least two string values; get as many as possible */ 295 /* at least two string values; get as many as possible */
296 lu_mem tl = (lu_mem)tsvalue(top-1)->tsv.len + 296 lu_mem tl = cast(lu_mem, tsvalue(top-1)->tsv.len) +
297 (lu_mem)tsvalue(top-2)->tsv.len; 297 cast(lu_mem, tsvalue(top-2)->tsv.len);
298 l_char *buffer; 298 l_char *buffer;
299 int i; 299 int i;
300 while (n < total && !tostring(L, top-n-1)) { /* collect total length */ 300 while (n < total && !tostring(L, top-n-1)) { /* collect total length */
@@ -618,7 +618,7 @@ StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) {
618 runtime_check(L, ttype(ra) == LUA_TTABLE && 618 runtime_check(L, ttype(ra) == LUA_TTABLE &&
619 ttype(ra+1) == LUA_TNUMBER); 619 ttype(ra+1) == LUA_TNUMBER);
620 t = hvalue(ra); 620 t = hvalue(ra);
621 n = (int)nvalue(ra+1); 621 n = cast(int, nvalue(ra+1));
622 n = luaH_nexti(t, n); 622 n = luaH_nexti(t, n);
623 if (n != -1) { /* repeat loop? */ 623 if (n != -1) { /* repeat loop? */
624 Node *node = node(t, n); 624 Node *node = node(t, n);