Commit c8fa4ed3 authored by Dominik Charousset's avatar Dominik Charousset

Fix format-nonliteral warnings

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