diff options
author | Jim Meyering <meyering@redhat.com> | 2011-09-10 12:04:20 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2011-09-16 14:29:55 +0200 |
commit | 786c10af2b70ed6f585362185a76566ba3e84a91 (patch) | |
tree | be20f926e823612d455b4f23a9c1fd3fe4833fb5 | |
parent | ba10005a6df3c2bb94cf85a6ddb28b26ff459af7 (diff) | |
download | grep-786c10af2b70ed6f585362185a76566ba3e84a91.tar.gz |
maint: dfa: avoid in-function "#if MBS_SUPPORT" tests
* src/dfa.c (setbit_case_fold_c): Remove "#if MBS_SUPPORT" in favor
of simple "if (MBS_SUPPORT ...".
(dfaexec, addtok): Likewise.
-rw-r--r-- | src/dfa.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -590,8 +590,7 @@ static inline bool setbit_wc (wint_t wc, charclass c) { abort (); } 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) @@ -601,7 +600,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)) @@ -1440,8 +1438,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]; @@ -1488,8 +1485,9 @@ addtok (token t) } } else -#endif - addtok_mb (t, 3); + { + addtok_mb (t, 3); + } } #if MBS_SUPPORT @@ -3326,10 +3324,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. */ |