From 4d569db0fd279af762791ba895c50ec71e5a6901 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Sat, 17 Sep 2022 02:58:32 +0800 Subject: [PATCH] refactor: use MACH_PORT_NULL instead of magic number 0 --- src/detection/battery/battery_apple.c | 2 +- src/detection/gpu/gpu_apple.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detection/battery/battery_apple.c b/src/detection/battery/battery_apple.c index f3d98c071..3af71bf56 100644 --- a/src/detection/battery/battery_apple.c +++ b/src/detection/battery/battery_apple.c @@ -13,7 +13,7 @@ const char* ffDetectBatteryImpl(FFinstance* instance, FFlist* results) return "IOServiceMatching(\"AppleSmartBattery\") failed"; io_iterator_t iterator; - if(IOServiceGetMatchingServices(0, matchDict, &iterator) != kIOReturnSuccess) + if(IOServiceGetMatchingServices(MACH_PORT_NULL, matchDict, &iterator) != kIOReturnSuccess) return "IOServiceGetMatchingServices() failed"; io_registry_entry_t registryEntry; diff --git a/src/detection/gpu/gpu_apple.c b/src/detection/gpu/gpu_apple.c index e7e58116b..745704457 100644 --- a/src/detection/gpu/gpu_apple.c +++ b/src/detection/gpu/gpu_apple.c @@ -11,7 +11,7 @@ const char* ffDetectGPUImpl(FFlist* gpus, const FFinstance* instance) CFMutableDictionaryRef matchDict = IOServiceMatching(kIOAcceleratorClassName); io_iterator_t iterator; - if(IOServiceGetMatchingServices(0, matchDict, &iterator) != kIOReturnSuccess) + if(IOServiceGetMatchingServices(MACH_PORT_NULL, matchDict, &iterator) != kIOReturnSuccess) return "IOServiceGetMatchingServices() failed"; io_registry_entry_t registryEntry;