The Battle for Wesnoth  1.15.12+dev
Macros | Enumerations | Functions
lvm.h File Reference
#include "ldo.h"
#include "lobject.h"
#include "ltm.h"
Include dependency graph for lvm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define cvt2str(o)   ttisnumber(o)
 
#define cvt2num(o)   ttisstring(o)
 
#define LUA_FLOORN2I   F2Ieq
 
#define tonumber(o, n)   (ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n))
 
#define tonumberns(o, n)
 
#define tointeger(o, i)   (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointeger(o,i,LUA_FLOORN2I))
 
#define tointegerns(o, i)   (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointegerns(o,i,LUA_FLOORN2I))
 
#define intop(op, v1, v2)   l_castU2S(l_castS2U(v1) op l_castS2U(v2))
 
#define luaV_rawequalobj(t1, t2)   luaV_equalobj(NULL,t1,t2)
 
#define luaV_fastget(L, t, k, slot, f)
 
#define luaV_fastgeti(L, t, k, slot)
 
#define luaV_finishfastset(L, t, slot, v)
 

Enumerations

enum  F2Imod { F2Ieq, F2Ifloor, F2Iceil }
 

Functions

LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2)
 
LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r)
 
LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r)
 
LUAI_FUNC int luaV_tonumber_ (const TValue *obj, lua_Number *n)
 
LUAI_FUNC int luaV_tointeger (const TValue *obj, lua_Integer *p, F2Imod mode)
 
LUAI_FUNC int luaV_tointegerns (const TValue *obj, lua_Integer *p, F2Imod mode)
 
LUAI_FUNC int luaV_flttointeger (lua_Number n, lua_Integer *p, F2Imod mode)
 
LUAI_FUNC void luaV_finishget (lua_State *L, const TValue *t, TValue *key, StkId val, const TValue *slot)
 
LUAI_FUNC void luaV_finishset (lua_State *L, const TValue *t, TValue *key, TValue *val, const TValue *slot)
 
LUAI_FUNC void luaV_finishOp (lua_State *L)
 
LUAI_FUNC void luaV_execute (lua_State *L, CallInfo *ci)
 
LUAI_FUNC void luaV_concat (lua_State *L, int total)
 
LUAI_FUNC lua_Integer luaV_idiv (lua_State *L, lua_Integer x, lua_Integer y)
 
LUAI_FUNC lua_Integer luaV_mod (lua_State *L, lua_Integer x, lua_Integer y)
 
LUAI_FUNC lua_Number luaV_modf (lua_State *L, lua_Number x, lua_Number y)
 
LUAI_FUNC lua_Integer luaV_shiftl (lua_Integer x, lua_Integer y)
 
LUAI_FUNC void luaV_objlen (lua_State *L, StkId ra, const TValue *rb)
 

Macro Definition Documentation

◆ cvt2num

#define cvt2num (   o)    ttisstring(o)

Definition at line 24 of file lvm.h.

Referenced by l_strton().

◆ cvt2str

#define cvt2str (   o)    ttisnumber(o)

Definition at line 17 of file lvm.h.

Referenced by lua_isstring(), lua_tolstring(), luaG_concaterror(), and luaV_concat().

◆ intop

#define intop (   op,
  v1,
  v2 
)    l_castU2S(l_castS2U(v1) op l_castS2U(v2))

Definition at line 71 of file lvm.h.

Referenced by intarith(), luaV_execute(), luaV_idiv(), and luaV_shiftl().

◆ LUA_FLOORN2I

#define LUA_FLOORN2I   F2Ieq

Definition at line 36 of file lvm.h.

◆ luaV_fastget

#define luaV_fastget (   L,
  t,
  k,
  slot,
  f 
)
Value:
? (slot = NULL, 0) /* not a table; 'slot' is NULL and result is 0 */ \
: (slot = f(hvalue(t), k), /* else, do raw access */ \
!isempty(slot))) /* result not empty? */
#define ttistable(o)
Definition: lobject.h:657
#define isempty(v)
Definition: lobject.h:195
#define f
double t
Definition: astarsearch.cpp:64
#define hvalue(o)
Definition: lobject.h:659

Definition at line 83 of file lvm.h.

Referenced by auxgetstr(), auxsetstr(), lua_gettable(), lua_settable(), luaV_execute(), luaV_finishget(), and luaV_finishset().

◆ luaV_fastgeti

#define luaV_fastgeti (   L,
  t,
  k,
  slot 
)
Value:
? (slot = NULL, 0) /* not a table; 'slot' is NULL and result is 0 */ \
: (slot = (l_castS2U(k) - 1u < hvalue(t)->alimit) \
? &hvalue(t)->array[k - 1] : luaH_getint(hvalue(t), k), \
!isempty(slot))) /* result not empty? */
#define ttistable(o)
Definition: lobject.h:657
#define isempty(v)
Definition: lobject.h:195
const TValue * luaH_getint(Table *t, lua_Integer key)
Definition: ltable.cpp:697
#define l_castS2U(i)
Definition: llimits.h:139
double t
Definition: astarsearch.cpp:64
#define hvalue(o)
Definition: lobject.h:659

Definition at line 94 of file lvm.h.

Referenced by lua_geti(), lua_seti(), and luaV_execute().

◆ luaV_finishfastset

#define luaV_finishfastset (   L,
  t,
  slot,
 
)
Value:
{ setobj2t(L, cast(TValue *,slot), v); \
luaC_barrierback(L, gcvalue(t), v); }
#define gcvalue(o)
Definition: lobject.h:283
Definition: lobject.h:65
#define cast(t, exp)
Definition: llimits.h:123
#define setobj2t
Definition: lobject.h:135
double t
Definition: astarsearch.cpp:64

Definition at line 106 of file lvm.h.

Referenced by auxsetstr(), lua_seti(), lua_settable(), luaV_execute(), and luaV_finishset().

◆ luaV_rawequalobj

#define luaV_rawequalobj (   t1,
  t2 
)    luaV_equalobj(NULL,t1,t2)

Definition at line 73 of file lvm.h.

Referenced by addk(), lua_rawequal(), and luaV_execute().

◆ tointeger

#define tointeger (   o,
  i 
)    (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointeger(o,i,LUA_FLOORN2I))

Definition at line 62 of file lvm.h.

Referenced by lua_tointegerx().

◆ tointegerns

#define tointegerns (   o,
  i 
)    (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointegerns(o,i,LUA_FLOORN2I))

Definition at line 67 of file lvm.h.

Referenced by luaG_tointerror(), luaO_rawarith(), luaV_equalobj(), luaV_execute(), and validop().

◆ tonumber

#define tonumber (   o,
  n 
)    (ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n))

Definition at line 51 of file lvm.h.

Referenced by forlimit(), forprep(), lua_isnumber(), and lua_tonumberx().

◆ tonumberns

#define tonumberns (   o,
  n 
)
Value:
(ttisfloat(o) ? ((n) = fltvalue(o), 1) : \
(ttisinteger(o) ? ((n) = cast_num(ivalue(o)), 1) : 0))
#define cast_num(i)
Definition: llimits.h:127
#define ttisfloat(o)
Definition: lobject.h:305
#define ttisinteger(o)
Definition: lobject.h:306
#define fltvalue(o)
Definition: lobject.h:310
#define ivalue(o)
Definition: lobject.h:311
static map_location::DIRECTION n

Definition at line 56 of file lvm.h.

Referenced by luaO_rawarith(), and luaV_execute().

Enumeration Type Documentation

◆ F2Imod

enum F2Imod
Enumerator
F2Ieq 
F2Ifloor 
F2Iceil 

Definition at line 43 of file lvm.h.

Function Documentation

◆ luaV_concat()

LUAI_FUNC void luaV_concat ( lua_State L,
int  total 
)

◆ luaV_equalobj()

LUAI_FUNC int luaV_equalobj ( lua_State L,
const TValue t1,
const TValue t2 
)

◆ luaV_execute()

LUAI_FUNC void luaV_execute ( lua_State L,
CallInfo ci 
)

Definition at line 1122 of file lvm.cpp.

References Table::array, b, c, CallInfo::callstatus, cast_int, cast_num, cast_void, checkGC, checkstackGCp, chgivalue, lua_State::ci, CIST_FRESH, clLvalue, Proto::code, cond(), docondjump, dojump, donextjump, floatforloop(), fltvalue, forprep(), CallInfo::func, GET_OPCODE, GETARG_A, GETARG_Ax, GETARG_B, GETARG_Bx, GETARG_C, GETARG_k, GETARG_sB, GETARG_sBx, GETARG_sC, h, halfProtect, lua_State::hookmask, hvalue, i, intop, Proto::is_vararg, isIT, ivalue, Proto::k, KB, KC, CallInfo::l, l_addi, l_band, l_bor, l_bxor, l_castS2U, l_gei, l_gti, l_isfalse, l_lei, l_lti, l_muli, l_subi, LEnum(), lessequalothers(), lessthanothers(), LTnum(), lua_assert, LUA_MULTRET, LUA_OK, luaC_barrier, luaC_barrierback, luaD_call(), luaD_hookcall(), luaD_poscall(), luaD_precall(), luaD_pretailcall(), luaD_tryfuncTM(), luaF_close(), luaF_newtbcupval(), luaH_get(), luaH_getshortstr(), luaH_getstr(), luaH_new(), luaH_realasize(), luaH_resize(), luaH_resizearray(), luai_numadd, luai_numdiv, luai_numeq, luai_numge, luai_numgt, luai_numidiv, luai_numle, luai_numlt, luai_nummul, luai_numpow, luai_numsub, luai_numunm, luaT_adjustvarargs(), luaT_getvarargs(), luaT_trybinassocTM(), luaT_trybiniTM(), luaT_trybinTM(), luaV_concat(), luaV_equalobj(), luaV_fastget, luaV_fastgeti, luaV_finishfastset, luaV_finishget(), luaV_finishset(), luaV_idiv(), luaV_mod(), luaV_modf(), luaV_objlen(), luaV_rawequalobj, luaV_shiftl(), luaV_shiftr, MAXARG_C, n, NOCLOSINGMETH, CallInfo::nresults, obj2gco, lua_State::oldpc, OP_ADD, OP_ADDI, OP_ADDK, op_arith, op_arithf, op_arithfK, op_arithI, op_arithK, OP_BAND, OP_BANDK, op_bitwise, op_bitwiseK, OP_BNOT, OP_BOR, OP_BORK, OP_BXOR, OP_BXORK, OP_CALL, OP_CLOSE, OP_CLOSURE, OP_CONCAT, OP_DIV, OP_DIVK, OP_EQ, OP_EQI, OP_EQK, OP_EXTRAARG, OP_FORLOOP, OP_FORPREP, OP_GEI, OP_GETFIELD, OP_GETI, OP_GETTABLE, OP_GETTABUP, OP_GETUPVAL, OP_GTI, OP_IDIV, OP_IDIVK, OP_JMP, OP_LE, OP_LEI, OP_LEN, OP_LFALSESKIP, OP_LOADF, OP_LOADFALSE, OP_LOADI, OP_LOADK, OP_LOADKX, OP_LOADNIL, OP_LOADTRUE, OP_LT, OP_LTI, OP_MMBIN, OP_MMBINI, OP_MMBINK, OP_MOD, OP_MODK, OP_MOVE, OP_MUL, OP_MULK, OP_NEWTABLE, OP_NOT, op_order, op_orderI, OP_POW, OP_POWK, OP_RETURN, OP_RETURN0, OP_RETURN1, OP_SELF, OP_SETFIELD, OP_SETI, OP_SETLIST, OP_SETTABLE, OP_SETTABUP, OP_SETUPVAL, OP_SHL, OP_SHLI, OP_SHR, OP_SHRI, OP_SUB, OP_SUBK, OP_TAILCALL, OP_TBC, OP_TEST, OP_TESTSET, OP_TFORCALL, OP_TFORLOOP, OP_TFORPREP, OP_UNM, OP_VARARG, OP_VARARGPREP, p, Proto::p, LClosure::p, CallInfo::previous, Protect, ProtectNT, pushclosure(), RA, RB, RKC, s2v, savepc, savestate, setbfvalue, setbtvalue, setfltvalue, sethvalue2s, setivalue, setnilvalue, setobj, setobj2s, setobj2t, setobjs2s, lua_State::stack_last, t, TESTARG_k, TM_BNOT, TM_LE, TM_LT, TM_UNM, tointegerns, tonumberns, CallInfo::top, lua_State::top, tsvalue, ttisfloat, ttisfunction, ttisinteger, ttisLclosure, ttisnil, CallInfo::u, updatebase, updatestack, updatetrap, LClosure::upvals, UpVal::v, vmbreak, vmcase, vmdispatch, vmfetch, vRB, and vRC.

Referenced by ccall(), resume(), and unroll().

◆ luaV_finishget()

LUAI_FUNC void luaV_finishget ( lua_State L,
const TValue t,
TValue key,
StkId  val,
const TValue slot 
)

◆ luaV_finishOp()

LUAI_FUNC void luaV_finishOp ( lua_State L)

◆ luaV_finishset()

LUAI_FUNC void luaV_finishset ( lua_State L,
const TValue t,
TValue key,
TValue val,
const TValue slot 
)

◆ luaV_flttointeger()

LUAI_FUNC int luaV_flttointeger ( lua_Number  n,
lua_Integer p,
F2Imod  mode 
)

◆ luaV_idiv()

LUAI_FUNC lua_Integer luaV_idiv ( lua_State L,
lua_Integer  x,
lua_Integer  y 
)

Definition at line 716 of file lvm.cpp.

References intop, l_castS2U, luaG_runerror(), n, and unlikely.

Referenced by intarith(), and luaV_execute().

◆ luaV_lessequal()

LUAI_FUNC int luaV_lessequal ( lua_State L,
const TValue l,
const TValue r 
)

Definition at line 557 of file lvm.cpp.

References LEnum(), lessequalothers(), and ttisnumber.

Referenced by lua_compare().

◆ luaV_lessthan()

LUAI_FUNC int luaV_lessthan ( lua_State L,
const TValue l,
const TValue r 
)

Definition at line 535 of file lvm.cpp.

References lessthanothers(), LTnum(), and ttisnumber.

Referenced by lua_compare().

◆ luaV_mod()

LUAI_FUNC lua_Integer luaV_mod ( lua_State L,
lua_Integer  x,
lua_Integer  y 
)

Definition at line 736 of file lvm.cpp.

References l_castS2U, luaG_runerror(), n, and unlikely.

Referenced by intarith(), and luaV_execute().

◆ luaV_modf()

LUAI_FUNC lua_Number luaV_modf ( lua_State L,
lua_Number  x,
lua_Number  y 
)

Definition at line 754 of file lvm.cpp.

References luai_nummod.

Referenced by luaV_execute(), and numarith().

◆ luaV_objlen()

LUAI_FUNC void luaV_objlen ( lua_State L,
StkId  ra,
const TValue rb 
)

◆ luaV_shiftl()

LUAI_FUNC lua_Integer luaV_shiftl ( lua_Integer  x,
lua_Integer  y 
)

Definition at line 769 of file lvm.cpp.

References intop, and NBITS.

Referenced by intarith(), and luaV_execute().

◆ luaV_tointeger()

LUAI_FUNC int luaV_tointeger ( const TValue obj,
lua_Integer p,
F2Imod  mode 
)

Definition at line 152 of file lvm.cpp.

References l_strton(), and luaV_tointegerns().

Referenced by forlimit().

◆ luaV_tointegerns()

LUAI_FUNC int luaV_tointegerns ( const TValue obj,
lua_Integer p,
F2Imod  mode 
)

Definition at line 137 of file lvm.cpp.

References fltvalue, ivalue, luaV_flttointeger(), ttisfloat, and ttisinteger.

Referenced by luaV_tointeger().

◆ luaV_tonumber_()

LUAI_FUNC int luaV_tonumber_ ( const TValue obj,
lua_Number n 
)

Definition at line 103 of file lvm.cpp.

References cast_num, ivalue, l_strton(), nvalue, and ttisinteger.