]> granicus.if.org Git - onig/commitdiff
fix address output format
authorkosako <kosako@sofnec.co.jp>
Mon, 4 Jul 2016 08:54:04 +0000 (17:54 +0900)
committerkosako <kosako@sofnec.co.jp>
Mon, 4 Jul 2016 08:54:04 +0000 (17:54 +0900)
src/regcomp.c

index f6c164845f4ac4d466fcc340ee7282042e60e744..d6a87860b6c449058552ad724797c6a4b011aa24 100644 (file)
@@ -5151,7 +5151,7 @@ print_optimize_info(FILE* f, regex_t* reg)
     for (p = reg->exact; p < reg->exact_end; p++) {
       fputc(*p, f);
     }
-    fprintf(f, "]: length: %d\n", (reg->exact_end - reg->exact));
+    fprintf(f, "]: length: %ld\n", (reg->exact_end - reg->exact));
   }
   else if (reg->optimize & ONIG_OPTIMIZE_MAP) {
     int c, i, n = 0;
@@ -5939,7 +5939,7 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar** nextp,
 
         GET_POINTER_INC(cc, bp);
         n = bitset_on_num(cc->bs);
-        fprintf(f, ":%u:%d", (unsigned int )cc, n);
+        fprintf(f, ":%p:%d", cc, n);
       }
       break;
 
@@ -6071,9 +6071,9 @@ print_indent_tree(FILE* f, Node* node, int indent)
   case NT_LIST:
   case NT_ALT:
     if (NTYPE(node) == NT_LIST)
-      fprintf(f, "<list:%x>\n", (int )node);
+      fprintf(f, "<list:%p>\n", node);
     else
-      fprintf(f, "<alt:%x>\n", (int )node);
+      fprintf(f, "<alt:%p>\n", node);
 
     print_indent_tree(f, NCAR(node), indent + add);
     while (IS_NOT_NULL(node = NCDR(node))) {
@@ -6086,8 +6086,8 @@ print_indent_tree(FILE* f, Node* node, int indent)
     break;
 
   case NT_STR:
-    fprintf(f, "<string%s:%x>",
-           (NSTRING_IS_RAW(node) ? "-raw" : ""), (int )node);
+    fprintf(f, "<string%s:%p>",
+           (NSTRING_IS_RAW(node) ? "-raw" : ""), node);
     for (p = NSTR(node)->s; p < NSTR(node)->end; p++) {
       if (*p >= 0x20 && *p < 0x7f)
         fputc(*p, f);
@@ -6098,7 +6098,7 @@ print_indent_tree(FILE* f, Node* node, int indent)
     break;
 
   case NT_CCLASS:
-    fprintf(f, "<cclass:%x>", (int )node);
+    fprintf(f, "<cclass:%p>", node);
     if (IS_NCCLASS_NOT(NCCLASS(node))) fputs(" not", f);
     if (NCCLASS(node)->mbuf) {
       BBuf* bbuf = NCCLASS(node)->mbuf;
@@ -6110,7 +6110,7 @@ print_indent_tree(FILE* f, Node* node, int indent)
     break;
 
   case NT_CTYPE:
-    fprintf(f, "<ctype:%x> ", (int )node);
+    fprintf(f, "<ctype:%p> ", node);
     switch (NCTYPE(node)->ctype) {
     case ONIGENC_CTYPE_WORD:
       if (NCTYPE(node)->not != 0)
@@ -6126,11 +6126,11 @@ print_indent_tree(FILE* f, Node* node, int indent)
     break;
 
   case NT_CANY:
-    fprintf(f, "<anychar:%x>", (int )node);
+    fprintf(f, "<anychar:%p>", node);
     break;
 
   case NT_ANCHOR:
-    fprintf(f, "<anchor:%x> ", (int )node);
+    fprintf(f, "<anchor:%p> ", node);
     switch (NANCHOR(node)->type) {
     case ANCHOR_BEGIN_BUF:      fputs("begin buf",      f); break;
     case ANCHOR_END_BUF:        fputs("end buf",        f); break;
@@ -6173,7 +6173,7 @@ print_indent_tree(FILE* f, Node* node, int indent)
       int* p;
       BRefNode* br = NBREF(node);
       p = BACKREFS_P(br);
-      fprintf(f, "<backref:%x>", (int )node);
+      fprintf(f, "<backref:%p>", node);
       for (i = 0; i < br->back_num; i++) {
         if (i > 0) fputs(", ", f);
         fprintf(f, "%d", p[i]);
@@ -6185,21 +6185,21 @@ print_indent_tree(FILE* f, Node* node, int indent)
   case NT_CALL:
     {
       CallNode* cn = NCALL(node);
-      fprintf(f, "<call:%x>", (int )node);
+      fprintf(f, "<call:%p>", node);
       p_string(f, cn->name_end - cn->name, cn->name);
     }
     break;
 #endif
 
   case NT_QTFR:
-    fprintf(f, "<quantifier:%x>{%d,%d}%s\n", (int )node,
+    fprintf(f, "<quantifier:%p>{%d,%d}%s\n", node,
            NQTFR(node)->lower, NQTFR(node)->upper,
            (NQTFR(node)->greedy ? "" : "?"));
     print_indent_tree(f, NQTFR(node)->target, indent + add);
     break;
 
   case NT_ENCLOSE:
-    fprintf(f, "<enclose:%x> ", (int )node);
+    fprintf(f, "<enclose:%p> ", node);
     switch (NENCLOSE(node)->type) {
     case ENCLOSE_OPTION:
       fprintf(f, "option:%d", NENCLOSE(node)->option);