diff options
| author | dacctal <donotcontactmevia@email.invalid> | 2026-06-26 07:25:38 +0000 |
|---|---|---|
| committer | dacctal <donotcontactmevia@email.invalid> | 2026-06-26 07:25:38 +0000 |
| commit | fd9f38ea42b04d23203c1d407d8c6f19d673264b (patch) | |
| tree | 5fd137e3b722ac2a13ab49b0b54dab3c3f8fa1fd /src/lua_state.c | |
| parent | 13ba408ef3316958b7cf9d5c1cdd3c222b1425ad (diff) | |
fixed false positives on lua return values
Diffstat (limited to 'src/lua_state.c')
| -rw-r--r-- | src/lua_state.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lua_state.c b/src/lua_state.c index 9751780..ed3f1cc 100644 --- a/src/lua_state.c +++ b/src/lua_state.c @@ -177,7 +177,7 @@ bool target_loop_build( lua_pop(L, 3); return false; } - if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) if (is_verbose) { + if ((int)lua_tonumber(L, -1) != 0) if (is_verbose) { printf( "%s %s: 'targets.%s.build' failed: %s\n", print_error, lua_file, target, lua_tostring(L, -1) @@ -210,10 +210,10 @@ bool target_loop_install(lua_State *L, const char* lua_file, const char *target) "%s %s: 'targets.%s.pre_install' function borked: %s\n", print_warning, lua_file, target, lua_tostring(L, -1) ); - if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) if (is_verbose) { + if ((int)lua_tonumber(L, -1) != 0) if (is_verbose) { printf( - "%s %s: 'targets.%s.pre_install' failed: %s\n", - print_error, lua_file, target, lua_tostring(L, -1) + "%s %s: 'targets.%s.pre_install' failed: %d\n", + print_error, lua_file, target, (int)lua_tonumber(L, -1) ); return false; } @@ -236,10 +236,10 @@ bool target_loop_install(lua_State *L, const char* lua_file, const char *target) lua_pop(L, 1); return false; } - if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) if (is_verbose) { + if ((int)lua_tonumber(L, -1) != 0) if (is_verbose) { printf( - "%s %s: 'targets.%s.install' failed: %s\n", - print_error, lua_file, target, lua_tostring(L, -1) + "%s %s: 'targets.%s.install' failed: %d\n", + print_error, lua_file, target, (int)lua_tonumber(L, -1) ); lua_pop(L, 1); return false; @@ -256,7 +256,7 @@ bool target_loop_install(lua_State *L, const char* lua_file, const char *target) "%s %s: 'targets.%s.post_install' function borked: %s\n", print_warning, lua_file, target, lua_tostring(L, -1) ); - if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) if (is_verbose) { + if ((int)lua_tonumber(L, -1) != 0) if (is_verbose) { printf( "%s %s: 'targets.%s.post_install' failed: %s\n", print_error, lua_file, target, lua_tostring(L, -1) @@ -294,7 +294,7 @@ bool target_loop_uninstall(lua_State *L, const char *lua_file, const char *targe lua_pop(L, 1); return false; } - if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) if (is_verbose) { + if ((int)lua_tonumber(L, -1) != 0) if (is_verbose) { printf( "%s %s: 'targets.%s.uninstall' failed: %s\n", print_error, lua_file, target, lua_tostring(L, -1) |
