changing {} style to match majority of previous style
This commit is contained in:
@@ -17,8 +17,7 @@
|
||||
#include "lualib.h"
|
||||
|
||||
|
||||
static int auxresume(lua_State *L, lua_State *co, int narg)
|
||||
{
|
||||
static int auxresume(lua_State *L, lua_State *co, int narg) {
|
||||
int status;
|
||||
if (!lua_checkstack(co, narg)) {
|
||||
lua_pushliteral(L, "too many arguments to resume");
|
||||
@@ -46,8 +45,7 @@ static int auxresume(lua_State *L, lua_State *co, int narg)
|
||||
}
|
||||
|
||||
|
||||
static int luaB_coresume(lua_State *L)
|
||||
{
|
||||
static int luaB_coresume(lua_State *L) {
|
||||
lua_State *co = lua_tothread(L, 1);
|
||||
int r;
|
||||
luaL_argcheck(L, co, 1, "coroutine expected");
|
||||
@@ -64,8 +62,7 @@ static int luaB_coresume(lua_State *L)
|
||||
}
|
||||
|
||||
|
||||
static int luaB_auxwrap(lua_State *L)
|
||||
{
|
||||
static int luaB_auxwrap(lua_State *L) {
|
||||
lua_State *co = lua_tothread(L, lua_upvalueindex(1));
|
||||
int r = auxresume(L, co, lua_gettop(L));
|
||||
if (r < 0) {
|
||||
@@ -80,8 +77,7 @@ static int luaB_auxwrap(lua_State *L)
|
||||
}
|
||||
|
||||
|
||||
static int luaB_cocreate(lua_State *L)
|
||||
{
|
||||
static int luaB_cocreate(lua_State *L) {
|
||||
lua_State *NL;
|
||||
luaL_checktype(L, 1, LUA_TFUNCTION);
|
||||
NL = lua_newthread(L);
|
||||
@@ -91,22 +87,19 @@ static int luaB_cocreate(lua_State *L)
|
||||
}
|
||||
|
||||
|
||||
static int luaB_cowrap(lua_State *L)
|
||||
{
|
||||
static int luaB_cowrap(lua_State *L) {
|
||||
luaB_cocreate(L);
|
||||
lua_pushcclosure(L, luaB_auxwrap, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static int luaB_yield(lua_State *L)
|
||||
{
|
||||
static int luaB_yield(lua_State *L) {
|
||||
return lua_yield(L, lua_gettop(L));
|
||||
}
|
||||
|
||||
|
||||
static int luaB_costatus(lua_State *L)
|
||||
{
|
||||
static int luaB_costatus(lua_State *L) {
|
||||
lua_State *co = lua_tothread(L, 1);
|
||||
luaL_argcheck(L, co, 1, "coroutine expected");
|
||||
if (L == co) lua_pushliteral(L, "running");
|
||||
@@ -134,8 +127,7 @@ static int luaB_costatus(lua_State *L)
|
||||
}
|
||||
|
||||
|
||||
static int luaB_corunning(lua_State *L)
|
||||
{
|
||||
static int luaB_corunning(lua_State *L) {
|
||||
int ismain = lua_pushthread(L);
|
||||
lua_pushboolean(L, ismain);
|
||||
return 2;
|
||||
@@ -154,8 +146,7 @@ static const luaL_Reg co_funcs[] = {
|
||||
|
||||
|
||||
|
||||
LUAMOD_API int luaopen_coroutine(lua_State *L)
|
||||
{
|
||||
LUAMOD_API int luaopen_coroutine(lua_State *L) {
|
||||
luaL_newlib(L, co_funcs);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user