#include <stdlib.h>
#include <time.h>
#include <string.h>
+#include <inttypes.h>
#include <libvirt/libvirt-admin.h>
static const char *
break;
case VIR_TYPED_PARAM_LLONG:
- ret = asprintf(&str, "%lld", item->value.l);
+ ret = asprintf(&str, "%" PRId64, (int64_t)item->value.l);
break;
case VIR_TYPED_PARAM_ULLONG:
- ret = asprintf(&str, "%llu", item->value.ul);
+ ret = asprintf(&str, "%" PRIu64, (uint64_t)item->value.ul);
break;
case VIR_TYPED_PARAM_DOUBLE:
if (!(timestr = exampleGetTimeStr(virAdmClientGetTimestamp(clnt))))
goto cleanup;
- printf("%-15s: %llu\n", "id", virAdmClientGetID(clnt));
+ printf("%-15s: %" PRIu64 "\n", "id", (uint64_t)virAdmClientGetID(clnt));
printf("%-15s: %s\n", "connection_time", timestr);
printf("%-15s: %s\n", "transport",
exampleTransportToString(virAdmClientGetTransport(clnt)));
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
+#include <inttypes.h>
#include <libvirt/libvirt-admin.h>
static const char *
exampleGetTimeStr(virAdmClientGetTimestamp(client))))
goto cleanup;
- printf(" %-5llu %-15s %-15s\n", id,
+ printf(" %-5" PRIu64 " %-15s %-15s\n", (uint64_t)id,
exampleTransportToString(transport), timestr);
free(timestr);
}
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
+#include <inttypes.h>
static bool debug;
static bool run_top;
return;
}
- DEBUG("now_params=%llu then_params=%llu now=%llu then=%llu",
- now_params[pos].value.ul, then_params[pos].value.ul, now, then);
+ DEBUG("now_params=%" PRIu64 " then_params=%" PRIu64
+ " now=%" PRIu64 " then=%" PRIu64,
+ (uint64_t)now_params[pos].value.ul,
+ (uint64_t)then_params[pos].value.ul,
+ (uint64_t)now, (uint64_t)then);
/* @now_params and @then_params are in nanoseconds, @now and @then are
* in microseconds. In ideal world, we would translate them both into