summaryrefslogtreecommitdiff
path: root/libs/liblua/src/loslib.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/liblua/src/loslib.c')
-rw-r--r--libs/liblua/src/loslib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/liblua/src/loslib.c b/libs/liblua/src/loslib.c
index e65e188bd7..3e20d622ba 100644
--- a/libs/liblua/src/loslib.c
+++ b/libs/liblua/src/loslib.c
@@ -170,7 +170,7 @@ static int os_tmpname (lua_State *L) {
char buff[LUA_TMPNAMBUFSIZE];
int err;
lua_tmpnam(buff, err);
- if (err)
+ if (l_unlikely(err))
return luaL_error(L, "unable to generate a unique filename");
lua_pushstring(L, buff);
return 1;
@@ -208,7 +208,7 @@ static int os_clock (lua_State *L) {
*/
static void setfield (lua_State *L, const char *key, int value, int delta) {
#if (defined(LUA_NUMTIME) && LUA_MAXINTEGER <= INT_MAX)
- if (value > LUA_MAXINTEGER - delta)
+ if (l_unlikely(value > LUA_MAXINTEGER - delta))
luaL_error(L, "field '%s' is out-of-bound", key);
#endif
lua_pushinteger(L, (lua_Integer)value + delta);
@@ -253,9 +253,9 @@ static int getfield (lua_State *L, const char *key, int d, int delta) {
int t = lua_getfield(L, -1, key); /* get field and its type */
lua_Integer res = lua_tointegerx(L, -1, &isnum);
if (!isnum) { /* field is not an integer? */
- if (t != LUA_TNIL) /* some other value? */
+ if (l_unlikely(t != LUA_TNIL)) /* some other value? */
return luaL_error(L, "field '%s' is not an integer", key);
- else if (d < 0) /* absent field; no default? */
+ else if (l_unlikely(d < 0)) /* absent field; no default? */
return luaL_error(L, "field '%s' missing in date table", key);
res = d;
}