changing {} style to match majority of previous style

This commit is contained in:
Philippe Teuwen 2019-03-10 11:20:22 +01:00
commit 961d929f4d
320 changed files with 5502 additions and 10485 deletions

View file

@ -86,8 +86,7 @@ typedef struct LG {
{ size_t t = cast(size_t, e); \
memcpy(buff + p, &t, sizeof(t)); p += sizeof(t); }
static unsigned int makeseed(lua_State *L)
{
static unsigned int makeseed(lua_State *L) {
char buff[4 * sizeof(size_t)];
unsigned int h = luai_makeseed();
int p = 0;
@ -104,15 +103,13 @@ static unsigned int makeseed(lua_State *L)
** set GCdebt to a new value keeping the value (totalbytes + GCdebt)
** invariant
*/
void luaE_setdebt(global_State *g, l_mem debt)
{
void luaE_setdebt(global_State *g, l_mem debt) {
g->totalbytes -= (debt - g->GCdebt);
g->GCdebt = debt;
}
CallInfo *luaE_extendCI(lua_State *L)
{
CallInfo *luaE_extendCI(lua_State *L) {
CallInfo *ci = luaM_new(L, CallInfo);
lua_assert(L->ci->next == NULL);
L->ci->next = ci;
@ -122,8 +119,7 @@ CallInfo *luaE_extendCI(lua_State *L)
}
void luaE_freeCI(lua_State *L)
{
void luaE_freeCI(lua_State *L) {
CallInfo *ci = L->ci;
CallInfo *next = ci->next;
ci->next = NULL;
@ -134,8 +130,7 @@ void luaE_freeCI(lua_State *L)
}
static void stack_init(lua_State *L1, lua_State *L)
{
static void stack_init(lua_State *L1, lua_State *L) {
int i;
CallInfo *ci;
/* initialize stack array */
@ -156,8 +151,7 @@ static void stack_init(lua_State *L1, lua_State *L)
}
static void freestack(lua_State *L)
{
static void freestack(lua_State *L) {
if (L->stack == NULL)
return; /* stack not completely built yet */
L->ci = &L->base_ci; /* free the entire 'ci' list */
@ -169,8 +163,7 @@ static void freestack(lua_State *L)
/*
** Create registry table and its predefined values
*/
static void init_registry(lua_State *L, global_State *g)
{
static void init_registry(lua_State *L, global_State *g) {
TValue mt;
/* create registry */
Table *registry = luaH_new(L);
@ -188,8 +181,7 @@ static void init_registry(lua_State *L, global_State *g)
/*
** open parts of the state that may cause memory-allocation errors
*/
static void f_luaopen(lua_State *L, void *ud)
{
static void f_luaopen(lua_State *L, void *ud) {
global_State *g = G(L);
UNUSED(ud);
stack_init(L, L); /* init stack */
@ -208,8 +200,7 @@ static void f_luaopen(lua_State *L, void *ud)
** preinitialize a state with consistent values without allocating
** any memory (to avoid errors)
*/
static void preinit_state(lua_State *L, global_State *g)
{
static void preinit_state(lua_State *L, global_State *g) {
G(L) = g;
L->stack = NULL;
L->ci = NULL;
@ -228,8 +219,7 @@ static void preinit_state(lua_State *L, global_State *g)
}
static void close_state(lua_State *L)
{
static void close_state(lua_State *L) {
global_State *g = G(L);
luaF_close(L, L->stack); /* close all upvalues for this thread */
luaC_freeallobjects(L); /* collect all objects */
@ -241,8 +231,7 @@ static void close_state(lua_State *L)
}
LUA_API lua_State *lua_newthread(lua_State *L)
{
LUA_API lua_State *lua_newthread(lua_State *L) {
lua_State *L1;
lua_lock(L);
luaC_checkGC(L);
@ -261,8 +250,7 @@ LUA_API lua_State *lua_newthread(lua_State *L)
}
void luaE_freethread(lua_State *L, lua_State *L1)
{
void luaE_freethread(lua_State *L, lua_State *L1) {
LX *l = fromstate(L1);
luaF_close(L1, L1->stack); /* close all upvalues for this thread */
lua_assert(L1->openupval == NULL);
@ -272,8 +260,7 @@ void luaE_freethread(lua_State *L, lua_State *L1)
}
LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)
{
LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud) {
int i;
lua_State *L;
global_State *g;
@ -325,8 +312,7 @@ LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)
}
LUA_API void lua_close(lua_State *L)
{
LUA_API void lua_close(lua_State *L) {
L = G(L)->mainthread; /* only the main thread can be closed */
lua_lock(L);
luai_userstateclose(L);