From f5515176825b1d0fc3b5ed6450b1f29510f955d5 Mon Sep 17 00:00:00 2001 From: Sitsofe Wheeler Date: Thu, 20 Aug 2020 07:08:46 +0100 Subject: [PATCH 1/1] windows: fix wrong format strings Found by Windows clang which mysteriously seemed able to ignore -Wno-format... (As some format strings are longer than the wrapping width, make an exception and avoid splitting/preserve them to make greping easier) Signed-off-by: Sitsofe Wheeler --- os/windows/cpu-affinity.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/os/windows/cpu-affinity.c b/os/windows/cpu-affinity.c index 69997b24..4ac32ed1 100644 --- a/os/windows/cpu-affinity.c +++ b/os/windows/cpu-affinity.c @@ -83,7 +83,7 @@ unsigned int cpus_online(void) static void print_mask(os_cpu_mask_t *cpumask) { for (int i = 0; i < FIO_CPU_MASK_ROWS; i++) - dprint(FD_PROCESS, "cpumask[%d]=%lu\n", i, cpumask->row[i]); + dprint(FD_PROCESS, "cpumask[%d]=%" PRIu64 "\n", i, cpumask->row[i]); } /* Return the index of the least significant set CPU in cpumask or -1 if no @@ -99,7 +99,7 @@ int first_set_cpu(os_cpu_mask_t *cpumask) int row_first_cpu; row_first_cpu = __builtin_ffsll(cpumask->row[row]) - 1; - dprint(FD_PROCESS, "row_first_cpu=%d cpumask->row[%d]=%lu\n", + dprint(FD_PROCESS, "row_first_cpu=%d cpumask->row[%d]=%" PRIu64 "\n", row_first_cpu, row, cpumask->row[row]); if (row_first_cpu > -1) { mask_first_cpu = cpus_offset + row_first_cpu; @@ -136,7 +136,7 @@ static int last_set_cpu(os_cpu_mask_t *cpumask) row_last_cpu++; } - dprint(FD_PROCESS, "row_last_cpu=%d cpumask->row[%d]=%lu\n", + dprint(FD_PROCESS, "row_last_cpu=%d cpumask->row[%d]=%" PRIu64 "\n", row_last_cpu, row, cpumask->row[row]); if (row_last_cpu > -1) { mask_last_cpu = cpus_offset + row_last_cpu; @@ -213,13 +213,17 @@ static int mask_to_group_mask(os_cpu_mask_t *cpumask, int *processor_group, uint needed_shift = FIO_CPU_MASK_STRIDE - bit_offset; needed_mask_shift = FIO_CPU_MASK_STRIDE - needed; needed_mask = (uint64_t)-1 >> needed_mask_shift; - dprint(FD_PROCESS, "bit_offset=%d end=%d needed=%d needed_shift=%d needed_mask=%ld needed_mask_shift=%d\n", bit_offset, end, needed, needed_shift, needed_mask, needed_mask_shift); + dprint(FD_PROCESS, + "bit_offset=%d end=%d needed=%d needed_shift=%d needed_mask=%" PRIu64 "needed_mask_shift=%d\n", + bit_offset, end, needed, needed_shift, needed_mask, + needed_mask_shift); group_cpumask |= (cpumask->row[row + 1] & needed_mask) << needed_shift; } group_cpumask &= (uint64_t)-1 >> (FIO_CPU_MASK_STRIDE - group_size); /* Return group and mask */ - dprint(FD_PROCESS, "Returning group=%d group_mask=%lu\n", group, group_cpumask); + dprint(FD_PROCESS, "Returning group=%d group_mask=%" PRIu64 "\n", + group, group_cpumask); *processor_group = group; *affinity_mask = group_cpumask; @@ -329,7 +333,7 @@ int fio_getaffinity(int pid, os_cpu_mask_t *mask) goto err; } if (!GetProcessAffinityMask(handle, &process_mask, &system_mask)) { - log_err("%s: GetProcessAffinityMask() failed for pid\n", + log_err("%s: GetProcessAffinityMask() failed for pid %d\n", __func__, pid); goto err; } -- 2.25.1