bug-grep
[Top][All Lists]
Advanced

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

update to newer gnulib, and syntactic/comment improvements


From: Jim Meyering
Subject: update to newer gnulib, and syntactic/comment improvements
Date: Thu, 15 Sep 2011 12:13:15 +0200

FYI, I've just pushed the following.
The gnulib update fixes some known build/portability problems.

>From 2e00c51e30c210e850e24a19de0a050e9795f712 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 10 Sep 2011 13:42:18 +0200
Subject: [PATCH 1/4] maint: move declaration "down" to inner scope where it
 is used

* src/dfa.c (dfaexec): Move decl of local down into scope where used.
---
 src/dfa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/dfa.c b/src/dfa.c
index 76e34a7..319765d 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -3255,7 +3255,7 @@ char *
 dfaexec (struct dfa *d, char const *begin, char *end,
          int newline, int *count, int *backref)
 {
-  int s, s1, tmp;      /* Current state. */
+  int s, s1;           /* Current state. */
   unsigned char const *p; /* Current input character. */
   int **trans, *t;     /* Copy of d->trans so it can be optimized
                                    into a register. */
@@ -3333,7 +3333,7 @@ dfaexec (struct dfa *d, char const *begin, char *end,
       while ((t = trans[s]) != 0) { /* hand-optimized loop */
         s1 = t[*p++];
         if ((t = trans[s1]) == 0) {
-          tmp = s ; s = s1 ; s1 = tmp ; /* swap */
+          int tmp = s; s = s1; s1 = tmp; /* swap */
           break;
         }
         s = t[*p++];
--
1.7.7.rc0.362.g5a14


>From 7ab88c048031be827726dc2e46611cd5c55ecbd0 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 10 Sep 2011 13:43:42 +0200
Subject: [PATCH 2/4] maint: correct indentation

* src/dfa.c (dfaexec): Reposition curly braces to match indentation style.
Remove useless comment.
---
 src/dfa.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/dfa.c b/src/dfa.c
index 319765d..a0d644f 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -3330,14 +3330,16 @@ dfaexec (struct dfa *d, char const *begin, char *end,
           }
       else
 #endif /* MBS_SUPPORT */
-      while ((t = trans[s]) != 0) { /* hand-optimized loop */
-        s1 = t[*p++];
-        if ((t = trans[s1]) == 0) {
-          int tmp = s; s = s1; s1 = tmp; /* swap */
-          break;
+      while ((t = trans[s]) != 0)
+        {
+          s1 = t[*p++];
+          if ((t = trans[s1]) == 0)
+            {
+              int tmp = s; s = s1; s1 = tmp; /* swap */
+              break;
+            }
+          s = t[*p++];
         }
-        s = t[*p++];
-      }

       if (s >= 0 && (char *) p <= end && d->fails[s])
         {
--
1.7.7.rc0.362.g5a14


>From e0ddc20aede7255a9f287cac6f31ab55d4fb72d9 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 14 Sep 2011 13:47:15 +0200
Subject: [PATCH 3/4] build: update gnulib submodule to newer

---
 gnulib |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gnulib b/gnulib
index 372ef2a..0b88a15 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 372ef2a0e94ec6ee85b5fc4bab763154ec11420d
+Subproject commit 0b88a15dca93414df75ff004811c8e2573d593e3
--
1.7.7.rc0.362.g5a14


>From 875ead86cca8f52129cef813ccc0f4c730dc0620 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 5 Apr 2010 11:37:06 +0200
Subject: [PATCH 4/4] maint: dfa: improve comments

* src/dfa.c (match_mb_charset, match_anychar): Improve comments.
---
 src/dfa.c |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/dfa.c b/src/dfa.c
index a0d644f..5b5ed93 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -2863,11 +2863,9 @@ transit_state_singlebyte (struct dfa *d, int s, unsigned 
char const *p,
   return rval;
 }

-/* Check whether period can match or not in the current context.  If it can,
-   return the amount of the bytes with which period can match, otherwise
-   return 0.
-   `pos' is the position of the period.  `idx' is the index from the
-   buf_begin, and it is the current position in the buffer.  */
+/* Match a "." against the current context.  buf_begin[IDX] is the
+   current position.  Return the length of the match, in bytes.
+   POS is the position of the ".".  */
 static int
 match_anychar (struct dfa *d, int s, position pos, int idx)
 {
@@ -2903,11 +2901,10 @@ match_anychar (struct dfa *d, int s, position pos, int 
idx)
   return mbclen;
 }

-/* Check whether bracket expression can match or not in the current context.
-   If it can, return the amount of the bytes with which expression can match,
-   otherwise return 0.
-   `pos' is the position of the bracket expression.  `idx' is the index
-   from the buf_begin, and it is the current position in the buffer.  */
+/* Match a bracket expression against the current context.
+   buf_begin[IDX] is the current position.
+   Return the length of the match, in bytes.
+   POS is the position of the bracket expression.  */
 static int
 match_mb_charset (struct dfa *d, int s, position pos, int idx)
 {
--
1.7.7.rc0.362.g5a14



reply via email to

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