fix(style): some clang-tidy 22 fixes

CI currently uses clang-tidy 20, but this affects local builds
and CI is going to be upgraded sooner or later.

Some remaining systematic issues:

- clang-tidy warns agains any atoi() or atol() usage (because of no
  error handling)

- functions which takes (char *fmt, char *only_string_arg) and expect
  fmt to contain exactly one "%s" usage.

- error: initializing non-local variable with non-const expression depending on
  uninitialized non-local variable (cppcoreguidelines-interfaces-global-init)

  This is a much worse problem in C++ (hence C++ core guidelines) where
  initialization is intermingled with arbitrary code execution. I
  "think" in plain C, the linker will either resolve all these
  deterministically or barf an error. But with some restructuring
  we could make all static initialization actually static..
This commit is contained in:
bfredl
2026-05-11 10:47:50 +02:00
parent 0e7d51a378
commit 7e9015fecb
21 changed files with 47 additions and 46 deletions

View File

@@ -731,7 +731,7 @@ void nlua_push_Array(lua_State *lstate, const Array array, int flags)
void nlua_push_handle(lua_State *lstate, const handle_T item, int flags)
FUNC_ATTR_NONNULL_ALL
{
lua_pushnumber(lstate, (lua_Number)(item));
lua_pushnumber(lstate, (lua_Number)item);
}
/// Convert given Object to Lua value