diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-01-27 11:34:32 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-01-27 11:34:32 -0200 |
commit | 86dd8bf3f58f118003d4b02773be08b68a5091ef (patch) | |
tree | 024776667a483fe4ed319f77ae050968a2f12a7b /lvm.c | |
parent | 67c5de928349bfff6ed8b4ae5ed1abe05abcb08e (diff) | |
download | lua-86dd8bf3f58f118003d4b02773be08b68a5091ef.tar.gz lua-86dd8bf3f58f118003d4b02773be08b68a5091ef.tar.bz2 lua-86dd8bf3f58f118003d4b02773be08b68a5091ef.zip |
no more 'L' in macros "luai_num*" (several places that use those macros
cannot throw errors anyway...)
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.183 2013/12/30 20:47:58 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.184 2014/01/22 20:02:04 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -193,7 +193,7 @@ int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { | |||
193 | if (ttisinteger(l) && ttisinteger(r)) | 193 | if (ttisinteger(l) && ttisinteger(r)) |
194 | return (ivalue(l) < ivalue(r)); | 194 | return (ivalue(l) < ivalue(r)); |
195 | else if (tonumber(l, &nl) && tonumber(r, &nr)) | 195 | else if (tonumber(l, &nl) && tonumber(r, &nr)) |
196 | return luai_numlt(L, nl, nr); | 196 | return luai_numlt(nl, nr); |
197 | else if (ttisstring(l) && ttisstring(r)) | 197 | else if (ttisstring(l) && ttisstring(r)) |
198 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; | 198 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; |
199 | else if ((res = luaT_callorderTM(L, l, r, TM_LT)) < 0) | 199 | else if ((res = luaT_callorderTM(L, l, r, TM_LT)) < 0) |
@@ -208,7 +208,7 @@ int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r) { | |||
208 | if (ttisinteger(l) && ttisinteger(r)) | 208 | if (ttisinteger(l) && ttisinteger(r)) |
209 | return (ivalue(l) <= ivalue(r)); | 209 | return (ivalue(l) <= ivalue(r)); |
210 | else if (tonumber(l, &nl) && tonumber(r, &nr)) | 210 | else if (tonumber(l, &nl) && tonumber(r, &nr)) |
211 | return luai_numle(L, nl, nr); | 211 | return luai_numle(nl, nr); |
212 | else if (ttisstring(l) && ttisstring(r)) | 212 | else if (ttisstring(l) && ttisstring(r)) |
213 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; | 213 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; |
214 | else if ((res = luaT_callorderTM(L, l, r, TM_LE)) >= 0) /* first try `le' */ | 214 | else if ((res = luaT_callorderTM(L, l, r, TM_LE)) >= 0) /* first try `le' */ |
@@ -641,7 +641,7 @@ void luaV_execute (lua_State *L) { | |||
641 | setivalue(ra, intop(+, ib, ic)); | 641 | setivalue(ra, intop(+, ib, ic)); |
642 | } | 642 | } |
643 | else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { | 643 | else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { |
644 | setnvalue(ra, luai_numadd(L, nb, nc)); | 644 | setnvalue(ra, luai_numadd(nb, nc)); |
645 | } | 645 | } |
646 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_ADD)); } | 646 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_ADD)); } |
647 | ) | 647 | ) |
@@ -654,7 +654,7 @@ void luaV_execute (lua_State *L) { | |||
654 | setivalue(ra, intop(-, ib, ic)); | 654 | setivalue(ra, intop(-, ib, ic)); |
655 | } | 655 | } |
656 | else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { | 656 | else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { |
657 | setnvalue(ra, luai_numsub(L, nb, nc)); | 657 | setnvalue(ra, luai_numsub(nb, nc)); |
658 | } | 658 | } |
659 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_SUB)); } | 659 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_SUB)); } |
660 | ) | 660 | ) |
@@ -667,7 +667,7 @@ void luaV_execute (lua_State *L) { | |||
667 | setivalue(ra, intop(*, ib, ic)); | 667 | setivalue(ra, intop(*, ib, ic)); |
668 | } | 668 | } |
669 | else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { | 669 | else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { |
670 | setnvalue(ra, luai_nummul(L, nb, nc)); | 670 | setnvalue(ra, luai_nummul(nb, nc)); |
671 | } | 671 | } |
672 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_MUL)); } | 672 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_MUL)); } |
673 | ) | 673 | ) |
@@ -676,7 +676,7 @@ void luaV_execute (lua_State *L) { | |||
676 | TValue *rc = RKC(i); | 676 | TValue *rc = RKC(i); |
677 | lua_Number nb; lua_Number nc; | 677 | lua_Number nb; lua_Number nc; |
678 | if (tonumber(rb, &nb) && tonumber(rc, &nc)) { | 678 | if (tonumber(rb, &nb) && tonumber(rc, &nc)) { |
679 | setnvalue(ra, luai_numdiv(L, nb, nc)); | 679 | setnvalue(ra, luai_numdiv(nb, nc)); |
680 | } | 680 | } |
681 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_DIV)); } | 681 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_DIV)); } |
682 | ) | 682 | ) |
@@ -743,7 +743,7 @@ void luaV_execute (lua_State *L) { | |||
743 | setivalue(ra, luaV_mod(L, ib, ic)); | 743 | setivalue(ra, luaV_mod(L, ib, ic)); |
744 | } | 744 | } |
745 | else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { | 745 | else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { |
746 | setnvalue(ra, luai_nummod(L, nb, nc)); | 746 | setnvalue(ra, luai_nummod(nb, nc)); |
747 | } | 747 | } |
748 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_MOD)); } | 748 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_MOD)); } |
749 | ) | 749 | ) |
@@ -756,7 +756,7 @@ void luaV_execute (lua_State *L) { | |||
756 | setivalue(ra, luaV_pow(L, ib, ic)); | 756 | setivalue(ra, luaV_pow(L, ib, ic)); |
757 | } | 757 | } |
758 | else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { | 758 | else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { |
759 | setnvalue(ra, luai_numpow(L, nb, nc)); | 759 | setnvalue(ra, luai_numpow(nb, nc)); |
760 | } | 760 | } |
761 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_POW)); } | 761 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_POW)); } |
762 | ) | 762 | ) |
@@ -768,7 +768,7 @@ void luaV_execute (lua_State *L) { | |||
768 | setivalue(ra, intop(-, 0, ib)); | 768 | setivalue(ra, intop(-, 0, ib)); |
769 | } | 769 | } |
770 | else if (tonumber(rb, &nb)) { | 770 | else if (tonumber(rb, &nb)) { |
771 | setnvalue(ra, luai_numunm(L, nb)); | 771 | setnvalue(ra, luai_numunm(nb)); |
772 | } | 772 | } |
773 | else { | 773 | else { |
774 | Protect(luaT_trybinTM(L, rb, rb, ra, TM_UNM)); | 774 | Protect(luaT_trybinTM(L, rb, rb, ra, TM_UNM)); |
@@ -919,10 +919,10 @@ void luaV_execute (lua_State *L) { | |||
919 | } | 919 | } |
920 | else { /* floating count */ | 920 | else { /* floating count */ |
921 | lua_Number step = fltvalue(ra + 2); | 921 | lua_Number step = fltvalue(ra + 2); |
922 | lua_Number idx = luai_numadd(L, fltvalue(ra), step); /* inc. index */ | 922 | lua_Number idx = luai_numadd(fltvalue(ra), step); /* inc. index */ |
923 | lua_Number limit = fltvalue(ra + 1); | 923 | lua_Number limit = fltvalue(ra + 1); |
924 | if (luai_numlt(L, 0, step) ? luai_numle(L, idx, limit) | 924 | if (luai_numlt(0, step) ? luai_numle(idx, limit) |
925 | : luai_numle(L, limit, idx)) { | 925 | : luai_numle(limit, idx)) { |
926 | ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ | 926 | ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ |
927 | setnvalue(ra, idx); /* update internal index... */ | 927 | setnvalue(ra, idx); /* update internal index... */ |
928 | setnvalue(ra + 3, idx); /* ...and external index */ | 928 | setnvalue(ra + 3, idx); /* ...and external index */ |
@@ -946,7 +946,7 @@ void luaV_execute (lua_State *L) { | |||
946 | setnvalue(pstep, nstep); | 946 | setnvalue(pstep, nstep); |
947 | if (!tonumber(init, &ninit)) | 947 | if (!tonumber(init, &ninit)) |
948 | luaG_runerror(L, LUA_QL("for") " initial value must be a number"); | 948 | luaG_runerror(L, LUA_QL("for") " initial value must be a number"); |
949 | setnvalue(ra, luai_numsub(L, ninit, nstep)); | 949 | setnvalue(ra, luai_numsub(ninit, nstep)); |
950 | } | 950 | } |
951 | ci->u.l.savedpc += GETARG_sBx(i); | 951 | ci->u.l.savedpc += GETARG_sBx(i); |
952 | ) | 952 | ) |