[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: New param in lua_resume in Lua 5.4
- From: "Joseph C. Sible" <josephcsible@...>
- Date: Thu, 9 Jul 2020 14:31:33 -0400
On Thu, Jul 9, 2020 at 11:46 AM Lubos Uhliarik <luhliari@redhat.com> wrote:
>
> I just found out, that there has been added new param to function lua_resume.
>
> New definition in Lua 5.4 is following:
>
> int lua_resume (lua_State *L, lua_State *from, int nargs,
> int *nresults);
>
>
> Do you have any idea, how I need to rewrite the code, if in old code we use just
> lua_resume(L, NULL, x) ?
It depends on the context of the code around it. Basically, wherever
you used lua_gettop(L) before, you want to use nres from the out
parameter now. For example, if you had this before:
/* set up for the call to lua_resume */
int status = lua_resume(L, NULL, x);
/* check status */
int nres = lua_gettop(L);
/* do stuff with nres */
Then you'd want to do this now:
/* set up for the call to lua_resume */
int nres;
int status = lua_resume(L, NULL, x, &nres);
/* check status */
/* do stuff with nres */
Joseph C. Sible