FFstrbuf: change ffStrbufToUInt16 to more general function ffStrbufToUInt

This commit is contained in:
李通洲
2023-09-26 00:09:56 +08:00
parent a4bc07cba5
commit e4c1ec916b
6 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ const char* ffDetectChassis(FFChassisResult* result)
if(result->type.length)
{
const char* typeStr = ffChassisTypeToString(ffStrbufToUInt16(&result->type, 9999));
const char* typeStr = ffChassisTypeToString((uint32_t) ffStrbufToUInt(&result->type, 9999));
if(typeStr)
ffStrbufSetS(&result->type, typeStr);
}
+1 -1
View File
@@ -128,7 +128,7 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
const char* error = parseCpuInfo(cpu, &physicalCoresBuffer, &cpuMHz, &cpuIsa, &cpuUarch);
if (error) return error;
cpu->coresPhysical = ffStrbufToUInt16(&physicalCoresBuffer, 1);
cpu->coresPhysical = (uint16_t) ffStrbufToUInt(&physicalCoresBuffer, 1);
cpu->coresLogical = (uint16_t) get_nprocs_conf();
cpu->coresOnline = (uint16_t) get_nprocs();
@@ -80,9 +80,9 @@ static bool detectWithGetprop(FFDisplayServerResult* ds)
ffStrbufContainC(&buffer, ','))
{
// 1440,3200,560 => width,height,ppi
uint32_t width = ffStrbufToUInt16(&buffer, 0);
uint32_t width = (uint32_t) ffStrbufToUInt(&buffer, 0);
ffStrbufSubstrAfterFirstC(&buffer, ',');
uint32_t height = ffStrbufToUInt16(&buffer, 0);
uint32_t height = (uint32_t) ffStrbufToUInt(&buffer, 0);
return ffdsAppendDisplay(ds,
width,
height,