Global: formats code [ci skip]

This commit is contained in:
李通洲
2026-04-12 19:19:55 +08:00
parent 4dc5033c80
commit 679def253d
9 changed files with 51 additions and 54 deletions
+7 -2
View File
@@ -164,7 +164,12 @@ static bool parseBattery(int dfd, const char* id, FFBatteryOptions* options, FFl
}
FF_DEBUG("Battery \"%s\": Capacity: %.2f%%, Status: \"%x\", Time Remaining: %d seconds, Temperature: %.1f°C, Cycle Count: %u",
id, result->capacity, result->status, result->timeRemaining, result->temperature, result->cycleCount);
id,
result->capacity,
result->status,
result->timeRemaining,
result->temperature,
result->cycleCount);
return true;
}
@@ -189,7 +194,7 @@ const char* ffDetectBattery(FFBatteryOptions* options, FFlist* results) {
}
if (acConnected) {
FF_LIST_FOR_EACH(FFBatteryResult, batt, *results) {
FF_LIST_FOR_EACH (FFBatteryResult, batt, *results) {
batt->status |= FF_BATTERY_STATUS_AC_CONNECTED;
}
}
+1 -1
View File
@@ -18,7 +18,7 @@ typedef struct FFSmbiosSystemInfo {
uint8_t ClockSeqLow;
uint8_t Node[6];
} FF_A_PACKED UUID; // varies
uint8_t WakeUpType; // enum
uint8_t WakeUpType; // enum
// 2.4+
uint8_t SKUNumber; // string
@@ -78,13 +78,14 @@ const char* ffDetectPhysicalDisk(FFlist* result, FFPhysicalDiskOptions* options)
if (deviceName.length == 0) {
FF_CFTYPE_AUTO_RELEASE CFDictionaryRef deviceCharacteristics = IORegistryEntryCreateCFProperty(entryPhysical, CFSTR(kIOPropertyDeviceCharacteristicsKey), NULL, kNilOptions);
if (deviceCharacteristics) {
if (ffCfDictGetString(deviceCharacteristics, CFSTR(kIOPropertyVendorNameKey), &deviceName) == NULL &&deviceName.length > 0) {
if (ffCfDictGetString(deviceCharacteristics, CFSTR(kIOPropertyVendorNameKey), &deviceName) == NULL && deviceName.length > 0) {
ffStrbufAppendC(&deviceName, ' ');
}
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreate();
if (ffCfDictGetString(deviceCharacteristics, CFSTR(kIOPropertyProductNameKey), &name) == NULL)
if (ffCfDictGetString(deviceCharacteristics, CFSTR(kIOPropertyProductNameKey), &name) == NULL) {
ffStrbufAppend(&deviceName, &name);
}
}
}