Skip to content
Snippets Groups Projects
Commit d83f2810 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Fix NetBSD printf warnings

parent e5584a71
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@ int test__date_to_timestamp()
time_t ref_timestamp, max_timestamp;
uint32_t test_timestamp;
uint8_t buffer[16];
uint64_t val1, val2; // For time_t type unification.
struct tm tm;
// Set UTC for strftime.
......@@ -53,19 +54,22 @@ int test__date_to_timestamp()
// Some continuous loging.
if (ref_timestamp % 10000000 == 0) {
printf("%s = %"PRIu64"\n", buffer, ref_timestamp);
val1 = ref_timestamp;
printf("%s = %"PRIu64"\n", buffer, val1);
}
// Comparing results.
if (ref_timestamp != test_timestamp) {
if (ref_timestamp > test_timestamp) {
val1 = ref_timestamp;
if (ref_timestamp > test_timestamp) {
val2 = ref_timestamp - test_timestamp;
printf("%s = %"PRIu64", in - out = %"PRIu64"\n",
buffer, ref_timestamp,
ref_timestamp - test_timestamp);
buffer, val1, val2);
} else {
val2 = test_timestamp - ref_timestamp;
printf("%s = %"PRIu64", out - in = %"PRIu64"\n",
buffer, ref_timestamp,
test_timestamp - ref_timestamp);
buffer, val1, val2);
}
return -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment