From: Ludek Finstrle <luf@pzkagis.cz>
To: Jaganath Kanakkassery <jaganath.k@samsung.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] audio: Replace g_hash_table_contains() with g_hash_table_lookup()
Date: Mon, 7 Jan 2013 14:12:15 +0100 [thread overview]
Message-ID: <20130107131215.GC914@pzkagis.cz> (raw)
In-Reply-To: <1357562033-26230-1-git-send-email-jaganath.k@samsung.com>
Hello,
Mon, Jan 07, 2013 at 06:03:52PM +0530, Jaganath Kanakkassery napsal(a):
> g_hash_table_contains() is supported only from GLib 2.32. If BlueZ has to
> build against GLib 2.28 this patch replaces g_hash_table_contains() to
> g_hash_table_lookup()
> ---
> profiles/audio/player.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/profiles/audio/player.c b/profiles/audio/player.c
> index 8748893..4198bdb 100644
> --- a/profiles/audio/player.c
> +++ b/profiles/audio/player.c
> @@ -172,8 +172,13 @@ static gboolean get_status(const GDBusPropertyTable *property,
> static gboolean setting_exists(const GDBusPropertyTable *property, void *data)
> {
> struct media_player *mp = data;
> + const char *value;
> +
> + value = g_hash_table_lookup(mp->settings, property->name);
> + if (value == NULL)
> + return FALSE;
>
> - return g_hash_table_contains(mp->settings, property->name);
> + return TRUE;
> }
Doesn't
return g_hash_table_lookup(mp->settings, property->name) != NULL;
do the same? Maybe it's againist some code style but looks better
than several lines.
Luf
next prev parent reply other threads:[~2013-01-07 13:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-07 12:33 [PATCH 1/2] audio: Replace g_hash_table_contains() with g_hash_table_lookup() Jaganath Kanakkassery
2013-01-07 12:33 ` [PATCH 2/2] shared: Fix build break Jaganath Kanakkassery
2013-01-08 3:20 ` Marcel Holtmann
2013-01-07 13:12 ` Ludek Finstrle [this message]
2013-01-07 13:52 ` [PATCH 1/2] audio: Replace g_hash_table_contains() with g_hash_table_lookup() Jaganath Kanakkassery
2013-01-07 20:00 ` Luiz Augusto von Dentz
2013-01-08 3:24 ` Marcel Holtmann
2013-01-08 3:22 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130107131215.GC914@pzkagis.cz \
--to=luf@pzkagis.cz \
--cc=jaganath.k@samsung.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.