We have a couple of instances which assume __u64 is an unsigned long,
which is not always the case.
For the printf() formats, we would ideally used PRId64, but on ll64
platforms, it looks this macro is broken: it expands to "ld", where
__u64 is an unsigned long long. So, do an explicit cast to unsigned long
long instead, and just use %lld.
With this change, we can compile without warnings on amd64, armhf and
powerpc64le.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
if (cfg.format == 0)
nrts = argconfig_parse_comma_sep_array(cfg.eilbrts, (int *)eilbrts.f0, ARRAY_SIZE(eilbrts.f0));
else if (cfg.format == 1)
- nrts = argconfig_parse_comma_sep_array_long(cfg.eilbrts, (__u64 *)eilbrts.f1, ARRAY_SIZE(eilbrts.f1));
+ nrts = argconfig_parse_comma_sep_array_long(cfg.eilbrts, (unsigned long long *)eilbrts.f1, ARRAY_SIZE(eilbrts.f1));
else {
fprintf(stderr, "invalid format\n");
err = -EINVAL;
for (i = 0; i < 64; i++)
printf("Bucket %2d: %u\n", i, stats->bucket_19[i]);
- printf("\nAverage latency statistics %lld\n", stats->average);
+ printf("\nAverage latency statistics %" PRIu64 "\n",
+ (uint64_t)stats->average);
}
ts = *localtime(&t);
strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &ts);
printf(" %-20s ", buf);
- printf("%-5lld ", fwActivHis.fwActHisEnt[i].powCycleCnt);
+ printf("%-5" PRId64 " ",
+ (uint64_t)fwActivHis.fwActHisEnt[i].powCycleCnt);
memset(prev_fw, 0, sizeof(prev_fw));
memcpy(prev_fw, fwActivHis.fwActHisEnt[i].previousFW, sizeof(fwActivHis.fwActHisEnt[i].previousFW));