]> code.delx.au - pulseaudio/commitdiff
bluetooth: Improve code and log readability
authorJoão Paulo Rechi Vita <jprvita@openbossa.org>
Wed, 27 Mar 2013 13:45:33 +0000 (10:45 -0300)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Mon, 3 Jun 2013 19:08:39 +0000 (00:38 +0530)
This commit makes the code cleaner, avoiding unnecessary line breaks. It
also changes the debug message elements order, to make it look more
natural ("path, interface, member" instead of "interface, path,
member").

src/modules/bluetooth/bluetooth-util.c

index 81cbf9bd65a8afe001b9d1683f7f9c10de8ffae1..c15ecd14fd418b3fca73b7aa570ab0c5878f322c 100644 (file)
@@ -1606,16 +1606,16 @@ static DBusHandlerResult endpoint_handler(DBusConnection *c, DBusMessage *m, voi
     struct pa_bluetooth_discovery *y = userdata;
     DBusMessage *r = NULL;
     DBusError e;
-    const char *path;
+    const char *path, *interface, *member;
 
     pa_assert(y);
 
-    pa_log_debug("dbus: interface=%s, path=%s, member=%s\n",
-            dbus_message_get_interface(m),
-            dbus_message_get_path(m),
-            dbus_message_get_member(m));
-
     path = dbus_message_get_path(m);
+    interface = dbus_message_get_interface(m);
+    member = dbus_message_get_member(m);
+
+    pa_log_debug("dbus: path=%s, interface=%s, member=%s", path, interface, member);
+
     dbus_error_init(&e);
 
     if (!pa_streq(path, A2DP_SOURCE_ENDPOINT) && !pa_streq(path, A2DP_SINK_ENDPOINT) && !pa_streq(path, HFP_AG_ENDPOINT) &&
@@ -1626,10 +1626,7 @@ static DBusHandlerResult endpoint_handler(DBusConnection *c, DBusMessage *m, voi
         const char *xml = ENDPOINT_INTROSPECT_XML;
 
         pa_assert_se(r = dbus_message_new_method_return(m));
-        pa_assert_se(dbus_message_append_args(
-                                 r,
-                                 DBUS_TYPE_STRING, &xml,
-                                 DBUS_TYPE_INVALID));
+        pa_assert_se(dbus_message_append_args(r, DBUS_TYPE_STRING, &xml, DBUS_TYPE_INVALID));
 
     } else if (dbus_message_is_method_call(m, "org.bluez.MediaEndpoint", "SetConfiguration"))
         r = endpoint_set_configuration(c, m, userdata);