Chore: introduce macro ARRAY_SIZE

This commit is contained in:
李通洲
2024-10-18 16:15:48 +08:00
parent 5497cb64c2
commit b257134d74
67 changed files with 142 additions and 135 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ void ffPrintCPU(FFCPUOptions* options)
if (options->showPeCoreCount)
{
uint32_t typeCount = 0;
while (cpu.coreTypes[typeCount].count != 0 && typeCount < sizeof(cpu.coreTypes) / sizeof(cpu.coreTypes[0])) typeCount++;
while (cpu.coreTypes[typeCount].count != 0 && typeCount < ARRAY_SIZE(cpu.coreTypes)) typeCount++;
if (typeCount > 0)
{
qsort(cpu.coreTypes, typeCount, sizeof(cpu.coreTypes[0]), (void*) sortCores);