(bluetooth/btdynamic.c) Cleanups

This commit is contained in:
Twinaphex 2015-04-03 23:55:50 +02:00
parent 6f9f4e16df
commit a980c9c7c7

View File

@ -71,9 +71,7 @@ static CFRunLoopSourceRef btstack_quit_source;
bool btstack_try_load(void) bool btstack_try_load(void)
{ {
unsigned i; unsigned i;
void *handle = NULL; void *handle = NULL;
assert(sizeof(void**) == sizeof(void(*)()));
if (btstack_tested) if (btstack_tested)
return btstack_loaded; return btstack_loaded;
@ -84,10 +82,7 @@ bool btstack_try_load(void)
handle = dylib_load("/usr/lib/libBTstack.dylib"); handle = dylib_load("/usr/lib/libBTstack.dylib");
if (!handle) if (!handle)
{
RARCH_ERR("[BTstack]: Not loaded\n");
return false; return false;
}
for (i = 0; grabbers[i].name; i ++) for (i = 0; grabbers[i].name; i ++)
{ {
@ -95,8 +90,6 @@ bool btstack_try_load(void)
if (!*grabbers[i].target) if (!*grabbers[i].target)
{ {
RARCH_ERR("[BTstack]: Symbol %s not found, not loaded.\n", grabbers[i].name);
dylib_close(handle); dylib_close(handle);
return false; return false;
} }
@ -105,7 +98,6 @@ bool btstack_try_load(void)
run_loop_init_ptr(RUN_LOOP_COCOA); run_loop_init_ptr(RUN_LOOP_COCOA);
bt_register_packet_handler_ptr(btpad_packet_handler); bt_register_packet_handler_ptr(btpad_packet_handler);
RARCH_LOG("[BTstack]: Loaded.\n");
btstack_loaded = true; btstack_loaded = true;
return true; return true;
@ -122,10 +114,7 @@ static void btstack_thread_func(void* data)
RARCH_LOG("[BTstack]: Thread started"); RARCH_LOG("[BTstack]: Thread started");
if (bt_open_ptr()) if (bt_open_ptr())
{
RARCH_LOG("[BTstack]: bt_open() failed\n");
return; return;
}
CFRunLoopSourceContext ctx = { 0, 0, 0, 0, 0, 0, 0, 0, 0, btstack_thread_stop }; CFRunLoopSourceContext ctx = { 0, 0, 0, 0, 0, 0, 0, 0, 0, btstack_thread_stop };
btstack_quit_source = CFRunLoopSourceCreate(0, 0, &ctx); btstack_quit_source = CFRunLoopSourceCreate(0, 0, &ctx);