]> 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:21:42 +0000 (21:21 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Mon, 3 Aug 2015 21:21:42 +0000 (21:21 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15480

helgrind/hg_basics.c
helgrind/hg_basics.h
helgrind/hg_errors.c
helgrind/hg_main.c
helgrind/libhb_core.c

index 4a039c988e2664013e952a0c5c904ddc872648d2..b2a22adbd396af8e37b237e20ee18184d79504df 100644 (file)
@@ -77,7 +77,7 @@ UWord HG_(clo_history_level) = 2;
 
 UWord HG_(clo_conflict_cache_size) = 2000000;
 
-Word  HG_(clo_sanity_flags) = 0;
+UWord HG_(clo_sanity_flags) = 0;
 
 Bool  HG_(clo_free_is_write) = False;
 
index 41ee803e124c6d4fe509d670231436f89840612e..37f29067ca40787b7605f88e715f0fa43f4544f2 100644 (file)
@@ -101,7 +101,7 @@ extern UWord HG_(clo_conflict_cache_size);
 
 /* Sanity check level.  This is an or-ing of
    SCE_{THREADS,LOCKS,BIGRANGE,ACCESS,LAOG}. */
-extern Word HG_(clo_sanity_flags);
+extern UWord HG_(clo_sanity_flags);
 
 /* Treat heap frees as if the memory was written immediately prior to
    the free.  This shakes out races in which memory is referenced by
index 49414549e8392cad8e6a024ddba547cf652d1a5e..e694fb73f8ea11842a4ddd88ec6edbc1c69f84bb 100644 (file)
@@ -1296,7 +1296,7 @@ void HG_(print_access) (StackTrace ips, UInt n_ips,
    if (threadp->coretid == VG_INVALID_THREADID) 
       VG_(printf)(" tid (exited)\n");
    else
-      VG_(printf)(" tid %d\n", threadp->coretid);
+      VG_(printf)(" tid %u\n", threadp->coretid);
    {
       Lock** locksHeldW_P;
       locksHeldW_P = enumerate_WordSet_into_LockP_vector(
index 2550613083e20097be285d4276e3a486d9ab1088..76650c05e99356c73d6fc1a7d36e48cf289b4cd4 100644 (file)
@@ -520,7 +520,7 @@ static void pp_Lock ( Int d, Lock* lk,
             if (thr->coretid == VG_INVALID_THREADID) 
                VG_(printf)("tid (exited) ");
             else
-               VG_(printf)("tid %d ", thr->coretid);
+               VG_(printf)("tid %u ", thr->coretid);
 
          }
       }
@@ -1037,7 +1037,7 @@ static void shadow_mem_make_New ( Thread* thr, Addr a, SizeT len )
 static void shadow_mem_make_NoAccess_NoFX ( Thread* thr, Addr aIN, SizeT len )
 {
    if (0 && len > 500)
-      VG_(printf)("make NoAccess_NoFX ( %#lx, %ld )\n", aIN, len );
+      VG_(printf)("make NoAccess_NoFX ( %#lx, %lu )\n", aIN, len );
    // has no effect (NoFX)
    libhb_srange_noaccess_NoFX( thr->hbthr, aIN, len );
 }
@@ -1045,7 +1045,7 @@ static void shadow_mem_make_NoAccess_NoFX ( Thread* thr, Addr aIN, SizeT len )
 static void shadow_mem_make_NoAccess_AHAE ( Thread* thr, Addr aIN, SizeT len )
 {
    if (0 && len > 500)
-      VG_(printf)("make NoAccess_AHAE ( %#lx, %ld )\n", aIN, len );
+      VG_(printf)("make NoAccess_AHAE ( %#lx, %lu )\n", aIN, len );
    // Actually Has An Effect (AHAE)
    libhb_srange_noaccess_AHAE( thr->hbthr, aIN, len );
 }
@@ -1053,7 +1053,7 @@ static void shadow_mem_make_NoAccess_AHAE ( Thread* thr, Addr aIN, SizeT len )
 static void shadow_mem_make_Untracked ( Thread* thr, Addr aIN, SizeT len )
 {
    if (0 && len > 500)
-      VG_(printf)("make Untracked ( %#lx, %ld )\n", aIN, len );
+      VG_(printf)("make Untracked ( %#lx, %lu )\n", aIN, len );
    libhb_srange_untrack( thr->hbthr, aIN, len );
 }
 
@@ -5021,7 +5021,7 @@ Bool hg_handle_client_request ( ThreadId tid, UWord* args, UWord* ret)
       /* --- --- User-visible client requests --- --- */
 
       case VG_USERREQ__HG_CLEAN_MEMORY:
-         if (0) VG_(printf)("VG_USERREQ__HG_CLEAN_MEMORY(%#lx,%ld)\n",
+         if (0) VG_(printf)("VG_USERREQ__HG_CLEAN_MEMORY(%#lx,%lu)\n",
                             args[1], args[2]);
          /* Call die_mem to (expensively) tidy up properly, if there
             are any held locks etc in the area.  Calling evh__die_mem
@@ -5053,7 +5053,7 @@ Bool hg_handle_client_request ( ThreadId tid, UWord* args, UWord* ret)
       }
 
       case _VG_USERREQ__HG_ARANGE_MAKE_UNTRACKED:
-         if (0) VG_(printf)("HG_ARANGE_MAKE_UNTRACKED(%#lx,%ld)\n",
+         if (0) VG_(printf)("HG_ARANGE_MAKE_UNTRACKED(%#lx,%lu)\n",
                             args[1], args[2]);
          if (args[2] > 0) { /* length */
             evh__untrack_mem(args[1], args[2]);
@@ -5061,7 +5061,7 @@ Bool hg_handle_client_request ( ThreadId tid, UWord* args, UWord* ret)
          break;
 
       case _VG_USERREQ__HG_ARANGE_MAKE_TRACKED:
-         if (0) VG_(printf)("HG_ARANGE_MAKE_TRACKED(%#lx,%ld)\n",
+         if (0) VG_(printf)("HG_ARANGE_MAKE_TRACKED(%#lx,%lu)\n",
                             args[1], args[2]);
          if (args[2] > 0) { /* length */
             evh__new_mem(args[1], args[2]);
@@ -5069,7 +5069,7 @@ Bool hg_handle_client_request ( ThreadId tid, UWord* args, UWord* ret)
          break;
 
       case _VG_USERREQ__HG_GET_ABITS:
-         if (0) VG_(printf)("HG_GET_ABITS(%#lx,%#lx,%ld)\n",
+         if (0) VG_(printf)("HG_GET_ABITS(%#lx,%#lx,%lu)\n",
                             args[1], args[2], args[3]);
          UChar *zzabit = (UChar *) args[2];
          if (zzabit == NULL 
index 96f731c17233ec9d594fadefb69f9e5c705afb3f..f493f67c736464425d7e42e4160e2b4866078951 100644 (file)
@@ -1503,7 +1503,7 @@ static __attribute__((noinline)) void cacheline_wback ( UWord wix )
    sequentialise_CacheLine( csvals, &csvalsUsed, 
                             N_LINE_ARANGE, cl );
    tl_assert(csvalsUsed >= 1 && csvalsUsed <= N_LINE_ARANGE);
-   if (0) VG_(printf)("%lu ", csvalsUsed);
+   if (0) VG_(printf)("%ld ", csvalsUsed);
 
    lineZ->dict[0] = lineZ->dict[1] 
                   = lineZ->dict[2] = lineZ->dict[3] = SVal_INVALID;
@@ -2625,7 +2625,7 @@ static void VTS__show ( const VTS* vts )
    n =  vts->usedTS;
    for (i = 0; i < n; i++) {
       const ScalarTS *st = &vts->ts[i];
-      VG_(printf)(i < n-1 ? "%u:%llu " : "%u:%llu", st->thrid, (ULong)st->tym);
+      VG_(printf)(i < n-1 ? "%d:%llu " : "%d:%llu", st->thrid, (ULong)st->tym);
    }
    VG_(printf)("]");
 }
@@ -5050,7 +5050,7 @@ static void record_race_info ( Thr* acc_thr,
                  (XACmpFn_t)cmp__ULong_n_EC__by_ULong
               );
       if (0) VG_(printf)("record_race_info %u %u %u  confThr %p "
-                         "confTym %llu found %d (%lu,%lu)\n", 
+                         "confTym %llu found %d (%ld,%ld)\n", 
                          Cfailed, Kfailed, Cw,
                          confThr, confTym, found, firstIx, lastIx);
       /* We can't indefinitely collect stack traces at VTS
@@ -5779,7 +5779,7 @@ static void zsm_sset_range ( Addr a, SizeT len, SVal svNew )
    stats__cache_make_New_arange += (ULong)len;
 
    if (0 && len > 500)
-      VG_(printf)("make New      ( %#lx, %ld )\n", a, len );
+      VG_(printf)("make New      ( %#lx, %lu )\n", a, len );
 
    if (0) {
       static UWord n_New_in_cache = 0;
@@ -6445,8 +6445,8 @@ void libhb_shutdown ( Bool show_stats )
                live++;
             hgthread = hgthread->admin;
          }
-         VG_(printf)("   libhb: threads live: %d exit_and_joinedwith %d"
-                     " exit %d joinedwith %d\n",
+         VG_(printf)("   libhb: threads live: %u exit_and_joinedwith %u"
+                     " exit %u joinedwith %u\n",
                      live, llexit_and_joinedwith_done,
                      llexit_done, joinedwith_done);
          VG_(printf)("   libhb: %d verydead_threads, "
@@ -6505,7 +6505,7 @@ void libhb_shutdown ( Bool show_stats )
                       / (Double)(non0chain ? non0chain : 1));
          for (i = 0; i <= MAXCHAIN; i++) {
             if (chains[i] != 0)
-                VG_(printf)( "[%d%s]=%d ",
+                VG_(printf)( "[%u%s]=%u ",
                              i, i == MAXCHAIN ? "+" : "",
                              chains[i]);
          }
@@ -6860,9 +6860,9 @@ static void zsm_sset_range_noaccess (Addr addr, SizeT len)
    PlenCONSUME(APC, ARE, 1,               APClen);
 
    if (0)
-      VG_(printf) ("addr %p[%ld] ARE %p"
-                   " BPC %p[%ld] BFC %p[%ld] FSM %p[%ld]"
-                   " AFC %p[%ld] APC %p[%ld]\n",
+      VG_(printf) ("addr %p[%lu] ARE %p"
+                   " BPC %p[%lu] BFC %p[%lu] FSM %p[%lu]"
+                   " AFC %p[%lu] APC %p[%lu]\n",
                    (void*)addr, len, (void*)ARE,
                    (void*)BPC, BPClen, (void*)BFC, BFClen, (void*)FSM, FSMlen,
                    (void*)AFC, AFClen, (void*)APC, APClen);