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

@@ -172,7 +172,7 @@ static void set_buffer_lines(buf_T *buf, linenr_T lnum_arg, bool append, typval_
}
// Default result is zero == OK.
for (;;) {
while (true) {
if (lines->v_type == VAR_LIST) {
// List argument, get next string.
if (li == NULL) {

View File

@@ -418,7 +418,7 @@ int encode_read_from_list(ListReaderState *const state, char *const buf, const s
ga_concat(gap, "v:null")
#define TYPVAL_ENCODE_CONV_BOOL(tv, num) \
ga_concat(gap, ((num)? "v:true": "v:false"))
ga_concat(gap, ((num) ? "v:true" : "v:false"))
#define TYPVAL_ENCODE_CONV_UNSIGNED_NUMBER(tv, num)
@@ -544,7 +544,7 @@ int encode_read_from_list(ListReaderState *const state, char *const buf, const s
#undef TYPVAL_ENCODE_CONV_BOOL
#define TYPVAL_ENCODE_CONV_BOOL(tv, num) \
ga_concat(gap, ((num)? "true": "false"))
ga_concat(gap, ((num) ? "true" : "false"))
#undef TYPVAL_ENCODE_CONV_UNSIGNED_NUMBER
#define TYPVAL_ENCODE_CONV_UNSIGNED_NUMBER(tv, num) \

View File

@@ -643,7 +643,7 @@ static void f_chansend(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
bool crlf = false;
#else
Channel *chan = find_channel(id);
bool crlf = (chan != NULL && chan->term) ? true: false;
bool crlf = (chan != NULL && chan->term) ? true : false;
#endif
if (argvars[1].v_type == VAR_BLOB) {
@@ -4593,7 +4593,7 @@ static void find_some_match(typval_T *const argvars, typval_T *const rettv,
if (regmatch.regprog != NULL) {
regmatch.rm_ic = p_ic;
for (;;) {
while (true) {
if (l != NULL) {
if (li == NULL) {
match = false;
@@ -4960,7 +4960,7 @@ static void msgpackparse_unpack_list(const list_T *const list, list_T *const ret
}
msgpack_unpacked unpacked;
msgpack_unpacked_init(&unpacked);
do {
while (true) {
if (!msgpack_unpacker_reserve_buffer(unpacker, IOSIZE)) {
emsg(_(e_outofmem));
goto end;
@@ -4990,7 +4990,7 @@ static void msgpackparse_unpack_list(const list_T *const list, list_T *const ret
if (rlret == OK) {
break;
}
} while (true);
}
end:
msgpack_unpacker_free(unpacker);
@@ -6026,8 +6026,8 @@ static void f_resolve(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
char *const buf = xmallocz(MAXPATHL);
char *cpy;
for (;;) {
for (;;) {
while (true) {
while (true) {
len = readlink(p, buf, MAXPATHL);
if (len <= 0) {
break;
@@ -6409,7 +6409,7 @@ static int search_cmn(typval_T *argvars, pos_T *match_pos, int *flagsp)
int subpatnum;
// Repeat until {skip} returns false.
for (;;) {
while (true) {
subpatnum
= searchit(curwin, curbuf, &pos, NULL, dir, (char *)pat, 1, options, RE_SEARCH, &sia);
// finding the first match again means there is no match where {skip}
@@ -6989,7 +6989,7 @@ long do_searchpair(const char *spat, const char *mpat, const char *epat, int dir
pos_T foundpos;
clearpos(&foundpos);
char *pat = pat3;
for (;;) {
while (true) {
searchit_arg_T sia = {
.sa_stop_lnum = lnum_stop,
.sa_tm = &tm,

View File

@@ -1042,7 +1042,7 @@ static int item_compare(const void *s1, const void *s2, bool keep_zero)
if (sortinfo->item_compare_lc) {
res = strcoll(p1, p2);
} else {
res = sortinfo->item_compare_ic ? STRICMP(p1, p2): strcmp(p1, p2);
res = sortinfo->item_compare_ic ? STRICMP(p1, p2) : strcmp(p1, p2);
}
} else {
double n1, n2;

View File

@@ -2343,7 +2343,7 @@ void ex_function(exarg_T *eap)
}
// find extra arguments "range", "dict", "abort" and "closure"
for (;;) {
while (true) {
p = skipwhite(p);
if (strncmp(p, "range", 5) == 0) {
flags |= FC_RANGE;
@@ -2403,7 +2403,7 @@ void ex_function(exarg_T *eap)
indent = 2;
nesting = 0;
for (;;) {
while (true) {
if (KeyTyped) {
msg_scroll = true;
saved_wait_return = false;

View File

@@ -220,7 +220,7 @@ static list_T *heredoc_get(exarg_T *eap, char *cmd)
char *theline = NULL;
list_T *l = tv_list_alloc(0);
for (;;) {
while (true) {
int mi = 0;
int ti = 0;
@@ -502,7 +502,7 @@ const char *skip_var_list(const char *arg, int *var_count, int *semicolon)
const char *s;
// "[var, var]": find the matching ']'.
const char *p = arg;
for (;;) {
while (true) {
p = skipwhite(p + 1); // skip whites after '[', ';' or ','
s = skip_var_one(p);
if (s == p) {
@@ -1012,7 +1012,7 @@ static int do_unlet_var(lval_T *lp, char *name_end, exarg_T *eap, int deep FUNC_
// Delete a range of List items.
listitem_T *const first_li = lp->ll_li;
listitem_T *last_li = first_li;
for (;;) {
while (true) {
listitem_T *const li = TV_LIST_ITEM_NEXT(lp->ll_list, lp->ll_li);
if (value_check_lock(TV_LIST_ITEM_TV(lp->ll_li)->v_lock,
lp->ll_name,