time_t is "long" or "long long" (depending on the system). So it should be safe to convert it to "long long", in order to get a consistent data type on all systems. Signed-off-by: Christian Eggers <ceggers@xxxxxxx> --- src/cyclictest/cyclictest.c | 8 ++++---- src/hackbench/hackbench.c | 2 +- src/sched_deadline/cyclicdeadline.c | 6 +++--- src/signaltest/signaltest.c | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index 157047837259..8a7784e645da 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -1751,15 +1751,15 @@ static void write_stats(FILE *f, void *data) if (s->hist_array[j] == 0) continue; fprintf(f, "%s", comma ? ",\n" : "\n"); - fprintf(f, " \"%u\": %" PRIu64, j, s->hist_array[j]); + fprintf(f, " \"%u\": %ld", j, s->hist_array[j]); comma = 1; } if (comma) fprintf(f, "\n"); fprintf(f, " },\n"); - fprintf(f, " \"cycles\": %" PRIu64 ",\n", s->cycles); - fprintf(f, " \"min\": %" PRIu64 ",\n", s->min); - fprintf(f, " \"max\": %" PRIu64 ",\n", s->max); + fprintf(f, " \"cycles\": %lu,\n", s->cycles); + fprintf(f, " \"min\": %ld,\n", s->min); + fprintf(f, " \"max\": %ld,\n", s->max); fprintf(f, " \"avg\": %.2f,\n", s->avg/s->cycles); fprintf(f, " \"cpu\": %d,\n", par[i]->cpu); fprintf(f, " \"node\": %d\n", par[i]->node); diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c index 268c23233004..785b9c076256 100644 --- a/src/hackbench/hackbench.c +++ b/src/hackbench/hackbench.c @@ -505,7 +505,7 @@ int main(int argc, char *argv[]) /* Print time... */ if (timer_started) { timersub(&stop, &start, &diff); - printf("Time: %lu.%03lu\n", diff.tv_sec, diff.tv_usec/1000); + printf("Time: %lld.%03lld\n", (long long)diff.tv_sec, (long long)diff.tv_usec/1000); } else fprintf(stderr, "No measurements available\n"); diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c index ed3c960d9916..1c66a227f156 100644 --- a/src/sched_deadline/cyclicdeadline.c +++ b/src/sched_deadline/cyclicdeadline.c @@ -978,9 +978,9 @@ static void write_stats(FILE *f, void *data) for (i = 0; i < nr_threads; i++) { s = &sd[i].stat; fprintf(f, " \"%u\": {\n", i); - fprintf(f, " \"cycles\": %" PRIu64 ",\n", s->cycles); - fprintf(f, " \"min\": %" PRIu64 ",\n", s->min); - fprintf(f, " \"max\": %" PRIu64 ",\n", s->max); + fprintf(f, " \"cycles\": %lu,\n", s->cycles); + fprintf(f, " \"min\": %ld,\n", s->min); + fprintf(f, " \"max\": %ld,\n", s->max); fprintf(f, " \"avg\": %.2f\n", s->avg/s->cycles); fprintf(f, " }%s\n", i == nr_threads - 1 ? "" : ","); } diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c index b1a7e1db8302..b39e9d2a96d6 100644 --- a/src/signaltest/signaltest.c +++ b/src/signaltest/signaltest.c @@ -392,9 +392,9 @@ static void write_stats(FILE *f, void *data) for (i = 0; i < num_threads; i++) { fprintf(f, " \"%u\": {\n", i); s = &par->stats[i]; - fprintf(f, " \"cycles\": %" PRIu64 ",\n", s->cycles); - fprintf(f, " \"min\": %" PRIu64 ",\n", s->min); - fprintf(f, " \"max\": %" PRIu64 ",\n", s->max); + fprintf(f, " \"cycles\": %lu,\n", s->cycles); + fprintf(f, " \"min\": %ld,\n", s->min); + fprintf(f, " \"max\": %ld,\n", s->max); fprintf(f, " \"avg\": %.2f,\n", s->avg/s->cycles); fprintf(f, " \"cpu\": %d\n", par->cpu); fprintf(f, " }%s\n", i == num_threads - 1 ? "" : ","); -- Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler