From: Johan Hedberg <johan.hedberg@gmail.com>
To: Bartosz Szatkowski <bulislaw@linux.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH obexd 2/2] Add SetFolder function for MAP tracker backend
Date: Thu, 14 Jul 2011 17:08:34 +0300 [thread overview]
Message-ID: <20110714140834.GH2770@dell.ger.corp.intel.com> (raw)
In-Reply-To: <1310651174-11945-2-git-send-email-bulislaw@linux.com>
Hi Bartosz,
On Thu, Jul 14, 2011, Bartosz Szatkowski wrote:
> +static char *root_folder = "/";
Do you intend to change this a runtime in the future? If not, I don't
think you need a special varialble for it.
> +static struct message_folder *get_folder(const char *folder)
> +{
> + GSList *current = folder_tree->subfolders;
> + GSList *last;
> + int i = 1;
> + char **path;
> +
> + if (g_strcmp0(folder, "/") == 0)
> + return folder_tree;
> +
> + path = g_strsplit(folder, "/", 0);
> +
> + while (path[i] != NULL) {
This should be a for-loop:
for (i = 1; path[i] != NULL; i++)
> + GSList *next = current;
You seem to use this as a simple iterator, so please call it simply l
instead of next;
> + int find = 0;
This is used as a boolean so please use gboolean instead of an int. I
also think that match_found would be a better name.
> + while (next != NULL) {
This should be a for-loop too:
for (l = current; l != NULL; l = g_slist_next(l))
> +static void create_folder_tree()
> +{
> + struct message_folder *parent, *child;
> +
> + folder_tree = create_folder("/", NULL);
> +
> + parent = create_folder("telecom", NULL);
> + folder_tree->subfolders = g_slist_append(folder_tree->subfolders,
> + parent);
Mixed tabs and spaces for indentation in the last line above.
Johan
next prev parent reply other threads:[~2011-07-14 14:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-14 13:46 [PATCH obexd 1/2] Add tracker backend stump for MAP Bartosz Szatkowski
2011-07-14 13:46 ` [PATCH obexd 2/2] Add SetFolder function for MAP tracker backend Bartosz Szatkowski
2011-07-14 14:08 ` Johan Hedberg [this message]
2011-07-15 12:29 ` [PATCH obexd 2/2 v2] " Bartosz Szatkowski
2011-07-26 9:24 ` Johan Hedberg
2011-07-26 9:40 ` [PATCH] " Bartosz Szatkowski
2011-07-26 10:32 ` Johan Hedberg
2011-07-14 13:59 ` [PATCH obexd 1/2] Add tracker backend stump for MAP Johan Hedberg
2011-07-14 14:07 ` [PATCH obexd 1/2 v2] " Bartosz Szatkowski
2011-07-14 14:14 ` 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=20110714140834.GH2770@dell.ger.corp.intel.com \
--to=johan.hedberg@gmail.com \
--cc=bulislaw@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).