mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
@@ -712,7 +712,7 @@ static bool detectFrequency(FFCPUResult* cpu, const FFCPUOptions* options) {
|
||||
while ((p = memmem(p, cpuinfo->length - (uint32_t) (p - cpuinfo->chars), "\nphysical id\t:", strlen("\nphysical id\t:")))) {
|
||||
p += strlen("\nphysical id\t:");
|
||||
char* pend;
|
||||
unsigned long long id = strtoul(p, &pend, 10);
|
||||
unsigned long id = strtoul(p, &pend, 10);
|
||||
if (__builtin_expect(id > 64, false)) { // Do 129-socket boards exist?
|
||||
high |= 1ULL << (id - 64);
|
||||
} else {
|
||||
|
||||
@@ -426,7 +426,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
|
||||
ffStrbufAppendS(deviceDir, "/revision");
|
||||
if (ffReadFileBuffer(deviceDir->chars, buffer)) {
|
||||
char* pend;
|
||||
uint64_t revision = strtoul(buffer->chars, &pend, 16);
|
||||
uint32_t revision = (uint32_t) strtoul(buffer->chars, &pend, 16);
|
||||
if (pend != buffer->chars) {
|
||||
ffGPUQueryAmdGpuName((uint16_t) deviceId, (uint8_t) revision, gpu);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ static int walkDevTree(di_node_t node, [[maybe_unused]] di_minor_t minor, FFlist
|
||||
gpu->coreUsage = FF_GPU_CORE_USAGE_UNSET;
|
||||
gpu->type = FF_GPU_TYPE_UNKNOWN;
|
||||
gpu->dedicated.total = gpu->dedicated.used = gpu->shared.total = gpu->shared.used = FF_GPU_VMEM_SIZE_UNSET;
|
||||
gpu->deviceId = strtoul(di_bus_addr(node), nullptr, 16);
|
||||
gpu->deviceId = (uint64_t) strtoull(di_bus_addr(node), nullptr, 16);
|
||||
gpu->frequency = FF_GPU_FREQUENCY_UNSET;
|
||||
gpu->pcieSpeed = FF_GPU_PCIE_SPEED_UNSET;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ static void parsePhysicalDisk(int dfd, const char* devName, FFPhysicalDiskOption
|
||||
ssize_t fileSize = ffReadFileDataRelative(dfd, "size", ARRAY_SIZE(blkSize) - 1, blkSize);
|
||||
if (fileSize > 0) {
|
||||
blkSize[fileSize] = 0;
|
||||
size = (uint64_t) strtoul(blkSize, nullptr, 10) * 512;
|
||||
size = (uint64_t) strtoull(blkSize, nullptr, 10) * 512;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ static void appendDevice(
|
||||
if (size)
|
||||
{
|
||||
char* unit = nullptr;
|
||||
device->size = strtoul(size.UTF8String, &unit, 10);
|
||||
device->size = (uint64_t) strtoull(size.UTF8String, &unit, 10);
|
||||
if (*unit == ' ') ++unit;
|
||||
|
||||
switch (*unit)
|
||||
|
||||
@@ -19,11 +19,11 @@ static const char* detectByProcMeminfo(FFlist* result) {
|
||||
|
||||
char* token = nullptr;
|
||||
if ((token = strstr(buf, "SwapTotal:")) != nullptr) {
|
||||
swapTotal = strtoul(token + strlen("SwapTotal:"), nullptr, 10);
|
||||
swapTotal = (uint64_t) strtoull(token + strlen("SwapTotal:"), nullptr, 10);
|
||||
}
|
||||
|
||||
if ((token = strstr(buf, "SwapFree:")) != nullptr) {
|
||||
swapFree = strtoul(token + strlen("SwapFree:"), nullptr, 10);
|
||||
swapFree = (uint64_t) strtoull(token + strlen("SwapFree:"), nullptr, 10);
|
||||
}
|
||||
|
||||
FFSwapResult* swap = FF_LIST_ADD(FFSwapResult, *result);
|
||||
|
||||
Reference in New Issue
Block a user