mirror of https://github.com/rusefi/lua.git
added 'return' to calls to 'luaL_error' (to signal to the compiler
that the function cannot continue past that call)
This commit is contained in:
parent
f5f3df3bd1
commit
1a1b2f3d7f
8
loslib.c
8
loslib.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: loslib.c,v 1.64 2016/04/18 13:06:55 roberto Exp $
|
** $Id: loslib.c,v 1.65 2016/07/18 17:58:58 roberto Exp roberto $
|
||||||
** Standard Operating System library
|
** Standard Operating System library
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -293,7 +293,8 @@ static int os_date (lua_State *L) {
|
||||||
else
|
else
|
||||||
stm = l_localtime(&t, &tmr);
|
stm = l_localtime(&t, &tmr);
|
||||||
if (stm == NULL) /* invalid date? */
|
if (stm == NULL) /* invalid date? */
|
||||||
luaL_error(L, "time result cannot be represented in this installation");
|
return luaL_error(L,
|
||||||
|
"time result cannot be represented in this installation");
|
||||||
if (strcmp(s, "*t") == 0) {
|
if (strcmp(s, "*t") == 0) {
|
||||||
lua_createtable(L, 0, 9); /* 9 = number of fields */
|
lua_createtable(L, 0, 9); /* 9 = number of fields */
|
||||||
setallfields(L, stm);
|
setallfields(L, stm);
|
||||||
|
@ -340,7 +341,8 @@ static int os_time (lua_State *L) {
|
||||||
setallfields(L, &ts); /* update fields with normalized values */
|
setallfields(L, &ts); /* update fields with normalized values */
|
||||||
}
|
}
|
||||||
if (t != (time_t)(l_timet)t || t == (time_t)(-1))
|
if (t != (time_t)(l_timet)t || t == (time_t)(-1))
|
||||||
luaL_error(L, "time result cannot be represented in this installation");
|
return luaL_error(L,
|
||||||
|
"time result cannot be represented in this installation");
|
||||||
l_pushtime(L, t);
|
l_pushtime(L, t);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lstrlib.c,v 1.253 2016/12/20 18:37:00 roberto Exp roberto $
|
** $Id: lstrlib.c,v 1.254 2016/12/22 13:08:50 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
|
||||||
*/
|
*/
|
||||||
|
@ -879,7 +879,7 @@ static int lua_number2strx (lua_State *L, char *buff, int sz,
|
||||||
buff[i] = toupper(uchar(buff[i]));
|
buff[i] = toupper(uchar(buff[i]));
|
||||||
}
|
}
|
||||||
else if (fmt[SIZELENMOD] != 'a')
|
else if (fmt[SIZELENMOD] != 'a')
|
||||||
luaL_error(L, "modifiers for format '%%a'/'%%A' not implemented");
|
return luaL_error(L, "modifiers for format '%%a'/'%%A' not implemented");
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1199,7 +1199,7 @@ static int getnum (const char **fmt, int df) {
|
||||||
static int getnumlimit (Header *h, const char **fmt, int df) {
|
static int getnumlimit (Header *h, const char **fmt, int df) {
|
||||||
int sz = getnum(fmt, df);
|
int sz = getnum(fmt, df);
|
||||||
if (sz > MAXINTSIZE || sz <= 0)
|
if (sz > MAXINTSIZE || sz <= 0)
|
||||||
luaL_error(h->L, "integral size (%d) out of limits [1,%d]",
|
return luaL_error(h->L, "integral size (%d) out of limits [1,%d]",
|
||||||
sz, MAXINTSIZE);
|
sz, MAXINTSIZE);
|
||||||
return sz;
|
return sz;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lutf8lib.c,v 1.15 2015/03/28 19:16:55 roberto Exp roberto $
|
** $Id: lutf8lib.c,v 1.16 2016/12/22 13:08:50 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
|
||||||
*/
|
*/
|
||||||
|
@ -171,7 +171,7 @@ static int byteoffset (lua_State *L) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (iscont(s + posi))
|
if (iscont(s + posi))
|
||||||
luaL_error(L, "initial position is a continuation byte");
|
return luaL_error(L, "initial position is a continuation byte");
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
while (n < 0 && posi > 0) { /* move back */
|
while (n < 0 && posi > 0) { /* move back */
|
||||||
do { /* find beginning of previous character */
|
do { /* find beginning of previous character */
|
||||||
|
|
Loading…
Reference in New Issue