From: Johan Hedberg <johan.hedberg@gmail.com>
To: "RISKÓ Gergely" <gergely@risko.hu>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
linux-bluetooth@vger.kernel.org,
Context Devel mailing list <context-devel@projects.maemo.org>
Subject: Re: [PATCH] Add introspection interface to the output of introspection calls.
Date: Wed, 16 Sep 2009 14:39:59 +0300 [thread overview]
Message-ID: <20090916113959.GA4314@jh-x301> (raw)
In-Reply-To: <87eiq7du6t.fsf@bubble.risko.hu>
Hi Gregely,
On Wed, Sep 16, 2009, RISKÓ Gergely wrote:
> Diffstat says 58 insertions, 43 deletions, I think the extra 15 lines
> really worth that bluez no longer treats the introspection as a very
> specific interface.
Looks good to me, except for the following (rather minor) issues:
> +static void add_interface(struct generic_data *data, const char *name,
> + GDBusMethodTable *methods,
> + GDBusSignalTable *signals,
> + GDBusPropertyTable *properties,
> + void *user_data,
> + GDBusDestroyFunction destroy)
There seems to be mixed tabs & spaces here for indentation. Can you
confirm this? We only use tabs for indentation in BlueZ (which I believe
is also the usual kernel coding style).
> +static gboolean remove_interface(struct generic_data *data, const char *name)
> +{
> + struct interface_data *iface;
> +
> + iface = find_interface(data->interfaces, name);
> + if (iface) {
> + data->interfaces = g_slist_remove(data->interfaces, iface);
> +
> + if (iface->destroy)
> + iface->destroy(iface->user_data);
> +
> + g_free(iface->name);
> + g_free(iface);
> + return TRUE;
> + } else
> + return FALSE;
> +}
Marcel usually likes to do this as follows (and I agree with him):
iface = find_interface(data->interfaces, name);
if (!iface)
return FALSE;
...rest of the code...
return TRUE;
That saves you one level of indentation for most of the function and could
be considered also esier to read.
With those things fixed I think this is now up to Marcel whether he agrees
with the change. In my opinion, even though it increases the total line
count it still makes the code look nicer/cleaner since it removes the
special casing for the introspection. E.g. one added benefit that wasn't
previously mentioned is that now g_dbus_register_interface will correctly
return an error if someone tries to register the introspection interface
themselves.
Johan
next prev parent reply other threads:[~2009-09-16 11:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-01 14:10 [PATCH] bluez git HEAD doesn't put introspection methods into the introspection output RISKÓ Gergely
2009-09-02 10:00 ` [PATCH] Add introspection interface to the output of introspection calls RISKÓ Gergely
2009-09-02 14:46 ` Luiz Augusto von Dentz
2009-09-02 17:48 ` RISKÓ Gergely
2009-09-14 14:18 ` Johan Hedberg
2009-09-14 14:52 ` RISKÓ Gergely
2009-09-14 21:11 ` Johan Hedberg
2009-09-15 10:50 ` Luiz Augusto von Dentz
2009-09-15 12:28 ` RISKÓ Gergely
2009-09-15 15:22 ` Johan Hedberg
2009-09-15 17:27 ` Marcel Holtmann
2009-09-15 17:55 ` Johan Hedberg
2009-09-15 19:25 ` RISKÓ Gergely
2009-09-16 11:07 ` RISKÓ Gergely
2009-09-16 11:39 ` Johan Hedberg [this message]
2009-09-16 12:03 ` RISKÓ Gergely
2009-09-24 17:22 ` Johan Hedberg
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=20090916113959.GA4314@jh-x301 \
--to=johan.hedberg@gmail.com \
--cc=context-devel@projects.maemo.org \
--cc=gergely@risko.hu \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox