summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2014-08-24 14:55:27 +0200
committerThomas Graf <tgraf@suug.ch>2014-08-24 14:55:27 +0200
commit6eae8530c52db1fc2c9b800e7e63b3b19b5b1e83 (patch)
treeee640164d9c36f0b0d25a4520fb30cf36ec4180d
parenta29f6da2c574bfca65a6fb7096dbb81d3d0a2905 (diff)
Fix uint64_t printf modifiers
Reported by clang. Repo compiles cleanly with clang at this point. Signed-off-by: Thomas Graf <tgraf@suug.ch>
-rw-r--r--src/out_format.c4
-rw-r--r--src/unit.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/out_format.c b/src/out_format.c
index 19c588f..84a5a2b 100644
--- a/src/out_format.c
+++ b/src/out_format.c
@@ -126,10 +126,10 @@ static char *get_token(struct element_group *g, struct element *e,
}
if (!strncasecmp(type, "rx:", 3)) {
- snprintf(buf, len, "%llu", a->a_rx_rate.r_total);
+ snprintf(buf, len, "%" PRIu64, a->a_rx_rate.r_total);
return buf;
} else if (!strncasecmp(type, "tx:", 3)) {
- snprintf(buf, len, "%llu", a->a_tx_rate.r_total);
+ snprintf(buf, len, "%" PRIu64, a->a_tx_rate.r_total);
return buf;
} else if (!strncasecmp(type, "rxrate:", 7)) {
snprintf(buf, len, "%.2f", a->a_rx_rate.r_rate);
diff --git a/src/unit.c b/src/unit.c
index 6f3c577..38fc468 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -191,7 +191,7 @@ char *unit_bytes2str(uint64_t bytes, char *buf, size_t len)
v = unit_value2str(bytes, byte_unit, &ustr, &prec);
snprintf(buf, len, "%'.*f%3s", prec, v, ustr);
} else
- snprintf(buf, len, "%llu", (unsigned long long) bytes);
+ snprintf(buf, len, "%" PRIu64, bytes);
return buf;
}
@@ -206,7 +206,7 @@ char *unit_bit2str(uint64_t bits, char *buf, size_t len)
v = unit_value2str(bits, bit_unit, &ustr, &prec);
snprintf(buf, len, "%'.*f%3s", prec, v, ustr);
} else
- snprintf(buf, len, "%llu", (unsigned long long) bits);
+ snprintf(buf, len, "%" PRIu64, bits);
return buf;
}