]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: remove gl/lib/reg*.c.diff; no longer needed
authorJim Meyering <meyering@fb.com>
Mon, 14 Mar 2016 15:59:56 +0000 (08:59 -0700)
committerJim Meyering <meyering@fb.com>
Tue, 15 Mar 2016 14:36:12 +0000 (07:36 -0700)
* gl/lib/regcomp.c.diff: Remove file, now that gnulib's
regcomp.c compiles regex.c with -Wno-unused-parameter.
* gl/lib/regex_internal.h.diff: Likewise.
* gl/lib/regex_internal.c.diff: This file induced a change to ensure
that the "Idx" type was unsigned and to remove a few "VAR < 0"
comparisons.  These days, it is probably fine to stay in sync with
gnulib/glibc's copies
of these files, so remove these patches, too.
* gl/lib/regexec.c.diff: Likewise.
Prompted by a report by Assaf Gordon and a suggestion from Paul Eggert.

cfg.mk
gl/lib/regcomp.c.diff [deleted file]
gl/lib/regex_internal.c.diff [deleted file]
gl/lib/regex_internal.h.diff [deleted file]
gl/lib/regexec.c.diff [deleted file]

diff --git a/cfg.mk b/cfg.mk
index 05b701591a7a07ec3a6c126ffb53e3721c483d12..6ef09dd04211bf3d4ebc628142cfdcd273518d12 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -807,7 +807,7 @@ _ll = ^src/longlong\.h$$
 exclude_file_name_regexp--sc_useless_cpp_parens = $(_ll)
 exclude_file_name_regexp--sc_space_before_open_paren = $(_ll)
 
-tbi_1 = ^tests/pr/|(^gl/lib/reg.*\.c\.diff|\.mk|^man/help2man)$$
+tbi_1 = ^tests/pr/|(\.mk|^man/help2man)$$
 tbi_2 = ^scripts/git-hooks/(pre-commit|pre-applypatch|applypatch-msg)$$
 tbi_3 = (GNU)?[Mm]akefile(\.am)?$$|$(_ll)
 exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \
diff --git a/gl/lib/regcomp.c.diff b/gl/lib/regcomp.c.diff
deleted file mode 100644 (file)
index 2f5107b..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-diff --git i/lib/regcomp.c w/lib/regcomp.c
-index 6de9b72..bd069dd 100644
---- i/lib/regcomp.c
-+++ w/lib/regcomp.c
-@@ -523,8 +523,8 @@ weak_alias (__regcomp, regcomp)
-    from either regcomp or regexec.   We don't use PREG here.  */
-
- size_t
--regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf,
--        size_t errbuf_size)
-+regerror (int errcode, const regex_t *__restrict preg _UNUSED_PARAMETER_,
-+          char *__restrict errbuf, size_t errbuf_size)
- {
-   const char *msg;
-   size_t msg_size;
-@@ -1407,7 +1407,7 @@ calc_first (void *extra, bin_tree_t *node)
-
- /* Pass 2: compute NEXT on the tree.  Preorder visit.  */
- static reg_errcode_t
--calc_next (void *extra, bin_tree_t *node)
-+calc_next (void *extra _UNUSED_PARAMETER_, bin_tree_t *node)
- {
-   switch (node->token.type)
-     {
-@@ -2821,8 +2821,10 @@ build_range_exp (const reg_syntax_t syntax,
- static reg_errcode_t
- internal_function
- # ifdef RE_ENABLE_I18N
--build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset,
--                      Idx *coll_sym_alloc, const unsigned char *name)
-+build_collating_symbol (bitset_t sbcset,
-+                        re_charset_t *mbcset _UNUSED_PARAMETER_,
-+                        Idx *coll_sym_alloc _UNUSED_PARAMETER_,
-+                        const unsigned char *name)
- # else /* not RE_ENABLE_I18N */
- build_collating_symbol (bitset_t sbcset, const unsigned char *name)
- # endif /* not RE_ENABLE_I18N */
-@@ -3392,7 +3394,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
-
- static reg_errcode_t
- parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
--                     re_token_t *token, int token_len, re_dfa_t *dfa,
-+                       re_token_t *token, int token_len,
-+                       re_dfa_t *dfa _UNUSED_PARAMETER_,
-                      reg_syntax_t syntax, bool accept_hyphen)
- {
- #ifdef RE_ENABLE_I18N
-@@ -3479,8 +3482,9 @@ parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp,
-
- static reg_errcode_t
- #ifdef RE_ENABLE_I18N
--build_equiv_class (bitset_t sbcset, re_charset_t *mbcset,
--                 Idx *equiv_class_alloc, const unsigned char *name)
-+build_equiv_class (bitset_t sbcset, re_charset_t *mbcset _UNUSED_PARAMETER_,
-+                   Idx *equiv_class_alloc _UNUSED_PARAMETER_,
-+                   const unsigned char *name)
- #else /* not RE_ENABLE_I18N */
- build_equiv_class (bitset_t sbcset, const unsigned char *name)
- #endif /* not RE_ENABLE_I18N */
-@@ -3884,7 +3888,7 @@ free_token (re_token_t *node)
-    and its children. */
-
- static reg_errcode_t
--free_tree (void *extra, bin_tree_t *node)
-+free_tree (void *extra _UNUSED_PARAMETER_, bin_tree_t *node)
- {
-   free_token (&node->token);
-   return REG_NOERROR;
diff --git a/gl/lib/regex_internal.c.diff b/gl/lib/regex_internal.c.diff
deleted file mode 100644 (file)
index 2a72e0d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-diff --git a/lib/regex_internal.c b/lib/regex_internal.c
-index 93d7ee9..9b86a07 100644
---- a/lib/regex_internal.c
-+++ b/lib/regex_internal.c
-@@ -17,6 +17,8 @@
-    License along with the GNU C Library; if not, see
-    <http://www.gnu.org/licenses/>.  */
-+#include "verify.h"
-+#include "intprops.h"
- static void re_string_construct_common (const char *str, Idx len,
-                                       re_string_t *pstr,
-                                       RE_TRANSLATE_TYPE trans, bool icase,
-@@ -1389,7 +1391,10 @@ static void
- internal_function
- re_node_set_remove_at (re_node_set *set, Idx idx)
- {
--  if (idx < 0 || idx >= set->nelem)
-+  verify (! TYPE_SIGNED (Idx));
-+  /* if (idx < 0)
-+     return; */
-+  if (idx >= set->nelem)
-     return;
-   --set->nelem;
-   for (; idx < set->nelem; idx++)
diff --git a/gl/lib/regex_internal.h.diff b/gl/lib/regex_internal.h.diff
deleted file mode 100644 (file)
index 66ea417..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/lib/regex_internal.h b/lib/regex_internal.h
-index 0307a34..45c2d44 100644
---- a/lib/regex_internal.h
-+++ b/lib/regex_internal.h
-@@ -868,7 +868,8 @@ re_string_wchar_at (const re_string_t *pstr, Idx idx)
- static int
- internal_function __attribute__ ((pure, unused))
--re_string_elem_size_at (const re_string_t *pstr, Idx idx)
-+re_string_elem_size_at (const re_string_t *pstr _UNUSED_PARAMETER_,
-+                      Idx idx _UNUSED_PARAMETER_)
- {
- # ifdef _LIBC
-   const unsigned char *p, *extra;
diff --git a/gl/lib/regexec.c.diff b/gl/lib/regexec.c.diff
deleted file mode 100644 (file)
index 1aa3c24..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-diff --git a/lib/regexec.c b/lib/regexec.c
-index d3920c4..a8152b5 100644
---- a/lib/regexec.c
-+++ b/lib/regexec.c
-@@ -17,6 +17,8 @@
-    License along with the GNU C Library; if not, see
-    <http://www.gnu.org/licenses/>.  */
-
-+#include "verify.h"
-+#include "intprops.h"
- static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
-                                    Idx n) internal_function;
- static void match_ctx_clean (re_match_context_t *mctx) internal_function;
-@@ -373,8 +375,11 @@ re_search_2_stub (struct re_pattern_buffer *bufp,
-   Idx len = length1 + length2;
-   char *s = NULL;
-
--  if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1, 0))
--    return -2;
-+  verify (! TYPE_SIGNED (Idx));
-+  if (BE (len < length1, 0))
-+     return -2;
-+  /* if (BE (length1 < 0 || length2 < 0 || stop < 0, 0))
-+     return -2; */
-
-   /* Concatenate the strings.  */
-   if (length2 > 0)
-@@ -423,11 +428,14 @@ re_search_stub (struct re_pattern_buffer *bufp,
-   Idx last_start = start + range;
-
-   /* Check for out-of-range.  */
--  if (BE (start < 0 || start > length, 0))
--    return -1;
-+  verify (! TYPE_SIGNED (Idx));
-+  /* if (BE (start < 0, 0))
-+     return -1; */
-+  if (BE (start > length, 0))
-+     return -1;
-   if (BE (length < last_start || (0 <= range && last_start < start), 0))
-     last_start = length;
--  else if (BE (last_start < 0 || (range < 0 && start <= last_start), 0))
-+  else if (BE (/* last_start < 0 || */ (range < 0 && start <= last_start), 0))
-     last_start = 0;
-
-   lock_lock (dfa->lock);