[commit: ghc] master: rts: Add casts to prevent compiler warnings in printfs. (7cb10ba)

git at git.haskell.org git at git.haskell.org
Tue Oct 29 03:17:52 UTC 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/7cb10ba40e619a0a368571ea8c7a85c1dd34628b/ghc

>---------------------------------------------------------------

commit 7cb10ba40e619a0a368571ea8c7a85c1dd34628b
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Sat Oct 26 11:11:54 2013 +1100

    rts: Add casts to prevent compiler warnings in printfs.


>---------------------------------------------------------------

7cb10ba40e619a0a368571ea8c7a85c1dd34628b
 rts/Stats.c     |    2 +-
 rts/sm/Sanity.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/rts/Stats.c b/rts/Stats.c
index c19f23c..7db4563 100644
--- a/rts/Stats.c
+++ b/rts/Stats.c
@@ -691,7 +691,7 @@ stat_exit (void)
 	    statsPrintf("%16s bytes maximum slop\n", temp);
 
 	    statsPrintf("%16" FMT_SizeT " MB total memory in use (%" FMT_SizeT " MB lost due to fragmentation)\n\n", 
-                        peak_mblocks_allocated * MBLOCK_SIZE_W / (1024 * 1024 / sizeof(W_)),
+                        (W_)(peak_mblocks_allocated * MBLOCK_SIZE_W / (1024 * 1024 / sizeof(W_))),
                         (W_)(peak_mblocks_allocated * BLOCKS_PER_MBLOCK * BLOCK_SIZE_W - hw_alloc_blocks * BLOCK_SIZE_W) / (1024 * 1024 / sizeof(W_)));
 
 	    /* Print garbage collections in each gen */
diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c
index 0d48ba2..c653331 100644
--- a/rts/sm/Sanity.c
+++ b/rts/sm/Sanity.c
@@ -917,7 +917,7 @@ memInventory (rtsBool show)
                  live_blocks + free_blocks, MB(live_blocks+free_blocks));
       if (leak) {
           debugBelch("\n  in system    : %5" FMT_Word " blocks (%" FMT_Word " MB)\n", 
-                     mblocks_allocated * BLOCKS_PER_MBLOCK, mblocks_allocated);
+                     (W_)(mblocks_allocated * BLOCKS_PER_MBLOCK), mblocks_allocated);
       }
   }
 



More information about the ghc-commits mailing list