]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix printf format inconsistencies as pointed out by gcc -Wformat-signedness.
authorFlorian Krohm <florian@eich-krohm.de>
Mon, 3 Aug 2015 21:05:20 +0000 (21:05 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Mon, 3 Aug 2015 21:05:20 +0000 (21:05 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15479

exp-bbv/bbv_main.c
exp-dhat/dh_main.c
exp-sgcheck/pc_common.c
exp-sgcheck/sg_main.c
massif/ms_main.c

index db7835f41cbf74b7af97f9a52c3b1002537712ea..c199cc0bb60b071d39833fde871bcbc5e77d26d3 100644 (file)
@@ -116,8 +116,8 @@ static void dumpPcFile(void)
       /*    and function name for each basic block             */
    VG_(OSetGen_ResetIter)(instr_info_table);
    while ( (bb_elem = VG_(OSetGen_Next)(instr_info_table)) ) {
-      VG_(fprintf)( fp, "F:%d:%x:%s\n", bb_elem->block_num,
-                    (Int)bb_elem->BB_addr, bb_elem->fn_name);
+      VG_(fprintf)( fp, "F:%d:%lx:%s\n", bb_elem->block_num,
+                    bb_elem->BB_addr, bb_elem->fn_name);
    }
 
    VG_(fclose)(fp);
@@ -565,10 +565,10 @@ static void bbv_fini(Int exitcode)
          VG_(sprintf)(buf,"\n\n"
                           "# Thread %d\n"
                           "#   Total intervals: %d (Interval Size %d)\n"
-                          "#   Total instructions: %lld\n"
-                          "#   Total reps: %lld\n"
-                          "#   Unique reps: %lld\n"
-                          "#   Total fldcw instructions: %lld\n\n",
+                          "#   Total instructions: %llu\n"
+                          "#   Total reps: %llu\n"
+                          "#   Unique reps: %llu\n"
+                          "#   Total fldcw instructions: %llu\n\n",
                 i,
                 (Int)(bbv_thread[i].total_instr/(ULong)interval_size),
                 interval_size,
index 471c3edc62d2b338aca1564182d227b83aa9f7db..b9dfff08095810ae4de74d342d164b243cc9feda 100644 (file)
@@ -494,7 +494,7 @@ void* new_block ( ThreadId tid, void* p, SizeT req_szB, SizeT req_alignB,
 
    intro_Block(bk);
 
-   if (0) VG_(printf)("ALLOC %ld -> %p\n", req_szB, p);
+   if (0) VG_(printf)("ALLOC %lu -> %p\n", req_szB, p);
 
    return p;
 }
@@ -537,7 +537,7 @@ void die_block ( void* p, Bool custom_free )
 static
 void* renew_block ( ThreadId tid, void* p_old, SizeT new_req_szB )
 {
-   if (0) VG_(printf)("REALL %p %ld\n", p_old, new_req_szB);
+   if (0) VG_(printf)("REALL %p %lu\n", p_old, new_req_szB);
    void* p_new = NULL;
 
    tl_assert(new_req_szB > 0); // map 0 to 1
index de6bb16ce14345388459b92e52c820521f5afc66..57be8bda097551a59cfe581e4a460854523aee06 100644 (file)
@@ -564,8 +564,8 @@ void pc_pp_Error ( const Error* err )
                   what, s );
             VG_(pp_ExeContext)( VG_(get_error_where)(err) );
    
-            emit( "  <auxwhat>Address %#lx is %ld bytes inside a "
-                  "%ld-byte block free'd</auxwhat>\n",
+            emit( "  <auxwhat>Address %#lx is %lu bytes inside a "
+                  "%lu-byte block free'd</auxwhat>\n",
                   lo, lo-Seg__addr(seglo), Seg__size(seglo) );
             VG_(pp_ExeContext)(Seg__where(seglo));
 
@@ -575,8 +575,8 @@ void pc_pp_Error ( const Error* err )
                   what, s );
             VG_(pp_ExeContext)( VG_(get_error_where)(err) );
    
-            emit( " Address %#lx is %ld bytes inside a "
-                  "%ld-byte block free'd\n",
+            emit( " Address %#lx is %lu bytes inside a "
+                  "%lu-byte block free'd\n",
                   lo, lo-Seg__addr(seglo), Seg__size(seglo) );
             VG_(pp_ExeContext)(Seg__where(seglo));
 
@@ -595,8 +595,8 @@ void pc_pp_Error ( const Error* err )
                emit( "  <auxwhat>First byte is "
                         "not inside a known block</auxwhat>\n" );
             } else {
-               emit( "  <auxwhat>First byte (%#lx) is %ld bytes inside a "
-                     "%ld-byte block alloc'd</auxwhat>\n",
+               emit( "  <auxwhat>First byte (%#lx) is %lu bytes inside a "
+                     "%lu-byte block alloc'd</auxwhat>\n",
                      lo, lo-Seg__addr(seglo), Seg__size(seglo) );
                VG_(pp_ExeContext)(Seg__where(seglo));
             }
@@ -605,8 +605,8 @@ void pc_pp_Error ( const Error* err )
                emit( "  <auxwhat>Last byte is "
                         "not inside a known block</auxwhat>\n" );
             } else {
-               emit( "  <auxwhat>Last byte (%#lx) is %ld bytes inside a "
-                     "%ld-byte block alloc'd</auxwhat>\n",
+               emit( "  <auxwhat>Last byte (%#lx) is %lu bytes inside a "
+                     "%lu-byte block alloc'd</auxwhat>\n",
                      hi, hi-Seg__addr(seghi), Seg__size(seghi) );
                VG_(pp_ExeContext)(Seg__where(seghi));
             }
@@ -620,8 +620,8 @@ void pc_pp_Error ( const Error* err )
             if (UNKNOWN == seglo) {
                emit( " First byte is not inside a known block\n" );
             } else {
-               emit( " First byte (%#lx) is %ld bytes inside a "
-                     "%ld-byte block alloc'd\n",
+               emit( " First byte (%#lx) is %lu bytes inside a "
+                     "%lu-byte block alloc'd\n",
                      lo, lo-Seg__addr(seglo), Seg__size(seglo) );
                VG_(pp_ExeContext)(Seg__where(seglo));
             }
@@ -629,8 +629,8 @@ void pc_pp_Error ( const Error* err )
             if (UNKNOWN == seghi) {
                emit( " Last byte is not inside a known block\n" );
             } else {
-               emit( " Last byte (%#lx) is %ld bytes inside a "
-                     "%ld-byte block alloc'd\n",
+               emit( " Last byte (%#lx) is %lu bytes inside a "
+                     "%lu-byte block alloc'd\n",
                      hi, hi-Seg__addr(seghi), Seg__size(seghi) );
                VG_(pp_ExeContext)(Seg__where(seghi));
             }
index 0b2c50ef5b4c9d7c6c4725f5df5bbdc0d2f8d42e..1910ae686e50ed1fe3d84794f2aea771fae7ad11 100644 (file)
@@ -631,7 +631,7 @@ typedef
 
 static void GlobalTreeNode__pp ( GlobalTreeNode* nd ) {
    tl_assert(nd->descr);
-   VG_(printf)("GTNode [%#lx,+%ld) %s", 
+   VG_(printf)("GTNode [%#lx,+%lu) %s", 
                nd->addr, nd->szB, nd->descr->name);
 }
 
@@ -1648,7 +1648,7 @@ static void classify_address ( /*OUT*/Invar* inv,
            sKey.szB  = szB;
            gKey.addr = ea;
            gKey.szB  = szB;
-           if (0) VG_(printf)("Tree sizes %ld %ld\n",
+           if (0) VG_(printf)("Tree sizes %lu %lu\n",
                               VG_(sizeFM)(siTrees[tid]), VG_(sizeFM)(giTree));
            sOK = VG_(findBoundsFM)( siTrees[tid], 
                                     (UWord*)&sLB,    NULL/*unused*/,
@@ -1896,7 +1896,7 @@ void shadowStack_new_frame ( ThreadId tid,
          if (0 && (sb || gb))
             VG_(message)(Vg_DebugMsg, 
                          "exp-sgcheck: new max tree sizes: "
-                         "StackTree %ld, GlobalTree %ld\n",
+                         "StackTree %lu, GlobalTree %lu\n",
                          stats__max_sitree_size, stats__max_gitree_size );
       }
    } else {
index 5053c4f0ae7739895f2b7c9637564259c1e33f61..1ca0cd1db48fb04db95b63fea4329dc7a7c6864d 100644 (file)
@@ -1115,7 +1115,7 @@ static void VERB_snapshot(Int verbosity, const HChar* prefix, Int i)
    default:
       tl_assert2(0, "VERB_snapshot: unknown snapshot kind: %d", snapshot->kind);
    }
-   VERB(verbosity, "%s S%s%3d (t:%lld, hp:%ld, ex:%ld, st:%ld)\n",
+   VERB(verbosity, "%s S%s%3d (t:%lld, hp:%lu, ex:%lu, st:%lu)\n",
       prefix, suffix, i,
       snapshot->time,
       snapshot->heap_szB,
@@ -1722,7 +1722,8 @@ void* realloc_block ( ThreadId tid, void* p_old, SizeT new_req_szB )
       }
 
       VERB(3, ">>> (%ld, %ld)\n",
-         new_req_szB - old_req_szB, new_slop_szB - old_slop_szB);
+           (SSizeT)(new_req_szB - old_req_szB),
+           (SSizeT)(new_slop_szB - old_slop_szB));
    }
 
    return p_new;
@@ -1902,7 +1903,7 @@ static void update_stack_stats(SSizeT stack_szB_delta)
 static INLINE void new_mem_stack_2(SizeT len, const HChar* what)
 {
    if (have_started_executing_code) {
-      VERB(3, "<<< new_mem_stack (%ld)\n", len);
+      VERB(3, "<<< new_mem_stack (%lu)\n", len);
       n_stack_allocs++;
       update_stack_stats(len);
       maybe_take_snapshot(Normal, what);
@@ -1913,7 +1914,7 @@ static INLINE void new_mem_stack_2(SizeT len, const HChar* what)
 static INLINE void die_mem_stack_2(SizeT len, const HChar* what)
 {
    if (have_started_executing_code) {
-      VERB(3, "<<< die_mem_stack (%ld)\n", -len);
+      VERB(3, "<<< die_mem_stack (-%lu)\n", len);
       n_stack_frees++;
       maybe_take_snapshot(Peak,   "stkPEAK");
       update_stack_stats(-len);
@@ -2149,7 +2150,7 @@ static void pp_snapshot_SXPt(VgFile *fp, SXPt* sxpt, Int depth,
       }
       
       // Do the non-ip_desc part first...
-      FP("%sn%d: %lu ", depth_str, sxpt->Sig.n_children, sxpt->szB);
+      FP("%sn%u: %lu ", depth_str, sxpt->Sig.n_children, sxpt->szB);
 
       // For ip_descs beginning with "0xABCD...:" addresses, we first
       // measure the length of the "0xabcd: " address at the start of the
@@ -2407,7 +2408,7 @@ static void ms_print_stats (void)
    STATS("stack allocs:          %u\n", n_stack_allocs);
    STATS("stack frees:           %u\n", n_stack_frees);
    STATS("XPts:                  %u\n", n_xpts);
-   STATS("top-XPts:              %u (%d%%)\n",
+   STATS("top-XPts:              %u (%u%%)\n",
       alloc_xpt->n_children,
       ( n_xpts ? alloc_xpt->n_children * 100 / n_xpts : 0));
    STATS("XPt init expansions:   %u\n", n_xpt_init_expansions);