mirror of
https://github.com/lua/lua
synced 2025-03-10 16:01:28 +03:00
simpler definition for incr_top
This commit is contained in:
parent
be00cd2a6b
commit
010bbd9d9c
10
ldo.h
10
ldo.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ldo.h,v 1.51 2002/08/07 14:35:55 roberto Exp roberto $
|
** $Id: ldo.h,v 1.52 2002/09/02 20:00:41 roberto Exp roberto $
|
||||||
** Stack and Call structure of Lua
|
** Stack and Call structure of Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -13,17 +13,13 @@
|
|||||||
#include "lzio.h"
|
#include "lzio.h"
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
** macro to increment stack top.
|
|
||||||
** There must be always an empty slot at the L->stack.top
|
|
||||||
*/
|
|
||||||
#define incr_top(L) \
|
|
||||||
{if (L->top >= L->stack_last) luaD_growstack(L, 1); L->top++;}
|
|
||||||
|
|
||||||
#define luaD_checkstack(L,n) \
|
#define luaD_checkstack(L,n) \
|
||||||
if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TObject)) \
|
if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TObject)) \
|
||||||
luaD_growstack(L, n)
|
luaD_growstack(L, n)
|
||||||
|
|
||||||
|
#define incr_top(L) {luaD_checkstack(L,1); L->top++;}
|
||||||
|
|
||||||
#define savestack(L,p) ((char *)(p) - (char *)L->stack)
|
#define savestack(L,p) ((char *)(p) - (char *)L->stack)
|
||||||
#define restorestack(L,n) ((TObject *)((char *)L->stack + (n)))
|
#define restorestack(L,n) ((TObject *)((char *)L->stack + (n)))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user