From 45ba5bc4c40011d0ea98cb02aa9c1db73a1d4b8a Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Thu, 21 Mar 2019 13:50:26 +0100 Subject: [PATCH] Use matching signedness in format strings Either cast the variable or change the format string to match the signedness. --- daemon/external-helper.c | 2 +- daemon/gpu-control.c | 6 +++--- daemon/gpuclockctl.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/daemon/external-helper.c b/daemon/external-helper.c index af0daf8..52361f9 100644 --- a/daemon/external-helper.c +++ b/daemon/external-helper.c @@ -133,7 +133,7 @@ int run_external_process(const char *const *exec_args, char buffer[EXTERNAL_BUFF if (!WIFEXITED(status)) { LOG_ERROR("Child process '%s' exited abnormally\n", exec_args[0]); } else if (WEXITSTATUS(status) != 0) { - LOG_ERROR("External process failed with exit code %u\n", WEXITSTATUS(status)); + LOG_ERROR("External process failed with exit code %d\n", WEXITSTATUS(status)); LOG_ERROR("Output was: %s\n", buffer ? buffer : internal); return -1; } diff --git a/daemon/gpu-control.c b/daemon/gpu-control.c index 7aef5ef..147cdd1 100644 --- a/daemon/gpu-control.c +++ b/daemon/gpu-control.c @@ -62,9 +62,9 @@ enum GPUVendor gamemode_get_gpu_vendor(long device) LOG_ERROR("Unknown vendor value (0x%04x) found, cannot apply optimisations!\n", (unsigned int)vendor); LOG_ERROR("Known values are: 0x%04x (NVIDIA) 0x%04x (AMD) 0x%04x (Intel)\n", - Vendor_NVIDIA, - Vendor_AMD, - Vendor_Intel); + (unsigned int)Vendor_NVIDIA, + (unsigned int)Vendor_AMD, + (unsigned int)Vendor_Intel); return Vendor_Invalid; } diff --git a/daemon/gpuclockctl.c b/daemon/gpuclockctl.c index b59340c..73c17c5 100644 --- a/daemon/gpuclockctl.c +++ b/daemon/gpuclockctl.c @@ -414,7 +414,7 @@ int main(int argc, char *argv[]) break; default: LOG_ERROR("Currently unsupported GPU vendor 0x%04x, doing nothing!\n", - (short)info.vendor); + (unsigned short)info.vendor); break; } @@ -454,7 +454,7 @@ int main(int argc, char *argv[]) break; default: LOG_ERROR("Currently unsupported GPU vendor 0x%04x, doing nothing!\n", - (short)info.vendor); + (unsigned short)info.vendor); print_usage_and_exit(); break; }