bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 27/34] build: enable compilation without MBS_SUPPORT


From: Paolo Bonzini
Subject: Re: [PATCH 27/34] build: enable compilation without MBS_SUPPORT
Date: Thu, 15 Sep 2011 13:18:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2

On 09/15/2011 12:28 PM, Jim Meyering wrote:
From: Jim Meyering<address@hidden>

* src/dfa.c (add_utf8_anychar): Always compile this function,
but when MBS_SUPPORT is 0, give it an empty body.
(prepare_wc_buf): Likewise.
---
  src/dfa.c |    9 ++++-----
  1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/dfa.c b/src/dfa.c
index b6d06aa..ca3c75a 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -1529,10 +1529,10 @@ addtok_wc (wint_t wc)
  static void addtok_wc (wint_t wc) {}
  #endif

-#if MBS_SUPPORT
  static void
  add_utf8_anychar (void)
  {
+#if MBS_SUPPORT
    static const charclass utf8_classes[5] = {
        {  0,  0,  0,  0, ~0, ~0, 0, 0 },            /* 80-bf: non-lead bytes */
        { ~0, ~0, ~0, ~0, 0, 0, 0, 0 },              /* 00-7f: 1-byte sequence 
*/
@@ -1577,8 +1577,8 @@ add_utf8_anychar (void)
        addtok (CAT);
        addtok (OR);
      }
-}
  #endif
+}

  /* The grammar understood by the parser is as follows.


Indeed, why not squash this part in patch 16/34 (maint: dfa: convert #if-MBS_SUPPORT (copytoks))...

@@ -3146,13 +3146,13 @@ transit_state (struct dfa *d, int s, unsigned char 
const **pp)
    return s1;
  }

-#if MBS_SUPPORT

  /* Initialize mblen_buf and inputwcs with data from the next line.  */

  static void
  prepare_wc_buf (const char *begin, const char *end)
  {
+#if MBS_SUPPORT
    unsigned char eol = eolbyte;
    size_t remain_bytes, i;

@@ -3193,9 +3193,8 @@ prepare_wc_buf (const char *begin, const char *end)
    buf_end = (unsigned char *) (begin + i);
    mblen_buf[i] = 0;
    inputwcs[i] = 0; /* sentinel */
-}
-
  #endif /* MBS_SUPPORT */
+}

  /* Search through a buffer looking for a match to the given struct dfa.
     Find the first occurrence of a string matching the regexp in the


and this one in patch 11/34 (maint: dfa: convert #if-MBS_SUPPORT (dfaexec))?

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]