diff --git a/include/villas/sample.h b/include/villas/sample.h index 83e4e6334..8ce3a996a 100644 --- a/include/villas/sample.h +++ b/include/villas/sample.h @@ -73,7 +73,7 @@ enum sample_flags { }; struct sample { - int sequence; /**< The sequence number of this sample. */ + uint64_t sequence; /**< The sequence number of this sample. */ int length; /**< The number of values in sample::values which are valid. */ int capacity; /**< The number of values in sample::values for which memory is reserved. */ int flags; /**< Flags are used to store binary properties of a sample. */ diff --git a/lib/formats/csv.c b/lib/formats/csv.c index a6f5b7e2f..837767f48 100644 --- a/lib/formats/csv.c +++ b/lib/formats/csv.c @@ -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%u", io->separator, s->sequence); + off += snprintf(buf + off, len - off, "%c%lu", io->separator, s->sequence); else off += snprintf(buf + off, len - off, "%cnan", io->separator); diff --git a/lib/formats/villas_human.c b/lib/formats/villas_human.c index 97dd48642..dc75d71b5 100644 --- a/lib/formats/villas_human.c +++ b/lib/formats/villas_human.c @@ -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, "(%u)", s->sequence); + off += snprintf(buf + off, len - off, "(%lu)", s->sequence); if (io->flags & SAMPLE_HAS_VALUES) { for (int i = 0; i < s->length; i++) { diff --git a/lib/hooks/drop.c b/lib/hooks/drop.c index 5111d1fa4..5193d0363 100644 --- a/lib/hooks/drop.c +++ b/lib/hooks/drop.c @@ -68,7 +68,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=%u, distance=%d", cur->sequence, dist); + debug(10, "Dropping reordered sample: sequence=%lu, distance=%d", cur->sequence, dist); } else goto ok; diff --git a/lib/hooks/restart.c b/lib/hooks/restart.c index 6a5e577f8..edc2b09f1 100644 --- a/lib/hooks/restart.c +++ b/lib/hooks/restart.c @@ -66,7 +66,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=%u, current->seq=%u)", + warn("Simulation from node %s restarted (previous->seq=%lu, current->seq=%lu)", node_name(h->node), prev->sequence, cur->sequence); cur->flags |= SAMPLE_IS_FIRST; diff --git a/lib/sample.c b/lib/sample.c index 870073dd9..573a6abb5 100644 --- a/lib/sample.c +++ b/lib/sample.c @@ -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: %d != %d\n", a->sequence, b->sequence); + printf("sequence no: %ld != %ld\n", a->sequence, b->sequence); return 2; } } diff --git a/src/villas-test-rtt.cpp b/src/villas-test-rtt.cpp index a91f33461..8b86474ec 100644 --- a/src/villas-test-rtt.cpp +++ b/src/villas-test-rtt.cpp @@ -185,7 +185,7 @@ void test_rtt() { smp_send->sequence++; - fprintf(stdout, "%10lu.%06lu%5u%10.3f%10.3f%10.3f%10.3f%10.3f\n", + fprintf(stdout, "%10lu.%06lu%5lu%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));