Browse Source

Use matching signedness in format strings

Either cast the variable or change the format string to match the
signedness.
Christian Kellner 6 years ago
parent
commit
45ba5bc4c4
3 changed files with 6 additions and 6 deletions
  1. 1 1
      daemon/external-helper.c
  2. 3 3
      daemon/gpu-control.c
  3. 2 2
      daemon/gpuclockctl.c

+ 1 - 1
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;
 	}

+ 3 - 3
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;
 	}
 

+ 2 - 2
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;
 		}