* lib/regcomp.c (search_duplicated_node): Make first pointer arg
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 31 Aug 2005 23:36:42 +0000 (23:36 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 31 Aug 2005 23:36:42 +0000 (23:36 +0000)
a pointer-to-const.
* lib/regex_internal.c (create_ci_newstate, create_cd_newstate):
(register_state): Likewise.
* lib/regexec.c (search_cur_bkref_entry, check_dst_limits):
(check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
(group_nodes_into_DFAstates): Likewise.
* config/srclist.txt: Add glibc bug 1282.

config/ChangeLog
config/srclist.txt
lib/ChangeLog
lib/regcomp.c
lib/regex_internal.c
lib/regexec.c

index 38eb9b9ce86275234c03594539cac842252e2b76..b915d410cb115e47935d7366c3f119ef26c28f02 100644 (file)
@@ -1,6 +1,6 @@
 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
 
-       * srclist.txt: Add glibc bugs 1273, 1278-1281.
+       * srclist.txt: Add glibc bugs 1273, 1278-1282.
 
 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
 
index d94e8773813bbff19b561d1d95edf8672055c589..0ec42c196c86535166b2e0df39faca2f699f7c47 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: srclist.txt,v 1.93 2005-08-31 22:51:09 eggert Exp $
+# $Id: srclist.txt,v 1.94 2005-08-31 23:36:43 eggert Exp $
 # Files for which we are not the source.  See ./srclistvars.sh for the
 # variable definitions.
 
@@ -106,6 +106,7 @@ $LIBCSRC/stdlib/getsubopt.c         lib gpl
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1278
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1280
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1281
+# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1282
 #$LIBCSRC/posix/regcomp.c              lib gpl
 #
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1238
@@ -130,6 +131,7 @@ $LIBCSRC/stdlib/getsubopt.c         lib gpl
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1241
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1248
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1281
+# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1282
 #$LIBCSRC/posix/regex_internal.c               lib gpl
 #
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1054
@@ -155,6 +157,7 @@ $LIBCSRC/stdlib/getsubopt.c         lib gpl
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1279
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1280
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1281
+# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1282
 #$LIBCSRC/posix/regexec.c              lib gpl
 #
 # c89 changes $LIBCSRC/string/strdup.c         lib gpl
index 7fb08735f561762311c8c5a281a87aa3f8a05d0b..53e94a2b7a13a061c7b6373a827fe0b2b189dbf6 100644 (file)
@@ -1,3 +1,13 @@
+2005-08-31  Jim Meyering  <jim@meyering.net>
+
+       * regcomp.c (search_duplicated_node): Make first pointer arg
+       a pointer-to-const.
+       * regex_internal.c (create_ci_newstate, create_cd_newstate):
+       (register_state): Likewise.
+       * regexec.c (search_cur_bkref_entry, check_dst_limits):
+       (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
+       (group_nodes_into_DFAstates): Likewise.
+
 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
 
        On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
index c2aac806cd4ec860566c9ff238547966ba1453e9..4ac78c3519235e48b5c5d7ef0f85b5fd6abbec32 100644 (file)
@@ -46,7 +46,7 @@ static reg_errcode_t calc_first (void *extra, bin_tree_t *node);
 static reg_errcode_t calc_next (void *extra, bin_tree_t *node);
 static reg_errcode_t link_nfa_nodes (void *extra, bin_tree_t *node);
 static Idx duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint);
-static Idx search_duplicated_node (re_dfa_t *dfa, Idx org_node,
+static Idx search_duplicated_node (const re_dfa_t *dfa, Idx org_node,
                                   unsigned int constraint);
 static reg_errcode_t calc_eclosure (re_dfa_t *dfa);
 static reg_errcode_t calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa,
@@ -1506,7 +1506,7 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node,
    satisfies the constraint CONSTRAINT.  */
 
 static Idx
-search_duplicated_node (re_dfa_t *dfa, Idx org_node,
+search_duplicated_node (const re_dfa_t *dfa, Idx org_node,
                        unsigned int constraint)
 {
   Idx idx;
index ea1f8d88339e241348b204bebf7a1ed23a325be7..05cd335efe6d550953e7eff2856c867b5c70f3df 100644 (file)
@@ -21,10 +21,10 @@ static void re_string_construct_common (const char *str, Idx len,
                                        re_string_t *pstr,
                                        REG_TRANSLATE_TYPE trans, int icase,
                                        const re_dfa_t *dfa) internal_function;
-static re_dfastate_t *create_ci_newstate (re_dfa_t *dfa,
+static re_dfastate_t *create_ci_newstate (const re_dfa_t *dfa,
                                          const re_node_set *nodes,
                                          re_hashval_t hash) internal_function;
-static re_dfastate_t *create_cd_newstate (re_dfa_t *dfa,
+static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa,
                                          const re_node_set *nodes,
                                          unsigned int context,
                                          re_hashval_t hash) internal_function;
@@ -1465,7 +1465,7 @@ re_acquire_state_context (reg_errcode_t *err, re_dfa_t *dfa,
 
 static reg_errcode_t
 internal_function
-register_state (re_dfa_t *dfa, re_dfastate_t *newstate, re_hashval_t hash)
+register_state (const re_dfa_t *dfa, re_dfastate_t *newstate, re_hashval_t hash)
 {
   struct re_state_table_entry *spot;
   reg_errcode_t err;
@@ -1502,7 +1502,8 @@ register_state (re_dfa_t *dfa, re_dfastate_t *newstate, re_hashval_t hash)
 
 static re_dfastate_t *
 internal_function
-create_ci_newstate (re_dfa_t *dfa, const re_node_set *nodes, re_hashval_t hash)
+create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
+                   re_hashval_t hash)
 {
   Idx i;
   reg_errcode_t err;
@@ -1551,7 +1552,7 @@ create_ci_newstate (re_dfa_t *dfa, const re_node_set *nodes, re_hashval_t hash)
 
 static re_dfastate_t *
 internal_function
-create_cd_newstate (re_dfa_t *dfa, const re_node_set *nodes,
+create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
                    unsigned int context, re_hashval_t hash)
 {
   Idx i, nctx_nodes = 0;
index 230f10d427b3b31fa0fc1e81235e50aa28e784e3..764e652529892e97de4f75a628cd903e9cf0b7fd 100644 (file)
@@ -24,7 +24,7 @@ static void match_ctx_free (re_match_context_t *cache) internal_function;
 static reg_errcode_t match_ctx_add_entry (re_match_context_t *cache, Idx node,
                                          Idx str_idx, Idx from, Idx to)
      internal_function;
-static Idx search_cur_bkref_entry (re_match_context_t *mctx, Idx str_idx)
+static Idx search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx)
      internal_function;
 static reg_errcode_t match_ctx_add_subtop (re_match_context_t *mctx, Idx node,
                                           Idx str_idx) internal_function;
@@ -91,13 +91,14 @@ static reg_errcode_t update_cur_sifted_state (re_match_context_t *mctx,
 static reg_errcode_t add_epsilon_src_nodes (re_dfa_t *dfa,
                                            re_node_set *dest_nodes,
                                            const re_node_set *candidates) internal_function;
-static int check_dst_limits (re_match_context_t *mctx, re_node_set *limits,
+static int check_dst_limits (const re_match_context_t *mctx,
+                            const re_node_set *limits,
                             Idx dst_node, Idx dst_idx, Idx src_node,
                             Idx src_idx) internal_function;
-static int check_dst_limits_calc_pos_1 (re_match_context_t *mctx,
+static int check_dst_limits_calc_pos_1 (const re_match_context_t *mctx,
                                        int boundaries, Idx subexp_idx,
                                        Idx from_node, Idx bkref_idx) internal_function;
-static int check_dst_limits_calc_pos (re_match_context_t *mctx,
+static int check_dst_limits_calc_pos (const re_match_context_t *mctx,
                                      Idx limit, Idx subexp_idx,
                                      Idx node, Idx str_idx,
                                      Idx bkref_idx) internal_function;
@@ -170,7 +171,7 @@ static unsigned int find_collation_sequence_value (const unsigned char *mbs,
                                                   size_t name_len) internal_function;
 # endif /* _LIBC */
 #endif /* RE_ENABLE_I18N */
-static Idx group_nodes_into_DFAstates (re_dfa_t *dfa,
+static Idx group_nodes_into_DFAstates (const re_dfa_t *dfa,
                                       const re_dfastate_t *state,
                                       re_node_set *states_node,
                                       bitset *states_ch) internal_function;
@@ -1855,7 +1856,7 @@ sub_epsilon_src_nodes (re_dfa_t *dfa, Idx node, re_node_set *dest_nodes,
 
 static int
 internal_function
-check_dst_limits (re_match_context_t *mctx, re_node_set *limits,
+check_dst_limits (const re_match_context_t *mctx, const re_node_set *limits,
                  Idx dst_node, Idx dst_idx, Idx src_node, Idx src_idx)
 {
   re_dfa_t *const dfa = mctx->dfa;
@@ -1891,7 +1892,7 @@ check_dst_limits (re_match_context_t *mctx, re_node_set *limits,
 
 static int
 internal_function
-check_dst_limits_calc_pos_1 (re_match_context_t *mctx, int boundaries,
+check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries,
                             Idx subexp_idx, Idx from_node, Idx bkref_idx)
 {
   re_dfa_t *const dfa = mctx->dfa;
@@ -1973,7 +1974,8 @@ check_dst_limits_calc_pos_1 (re_match_context_t *mctx, int boundaries,
 
 static int
 internal_function
-check_dst_limits_calc_pos (re_match_context_t *mctx, Idx limit, Idx subexp_idx,
+check_dst_limits_calc_pos (const re_match_context_t *mctx,
+                          Idx limit, Idx subexp_idx,
                           Idx from_node, Idx str_idx, Idx bkref_idx)
 {
   struct re_backref_cache_entry *lim = mctx->bkref_ents + limit;
@@ -3484,7 +3486,7 @@ out_free:
 
 static Idx
 internal_function
-group_nodes_into_DFAstates (re_dfa_t *dfa, const re_dfastate_t *state,
+group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
                            re_node_set *dests_node, bitset *dests_ch)
 {
   reg_errcode_t err;
@@ -4203,7 +4205,7 @@ match_ctx_add_entry (re_match_context_t *mctx, Idx node, Idx str_idx,
 
 static Idx
 internal_function
-search_cur_bkref_entry (re_match_context_t *mctx, Idx str_idx)
+search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx)
 {
   Idx left, right, mid, last;
   last = right = mctx->nbkref_ents;