[hackers] [ubase] Use the macros from inttypes.h to properly print uint64_t || sin
commit a4e8cf6664d63b86349a776b19e2f5b21873e8b5
Author: sin <sin_AT_2f30.org>
Date: Wed Jun 4 13:17:57 2014 +0100
Use the macros from inttypes.h to properly print uint64_t
diff --git a/dd.c b/dd.c
index 2685d54..994f712 100644
--- a/dd.c
+++ b/dd.c
_AT_@ -8,6 +8,7 @@
*/
#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
_AT_@ -201,9 +202,12 @@ print_stat(const struct dd_config *ddc)
if (ddc->quiet)
return;
- fprintf(stderr, "%lu records in
%lu records out
%lu bytes (%lu MB) copied, %lu s, %f MB/s [%f mB/s]
",
- ddc->rec_in, ddc->rec_out, ddc->b_out, ddc->b_out/(1<<20),
- ddc->t_end - ddc->t_start,
+ fprintf(stderr, "%"PRIu64" records in
", ddc->rec_in);
+ fprintf(stderr, "%"PRIu64" records out
", ddc->rec_out);
+ fprintf(stderr, "%"PRIu64" bytes (%"PRIu64" MB) copied", ddc->b_out,
+ ddc->b_out/(1<<20));
+ fprintf(stderr, ", %lu s, %f MB/s [%f mB/s]
",
+ (unsigned long)ddc->t_end - ddc->t_start,
((double)(ddc->b_out/(1<<20)))/(ddc->t_end - ddc->t_start),
((double)(ddc->b_out/(1000*1000)))/(ddc->t_end - ddc->t_start));
}
Received on Wed Jun 04 2014 - 14:23:34 CEST
This archive was generated by hypermail 2.3.0
: Wed Jun 04 2014 - 14:24:13 CEST