The Battle for Wesnoth  1.15.11+dev
Macros | Typedefs
llimits.h File Reference
#include <limits.h>
#include <stddef.h>
#include "lua.h"
Include dependency graph for llimits.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_SIZET   ((size_t)(~(size_t)0))
 
#define MAX_SIZE
 
#define MAX_LUMEM   ((lu_mem)(~(lu_mem)0))
 
#define MAX_LMEM   ((l_mem)(MAX_LUMEM >> 1))
 
#define MAX_INT   INT_MAX /* maximum value of an int */
 
#define log2maxs(t)   (sizeof(t) * 8 - 2)
 
#define ispow2(x)   (((x) & ((x) - 1)) == 0)
 
#define LL(x)   (sizeof(x)/sizeof(char) - 1)
 
#define point2uint(p)   ((unsigned int)((size_t)(p) & UINT_MAX))
 
#define lua_assert(c)   ((void)0)
 
#define check_exp(c, e)   (e)
 
#define lua_longassert(c)   ((void)0)
 
#define luai_apicheck(l, e)   ((void)l, lua_assert(e))
 
#define api_check(l, e, msg)   luai_apicheck(l,(e) && msg)
 
#define UNUSED(x)   ((void)(x))
 
#define cast(t, exp)   ((t)(exp))
 
#define cast_void(i)   cast(void, (i))
 
#define cast_voidp(i)   cast(void *, (i))
 
#define cast_num(i)   cast(lua_Number, (i))
 
#define cast_int(i)   cast(int, (i))
 
#define cast_uint(i)   cast(unsigned int, (i))
 
#define cast_byte(i)   cast(lu_byte, (i))
 
#define cast_uchar(i)   cast(unsigned char, (i))
 
#define cast_char(i)   cast(char, (i))
 
#define cast_charp(i)   cast(char *, (i))
 
#define cast_sizet(i)   cast(size_t, (i))
 
#define l_castS2U(i)   ((lua_Unsigned)(i))
 
#define l_castU2S(i)   ((lua_Integer)(i))
 
#define likely(x)   (x)
 
#define unlikely(x)   (x)
 
#define l_noret   void
 
#define LUAI_MAXSHORTLEN   40
 
#define MINSTRTABSIZE   128
 
#define STRCACHE_N   53
 
#define STRCACHE_M   2
 
#define LUA_MINBUFFER   32
 
#define LUAI_MAXCCALLS   200
 
#define lua_lock(L)   ((void) 0)
 
#define lua_unlock(L)   ((void) 0)
 
#define luai_threadyield(L)   {lua_unlock(L); lua_lock(L);}
 
#define luai_userstateopen(L)   ((void)L)
 
#define luai_userstateclose(L)   ((void)L)
 
#define luai_userstatethread(L, L1)   ((void)L)
 
#define luai_userstatefree(L, L1)   ((void)L)
 
#define luai_userstateresume(L, n)   ((void)L)
 
#define luai_userstateyield(L, n)   ((void)L)
 
#define luai_numidiv(L, a, b)   ((void)L, l_floor(luai_numdiv(L,a,b)))
 
#define luai_numdiv(L, a, b)   ((a)/(b))
 
#define luai_nummod(L, a, b, m)
 
#define luai_numpow(L, a, b)   ((void)L, (b == 2) ? (a)*(a) : l_mathop(pow)(a,b))
 
#define luai_numadd(L, a, b)   ((a)+(b))
 
#define luai_numsub(L, a, b)   ((a)-(b))
 
#define luai_nummul(L, a, b)   ((a)*(b))
 
#define luai_numunm(L, a)   (-(a))
 
#define luai_numeq(a, b)   ((a)==(b))
 
#define luai_numlt(a, b)   ((a)<(b))
 
#define luai_numle(a, b)   ((a)<=(b))
 
#define luai_numgt(a, b)   ((a)>(b))
 
#define luai_numge(a, b)   ((a)>=(b))
 
#define luai_numisnan(a)   (!luai_numeq((a), (a)))
 
#define condmovestack(L, pre, pos)   ((void)0)
 
#define condchangemem(L, pre, pos)   ((void)0)
 

Typedefs

typedef unsigned long lu_mem
 
typedef long l_mem
 
typedef unsigned char lu_byte
 
typedef signed char ls_byte
 
typedef LUAI_UACNUMBER l_uacNumber
 
typedef LUAI_UACINT l_uacInt
 
typedef unsigned long l_uint32
 
typedef l_uint32 Instruction
 

Macro Definition Documentation

◆ api_check

#define api_check (   l,
  e,
  msg 
)    luai_apicheck(l,(e) && msg)

◆ cast

#define cast (   t,
  exp 
)    ((t)(exp))

◆ cast_byte

#define cast_byte (   i)    cast(lu_byte, (i))

◆ cast_char

#define cast_char (   i)    cast(char, (i))

Definition at line 132 of file llimits.h.

Referenced by luaO_utf8esc(), and save().

◆ cast_charp

#define cast_charp (   i)    cast(char *, (i))

Definition at line 133 of file llimits.h.

Referenced by isneg().

◆ cast_int

#define cast_int (   i)    cast(int, (i))

◆ cast_num

#define cast_num (   i)    cast(lua_Number, (i))

◆ cast_sizet

#define cast_sizet (   i)    cast(size_t, (i))

Definition at line 134 of file llimits.h.

Referenced by freehash(), lua_topointer(), luaK_intK(), luaM_growaux_(), and luaM_shrinkvector_().

◆ cast_uchar

#define cast_uchar (   i)    cast(unsigned char, (i))

Definition at line 131 of file llimits.h.

Referenced by isneg(), l_str2d(), l_str2dloc(), l_str2int(), luaO_pushvfstring(), and luaZ_fill().

◆ cast_uint

#define cast_uint (   i)    cast(unsigned int, (i))

◆ cast_void

#define cast_void (   i)    cast(void, (i))

Definition at line 125 of file llimits.h.

Referenced by luaV_concat(), luaV_execute(), readutf8esc(), and traversetable().

◆ cast_voidp

#define cast_voidp (   i)    cast(void *, (i))

Definition at line 126 of file llimits.h.

Referenced by lua_rawgetp(), lua_rawsetp(), lua_topointer(), and luaK_intK().

◆ check_exp

#define check_exp (   c,
  e 
)    (e)

Definition at line 102 of file llimits.h.

Referenced by upvalname().

◆ condchangemem

#define condchangemem (   L,
  pre,
  pos 
)    ((void)0)

Definition at line 363 of file llimits.h.

◆ condmovestack

#define condmovestack (   L,
  pre,
  pos 
)    ((void)0)

Definition at line 355 of file llimits.h.

Referenced by luaD_shrinkstack().

◆ ispow2

#define ispow2 (   x)    (((x) & ((x) - 1)) == 0)

Definition at line 66 of file llimits.h.

Referenced by ispow2realasize(), luaH_getn(), and luaH_realasize().

◆ l_castS2U

#define l_castS2U (   i)    ((lua_Unsigned)(i))

◆ l_castU2S

#define l_castU2S (   i)    ((lua_Integer)(i))

Definition at line 148 of file llimits.h.

Referenced by forprep(), and l_str2int().

◆ l_noret

#define l_noret   void

Definition at line 178 of file llimits.h.

◆ likely

#define likely (   x)    (x)

Definition at line 161 of file llimits.h.

Referenced by callclosemth(), lua_resume(), and luaD_growstack().

◆ LL

#define LL (   x)    (sizeof(x)/sizeof(char) - 1)

Definition at line 70 of file llimits.h.

Referenced by funcinfo(), and luaO_chunkid().

◆ log2maxs

#define log2maxs (   t)    (sizeof(t) * 8 - 2)

Definition at line 60 of file llimits.h.

Referenced by incstep().

◆ lua_assert

#define lua_assert (   c)    ((void)0)

Definition at line 101 of file llimits.h.

Referenced by atomic(), check_next2(), choosePivot(), clearkey(), close_func(), close_state(), codebinexpval(), codebini(), codebitwise(), codeconcat(), codeeq(), codeextraarg(), codenot(), codesJ(), computesizes(), const2exp(), const2val(), constructor(), correctgraylist(), currentpc(), discharge2reg(), dumpConstants(), enterblock(), entersweep(), exp1(), f_parser(), finishCcall(), fixjump(), freeobj(), freereg(), freestack(), fullinc(), funcargs(), GCTM(), genlink(), genstep(), getbuff(), getgclist(), hookf(), inclinenumber(), intarith(), internshrstr(), io_readline(), Ishl(), l_hashfloat(), l_strton(), leaveblock(), LEnum(), lessequalothers(), lessthanothers(), linkgclist_(), loadConstants(), localdebuginfo(), LTnum(), lua_getinfo(), lua_pushcclosure(), lua_resume(), lua_toclose(), lua_yieldk(), luaC_barrier_(), luaC_barrierback_(), luaC_fix(), luaC_freeallobjects(), luaC_fullgc(), luaC_step(), luaD_growstack(), luaD_hook(), luaD_precall(), luaD_pretailcall(), luaD_reallocstack(), luaE_extendCI(), luaE_freethread(), luaE_setdebt(), luaF_close(), luaF_findupval(), luaF_newtbcupval(), luaF_unlinkupval(), luaG_errormsg(), luaG_getfuncline(), luaH_getn(), luaH_getshortstr(), luaH_newkey(), luaH_realasize(), luai_makeseed(), luaK_codeABCk(), luaK_codeABx(), luaK_codeAsBx(), luaK_finish(), luaK_indexed(), luaK_infix(), luaK_patchlist(), luaK_posfix(), luaK_prefix(), luaK_setlist(), luaK_setoneret(), luaK_setreturns(), luaK_storevar(), luaM_free_(), luaM_growaux_(), luaM_realloc_(), luaM_shrinkvector_(), luaO_pushvfstring(), luaO_utf8esc(), luaS_eqlngstr(), luaS_hashlongstr(), luaT_adjustvarargs(), luaT_gettm(), luaU_undump(), luaV_execute(), luaV_finishget(), luaV_finishOp(), luaV_finishset(), luaX_lookahead(), luaY_parser(), markold(), negatecondition(), newupvalue(), numarith(), project(), propagatemark(), read_numeral(), reallymarkobject(), remarkupvals(), removelastlineinfo(), reprepstate(), resume(), retstat(), rotl(), rotl1(), separatetobefnz(), setpause(), singlestep(), singlevar(), skip_sep(), solvegoto(), stackinuse(), statement(), str2K(), str_format(), str_gsub(), sweep2old(), sweepgen(), tofile(), tostringbuff(), traversestrongtable(), traversethread(), traverseweakvalue(), udata2finalize(), and youngcollection().

◆ lua_lock

#define lua_lock (   L)    ((void) 0)

◆ lua_longassert

#define lua_longassert (   c)    ((void)0)

Definition at line 103 of file llimits.h.

◆ LUA_MINBUFFER

#define LUA_MINBUFFER   32

Definition at line 233 of file llimits.h.

Referenced by luaX_setinput().

◆ lua_unlock

#define lua_unlock (   L)    ((void) 0)

◆ luai_apicheck

#define luai_apicheck (   l,
  e 
)    ((void)l, lua_assert(e))

Definition at line 110 of file llimits.h.

◆ LUAI_MAXCCALLS

#define LUAI_MAXCCALLS   200

Definition at line 244 of file llimits.h.

Referenced by ccall(), lua_setcstacklimit(), luaE_checkcstack(), and luaE_incCstack().

◆ LUAI_MAXSHORTLEN

#define LUAI_MAXSHORTLEN   40

Definition at line 205 of file llimits.h.

Referenced by loadStringN(), luaS_newlstr(), and luaV_concat().

◆ luai_numadd

#define luai_numadd (   L,
  a,
  b 
)    ((a)+(b))

Definition at line 335 of file llimits.h.

Referenced by floatforloop(), luaV_execute(), and numarith().

◆ luai_numdiv

#define luai_numdiv (   L,
  a,
  b 
)    ((a)/(b))

Definition at line 307 of file llimits.h.

Referenced by luaV_execute(), and numarith().

◆ luai_numeq

#define luai_numeq (   a,
  b 
)    ((a)==(b))

Definition at line 339 of file llimits.h.

Referenced by equalkey(), luaV_equalobj(), and luaV_execute().

◆ luai_numge

#define luai_numge (   a,
  b 
)    ((a)>=(b))

Definition at line 343 of file llimits.h.

Referenced by luaV_execute().

◆ luai_numgt

#define luai_numgt (   a,
  b 
)    ((a)>(b))

Definition at line 342 of file llimits.h.

Referenced by luaV_execute().

◆ luai_numidiv

#define luai_numidiv (   L,
  a,
  b 
)    ((void)L, l_floor(luai_numdiv(L,a,b)))

Definition at line 302 of file llimits.h.

Referenced by luaV_execute(), and numarith().

◆ luai_numisnan

#define luai_numisnan (   a)    (!luai_numeq((a), (a)))

Definition at line 344 of file llimits.h.

Referenced by constfolding(), l_hashfloat(), and luaH_newkey().

◆ luai_numle

#define luai_numle (   a,
  b 
)    ((a)<=(b))

Definition at line 341 of file llimits.h.

Referenced by floatforloop(), LEfloatint(), LEintfloat(), LEnum(), and luaV_execute().

◆ luai_numlt

#define luai_numlt (   a,
  b 
)    ((a)<(b))

Definition at line 340 of file llimits.h.

Referenced by floatforloop(), forlimit(), forprep(), LTfloatint(), LTintfloat(), LTnum(), and luaV_execute().

◆ luai_nummod

#define luai_nummod (   L,
  a,
  b,
 
)
Value:
{ (void)L; (m) = l_mathop(fmod)(a,b); \
if (((m) > 0) ? (b) < 0 : ((m) < 0 && (b) > 0)) (m) += (b); }
#define a
#define b
#define l_mathop(op)
Definition: luaconf.h:463

Definition at line 322 of file llimits.h.

Referenced by luaV_modf().

◆ luai_nummul

#define luai_nummul (   L,
  a,
  b 
)    ((a)*(b))

Definition at line 337 of file llimits.h.

Referenced by luaV_execute(), and numarith().

◆ luai_numpow

#define luai_numpow (   L,
  a,
  b 
)    ((void)L, (b == 2) ? (a)*(a) : l_mathop(pow)(a,b))

Definition at line 329 of file llimits.h.

Referenced by luaV_execute(), and numarith().

◆ luai_numsub

#define luai_numsub (   L,
  a,
  b 
)    ((a)-(b))

Definition at line 336 of file llimits.h.

Referenced by luaV_execute(), and numarith().

◆ luai_numunm

#define luai_numunm (   L,
  a 
)    (-(a))

Definition at line 338 of file llimits.h.

Referenced by luaV_execute(), and numarith().

◆ luai_threadyield

#define luai_threadyield (   L)    {lua_unlock(L); lua_lock(L);}

Definition at line 262 of file llimits.h.

◆ luai_userstateclose

#define luai_userstateclose (   L)    ((void)L)

Definition at line 275 of file llimits.h.

Referenced by close_state().

◆ luai_userstatefree

#define luai_userstatefree (   L,
  L1 
)    ((void)L)

Definition at line 283 of file llimits.h.

Referenced by luaE_freethread().

◆ luai_userstateopen

#define luai_userstateopen (   L)    ((void)L)

Definition at line 271 of file llimits.h.

Referenced by f_luaopen().

◆ luai_userstateresume

#define luai_userstateresume (   L,
  n 
)    ((void)L)

Definition at line 287 of file llimits.h.

Referenced by lua_resume().

◆ luai_userstatethread

#define luai_userstatethread (   L,
  L1 
)    ((void)L)

Definition at line 279 of file llimits.h.

Referenced by lua_newthread().

◆ luai_userstateyield

#define luai_userstateyield (   L,
  n 
)    ((void)L)

Definition at line 291 of file llimits.h.

Referenced by lua_yieldk().

◆ MAX_INT

#define MAX_INT   INT_MAX /* maximum value of an int */

Definition at line 53 of file llimits.h.

Referenced by growstrtab(), inclinenumber(), luaK_code(), recfield(), and savelineinfo().

◆ MAX_LMEM

#define MAX_LMEM   ((l_mem)(MAX_LUMEM >> 1))

Definition at line 50 of file llimits.h.

Referenced by incstep(), luaE_setdebt(), and setpause().

◆ MAX_LUMEM

#define MAX_LUMEM   ((lu_mem)(~(lu_mem)0))

Definition at line 48 of file llimits.h.

◆ MAX_SIZE

#define MAX_SIZE
Value:
(sizeof(size_t) < sizeof(lua_Integer) ? MAX_SIZET \
: (size_t)(LUA_MAXINTEGER))
#define MAX_SIZET
Definition: llimits.h:41
LUA_INTEGER lua_Integer
Definition: lua.h:94

Definition at line 44 of file llimits.h.

Referenced by luaS_newlstr(), luaS_newudata(), luaV_concat(), and save().

◆ MAX_SIZET

#define MAX_SIZET   ((size_t)(~(size_t)0))

Definition at line 41 of file llimits.h.

◆ MINSTRTABSIZE

#define MINSTRTABSIZE   128

Definition at line 216 of file llimits.h.

Referenced by luaS_init().

◆ point2uint

#define point2uint (   p)    ((unsigned int)((size_t)(p) & UINT_MAX))

Definition at line 78 of file llimits.h.

Referenced by luaS_new().

◆ STRCACHE_M

#define STRCACHE_M   2

Definition at line 227 of file llimits.h.

Referenced by luaS_clearcache(), luaS_init(), and luaS_new().

◆ STRCACHE_N

#define STRCACHE_N   53

Definition at line 226 of file llimits.h.

Referenced by luaS_clearcache(), luaS_init(), and luaS_new().

◆ unlikely

#define unlikely (   x)    (x)

◆ UNUSED

#define UNUSED (   x)    ((void)(x))

Definition at line 118 of file llimits.h.

Typedef Documentation

◆ Instruction

Definition at line 194 of file llimits.h.

◆ l_mem

typedef long l_mem

Definition at line 31 of file llimits.h.

◆ l_uacInt

Definition at line 84 of file llimits.h.

◆ l_uacNumber

Definition at line 83 of file llimits.h.

◆ l_uint32

typedef unsigned long l_uint32

Definition at line 191 of file llimits.h.

◆ ls_byte

typedef signed char ls_byte

Definition at line 37 of file llimits.h.

◆ lu_byte

typedef unsigned char lu_byte

Definition at line 36 of file llimits.h.

◆ lu_mem

typedef unsigned long lu_mem

Definition at line 30 of file llimits.h.