Commit c8fa4ed3 authored by Dominik Charousset's avatar Dominik Charousset

Fix format-nonliteral warnings

parent 2c194443
...@@ -30,12 +30,12 @@ using namespace caf; ...@@ -30,12 +30,12 @@ using namespace caf;
namespace { namespace {
template <class... Ts> #define PRINT(format, ...) \
void print(const char* format, Ts... xs) { { \
char buf[200]; char buf[200]; \
snprintf(buf, 200, format, xs...); snprintf(buf, 200, format, __VA_ARGS__); \
CAF_MESSAGE(buf); CAF_MESSAGE(buf); \
} }
struct fixture { struct fixture {
inbound_path::stats_t x; inbound_path::stats_t x;
...@@ -53,11 +53,11 @@ struct fixture { ...@@ -53,11 +53,11 @@ struct fixture {
int32_t t = total_time; int32_t t = total_time;
int32_t m = t > 0 ? std::max((c * n) / t, 1) : 1; int32_t m = t > 0 ? std::max((c * n) / t, 1) : 1;
int32_t b = t > 0 ? std::max((d * n) / t, 1) : 1; int32_t b = t > 0 ? std::max((d * n) / t, 1) : 1;
print("with a cycle C = %ldns, desied complexity D = %ld,", c, d); PRINT("with a cycle C = %dns, desied complexity D = %d,", c, d);
print("number of items N = %ld, and time delta t = %ld:", n, t); PRINT("number of items N = %d, and time delta t = %d:", n, t);
print("- throughput M = max(C * N / t, 1) = max(%ld * %ld / %ld, 1) = %ld", PRINT("- throughput M = max(C * N / t, 1) = max(%d * %d / %d, 1) = %d",
c, n, t, m); c, n, t, m);
print("- items/batch B = max(D * N / t, 1) = max(%ld * %ld / %ld, 1) = %ld", PRINT("- items/batch B = max(D * N / t, 1) = max(%d * %d / %d, 1) = %d",
d, n, t, b); d, n, t, b);
auto cr = x.calculate(timespan(c), timespan(d)); auto cr = x.calculate(timespan(c), timespan(d));
CAF_CHECK_EQUAL(cr.items_per_batch, b); CAF_CHECK_EQUAL(cr.items_per_batch, b);
......
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