[pulseaudio-discuss] [RFC 03/24] bluetooth: Improve code readability
Mikel Astiz
mikel.astiz.oss at gmail.com
Wed Mar 27 01:04:02 PDT 2013
Hi João Paulo,
On Wed, Mar 27, 2013 at 6:16 AM, <jprvita at gmail.com> wrote:
> From: João Paulo Rechi Vita <jprvita at openbossa.org>
>
> ---
> src/modules/bluetooth/bluetooth-util.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
> index 32566f2..7ae12fc 100644
> --- a/src/modules/bluetooth/bluetooth-util.c
> +++ b/src/modules/bluetooth/bluetooth-util.c
> @@ -2068,20 +2068,18 @@ 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 *interface;
> + const char *path, *interface, *member;
>
> pa_assert(y);
>
> - interface = y->version == BLUEZ_VERSION_4 ? "org.bluez.MediaEndpoint" : "org.bluez.MediaEndpoint1";
> + path = dbus_message_get_path(m);
> + interface = dbus_message_get_interface(m);
> + member = dbus_message_get_member(m);
>
> - 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));
> + pa_log_debug("dbus: path=%s, interface=%s, member=%s", path, interface, member);
>
> - path = dbus_message_get_path(m);
> dbus_error_init(&e);
> + interface = y->version == BLUEZ_VERSION_4 ? "org.bluez.MediaEndpoint" : "org.bluez.MediaEndpoint1";
>
> if (!pa_streq(path, A2DP_SOURCE_ENDPOINT) && !pa_streq(path, A2DP_SINK_ENDPOINT) && !pa_streq(path, HFP_AG_ENDPOINT) &&
> !pa_streq(path, HFP_HS_ENDPOINT))
> --
> 1.7.11.7
>
This one can also be submitted for master along with patch 1.
As a minor nitpicking: the commit message is incomplete since you're
also modifying the log trace.
Cheers,
Mikel
More information about the pulseaudio-discuss
mailing list