tweaks: use FALSE for booleans instead of zero

Also adjust some indentation and reduce the scope of a variable.
This commit is contained in:
Benno Schulenberg 2019-06-09 10:41:14 +02:00
parent fea1901592
commit fb17929fab
4 changed files with 9 additions and 11 deletions

View File

@ -70,7 +70,7 @@ bool is_alpha_mbchar(const char *c)
wchar_t wc;
if (mbtowc(&wc, c, MAXCHARLEN) < 0)
return 0;
return FALSE;
return iswalpha(wc);
} else
@ -86,7 +86,7 @@ bool is_alnum_mbchar(const char *c)
wchar_t wc;
if (mbtowc(&wc, c, MAXCHARLEN) < 0)
return 0;
return FALSE;
return iswalnum(wc);
} else
@ -102,7 +102,7 @@ bool is_blank_mbchar(const char *c)
wchar_t wc;
if (mbtowc(&wc, c, MAXCHARLEN) < 0)
return 0;
return FALSE;
return iswblank(wc);
} else
@ -139,7 +139,7 @@ bool is_punct_mbchar(const char *c)
wchar_t wc;
if (mbtowc(&wc, c, MAXCHARLEN) < 0)
return 0;
return FALSE;
return iswpunct(wc);
} else

View File

@ -331,12 +331,10 @@ void check_the_multis(linestruct *line)
/* Allocate (for one line) the cache space for multiline color regexes. */
void alloc_multidata_if_needed(linestruct *fileptr)
{
int i;
if (fileptr->multidata == NULL) {
fileptr->multidata = (short *)nmalloc(openfile->syntax->nmultis * sizeof(short));
for (i = 0; i < openfile->syntax->nmultis; i++)
for (int i = 0; i < openfile->syntax->nmultis; i++)
fileptr->multidata[i] = -1;
}
}

View File

@ -341,9 +341,9 @@ void do_cut_text(bool copying, bool marked, bool until_eof, bool append)
if (using_magicline)
UNSET(NO_NEWLINES);
} else
#endif /* !NANO_TINY */
#endif
set_modified();
set_modified();
refresh_needed = TRUE;
}

View File

@ -841,7 +841,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
void do_gotolinecolumn_void(void)
{
do_gotolinecolumn(openfile->current->lineno,
openfile->placewewant + 1, FALSE, TRUE);
openfile->placewewant + 1, FALSE, TRUE);
}
#ifndef NANO_TINY
@ -943,7 +943,7 @@ void do_find_bracket(void)
while (charcount-- > 0) {
if (reverse)
wanted_ch = matchbrackets + move_mbleft(matchbrackets,
wanted_ch - matchbrackets);
wanted_ch - matchbrackets);
else
wanted_ch += move_mbright(wanted_ch, 0);
}