mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
macOS: fix compile warnings
This commit is contained in:
@@ -11,7 +11,7 @@ static void calculatePercentage(FFMemoryStorage* storage)
|
||||
if(storage->bytesTotal == 0)
|
||||
storage->percentage = 0;
|
||||
else
|
||||
storage->percentage = (uint8_t) ((storage->bytesUsed / (long double) storage->bytesTotal) * 100.0);
|
||||
storage->percentage = (uint8_t) (((long double) storage->bytesUsed / (long double) storage->bytesTotal) * 100.0);
|
||||
}
|
||||
|
||||
const FFMemoryResult* ffDetectMemory()
|
||||
|
||||
@@ -11,7 +11,7 @@ uint32_t ffDetectProcesses(FFinstance* instance, FFstrbuf* error)
|
||||
|
||||
if(sysctl(request, sizeof(request) / sizeof(*request), NULL, &length, NULL, 0) != 0)
|
||||
{
|
||||
ffStrbufAppend(error, "sysctl() failed");
|
||||
ffStrbufAppendS(error, "sysctl() failed");
|
||||
return 0;
|
||||
}
|
||||
return (uint32_t)(length / sizeof(struct kinfo_proc));
|
||||
|
||||
@@ -207,7 +207,7 @@ static const char *smcReadValue(io_connect_t conn, const UInt32Char_t key, doubl
|
||||
uint64_t tmp = 0;
|
||||
for (uint32_t i = 0; i < val.dataSize; i++)
|
||||
tmp += (uint64_t)((uint8_t)(val.bytes[i]) * pow(256, val.dataSize - 1 - i));
|
||||
*value = tmp;
|
||||
*value = (double)tmp;
|
||||
}
|
||||
else if (strcmp(val.dataType, kDataTypeFlt) == 0)
|
||||
{
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ static void printFolder(FFinstance* instance, FFDiskResult* folder)
|
||||
});
|
||||
}
|
||||
|
||||
uint8_t percentage = (uint8_t) ((folder->used / (long double) folder->total) * 100.0);
|
||||
uint8_t percentage = (uint8_t) (((long double) folder->used / (long double) folder->total) * 100.0);
|
||||
|
||||
FFstrbuf usedPretty;
|
||||
ffStrbufInit(&usedPretty);
|
||||
|
||||
Reference in New Issue
Block a user