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

ruby-changes:36940

From: nobu <ko1@a...>
Date: Fri, 26 Dec 2014 14:33:13 +0900 (JST)
Subject: [ruby-changes:36940] nobu:r49021 (trunk): fix printf format conversion specifiers

nobu	2014-12-26 14:33:01 +0900 (Fri, 26 Dec 2014)

  New Revision: 49021

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

  Log:
    fix printf format conversion specifiers

  Modified files:
    trunk/compile.c
    trunk/ext/bigdecimal/bigdecimal.c
    trunk/ext/sdbm/_sdbm.c
    trunk/regexec.c
Index: compile.c
===================================================================
--- compile.c	(revision 49020)
+++ compile.c	(revision 49021)
@@ -5652,7 +5652,7 @@ dump_disasm_list(struct iseq_link_elemen https://github.com/ruby/ruby/blob/trunk/compile.c#L5652
 	    {
 		iobj = (INSN *)link;
 		str = insn_data_to_s_detail(iobj);
-		printf("%04d %-65s(%4d)\n", pos, StringValueCStr(str), iobj->line_no);
+		printf("%04d %-65s(%4u)\n", pos, StringValueCStr(str), iobj->line_no);
 		pos += insn_data_length(iobj);
 		break;
 	    }
Index: ext/bigdecimal/bigdecimal.c
===================================================================
--- ext/bigdecimal/bigdecimal.c	(revision 49020)
+++ ext/bigdecimal/bigdecimal.c	(revision 49021)
@@ -4842,11 +4842,11 @@ out_side: https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L4842
 space_error:
 #ifdef BIGDECIMAL_DEBUG
     if (gfDebug) {
-	printf("   word_a=%lu\n", word_a);
-	printf("   word_b=%lu\n", word_b);
-	printf("   word_c=%lu\n", word_c);
-	printf("   word_r=%lu\n", word_r);
-	printf("   ind_r =%lu\n", ind_r);
+	printf("   word_a=%"PRIuSIZE"\n", word_a);
+	printf("   word_b=%"PRIuSIZE"\n", word_b);
+	printf("   word_c=%"PRIuSIZE"\n", word_c);
+	printf("   word_r=%"PRIuSIZE"\n", word_r);
+	printf("   ind_r =%"PRIuSIZE"\n", ind_r);
     }
 #endif /* BIGDECIMAL_DEBUG */
     rb_bug("ERROR(VpDivd): space for remainder too small.");
Index: ext/sdbm/_sdbm.c
===================================================================
--- ext/sdbm/_sdbm.c	(revision 49020)
+++ ext/sdbm/_sdbm.c	(revision 49021)
@@ -507,7 +507,7 @@ getpage(register DBM *db, register long https://github.com/ruby/ruby/blob/trunk/ext/sdbm/_sdbm.c#L507
 	while (dbit < db->maxbno && getdbit(db, dbit))
 		dbit = 2 * dbit + ((hash & ((long) 1 << hbit++)) ? 2 : 1);
 
-	debug(("dbit: %d...", dbit));
+	debug(("dbit: %ld...", dbit));
 
 	db->curbit = dbit;
 	db->hmask = masks[hbit];
@@ -532,7 +532,7 @@ getpage(register DBM *db, register long https://github.com/ruby/ruby/blob/trunk/ext/sdbm/_sdbm.c#L532
 		}
 		db->pagbno = pagb;
 
-		debug(("pag read: %d\n", pagb));
+		debug(("pag read: %ld\n", pagb));
 	}
 	return 1;
 }
@@ -552,7 +552,7 @@ getdbit(register DBM *db, register long https://github.com/ruby/ruby/blob/trunk/ext/sdbm/_sdbm.c#L552
 			return 0;
 		db->dirbno = dirb;
 
-		debug(("dir read: %d\n", dirb));
+		debug(("dir read: %ld\n", dirb));
 	}
 
 	return db->dirbuf[c % DBLKSIZ] & (1 << (dbit % BYTESIZ));
@@ -573,7 +573,7 @@ setdbit(register DBM *db, register long https://github.com/ruby/ruby/blob/trunk/ext/sdbm/_sdbm.c#L573
 			return 0;
 		db->dirbno = dirb;
 
-		debug(("dir read: %d\n", dirb));
+		debug(("dir read: %ld\n", dirb));
 	}
 
 	db->dirbuf[c % DBLKSIZ] |= (1 << (dbit % BYTESIZ));
Index: regexec.c
===================================================================
--- regexec.c	(revision 49020)
+++ regexec.c	(revision 49021)
@@ -1292,7 +1292,7 @@ onig_print_statistics(FILE* f) https://github.com/ruby/ruby/blob/trunk/regexec.c#L1292
   int i;
   fprintf(f, "   count      prev        time\n");
   for (i = 0; OnigOpInfo[i].opcode >= 0; i++) {
-    fprintf(f, "%8d: %8d: %10ld: %s\n",
+    fprintf(f, "%8d: %8d: %10lu: %s\n",
 	    OpCounter[i], OpPrevCounter[i], OpTime[i], OnigOpInfo[i].name);
   }
   fprintf(f, "\nmax stack depth: %d\n", MaxStackDepth);
@@ -4290,7 +4290,7 @@ onig_search_gpos(regex_t* reg, const UCh https://github.com/ruby/ruby/blob/trunk/regexec.c#L4290
 
 #ifdef ONIG_DEBUG
   if (r != ONIG_MISMATCH)
-    fprintf(stderr, "onig_search: error %"PRIdPTR"\n", r);
+    fprintf(stderr, "onig_search: error %"PRIdPTRDIFF"\n", r);
 #endif
   return r;
 
@@ -4300,7 +4300,7 @@ onig_search_gpos(regex_t* reg, const UCh https://github.com/ruby/ruby/blob/trunk/regexec.c#L4300
   ONIG_STATE_DEC_THREAD(reg);
 #ifdef ONIG_DEBUG
   if (r != ONIG_MISMATCH)
-    fprintf(stderr, "onig_search: error %"PRIdPTR"\n", r);
+    fprintf(stderr, "onig_search: error %"PRIdPTRDIFF"\n", r);
 #endif
   return r;
 

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

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