1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Fixed compile errors with format string identifiers.

These identifiers were introduced in
eaa3f60b12
This commit is contained in:
Dennis Potter 2018-08-09 14:24:45 +02:00
parent 53e146b0ab
commit e926b9b6c2
6 changed files with 11 additions and 6 deletions

View file

@ -46,7 +46,7 @@ static size_t csv_sprint_single(struct io *io, char *buf, size_t len, struct sam
off += snprintf(buf + off, len - off, "%cnan", io->separator);
if (io->flags & SAMPLE_HAS_SEQUENCE)
off += snprintf(buf + off, len - off, "%c%llu", io->separator, s->sequence);
off += snprintf(buf + off, len - off, "%c%" PRIu64, io->separator, s->sequence);
else
off += snprintf(buf + off, len - off, "%cnan", io->separator);

View file

@ -45,7 +45,7 @@ static size_t villas_human_sprint_single(struct io *io, char *buf, size_t len, s
off += snprintf(buf + off, len - off, "%+e", time_delta(&s->ts.origin, &s->ts.received));
if (io->flags & SAMPLE_HAS_SEQUENCE)
off += snprintf(buf + off, len - off, "(%llu)", s->sequence);
off += snprintf(buf + off, len - off, "(%" PRIu64 ")", s->sequence);
if (io->flags & SAMPLE_HAS_VALUES) {
for (int i = 0; i < s->length; i++) {

View file

@ -24,6 +24,8 @@
* @{
*/
#include <inttypes.h>
#include <villas/hook.h>
#include <villas/plugin.h>
#include <villas/stats.h>
@ -68,7 +70,7 @@ static int drop_read(struct hook *h, struct sample *smps[], unsigned *cnt)
if (dist <= 0) {
cur->flags |= SAMPLE_IS_REORDERED;
debug(10, "Dropping reordered sample: sequence=%llu, distance=%d", cur->sequence, dist);
debug(10, "Dropping reordered sample: sequence=%" PRIu64 ", distance=%d", cur->sequence, dist);
}
else
goto ok;

View file

@ -24,6 +24,8 @@
* @{
*/
#include <inttypes.h>
#include <villas/hook.h>
#include <villas/plugin.h>
#include <villas/node.h>
@ -66,7 +68,7 @@ static int restart_read(struct hook *h, struct sample *smps[], unsigned *cnt)
if (prev) {
/* A wrap around of the sequence no should not be treated as a simulation restart */
if (cur->sequence == 0 && prev->sequence <= (int) (UINT32_MAX - 128)) {
warn("Simulation from node %s restarted (previous->seq=%llu, current->seq=%llu)",
warn("Simulation from node %s restarted (previous->seq=%" PRIu64 ", current->seq=%" PRIu64 ")",
node_name(h->node), prev->sequence, cur->sequence);
cur->flags |= SAMPLE_IS_FIRST;

View file

@ -215,7 +215,7 @@ int sample_cmp(struct sample *a, struct sample *b, double epsilon, int flags)
/* Compare sequence no */
if (flags & SAMPLE_HAS_SEQUENCE) {
if (a->sequence != b->sequence) {
printf("sequence no: %lld != %lld\n", a->sequence, b->sequence);
printf("sequence no: %" PRIu64 " != %" PRIu64 "\n", a->sequence, b->sequence);
return 2;
}
}

View file

@ -26,6 +26,7 @@
#include <unistd.h>
#include <ctype.h>
#include <sys/stat.h>
#include <inttypes.h>
#include <iostream>
#include <villas/config.h>
@ -185,7 +186,7 @@ void test_rtt() {
smp_send->sequence++;
fprintf(stdout, "%10lu.%06lu%5llu%10.3f%10.3f%10.3f%10.3f%10.3f\n",
fprintf(stdout, "%10lu.%06lu%5" PRIu64 "%10.3f%10.3f%10.3f%10.3f%10.3f\n",
recv.tv_sec, recv.tv_nsec / 1000, smp_send->sequence,
1e3 * rtt, 1e3 * hist.lowest, 1e3 * hist.highest,
1e3 * hist_mean(&hist), 1e3 * hist_stddev(&hist));