From a7c9e45c64a4bff9bdaf0d1177509bdd00fc53f7 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 11 Sep 2006 11:07:24 -0300 Subject: [PATCH] avoid trailing white spaces --- lapi.c | 6 +++--- ldblib.c | 4 ++-- ldebug.c | 4 ++-- ldo.c | 4 ++-- ldump.c | 4 ++-- lgc.c | 8 ++++---- llimits.h | 6 +++--- loadlib.c | 6 +++--- lobject.h | 4 ++-- lopcodes.c | 4 ++-- lopcodes.h | 18 +++++++++--------- lstate.c | 4 ++-- lstrlib.c | 6 +++--- ltable.c | 16 ++++++++-------- ltests.c | 8 ++++---- lua.c | 6 +++--- lua.h | 6 +++--- lualib.h | 4 ++-- lundump.c | 6 +++--- lvm.c | 6 +++--- 20 files changed, 65 insertions(+), 65 deletions(-) diff --git a/lapi.c b/lapi.c index e992d27e..56e86d4a 100644 --- a/lapi.c +++ b/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 2.55 2006/06/07 12:37:17 roberto Exp roberto $ +** $Id: lapi.c,v 2.56 2006/07/11 15:53:29 roberto Exp roberto $ ** Lua API ** See Copyright Notice in lua.h */ @@ -185,7 +185,7 @@ LUA_API void lua_replace (lua_State *L, int idx) { api_checkvalidindex(L, o); if (idx == LUA_ENVIRONINDEX) { Closure *func = curr_func(L); - api_check(L, ttistable(L->top - 1)); + api_check(L, ttistable(L->top - 1)); func->c.env = hvalue(L->top - 1); luaC_barrier(L, func, L->top - 1); } @@ -747,7 +747,7 @@ LUA_API int lua_setfenv (lua_State *L, int idx) { #define checkresults(L,na,nr) \ api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na))) - + LUA_API void lua_call (lua_State *L, int nargs, int nresults) { StkId func; diff --git a/ldblib.c b/ldblib.c index 6a07237b..441c478c 100644 --- a/ldblib.c +++ b/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.103 2005/11/01 16:08:32 roberto Exp roberto $ +** $Id: ldblib.c,v 1.104 2005/12/29 15:32:11 roberto Exp roberto $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ @@ -138,7 +138,7 @@ static int db_getinfo (lua_State *L) { treatstackoption(L, L1, "func"); return 1; /* return table */ } - + static int db_getlocal (lua_State *L) { int arg; diff --git a/ldebug.c b/ldebug.c index 10496741..8b482195 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.30 2006/07/11 15:53:29 roberto Exp roberto $ +** $Id: ldebug.c,v 2.31 2006/08/07 19:04:06 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -185,7 +185,7 @@ static void collectvalidlines (lua_State *L, Closure *f) { int i; int *lineinfo = f->l.p->lineinfo; Table *t = luaH_new(L); - sethvalue(L, L->top, t); + sethvalue(L, L->top, t); incr_top(L); for (i=0; il.p->sizelineinfo; i++) setbvalue(luaH_setnum(L, t, lineinfo[i]), 1); diff --git a/ldo.c b/ldo.c index 3d92bf85..1cb487cb 100644 --- a/ldo.c +++ b/ldo.c @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 2.40 2006/08/15 19:59:20 roberto Exp roberto $ +** $Id: ldo.c,v 2.41 2006/09/11 12:44:56 roberto Exp roberto $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -368,7 +368,7 @@ int luaD_poscall (lua_State *L, StkId firstResult) { ** The arguments are on the stack, right after the function. ** When returns, all the results are on the stack, starting at the original ** function position. -*/ +*/ void luaD_call (lua_State *L, StkId func, int nResults) { global_State *g = G(L); lua_assert(g->nCcalls >= L->baseCcalls); diff --git a/ldump.c b/ldump.c index f08277d3..b2771aca 100644 --- a/ldump.c +++ b/ldump.c @@ -1,5 +1,5 @@ /* -** $Id: ldump.c,v 1.15 2006/02/16 15:53:49 lhf Exp $ +** $Id: ldump.c,v 2.8 2006/02/17 15:51:03 roberto Exp roberto $ ** save precompiled Lua chunks ** See Copyright Notice in lua.h */ @@ -24,7 +24,7 @@ typedef struct { } DumpState; #define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) -#define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) +#define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) static void DumpBlock(const void* b, size_t size, DumpState* D) { diff --git a/lgc.c b/lgc.c index 93316741..7c1aea5f 100644 --- a/lgc.c +++ b/lgc.c @@ -1,5 +1,5 @@ /* -** $Id: lgc.c,v 2.38 2006/05/24 14:34:06 roberto Exp roberto $ +** $Id: lgc.c,v 2.39 2006/07/11 15:53:29 roberto Exp roberto $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -310,7 +310,7 @@ static l_mem propagatemark (global_State *g) { traverseproto(g, p); return sizeof(Proto) + sizeof(Instruction) * p->sizecode + sizeof(Proto *) * p->sizep + - sizeof(TValue) * p->sizek + + sizeof(TValue) * p->sizek + sizeof(int) * p->sizelineinfo + sizeof(LocVar) * p->sizelocvars + sizeof(TString *) * p->sizeupvalues; @@ -569,7 +569,7 @@ static void atomic (lua_State *L) { #define correctestimate(g,s) {lu_mem old = g->totalbytes; s; \ lua_assert(old >= g->totalbytes); g->estimate -= old - g->totalbytes;} - + static l_mem singlestep (lua_State *L) { global_State *g = G(L); @@ -713,7 +713,7 @@ void luaC_linkupval (lua_State *L, UpVal *uv) { GCObject *o = obj2gco(uv); o->gch.next = g->rootgc; /* link upvalue into `rootgc' list */ g->rootgc = o; - if (isgray(o)) { + if (isgray(o)) { if (g->gcstate == GCSpropagate) { gray2black(o); /* closed upvalues need barrier */ luaC_barrier(L, uv, uv->v); diff --git a/llimits.h b/llimits.h index e0065649..06e786ab 100644 --- a/llimits.h +++ b/llimits.h @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.68 2005/12/22 16:19:56 roberto Exp roberto $ +** $Id: llimits.h,v 1.69 2005/12/27 17:12:00 roberto Exp roberto $ ** Limits, basic types, and some other `installation-dependent' definitions ** See Copyright Notice in lua.h */ @@ -107,7 +107,7 @@ typedef lu_int32 Instruction; #ifndef lua_lock -#define lua_lock(L) ((void) 0) +#define lua_lock(L) ((void) 0) #define lua_unlock(L) ((void) 0) #endif @@ -118,7 +118,7 @@ typedef lu_int32 Instruction; /* ** macro to control inclusion of some hard tests on stack reallocation -*/ +*/ #ifndef HARDSTACKTESTS #define condhardstacktests(x) ((void)0) #else diff --git a/loadlib.c b/loadlib.c index 6964b567..36778891 100644 --- a/loadlib.c +++ b/loadlib.c @@ -1,5 +1,5 @@ /* -** $Id: loadlib.c,v 1.53 2006/06/22 16:12:59 roberto Exp roberto $ +** $Id: loadlib.c,v 1.54 2006/07/03 20:16:49 roberto Exp roberto $ ** Dynamic library loader for Lua ** See Copyright Notice in lua.h ** @@ -502,7 +502,7 @@ static int ll_require (lua_State *L) { ** 'module' function ** ======================================================= */ - + static void setfenv (lua_State *L) { lua_Debug ar; @@ -630,7 +630,7 @@ LUALIB_API int luaopen_package (lua_State *L) { lua_setfield(L, -2, "__gc"); /* create `package' table */ luaL_register(L, LUA_LOADLIBNAME, pk_funcs); -#if defined(LUA_COMPAT_LOADLIB) +#if defined(LUA_COMPAT_LOADLIB) lua_getfield(L, -1, "loadlib"); lua_setfield(L, LUA_GLOBALSINDEX, "loadlib"); #endif diff --git a/lobject.h b/lobject.h index 76221587..bb786b01 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.19 2006/01/10 12:51:53 roberto Exp roberto $ +** $Id: lobject.h,v 2.20 2006/01/18 11:37:34 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -337,7 +337,7 @@ typedef struct Node { typedef struct Table { CommonHeader; - lu_byte flags; /* 1<

C) then pc++ */ -OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ +OP_TEST,/* A C if not (R(A) <=> C) then pc++ */ +OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */ @@ -197,11 +197,11 @@ OP_FORLOOP,/* A sBx R(A)+=R(A+2); if R(A) =) R(A)*/ +OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/ OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */ OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ @@ -240,7 +240,7 @@ OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ ** bits 4-5: B arg mode ** bit 6: instruction set register A ** bit 7: operator is a test -*/ +*/ enum OpArgMask { OpArgN, /* argument is not used */ diff --git a/lstate.c b/lstate.c index 30ff3cbd..66fffbc9 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.37 2006/07/11 15:53:29 roberto Exp roberto $ +** $Id: lstate.c,v 2.38 2006/08/15 19:59:20 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -37,7 +37,7 @@ typedef struct LG { lua_State l; global_State g; } LG; - + static void stack_init (lua_State *L1, lua_State *L) { diff --git a/lstrlib.c b/lstrlib.c index ab04b5d5..641c3227 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.132 2006/04/26 20:41:19 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.133 2006/06/22 16:12:59 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -630,7 +630,7 @@ static void add_value (MatchState *ms, luaL_Buffer *b, const char *s, break; } default: { - luaL_argerror(L, 3, "string/function/table expected"); + luaL_argerror(L, 3, "string/function/table expected"); return; } } @@ -639,7 +639,7 @@ static void add_value (MatchState *ms, luaL_Buffer *b, const char *s, lua_pushlstring(L, s, e - s); /* keep original text */ } else if (!lua_isstring(L, -1)) - luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); + luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); luaL_addvalue(b); /* add result to accumulator */ } diff --git a/ltable.c b/ltable.c index a29eb030..722e1de3 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 2.33 2006/07/11 15:53:29 roberto Exp roberto $ +** $Id: ltable.c,v 2.34 2006/08/07 19:14:30 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -48,7 +48,7 @@ #define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) - + #define hashstr(t,str) hashpow2(t, (str)->tsv.hash) #define hashboolean(t,p) hashpow2(t, p) @@ -302,7 +302,7 @@ void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize) { if (nasize > oldasize) /* array part must grow? */ setarrayvector(L, t, nasize); /* create new hash part with appropriate size */ - setnodevector(L, t, nhsize); + setnodevector(L, t, nhsize); if (nasize < oldasize) { /* array part must shrink? */ t->sizearray = nasize; /* re-insert elements from vanishing slice */ @@ -386,11 +386,11 @@ static Node *getfreepos (Table *t) { /* -** inserts a new key into a hash table; first, check whether key's main -** position is free. If not, check whether colliding node is in its main -** position or not: if it is not, move colliding node to an empty place and -** put new key in its main position; otherwise (colliding node is in its main -** position), new key goes to an empty position. +** inserts a new key into a hash table; first, check whether key's main +** position is free. If not, check whether colliding node is in its main +** position or not: if it is not, move colliding node to an empty place and +** put new key in its main position; otherwise (colliding node is in its main +** position), new key goes to an empty position. */ static TValue *newkey (lua_State *L, Table *t, const TValue *key) { Node *mp = mainposition(t, key); diff --git a/ltests.c b/ltests.c index 151e1f4c..665b5d90 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 2.37 2006/06/05 19:35:57 roberto Exp roberto $ +** $Id: ltests.c,v 2.38 2006/07/11 15:53:29 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -399,7 +399,7 @@ static char *buildop (Proto *p, int pc, char *buff) { const char *name = luaP_opnames[o]; int line = getline(p, pc); sprintf(buff, "(%4d) %4d - ", line, pc); - switch (getOpMode(o)) { + switch (getOpMode(o)) { case iABC: sprintf(buff+strlen(buff), "%-12s%4d %4d %4d", name, GETARG_A(i), GETARG_B(i), GETARG_C(i)); @@ -581,7 +581,7 @@ static int table_query (lua_State *L) { else if (i < t->sizearray) { lua_pushinteger(L, i); pushobject(L, &t->array[i]); - lua_pushnil(L); + lua_pushnil(L); } else if ((i -= t->sizearray) < sizenode(t)) { if (!ttisnil(gval(gnode(t, i))) || @@ -821,7 +821,7 @@ static int getnum_aux (lua_State *L, const char **pc) { while (isdigit(cast_int(**pc))) res = res*10 + (*(*pc)++) - '0'; return sig*res; } - + static const char *getname_aux (char *buff, const char **pc) { int i = 0; skip(pc); diff --git a/lua.c b/lua.c index 5c0ae9c5..425c1290 100644 --- a/lua.c +++ b/lua.c @@ -1,5 +1,5 @@ /* -** $Id: lua.c,v 1.160 2006/06/02 15:34:00 roberto Exp roberto $ +** $Id: lua.c,v 1.161 2006/06/23 16:09:15 roberto Exp roberto $ ** Lua stand-alone interpreter ** See Copyright Notice in lua.h */ @@ -242,14 +242,14 @@ static int handle_script (lua_State *L, char **argv, int n) { int narg = getargs(L, argv, n); /* collect arguments */ lua_setglobal(L, "arg"); fname = argv[n]; - if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0) + if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0) fname = NULL; /* stdin */ status = luaL_loadfile(L, fname); lua_insert(L, -(narg+1)); if (status == 0) status = docall(L, narg, 0); else - lua_pop(L, narg); + lua_pop(L, narg); return report(L, status); } diff --git a/lua.h b/lua.h index fd1e46e5..e4daafae 100644 --- a/lua.h +++ b/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.217 2006/05/31 16:50:40 roberto Exp roberto $ +** $Id: lua.h,v 1.218 2006/06/02 15:34:00 roberto Exp roberto $ ** Lua - An Extensible Extension Language ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) ** See Copyright Notice at the end of this file @@ -20,7 +20,7 @@ #define LUA_RELEASE "Lua 5.1.1" #define LUA_VERSION_NUM 501 #define LUA_COPYRIGHT "Copyright (C) 1994-2006 Lua.org, PUC-Rio" -#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" +#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" /* mark for precompiled code (`Lua') */ @@ -245,7 +245,7 @@ LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); -/* +/* ** =============================================================== ** some useful macros ** =============================================================== diff --git a/lualib.h b/lualib.h index 3afa4591..ed4ffe4a 100644 --- a/lualib.h +++ b/lualib.h @@ -1,5 +1,5 @@ /* -** $Id: lualib.h,v 1.35 2005/08/10 18:06:58 roberto Exp roberto $ +** $Id: lualib.h,v 1.36 2005/12/27 17:12:00 roberto Exp roberto $ ** Lua standard libraries ** See Copyright Notice in lua.h */ @@ -41,7 +41,7 @@ LUALIB_API int (luaopen_package) (lua_State *L); /* open all previous libraries */ -LUALIB_API void (luaL_openlibs) (lua_State *L); +LUALIB_API void (luaL_openlibs) (lua_State *L); diff --git a/lundump.c b/lundump.c index 7fc635ee..534d2d38 100644 --- a/lundump.c +++ b/lundump.c @@ -1,5 +1,5 @@ /* -** $Id: lundump.c,v 1.60 2006/02/16 15:53:49 lhf Exp $ +** $Id: lundump.c,v 2.7 2006/02/17 15:51:03 roberto Exp roberto $ ** load precompiled Lua chunks ** See Copyright Notice in lua.h */ @@ -110,10 +110,10 @@ static void LoadConstants(LoadState* S, Proto* f) switch (t) { case LUA_TNIL: - setnilvalue(o); + setnilvalue(o); break; case LUA_TBOOLEAN: - setbvalue(o,LoadChar(S)); + setbvalue(o,LoadChar(S)); break; case LUA_TNUMBER: setnvalue(o,LoadNumber(S)); diff --git a/lvm.c b/lvm.c index db69e47e..98846bc9 100644 --- a/lvm.c +++ b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.65 2006/07/14 16:22:24 roberto Exp roberto $ +** $Id: lvm.c,v 2.66 2006/08/07 19:14:30 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -127,7 +127,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { callTMres(L, val, tm, t, key); return; } - t = tm; /* else repeat with `tm' */ + t = tm; /* else repeat with `tm' */ } luaG_runerror(L, "loop in gettable"); } @@ -154,7 +154,7 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { callTM(L, tm, t, key, val); return; } - t = tm; /* else repeat with `tm' */ + t = tm; /* else repeat with `tm' */ } luaG_runerror(L, "loop in settable"); }