commit fb17929fabaa5184c183dac482cee1285f949e72
parent fea1901592808d287184dbe9b88532b1128c0542
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 9 Jun 2019 10:41:14 +0200
tweaks: use FALSE for booleans instead of zero
Also adjust some indentation and reduce the scope of a variable.
Diffstat:
4 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/chars.c b/src/chars.c
@@ -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
diff --git a/src/color.c b/src/color.c
@@ -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;
}
}
diff --git a/src/cut.c b/src/cut.c
@@ -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;
}
diff --git a/src/search.c b/src/search.c
@@ -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);
}