mirror of
https://github.com/lua/lua.git
synced 2024-11-23 18:23:43 +08:00
detail (removing spaces at end of lines)
This commit is contained in:
parent
9903dd52a3
commit
2a235312f0
6
lcode.c
6
lcode.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lcode.c,v 2.110 2016/06/20 19:12:46 roberto Exp roberto $
|
** $Id: lcode.c,v 2.111 2016/07/19 17:12:07 roberto Exp roberto $
|
||||||
** Code generator for Lua
|
** Code generator for Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -86,7 +86,7 @@ void luaK_nil (FuncState *fs, int from, int n) {
|
|||||||
/*
|
/*
|
||||||
** Gets the destination address of a jump instruction. Used to traverse
|
** Gets the destination address of a jump instruction. Used to traverse
|
||||||
** a list of jumps.
|
** a list of jumps.
|
||||||
*/
|
*/
|
||||||
static int getjump (FuncState *fs, int pc) {
|
static int getjump (FuncState *fs, int pc) {
|
||||||
int offset = GETARG_sBx(fs->f->code[pc]);
|
int offset = GETARG_sBx(fs->f->code[pc]);
|
||||||
if (offset == NO_JUMP) /* point to itself represents end of list */
|
if (offset == NO_JUMP) /* point to itself represents end of list */
|
||||||
@ -754,7 +754,7 @@ void luaK_exp2val (FuncState *fs, expdesc *e) {
|
|||||||
** (that is, it is either in a register or in 'k' with an index
|
** (that is, it is either in a register or in 'k' with an index
|
||||||
** in the range of R/K indices).
|
** in the range of R/K indices).
|
||||||
** Returns R/K index.
|
** Returns R/K index.
|
||||||
*/
|
*/
|
||||||
int luaK_exp2RK (FuncState *fs, expdesc *e) {
|
int luaK_exp2RK (FuncState *fs, expdesc *e) {
|
||||||
luaK_exp2val(fs, e);
|
luaK_exp2val(fs, e);
|
||||||
switch (e->k) { /* move constants to 'k' */
|
switch (e->k) { /* move constants to 'k' */
|
||||||
|
4
lgc.c
4
lgc.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lgc.c,v 2.213 2016/10/19 12:31:42 roberto Exp roberto $
|
** $Id: lgc.c,v 2.214 2016/11/07 12:38:35 roberto Exp roberto $
|
||||||
** Garbage Collector
|
** Garbage Collector
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -539,7 +539,7 @@ static lu_mem traversethread (global_State *g, lua_State *th) {
|
|||||||
StkId lim = th->stack + th->stacksize; /* real end of stack */
|
StkId lim = th->stack + th->stacksize; /* real end of stack */
|
||||||
for (; o < lim; o++) /* clear not-marked stack slice */
|
for (; o < lim; o++) /* clear not-marked stack slice */
|
||||||
setnilvalue(o);
|
setnilvalue(o);
|
||||||
/* 'remarkupvals' may have removed thread from 'twups' list */
|
/* 'remarkupvals' may have removed thread from 'twups' list */
|
||||||
if (!isintwups(th) && th->openupval != NULL) {
|
if (!isintwups(th) && th->openupval != NULL) {
|
||||||
th->twups = g->twups; /* link it back to the list */
|
th->twups = g->twups; /* link it back to the list */
|
||||||
g->twups = th;
|
g->twups = th;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lmathlib.c,v 1.117 2015/10/02 15:39:23 roberto Exp roberto $
|
** $Id: lmathlib.c,v 1.118 2016/12/20 18:37:00 roberto Exp roberto $
|
||||||
** Standard mathematical library
|
** Standard mathematical library
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -265,7 +265,7 @@ static int math_random (lua_State *L) {
|
|||||||
default: return luaL_error(L, "wrong number of arguments");
|
default: return luaL_error(L, "wrong number of arguments");
|
||||||
}
|
}
|
||||||
/* random integer in the interval [low, up] */
|
/* random integer in the interval [low, up] */
|
||||||
luaL_argcheck(L, low <= up, 1, "interval is empty");
|
luaL_argcheck(L, low <= up, 1, "interval is empty");
|
||||||
luaL_argcheck(L, low >= 0 || up <= LUA_MAXINTEGER + low, 1,
|
luaL_argcheck(L, low >= 0 || up <= LUA_MAXINTEGER + low, 1,
|
||||||
"interval too large");
|
"interval too large");
|
||||||
r *= (double)(up - low) + 1.0;
|
r *= (double)(up - low) + 1.0;
|
||||||
@ -284,9 +284,9 @@ static int math_randomseed (lua_State *L) {
|
|||||||
static int math_type (lua_State *L) {
|
static int math_type (lua_State *L) {
|
||||||
if (lua_type(L, 1) == LUA_TNUMBER) {
|
if (lua_type(L, 1) == LUA_TNUMBER) {
|
||||||
if (lua_isinteger(L, 1))
|
if (lua_isinteger(L, 1))
|
||||||
lua_pushliteral(L, "integer");
|
lua_pushliteral(L, "integer");
|
||||||
else
|
else
|
||||||
lua_pushliteral(L, "float");
|
lua_pushliteral(L, "float");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
luaL_checkany(L, 1);
|
luaL_checkany(L, 1);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lobject.c,v 2.111 2016/05/20 14:07:48 roberto Exp roberto $
|
** $Id: lobject.c,v 2.112 2016/06/27 13:15:08 roberto Exp roberto $
|
||||||
** Some generic functions over Lua objects
|
** Some generic functions over Lua objects
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -394,7 +394,7 @@ static void pushstr (lua_State *L, const char *str, size_t l) {
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** this function handles only '%d', '%c', '%f', '%p', and '%s'
|
** this function handles only '%d', '%c', '%f', '%p', and '%s'
|
||||||
conventional formats, plus Lua-specific '%I' and '%U'
|
conventional formats, plus Lua-specific '%I' and '%U'
|
||||||
*/
|
*/
|
||||||
const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) {
|
const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) {
|
||||||
|
8
lstate.h
8
lstate.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lstate.h,v 2.131 2016/06/16 13:36:09 roberto Exp roberto $
|
** $Id: lstate.h,v 2.132 2016/10/19 12:31:42 roberto Exp roberto $
|
||||||
** Global State
|
** Global State
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -23,7 +23,7 @@
|
|||||||
**
|
**
|
||||||
** 'allgc': all objects not marked for finalization;
|
** 'allgc': all objects not marked for finalization;
|
||||||
** 'finobj': all objects marked for finalization;
|
** 'finobj': all objects marked for finalization;
|
||||||
** 'tobefnz': all objects ready to be finalized;
|
** 'tobefnz': all objects ready to be finalized;
|
||||||
** 'fixedgc': all objects that are not to be collected (currently
|
** 'fixedgc': all objects that are not to be collected (currently
|
||||||
** only small strings, such as reserved words).
|
** only small strings, such as reserved words).
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ struct lua_longjmp; /* defined in ldo.c */
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Atomic type (relative to signals) to better ensure that 'lua_sethook'
|
** Atomic type (relative to signals) to better ensure that 'lua_sethook'
|
||||||
** is thread safe
|
** is thread safe
|
||||||
*/
|
*/
|
||||||
#if !defined(l_signalT)
|
#if !defined(l_signalT)
|
||||||
@ -66,7 +66,7 @@ typedef struct stringtable {
|
|||||||
** Information about a call.
|
** Information about a call.
|
||||||
** When a thread yields, 'func' is adjusted to pretend that the
|
** When a thread yields, 'func' is adjusted to pretend that the
|
||||||
** top function has only the yielded values in its stack; in that
|
** top function has only the yielded values in its stack; in that
|
||||||
** case, the actual 'func' value is saved in field 'extra'.
|
** case, the actual 'func' value is saved in field 'extra'.
|
||||||
** When a function calls another with a continuation, 'extra' keeps
|
** When a function calls another with a continuation, 'extra' keeps
|
||||||
** the function index so that, in case of errors, the continuation
|
** the function index so that, in case of errors, the continuation
|
||||||
** function can be called with the correct top.
|
** function can be called with the correct top.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lstrlib.c,v 1.252 2016/06/27 13:15:08 roberto Exp roberto $
|
** $Id: lstrlib.c,v 1.253 2016/12/20 18:37:00 roberto Exp roberto $
|
||||||
** Standard library for string operations and pattern-matching
|
** Standard library for string operations and pattern-matching
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -1261,7 +1261,7 @@ static KOption getoption (Header *h, const char **fmt, int *size) {
|
|||||||
** 'psize' is filled with option's size, 'notoalign' with its
|
** 'psize' is filled with option's size, 'notoalign' with its
|
||||||
** alignment requirements.
|
** alignment requirements.
|
||||||
** Local variable 'size' gets the size to be aligned. (Kpadal option
|
** Local variable 'size' gets the size to be aligned. (Kpadal option
|
||||||
** always gets its full alignment, other options are limited by
|
** always gets its full alignment, other options are limited by
|
||||||
** the maximum alignment ('maxalign'). Kchar option needs no alignment
|
** the maximum alignment ('maxalign'). Kchar option needs no alignment
|
||||||
** despite its size.
|
** despite its size.
|
||||||
*/
|
*/
|
||||||
|
4
ltable.h
4
ltable.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ltable.h,v 2.21 2015/11/03 15:47:30 roberto Exp roberto $
|
** $Id: ltable.h,v 2.22 2016/11/07 12:38:35 roberto Exp roberto $
|
||||||
** Lua tables (hash)
|
** Lua tables (hash)
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -15,7 +15,7 @@
|
|||||||
#define gnext(n) ((n)->i_key.nk.next)
|
#define gnext(n) ((n)->i_key.nk.next)
|
||||||
|
|
||||||
|
|
||||||
/* 'const' to avoid wrong writings that can mess up field 'next' */
|
/* 'const' to avoid wrong writings that can mess up field 'next' */
|
||||||
#define gkey(n) cast(const TValue*, (&(n)->i_key.tvk))
|
#define gkey(n) cast(const TValue*, (&(n)->i_key.tvk))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
4
ltm.c
4
ltm.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ltm.c,v 2.36 2015/11/03 15:47:30 roberto Exp roberto $
|
** $Id: ltm.c,v 2.37 2016/02/26 19:20:15 roberto Exp roberto $
|
||||||
** Tag methods
|
** Tag methods
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -15,7 +15,7 @@
|
|||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
|
|
||||||
#include "ldebug.h"
|
#include "ldebug.h"
|
||||||
#include "ldo.h"
|
#include "ldo.h"
|
||||||
#include "lobject.h"
|
#include "lobject.h"
|
||||||
#include "lstate.h"
|
#include "lstate.h"
|
||||||
#include "lstring.h"
|
#include "lstring.h"
|
||||||
|
6
lua.c
6
lua.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lua.c,v 1.227 2016/07/18 17:55:59 roberto Exp roberto $
|
** $Id: lua.c,v 1.228 2016/12/13 15:50:58 roberto Exp roberto $
|
||||||
** Lua stand-alone interpreter
|
** Lua stand-alone interpreter
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -461,7 +461,7 @@ static int handle_script (lua_State *L, char **argv) {
|
|||||||
/*
|
/*
|
||||||
** Traverses all arguments from 'argv', returning a mask with those
|
** Traverses all arguments from 'argv', returning a mask with those
|
||||||
** needed before running any Lua code (or an error code if it finds
|
** needed before running any Lua code (or an error code if it finds
|
||||||
** any invalid argument). 'first' returns the first not-handled argument
|
** any invalid argument). 'first' returns the first not-handled argument
|
||||||
** (either the script name or a bad argument in case of error).
|
** (either the script name or a bad argument in case of error).
|
||||||
*/
|
*/
|
||||||
static int collectargs (char **argv, int *first) {
|
static int collectargs (char **argv, int *first) {
|
||||||
@ -485,7 +485,7 @@ static int collectargs (char **argv, int *first) {
|
|||||||
args |= has_E;
|
args |= has_E;
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
args |= has_i; /* (-i implies -v) *//* FALLTHROUGH */
|
args |= has_i; /* (-i implies -v) *//* FALLTHROUGH */
|
||||||
case 'v':
|
case 'v':
|
||||||
if (argv[i][2] != '\0') /* extra characters after 1st? */
|
if (argv[i][2] != '\0') /* extra characters after 1st? */
|
||||||
return has_error; /* invalid option */
|
return has_error; /* invalid option */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: luaconf.h,v 1.257 2016/08/22 17:21:12 roberto Exp roberto $
|
** $Id: luaconf.h,v 1.258 2016/12/20 18:37:00 roberto Exp roberto $
|
||||||
** Configuration file for Lua
|
** Configuration file for Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -621,7 +621,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ lua_number2strx converts a float to an hexadecimal numeric string.
|
@@ lua_number2strx converts a float to an hexadecimal numeric string.
|
||||||
** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that.
|
** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that.
|
||||||
** Otherwise, you can leave 'lua_number2strx' undefined and Lua will
|
** Otherwise, you can leave 'lua_number2strx' undefined and Lua will
|
||||||
** provide its own implementation.
|
** provide its own implementation.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lutf8lib.c,v 1.14 2015/03/05 16:07:46 roberto Exp roberto $
|
** $Id: lutf8lib.c,v 1.15 2015/03/28 19:16:55 roberto Exp roberto $
|
||||||
** Standard library for UTF-8 manipulation
|
** Standard library for UTF-8 manipulation
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -194,7 +194,7 @@ static int byteoffset (lua_State *L) {
|
|||||||
lua_pushinteger(L, posi + 1);
|
lua_pushinteger(L, posi + 1);
|
||||||
else /* no such character */
|
else /* no such character */
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
4
lvm.h
4
lvm.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lvm.h,v 2.39 2015/09/09 13:44:07 roberto Exp roberto $
|
** $Id: lvm.h,v 2.40 2016/01/05 16:07:21 roberto Exp roberto $
|
||||||
** Lua virtual machine
|
** Lua virtual machine
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -90,7 +90,7 @@
|
|||||||
#define luaV_settable(L,t,k,v) { const TValue *slot; \
|
#define luaV_settable(L,t,k,v) { const TValue *slot; \
|
||||||
if (!luaV_fastset(L,t,k,slot,luaH_get,v)) \
|
if (!luaV_fastset(L,t,k,slot,luaH_get,v)) \
|
||||||
luaV_finishset(L,t,k,v,slot); }
|
luaV_finishset(L,t,k,v,slot); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2);
|
LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2);
|
||||||
|
Loading…
Reference in New Issue
Block a user