From 903ecf37f7786f1f846fa1f80c68376635bcdaae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 3 May 2024 10:07:16 +0800 Subject: [PATCH] Chore: silience some warnings --- src/detection/gpu/gpu_linux.c | 2 +- src/detection/publicip/publicip.c | 2 +- src/util/edidHelper.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c index 65566cb8a..ff4decbba 100644 --- a/src/detection/gpu/gpu_linux.c +++ b/src/detection/gpu/gpu_linux.c @@ -258,7 +258,7 @@ FF_MAYBE_UNUSED static const char* detectAsahi(FFlist* gpus, FFstrbuf* buffer, F { uint32_t index = ffStrbufFirstIndexS(buffer, "apple,agx-t"); if (index == buffer->length) return "display-subsystem?"; - index += strlen("apple,agx-t"); + index += (uint32_t) strlen("apple,agx-t"); FFGPUResult* gpu = (FFGPUResult*)ffListAdd(gpus); gpu->deviceId = strtoul(buffer->chars + index, NULL, 10); diff --git a/src/detection/publicip/publicip.c b/src/detection/publicip/publicip.c index b5038e66e..d144f7219 100644 --- a/src/detection/publicip/publicip.c +++ b/src/detection/publicip/publicip.c @@ -28,7 +28,7 @@ void ffPreparePublicIp(FFPublicIpOptions* options) fputs("Error: only http: protocol is supported. Use `Command` module with `curl` if needed\n", stderr); exit(1); } - ffStrbufSubstrAfter(&host, hostStartIndex + (strlen("://") - 1)); + ffStrbufSubstrAfter(&host, hostStartIndex + (uint32_t) (strlen("://") - 1)); } uint32_t pathStartIndex = ffStrbufFirstIndexC(&host, '/'); diff --git a/src/util/edidHelper.c b/src/util/edidHelper.c index 7724c6136..adf621197 100644 --- a/src/util/edidHelper.c +++ b/src/util/edidHelper.c @@ -73,8 +73,8 @@ void ffEdidGetSerialAndManufactureDate(const uint8_t edid[128], uint32_t* serial { if (edid[17] > 0 && edid[17] < 0xFF) { - *year = edid[17] + 1990; - *week = edid[16]; + *year = (uint16_t) edid[17] + 1990; + *week = (uint16_t) edid[16]; if (*week == 0xFF) *week = 0; } else