refactor: follow style guide

- reduce variable scope
- prefer initialization over declaration and assignment
- use bool to represent boolean values
This commit is contained in:
dundargoc
2023-11-12 15:54:54 +01:00
committed by dundargoc
parent 48bcc7b971
commit 28f4f3c484
42 changed files with 287 additions and 554 deletions

View File

@@ -254,9 +254,8 @@ void alist_slash_adjust(void)
static char *do_one_arg(char *str)
{
char *p;
bool inbacktick;
inbacktick = false;
bool inbacktick = false;
for (p = str; *str; str++) {
// When the backslash is used for escaping the special meaning of a
// character we need to keep it until wildcard expansion.
@@ -834,10 +833,8 @@ char *get_arglist_name(expand_T *xp FUNC_ATTR_UNUSED, int idx)
/// Get the file name for an argument list entry.
char *alist_name(aentry_T *aep)
{
buf_T *bp;
// Use the name from the associated buffer if it exists.
bp = buflist_findnr(aep->ae_fnum);
buf_T *bp = buflist_findnr(aep->ae_fnum);
if (bp == NULL || bp->b_fname == NULL) {
return aep->ae_fname;
}