summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-25 06:05:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-25 06:05:48 +0000
commit4c68173079d0e99b4e83437aba24e9d3f479d848 (patch)
tree866356a33019272516253c7fec9fd3713cc4069b /regcomp.c
parent44c938c9235b95a73a0dfe369dc74900d1848fcd (diff)
regcomp.c: fix debug conditionals
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/regcomp.c b/regcomp.c
index 07e5186372..add0e8f458 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5354,7 +5354,7 @@ set_sub_anchor(regex_t* reg, OptAncInfo* anc)
reg->sub_anchor |= anc->right_anchor & ANCHOR_END_LINE;
}
-#ifdef ONIG_DEBUG
+#if defined(ONIG_DEBUG_COMPILE) || defined(ONIG_DEBUG_MATCH)
static void print_optimize_info(FILE* f, regex_t* reg);
#endif
@@ -5464,7 +5464,9 @@ static void print_enc_string(FILE* fp, OnigEncoding enc,
fprintf(fp, "/ (%s)\n", enc->name);
}
+#endif /* ONIG_DEBUG */
+#if defined(ONIG_DEBUG_COMPILE) || defined(ONIG_DEBUG_MATCH)
static void
print_distance_range(FILE* f, OnigDistance a, OnigDistance b)
{
@@ -5582,7 +5584,7 @@ print_optimize_info(FILE* f, regex_t* reg)
}
}
}
-#endif /* ONIG_DEBUG */
+#endif /* ONIG_DEBUG_COMPILE || ONIG_DEBUG_MATCH */
extern void
@@ -5683,7 +5685,7 @@ onig_chain_reduce(regex_t* reg)
}
}
-#ifdef ONIG_DEBUG
+#ifdef ONIG_DEBUG_COMPILE
static void print_compiled_byte_code_list P_((FILE* f, regex_t* reg));
#endif
#ifdef ONIG_DEBUG_PARSE_TREE
@@ -6271,15 +6273,17 @@ op2arg_type(int opcode)
return ARG_SPECIAL;
}
+#ifdef ONIG_DEBUG_PARSE_TREE
static void
Indent(FILE* f, int indent)
{
int i;
for (i = 0; i < indent; i++) putc(' ', f);
}
+#endif /* ONIG_DEBUG_PARSE_TREE */
static void
-p_string(FILE* f, int len, UChar* s)
+p_string(FILE* f, ptrdiff_t len, UChar* s)
{
fputs(":", f);
while (len-- > 0) { fputc(*s++, f); }
@@ -6544,6 +6548,7 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar* bpend, UChar** nextp,
if (nextp) *nextp = bp;
}
+#ifdef ONIG_DEBUG_COMPILE
static void
print_compiled_byte_code_list(FILE* f, regex_t* reg)
{
@@ -6565,7 +6570,9 @@ print_compiled_byte_code_list(FILE* f, regex_t* reg)
fprintf(f, "\n");
}
+#endif /* ONIG_DEBUG_COMPILE */
+#ifdef ONIG_DEBUG_PARSE_TREE
static void
print_indent_tree(FILE* f, Node* node, int indent)
{
@@ -6737,12 +6744,11 @@ print_indent_tree(FILE* f, Node* node, int indent)
fflush(f);
}
-#endif /* ONIG_DEBUG */
-#ifdef ONIG_DEBUG_PARSE_TREE
static void
print_tree(FILE* f, Node* node)
{
print_indent_tree(f, node, 0);
}
-#endif
+#endif /* ONIG_DEBUG_PARSE_TREE */
+#endif /* ONIG_DEBUG */