refactor: uncrustify

Notable changes: replace all infinite loops to `while(true)` and remove
`int` from `unsigned int`.
This commit is contained in:
dundargoc
2023-04-26 23:23:44 +02:00
committed by GitHub
parent 7d0479c558
commit 3b0df1780e
94 changed files with 324 additions and 324 deletions

View File

@@ -1094,7 +1094,7 @@ static int nlua_debug(lua_State *lstate)
.v_type = VAR_UNKNOWN,
},
};
for (;;) {
while (true) {
lua_settop(lstate, 0);
typval_T input;
get_user_input(input_args, &input, false, false);

View File

@@ -69,10 +69,10 @@ int nlua_spell_check(lua_State *lstate)
lua_pushlstring(lstate, str, len);
lua_rawseti(lstate, -2, 1);
result = attr == HLF_SPB ? "bad" :
attr == HLF_SPR ? "rare" :
result = attr == HLF_SPB ? "bad" :
attr == HLF_SPR ? "rare" :
attr == HLF_SPL ? "local" :
attr == HLF_SPC ? "caps" :
attr == HLF_SPC ? "caps" :
NULL;
assert(result != NULL);

View File

@@ -455,7 +455,7 @@ static int nlua_stricmp(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL
int ret = 0;
assert(s1[s1_len] == NUL);
assert(s2[s2_len] == NUL);
do {
while (true) {
nul1 = memchr(s1, NUL, s1_len);
nul2 = memchr(s2, NUL, s2_len);
ret = STRICMP(s1, s2);
@@ -479,7 +479,7 @@ static int nlua_stricmp(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL
} else {
break;
}
} while (true);
}
lua_pop(lstate, 2);
lua_pushnumber(lstate, (lua_Number)((ret > 0) - (ret < 0)));
return 1;

View File

@@ -454,7 +454,7 @@ static int parser_parse(lua_State *L)
// the lua GC.
// Old tree is still owned by the lua GC.
uint32_t n_ranges = 0;
TSRange *changed = old_tree ? ts_tree_get_changed_ranges(old_tree, new_tree, &n_ranges) : NULL;
TSRange *changed = old_tree ? ts_tree_get_changed_ranges(old_tree, new_tree, &n_ranges) : NULL;
push_tree(L, new_tree, false); // [tree]

View File

@@ -193,10 +193,10 @@ static bool check_xdiff_opt(ObjectType actType, ObjectType expType, const char *
{
if (actType != expType) {
const char *type_str =
expType == kObjectTypeString ? "string" :
expType == kObjectTypeInteger ? "integer" :
expType == kObjectTypeBoolean ? "boolean" :
expType == kObjectTypeLuaRef ? "function" :
expType == kObjectTypeString ? "string" :
expType == kObjectTypeInteger ? "integer" :
expType == kObjectTypeBoolean ? "boolean" :
expType == kObjectTypeLuaRef ? "function" :
"NA";
api_set_error(err, kErrorTypeValidation, "%s is not a %s", name,