[前][次][番号順一覧][スレッド一覧]

ruby-changes:43083

From: nobu <ko1@a...>
Date: Wed, 25 May 2016 15:05:53 +0900 (JST)
Subject: [ruby-changes:43083] nobu:r55157 (trunk): regcomp.c: fix debug conditionals

nobu	2016-05-25 15:05:48 +0900 (Wed, 25 May 2016)

  New Revision: 55157

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55157

  Log:
    regcomp.c: fix debug conditionals

  Modified files:
    trunk/regcomp.c
Index: regcomp.c
===================================================================
--- regcomp.c	(revision 55156)
+++ regcomp.c	(revision 55157)
@@ -5354,7 +5354,7 @@ set_sub_anchor(regex_t* reg, OptAncInfo* https://github.com/ruby/ruby/blob/trunk/regcomp.c#L5354
   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, O https://github.com/ruby/ruby/blob/trunk/regcomp.c#L5464
 
   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* re https://github.com/ruby/ruby/blob/trunk/regcomp.c#L5584
     }
   }
 }
-#endif /* ONIG_DEBUG */
+#endif /* ONIG_DEBUG_COMPILE || ONIG_DEBUG_MATCH */
 
 
 extern void
@@ -5683,7 +5685,7 @@ onig_chain_reduce(regex_t* reg) https://github.com/ruby/ruby/blob/trunk/regcomp.c#L5685
   }
 }
 
-#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) https://github.com/ruby/ruby/blob/trunk/regcomp.c#L6273
   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, U https://github.com/ruby/ruby/blob/trunk/regcomp.c#L6548
   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, r https://github.com/ruby/ruby/blob/trunk/regcomp.c#L6570
 
   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, i https://github.com/ruby/ruby/blob/trunk/regcomp.c#L6744
 
   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 */

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]