grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.6.1-12-gc03209e


From: Jim Meyering
Subject: grep branch, master, updated. v2.6.1-12-gc03209e
Date: Sat, 27 Mar 2010 09:50:08 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  c03209e3bb4a64a4ceacf3c02e6ba69cb1457d4d (commit)
       via  ef5011d294a4dfc21a726b3103e9d277912cabaf (commit)
       via  fc24c8fc93f2ae97eac06f4e64e82b2e2f9e5ab1 (commit)
       via  54d55bba41f2ff31682fe6523ef6f49b37a0e20f (commit)
      from  0b027cfbadb1c01152c552927352b9e06f5241fc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=c03209e3bb4a64a4ceacf3c02e6ba69cb1457d4d


commit c03209e3bb4a64a4ceacf3c02e6ba69cb1457d4d
Author: Jim Meyering <address@hidden>
Date:   Sat Mar 27 10:01:40 2010 +0100

    kwset: correct comments; require non-NULL kwsmatch argument
    
    * src/kwset.c (kwsexec): Correct comments.  This function has been
    returning an offset, not a pointer, for 9 years.
    Do not test for kwsmatch == NULL.  All callers pass non-NULL.
    (cwexec): Likewise.
    * src/kwset.h (kwsexec): Mark the 4th parameter, kwsmatch, as non-NULL.
    Include "arg-nonnull.h".

diff --git a/src/kwset.c b/src/kwset.c
index 9e3a675..050562e 100644
--- a/src/kwset.c
+++ b/src/kwset.c
@@ -583,7 +583,7 @@ bmexec (kwset_t kws, char const *text, size_t size)
 }
 
 /* Hairy multiple string search. */
-static size_t
+static size_t _GL_ARG_NONNULL ((4))
 cwexec (kwset_t kws, char const *text, size_t len, struct kwsmatch *kwsmatch)
 {
   struct kwset const *kwset;
@@ -731,31 +731,26 @@ cwexec (kwset_t kws, char const *text, size_t len, struct 
kwsmatch *kwsmatch)
        d = 1;
     }
 
-  if (kwsmatch)
-    {
-      kwsmatch->index = accept->accepting / 2;
-      kwsmatch->offset[0] = mch - text;
-      kwsmatch->size[0] = accept->depth;
-    }
+  kwsmatch->index = accept->accepting / 2;
+  kwsmatch->offset[0] = mch - text;
+  kwsmatch->size[0] = accept->depth;
+
   return mch - text;
 }
 
-/* Search through the given text for a match of any member of the
-   given keyword set.  Return a pointer to the first character of
-   the matching substring, or NULL if no match is found.  If FOUNDLEN
-   is non-NULL store in the referenced location the length of the
-   matching substring.  Similarly, if FOUNDIDX is non-NULL, store
-   in the referenced location the index number of the particular
-   keyword matched. */
+/* Search TEXT for a match of any member of the keyword set, KWS.
+   Return the offset (into TEXT) of the first byte of the matching substring,
+   or (size_t) -1 if no match is found.  Upon a match, store details in
+   *KWSMATCH: index of matched keyword, start offset (same as the return
+   value), and length.  */
 size_t
-kwsexec (kwset_t kws, char const *text, size_t size,
-        struct kwsmatch *kwsmatch)
+kwsexec (kwset_t kws, char const *text, size_t size, struct kwsmatch *kwsmatch)
 {
   struct kwset const *kwset = (struct kwset *) kws;
   if (kwset->words == 1 && kwset->trans == NULL)
     {
       size_t ret = bmexec (kws, text, size);
-      if (kwsmatch != NULL && ret != (size_t) -1)
+      if (ret != (size_t) -1)
        {
          kwsmatch->index = 0;
          kwsmatch->offset[0] = ret;
diff --git a/src/kwset.h b/src/kwset.h
index 6861be5..35caa41 100644
--- a/src/kwset.h
+++ b/src/kwset.h
@@ -28,6 +28,8 @@ struct kwsmatch
   size_t size[1];              /* Length of each submatch. */
 };
 
+#include "arg-nonnull.h"
+
 struct kwset;
 typedef struct kwset *kwset_t;
 
@@ -52,8 +54,8 @@ extern const char *kwsprep (kwset_t);
    the matching substring in the integer it points to.  Similarly,
    if foundindex is non-NULL, store the index of the particular
    keyword found therein. */
-extern size_t kwsexec (kwset_t, char const *, size_t, struct kwsmatch *);
+extern size_t kwsexec (kwset_t, char const *, size_t, struct kwsmatch *)
+  _GL_ARG_NONNULL ((4));
 
 /* Deallocate the given keyword set and all its associated storage. */
 extern void kwsfree (kwset_t);
-

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=ef5011d294a4dfc21a726b3103e9d277912cabaf


commit c03209e3bb4a64a4ceacf3c02e6ba69cb1457d4d
Author: Jim Meyering <address@hidden>
Date:   Sat Mar 27 10:01:40 2010 +0100

    kwset: correct comments; require non-NULL kwsmatch argument
    
    * src/kwset.c (kwsexec): Correct comments.  This function has been
    returning an offset, not a pointer, for 9 years.
    Do not test for kwsmatch == NULL.  All callers pass non-NULL.
    (cwexec): Likewise.
    * src/kwset.h (kwsexec): Mark the 4th parameter, kwsmatch, as non-NULL.
    Include "arg-nonnull.h".

diff --git a/src/kwset.c b/src/kwset.c
index 9e3a675..050562e 100644
--- a/src/kwset.c
+++ b/src/kwset.c
@@ -583,7 +583,7 @@ bmexec (kwset_t kws, char const *text, size_t size)
 }
 
 /* Hairy multiple string search. */
-static size_t
+static size_t _GL_ARG_NONNULL ((4))
 cwexec (kwset_t kws, char const *text, size_t len, struct kwsmatch *kwsmatch)
 {
   struct kwset const *kwset;
@@ -731,31 +731,26 @@ cwexec (kwset_t kws, char const *text, size_t len, struct 
kwsmatch *kwsmatch)
        d = 1;
     }
 
-  if (kwsmatch)
-    {
-      kwsmatch->index = accept->accepting / 2;
-      kwsmatch->offset[0] = mch - text;
-      kwsmatch->size[0] = accept->depth;
-    }
+  kwsmatch->index = accept->accepting / 2;
+  kwsmatch->offset[0] = mch - text;
+  kwsmatch->size[0] = accept->depth;
+
   return mch - text;
 }
 
-/* Search through the given text for a match of any member of the
-   given keyword set.  Return a pointer to the first character of
-   the matching substring, or NULL if no match is found.  If FOUNDLEN
-   is non-NULL store in the referenced location the length of the
-   matching substring.  Similarly, if FOUNDIDX is non-NULL, store
-   in the referenced location the index number of the particular
-   keyword matched. */
+/* Search TEXT for a match of any member of the keyword set, KWS.
+   Return the offset (into TEXT) of the first byte of the matching substring,
+   or (size_t) -1 if no match is found.  Upon a match, store details in
+   *KWSMATCH: index of matched keyword, start offset (same as the return
+   value), and length.  */
 size_t
-kwsexec (kwset_t kws, char const *text, size_t size,
-        struct kwsmatch *kwsmatch)
+kwsexec (kwset_t kws, char const *text, size_t size, struct kwsmatch *kwsmatch)
 {
   struct kwset const *kwset = (struct kwset *) kws;
   if (kwset->words == 1 && kwset->trans == NULL)
     {
       size_t ret = bmexec (kws, text, size);
-      if (kwsmatch != NULL && ret != (size_t) -1)
+      if (ret != (size_t) -1)
        {
          kwsmatch->index = 0;
          kwsmatch->offset[0] = ret;
diff --git a/src/kwset.h b/src/kwset.h
index 6861be5..35caa41 100644
--- a/src/kwset.h
+++ b/src/kwset.h
@@ -28,6 +28,8 @@ struct kwsmatch
   size_t size[1];              /* Length of each submatch. */
 };
 
+#include "arg-nonnull.h"
+
 struct kwset;
 typedef struct kwset *kwset_t;
 
@@ -52,8 +54,8 @@ extern const char *kwsprep (kwset_t);
    the matching substring in the integer it points to.  Similarly,
    if foundindex is non-NULL, store the index of the particular
    keyword found therein. */
-extern size_t kwsexec (kwset_t, char const *, size_t, struct kwsmatch *);
+extern size_t kwsexec (kwset_t, char const *, size_t, struct kwsmatch *)
+  _GL_ARG_NONNULL ((4));
 
 /* Deallocate the given keyword set and all its associated storage. */
 extern void kwsfree (kwset_t);
-

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=fc24c8fc93f2ae97eac06f4e64e82b2e2f9e5ab1


commit c03209e3bb4a64a4ceacf3c02e6ba69cb1457d4d
Author: Jim Meyering <address@hidden>
Date:   Sat Mar 27 10:01:40 2010 +0100

    kwset: correct comments; require non-NULL kwsmatch argument
    
    * src/kwset.c (kwsexec): Correct comments.  This function has been
    returning an offset, not a pointer, for 9 years.
    Do not test for kwsmatch == NULL.  All callers pass non-NULL.
    (cwexec): Likewise.
    * src/kwset.h (kwsexec): Mark the 4th parameter, kwsmatch, as non-NULL.
    Include "arg-nonnull.h".

diff --git a/src/kwset.c b/src/kwset.c
index 9e3a675..050562e 100644
--- a/src/kwset.c
+++ b/src/kwset.c
@@ -583,7 +583,7 @@ bmexec (kwset_t kws, char const *text, size_t size)
 }
 
 /* Hairy multiple string search. */
-static size_t
+static size_t _GL_ARG_NONNULL ((4))
 cwexec (kwset_t kws, char const *text, size_t len, struct kwsmatch *kwsmatch)
 {
   struct kwset const *kwset;
@@ -731,31 +731,26 @@ cwexec (kwset_t kws, char const *text, size_t len, struct 
kwsmatch *kwsmatch)
        d = 1;
     }
 
-  if (kwsmatch)
-    {
-      kwsmatch->index = accept->accepting / 2;
-      kwsmatch->offset[0] = mch - text;
-      kwsmatch->size[0] = accept->depth;
-    }
+  kwsmatch->index = accept->accepting / 2;
+  kwsmatch->offset[0] = mch - text;
+  kwsmatch->size[0] = accept->depth;
+
   return mch - text;
 }
 
-/* Search through the given text for a match of any member of the
-   given keyword set.  Return a pointer to the first character of
-   the matching substring, or NULL if no match is found.  If FOUNDLEN
-   is non-NULL store in the referenced location the length of the
-   matching substring.  Similarly, if FOUNDIDX is non-NULL, store
-   in the referenced location the index number of the particular
-   keyword matched. */
+/* Search TEXT for a match of any member of the keyword set, KWS.
+   Return the offset (into TEXT) of the first byte of the matching substring,
+   or (size_t) -1 if no match is found.  Upon a match, store details in
+   *KWSMATCH: index of matched keyword, start offset (same as the return
+   value), and length.  */
 size_t
-kwsexec (kwset_t kws, char const *text, size_t size,
-        struct kwsmatch *kwsmatch)
+kwsexec (kwset_t kws, char const *text, size_t size, struct kwsmatch *kwsmatch)
 {
   struct kwset const *kwset = (struct kwset *) kws;
   if (kwset->words == 1 && kwset->trans == NULL)
     {
       size_t ret = bmexec (kws, text, size);
-      if (kwsmatch != NULL && ret != (size_t) -1)
+      if (ret != (size_t) -1)
        {
          kwsmatch->index = 0;
          kwsmatch->offset[0] = ret;
diff --git a/src/kwset.h b/src/kwset.h
index 6861be5..35caa41 100644
--- a/src/kwset.h
+++ b/src/kwset.h
@@ -28,6 +28,8 @@ struct kwsmatch
   size_t size[1];              /* Length of each submatch. */
 };
 
+#include "arg-nonnull.h"
+
 struct kwset;
 typedef struct kwset *kwset_t;
 
@@ -52,8 +54,8 @@ extern const char *kwsprep (kwset_t);
    the matching substring in the integer it points to.  Similarly,
    if foundindex is non-NULL, store the index of the particular
    keyword found therein. */
-extern size_t kwsexec (kwset_t, char const *, size_t, struct kwsmatch *);
+extern size_t kwsexec (kwset_t, char const *, size_t, struct kwsmatch *)
+  _GL_ARG_NONNULL ((4));
 
 /* Deallocate the given keyword set and all its associated storage. */
 extern void kwsfree (kwset_t);
-

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=54d55bba41f2ff31682fe6523ef6f49b37a0e20f


commit c03209e3bb4a64a4ceacf3c02e6ba69cb1457d4d
Author: Jim Meyering <address@hidden>
Date:   Sat Mar 27 10:01:40 2010 +0100

    kwset: correct comments; require non-NULL kwsmatch argument
    
    * src/kwset.c (kwsexec): Correct comments.  This function has been
    returning an offset, not a pointer, for 9 years.
    Do not test for kwsmatch == NULL.  All callers pass non-NULL.
    (cwexec): Likewise.
    * src/kwset.h (kwsexec): Mark the 4th parameter, kwsmatch, as non-NULL.
    Include "arg-nonnull.h".

diff --git a/src/kwset.c b/src/kwset.c
index 9e3a675..050562e 100644
--- a/src/kwset.c
+++ b/src/kwset.c
@@ -583,7 +583,7 @@ bmexec (kwset_t kws, char const *text, size_t size)
 }
 
 /* Hairy multiple string search. */
-static size_t
+static size_t _GL_ARG_NONNULL ((4))
 cwexec (kwset_t kws, char const *text, size_t len, struct kwsmatch *kwsmatch)
 {
   struct kwset const *kwset;
@@ -731,31 +731,26 @@ cwexec (kwset_t kws, char const *text, size_t len, struct 
kwsmatch *kwsmatch)
        d = 1;
     }
 
-  if (kwsmatch)
-    {
-      kwsmatch->index = accept->accepting / 2;
-      kwsmatch->offset[0] = mch - text;
-      kwsmatch->size[0] = accept->depth;
-    }
+  kwsmatch->index = accept->accepting / 2;
+  kwsmatch->offset[0] = mch - text;
+  kwsmatch->size[0] = accept->depth;
+
   return mch - text;
 }
 
-/* Search through the given text for a match of any member of the
-   given keyword set.  Return a pointer to the first character of
-   the matching substring, or NULL if no match is found.  If FOUNDLEN
-   is non-NULL store in the referenced location the length of the
-   matching substring.  Similarly, if FOUNDIDX is non-NULL, store
-   in the referenced location the index number of the particular
-   keyword matched. */
+/* Search TEXT for a match of any member of the keyword set, KWS.
+   Return the offset (into TEXT) of the first byte of the matching substring,
+   or (size_t) -1 if no match is found.  Upon a match, store details in
+   *KWSMATCH: index of matched keyword, start offset (same as the return
+   value), and length.  */
 size_t
-kwsexec (kwset_t kws, char const *text, size_t size,
-        struct kwsmatch *kwsmatch)
+kwsexec (kwset_t kws, char const *text, size_t size, struct kwsmatch *kwsmatch)
 {
   struct kwset const *kwset = (struct kwset *) kws;
   if (kwset->words == 1 && kwset->trans == NULL)
     {
       size_t ret = bmexec (kws, text, size);
-      if (kwsmatch != NULL && ret != (size_t) -1)
+      if (ret != (size_t) -1)
        {
          kwsmatch->index = 0;
          kwsmatch->offset[0] = ret;
diff --git a/src/kwset.h b/src/kwset.h
index 6861be5..35caa41 100644
--- a/src/kwset.h
+++ b/src/kwset.h
@@ -28,6 +28,8 @@ struct kwsmatch
   size_t size[1];              /* Length of each submatch. */
 };
 
+#include "arg-nonnull.h"
+
 struct kwset;
 typedef struct kwset *kwset_t;
 
@@ -52,8 +54,8 @@ extern const char *kwsprep (kwset_t);
    the matching substring in the integer it points to.  Similarly,
    if foundindex is non-NULL, store the index of the particular
    keyword found therein. */
-extern size_t kwsexec (kwset_t, char const *, size_t, struct kwsmatch *);
+extern size_t kwsexec (kwset_t, char const *, size_t, struct kwsmatch *)
+  _GL_ARG_NONNULL ((4));
 
 /* Deallocate the given keyword set and all its associated storage. */
 extern void kwsfree (kwset_t);
-

-----------------------------------------------------------------------

Summary of changes:
 NEWS                  |    5 +++++
 THANKS                |    1 +
 lib/savedir.c         |    2 +-
 src/Makefile.am       |    2 +-
 src/kwset.c           |   29 ++++++++++++-----------------
 src/kwset.h           |    6 ++++--
 src/system.h          |    1 +
 tests/Makefile.am     |    1 +
 tests/include-exclude |   32 ++++++++++++++++++++++++++++++++
 9 files changed, 58 insertions(+), 21 deletions(-)
 create mode 100644 tests/include-exclude


hooks/post-receive
-- 
grep




reply via email to

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