Commit 188a929c authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov

ioping: use c99 macro from inttypes.h for printing 64-bit values

Signed-off-by: default avatarKonstantin Khlebnikov <koct9i@gmail.com>
parent 34fcb939
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <inttypes.h>
#include <getopt.h> #include <getopt.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
...@@ -341,12 +342,12 @@ long long parse_time(const char *str) ...@@ -341,12 +342,12 @@ long long parse_time(const char *str)
return parse_suffix(str, time_suffix); return parse_suffix(str, time_suffix);
} }
void print_suffix(long long val, struct suffix *sfx) void print_suffix(int64_t val, struct suffix *sfx)
{ {
while (val < sfx->mul && sfx->mul > 1) while (val < sfx->mul && sfx->mul > 1)
sfx++; sfx++;
if (sfx->mul == 1) if (sfx->mul == 1)
printf("%lld", val); printf("%" PRId64, val);
else else
printf("%.1f", val * 1.0 / sfx->mul); printf("%.1f", val * 1.0 / sfx->mul);
if (*sfx->txt) if (*sfx->txt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment