[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 28/34] maint: dfa: avoid in-function "#if MBS_SUPPORT" tests
From: |
Jim Meyering |
Subject: |
[PATCH 28/34] maint: dfa: avoid in-function "#if MBS_SUPPORT" tests |
Date: |
Thu, 15 Sep 2011 12:28:11 +0200 |
From: Jim Meyering <address@hidden>
* src/dfa.c (setbit_case_fold_c): Remove "#if MBS_SUPPORT" in favor
of simple "if (MBS_SUPPORT ...".
(dfaexec, addtok): Likewise.
---
src/dfa.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/dfa.c b/src/dfa.c
index ca3c75a..19bb59a 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -591,8 +591,7 @@ setbit_c (int b, charclass c)
static void
setbit_case_fold_c (int b, charclass c)
{
-#if MBS_SUPPORT
- if (MB_CUR_MAX > 1)
+ if (MBS_SUPPORT && MB_CUR_MAX > 1)
{
wint_t wc = btowc (b);
if (wc == WEOF)
@@ -602,7 +601,6 @@ setbit_case_fold_c (int b, charclass c)
setbit_wc (iswupper (wc) ? towlower (wc) : towupper (wc), c);
}
else
-#endif
{
setbit (b, c);
if (case_fold && isalpha (b))
@@ -1444,8 +1442,7 @@ static void addtok_wc (wint_t wc);
static void
addtok (token t)
{
-#if MBS_SUPPORT
- if (MB_CUR_MAX > 1 && t == MBCSET)
+ if (MBS_SUPPORT && MB_CUR_MAX > 1 && t == MBCSET)
{
bool need_or = false;
struct mb_char_classes *work_mbc = &dfa->mbcsets[dfa->nmbcsets - 1];
@@ -1492,8 +1489,9 @@ addtok (token t)
}
}
else
-#endif
- addtok_mb (t, 3);
+ {
+ addtok_mb (t, 3);
+ }
}
#if MBS_SUPPORT
@@ -3330,10 +3328,8 @@ dfaexec (struct dfa *d, char const *begin, char *end,
if (count)
++*count;
-#if MBS_SUPPORT
- if (d->mb_cur_max > 1)
+ if (MBS_SUPPORT && d->mb_cur_max > 1)
prepare_wc_buf ((const char *) p, end);
-#endif
}
/* Check if we've run off the end of the buffer. */
--
1.7.7.rc0.362.g5a14
- Re: [PATCH 09/34] maint: dfa: convert #if-MBS_SUPPORT (free_mbdata), (continued)
- [PATCH 17/34] maint: dfa: convert #if-MBS_SUPPORT (dfaparse), Jim Meyering, 2011/09/15
- [PATCH 14/34] maint: dfa: convert #if-MBS_SUPPORT (parse_bracket_exp), Jim Meyering, 2011/09/15
- [PATCH 18/34] maint: dfa: convert #if-MBS_SUPPORT (state_index), Jim Meyering, 2011/09/15
- [PATCH 28/34] maint: dfa: avoid in-function "#if MBS_SUPPORT" tests,
Jim Meyering <=
- [PATCH 03/34] maint: convert #if-MBS_SUPPORT (kwsincr_case), Jim Meyering, 2011/09/15
- [PATCH 33/34] maint: dfa: simplify multi-byte-related conditionals, Jim Meyering, 2011/09/15
- [PATCH 25/34] maint: remove #if MBS_SUPPORT around member declaration, Jim Meyering, 2011/09/15
- [PATCH 12/34] maint: dfa: convert #if-MBS_SUPPORT (parse_bracket_exp), Jim Meyering, 2011/09/15
- [PATCH 23/34] tests: make fmbtest explain (to stderr, not log) why it is skipped, Jim Meyering, 2011/09/15
- [PATCH 31/34] tests: skip sjis-mb when dfa.c is compiled without MB support, Jim Meyering, 2011/09/15
- [PATCH 20/34] maint: dfa: convert #if-MBS_SUPPORT (dfastate), Jim Meyering, 2011/09/15