]> granicus.if.org Git - onig/commitdiff
refactoring
authorK.Kosako <kkosako0@gmail.com>
Sat, 22 Sep 2018 08:03:03 +0000 (17:03 +0900)
committerK.Kosako <kkosako0@gmail.com>
Sat, 22 Sep 2018 08:03:03 +0000 (17:03 +0900)
src/regcomp.c
src/regexec.c

index ffe87105eda28d7aa2deeff656619461dc502d79..fc2b48f653f24ad04b86474c8795008d98a7151b 100644 (file)
@@ -4554,7 +4554,7 @@ setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env)
 
 /* set skip map for Boyer-Moore-Horspool search */
 static int
-set_bm_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED, UChar skip[])
+set_bmh_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED, UChar skip[])
 {
   int i, len;
 
@@ -5559,8 +5559,7 @@ set_optimize_exact(regex_t* reg, OptExact* e)
       ONIGENC_IS_ALLOWED_REVERSE_MATCH(reg->enc, reg->exact, reg->exact_end);
 
     if (e->len >= 3 || (e->len >= 2 && allow_reverse)) {
-      r = set_bm_skip(reg->exact, reg->exact_end, reg->enc,
-                      reg->map);
+      r = set_bmh_skip(reg->exact, reg->exact_end, reg->enc, reg->map);
       if (r != 0) return r;
 
       reg->optimize = (allow_reverse != 0
index 0353be0caae49ff697f44b7b1177ff8b2fc9cd66..ce60cf85df8cdfb663e1fa5c610ecf263520f1de 100644 (file)
@@ -4113,16 +4113,17 @@ slow_search_backward_ic(OnigEncoding enc, int case_fold_flag,
 }
 
 static UChar*
-bm_search_forward(regex_t* reg, const UChar* target, const UChar* target_end,
-                  const UChar* text, const UChar* text_end,
-                  const UChar* text_range)
+bmh_search_forward(regex_t* reg, const UChar* target, const UChar* target_end,
+                   const UChar* text, const UChar* text_end,
+                   const UChar* text_range)
 {
   const UChar *s, *se, *t, *p, *end;
   const UChar *tail;
   int skip, tlen1;
 
 #ifdef ONIG_DEBUG_SEARCH
-  fprintf(stderr, "bm_search_forward: text: %p, text_end: %p, text_range: %p\n",
+  fprintf(stderr,
+          "bmh_search_forward: text: %p, text_end: %p, text_range: %p\n",
           text, text_end, text_range);
 #endif
 
@@ -4152,8 +4153,8 @@ bm_search_forward(regex_t* reg, const UChar* target, const UChar* target_end,
 }
 
 static UChar*
-bm_search(regex_t* reg, const UChar* target, const UChar* target_end,
-          const UChar* text, const UChar* text_end, const UChar* text_range)
+bmh_search(regex_t* reg, const UChar* target, const UChar* target_end,
+           const UChar* text, const UChar* text_end, const UChar* text_range)
 {
   const UChar *s, *t, *p, *end;
   const UChar *tail;
@@ -4292,11 +4293,11 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
     break;
 
   case OPTIMIZE_EXACT_BMH:
-    p = bm_search(reg, reg->exact, reg->exact_end, p, end, range);
+    p = bmh_search(reg, reg->exact, reg->exact_end, p, end, range);
     break;
 
   case OPTIMIZE_EXACT_BMH_FORWARD:
-    p = bm_search_forward(reg, reg->exact, reg->exact_end, p, end, range);
+    p = bmh_search_forward(reg, reg->exact, reg->exact_end, p, end, range);
     break;
 
   case OPTIMIZE_MAP: