mirror of https://github.com/rusefi/lua.git
details (avoid 'lint' warnings)
This commit is contained in:
parent
f2a813ae10
commit
3a91274547
4
ltable.c
4
ltable.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: ltable.c,v 2.105 2015/02/20 14:27:53 roberto Exp roberto $
|
** $Id: ltable.c,v 2.106 2015/03/03 19:53:13 roberto Exp roberto $
|
||||||
** Lua tables (hash)
|
** Lua tables (hash)
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -546,7 +546,7 @@ const TValue *luaH_get (Table *t, const TValue *key) {
|
||||||
lua_Integer k;
|
lua_Integer k;
|
||||||
if (luaV_tointeger(key, &k, 0)) /* index is int? */
|
if (luaV_tointeger(key, &k, 0)) /* index is int? */
|
||||||
return luaH_getint(t, k); /* use specialized version */
|
return luaH_getint(t, k); /* use specialized version */
|
||||||
/* else go through */
|
/* else *//* FALLTHROUGH */
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
Node *n = mainposition(t, key);
|
Node *n = mainposition(t, key);
|
||||||
|
|
5
ltm.c
5
ltm.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: ltm.c,v 2.32 2014/11/10 17:24:43 roberto Exp roberto $
|
** $Id: ltm.c,v 2.33 2014/11/21 12:15:57 roberto Exp roberto $
|
||||||
** Tag methods
|
** Tag methods
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -117,6 +117,7 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2,
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case TM_CONCAT:
|
case TM_CONCAT:
|
||||||
luaG_concaterror(L, p1, p2);
|
luaG_concaterror(L, p1, p2);
|
||||||
|
/* call never returns, but to avoid warnings: *//* FALLTHROUGH */
|
||||||
case TM_BAND: case TM_BOR: case TM_BXOR:
|
case TM_BAND: case TM_BOR: case TM_BXOR:
|
||||||
case TM_SHL: case TM_SHR: case TM_BNOT: {
|
case TM_SHL: case TM_SHR: case TM_BNOT: {
|
||||||
lua_Number dummy;
|
lua_Number dummy;
|
||||||
|
@ -124,8 +125,8 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2,
|
||||||
luaG_tointerror(L, p1, p2);
|
luaG_tointerror(L, p1, p2);
|
||||||
else
|
else
|
||||||
luaG_opinterror(L, p1, p2, "perform bitwise operation on");
|
luaG_opinterror(L, p1, p2, "perform bitwise operation on");
|
||||||
/* else go through */
|
|
||||||
}
|
}
|
||||||
|
/* calls never return, but to avoid warnings: *//* FALLTHROUGH */
|
||||||
default:
|
default:
|
||||||
luaG_opinterror(L, p1, p2, "perform arithmetic on");
|
luaG_opinterror(L, p1, p2, "perform arithmetic on");
|
||||||
}
|
}
|
||||||
|
|
15
lua.c
15
lua.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lua.c,v 1.223 2015/03/09 21:57:05 roberto Exp roberto $
|
** $Id: lua.c,v 1.224 2015/03/10 14:15:06 roberto Exp roberto $
|
||||||
** Lua stand-alone interpreter
|
** Lua stand-alone interpreter
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -485,14 +485,14 @@ static int collectargs (char **argv, int *first) {
|
||||||
args |= has_E;
|
args |= has_E;
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
args |= has_i; /* goes through (-i implies -v) */
|
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 */
|
||||||
args |= has_v;
|
args |= has_v;
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
args |= has_e; /* go through */
|
args |= has_e; /* FALLTHROUGH */
|
||||||
case 'l': /* both options need an argument */
|
case 'l': /* both options need an argument */
|
||||||
if (argv[i][2] == '\0') { /* no concatenated argument? */
|
if (argv[i][2] == '\0') { /* no concatenated argument? */
|
||||||
i++; /* try next 'argv' */
|
i++; /* try next 'argv' */
|
||||||
|
@ -516,17 +516,16 @@ static int collectargs (char **argv, int *first) {
|
||||||
static int runargs (lua_State *L, char **argv, int n) {
|
static int runargs (lua_State *L, char **argv, int n) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 1; i < n; i++) {
|
for (i = 1; i < n; i++) {
|
||||||
int status;
|
|
||||||
int option = argv[i][1];
|
int option = argv[i][1];
|
||||||
lua_assert(argv[i][0] == '-'); /* already checked */
|
lua_assert(argv[i][0] == '-'); /* already checked */
|
||||||
if (option == 'e' || option == 'l') {
|
if (option == 'e' || option == 'l') {
|
||||||
|
int status;
|
||||||
const char *extra = argv[i] + 2; /* both options need an argument */
|
const char *extra = argv[i] + 2; /* both options need an argument */
|
||||||
if (*extra == '\0') extra = argv[++i];
|
if (*extra == '\0') extra = argv[++i];
|
||||||
lua_assert(extra != NULL);
|
lua_assert(extra != NULL);
|
||||||
if (option == 'e')
|
status = (option == 'e')
|
||||||
status = dostring(L, extra, "=(command line)");
|
? dostring(L, extra, "=(command line)")
|
||||||
else
|
: dolibrary(L, extra);
|
||||||
status = dolibrary(L, extra);
|
|
||||||
if (status != LUA_OK) return 0;
|
if (status != LUA_OK) return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue