Global (Linux): silence some compiler warnings

This commit is contained in:
李通洲
2024-06-05 16:03:10 +08:00
parent f2ff20d69c
commit b308ded1e1
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -115,13 +115,13 @@ static uint8_t getNumCores(FFstrbuf* basePath, FFstrbuf* buffer)
bool ok = ffReadFileBuffer(basePath->chars, buffer);
ffStrbufSubstrBefore(basePath, baseLen);
if (ok)
return (uint8_t) ffStrbufCountC(buffer, ' ') + 1;
return (uint8_t) (ffStrbufCountC(buffer, ' ') + 1);
ffStrbufAppendS(basePath, "/related_cpus");
ok = ffReadFileBuffer(basePath->chars, buffer);
ffStrbufSubstrBefore(basePath, baseLen);
if (ok)
return (uint8_t) ffStrbufCountC(buffer, ' ') + 1;
return (uint8_t) (ffStrbufCountC(buffer, ' ') + 1);
return 0;
}
+1 -1
View File
@@ -45,7 +45,7 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
uint32_t iStart = ffStrbufFirstIndexS(&result->version, "Version ");
if (iStart < result->version.length)
{
iStart += strlen("Version");
iStart += (uint32_t) strlen("Version");
uint32_t iEnd = ffStrbufNextIndexC(&result->version, iStart + 1, ':');
ffStrbufSubstrBefore(&result->version, iEnd);
ffStrbufSubstrAfter(&result->version, iStart);
@@ -320,7 +320,7 @@ static void detectSt(FFTerminalFontResult* terminalFont, const FFTerminalResult*
uint32_t sIndex = ffStrbufNextIndexS(&font, index + 1, "size=");
if (sIndex != font.length)
{
sIndex += strlen("size=");
sIndex += (uint32_t) strlen("size=");
uint32_t sIndexEnd = ffStrbufNextIndexC(&font, sIndex, ':');
ffStrbufSetNS(&size, sIndexEnd - sIndex, font.chars + sIndex);
}
+1 -1
View File
@@ -334,7 +334,7 @@ static const char* detectWifiWithIoctls(FFlist* result)
#endif
const char* ffDetectWifi(FFlist* result)
const char* ffDetectWifi(FF_MAYBE_UNUSED FFlist* result)
{
#ifdef FF_HAVE_LIBNM
detectWifiWithLibnm(result);