From 5f7724d0120417b4a4f23c916fbf55dc58881d4c Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 13 Mar 2016 19:03:18 -0400 Subject: [PATCH] Inline GetUserPropertyValue(). --- apple-ir-control.cc | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/apple-ir-control.cc b/apple-ir-control.cc index 1a7186e..91345e6 100644 --- a/apple-ir-control.cc +++ b/apple-ir-control.cc @@ -101,11 +101,6 @@ bool SynchronizePrefs() { return rv; } -CFTypeRef GetUserPropertyValue() { - return CFPreferencesCopyValue(kPrefEnabled, kPrefDomain, - kCFPreferencesAnyUser, kCFPreferencesCurrentHost); -} - io_iterator_t CreateIOServiceIterator() { CFMutableDictionaryRef matching_dict = IOServiceMatching("AppleIRController"); io_iterator_t iterator; @@ -122,7 +117,8 @@ int HandleRead() { if (!SynchronizePrefs()) return EXIT_FAILURE; - CFTypeRef user_prop = GetUserPropertyValue(); + CFTypeRef user_prop = CFPreferencesCopyValue(kPrefEnabled, kPrefDomain, + kCFPreferencesAnyUser, kCFPreferencesCurrentHost); printf("Userspace property value: %s\n", GetBooleanDescription(user_prop)); io_iterator_t iterator = CreateIOServiceIterator(); @@ -147,16 +143,6 @@ int HandleRead() { IORegistryEntryCreateCFProperty(service, kPrefEnabled, nullptr, 0)); printf("Kernel property value %s: %s\n", name, GetBooleanDescription(device_enabled.get())); - -#if 0 - ScopedCFTypeRef props; - kr = IORegistryEntryCreateCFProperties(service, props.pointer_to(), nullptr, 0); - if (kr != KERN_SUCCESS) { - ERROR("Failed to IORegistryEntryCreateCFProperties(%s) = 0x%x", name, kr); - continue; - } - CFShow(props.get()); -#endif } if (!did_find) { -- 2.43.5