CPU / GPU (macOS): fixes operator priority bug

This commit is contained in:
Carter Li
2026-07-10 10:12:00 +08:00
parent 48c3b4f980
commit c5c61584d9
2 changed files with 2 additions and 4 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ static const char* detectFrequency(FFCPUResult* cpu) {
// voltage-states5-sram stores supported <frequency / voltage> pairs of pcores from the lowest to the highest
// voltage-states1-sram stores ecores'
CFIndex propLength = CFDataGetLength(freqProperty);
if (propLength == 0 || propLength % (CFIndex) sizeof(uint32_t) * 2 != 0) {
if (propLength == 0 || propLength % (CFIndex) (sizeof(uint32_t) * 2) != 0) {
return "Invalid \"voltage-states5-sram\" length";
}
+1 -3
View File
@@ -48,8 +48,6 @@ static double detectGpuTemp(const FFstrbuf* gpuName) {
}
#ifdef __aarch64__
#include "common/apple/cf_helpers.h"
#include <IOKit/IOKitLib.h>
static const char* detectFrequency(FFGPUResult* gpu) {
@@ -71,7 +69,7 @@ static const char* detectFrequency(FFGPUResult* gpu) {
// voltage-states9-sram stores supported <frequency / voltage> pairs of gpu from the lowest to the highest
CFIndex propLength = CFDataGetLength(freqProperty);
if (propLength == 0 || propLength % (CFIndex) sizeof(uint32_t) * 2 != 0) {
if (propLength == 0 || propLength % (CFIndex) (sizeof(uint32_t) * 2) != 0) {
return "Invalid \"voltage-states9-sram\" length";
}