From: Luiz Capitulino <lcapitulino@redhat.com>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org,
armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH for-1.2 v3 1/3] qlist: add qlist_size()
Date: Thu, 16 Aug 2012 10:40:05 -0300 [thread overview]
Message-ID: <20120816104005.67581ecf@doriath.home> (raw)
In-Reply-To: <1345056344-31849-1-git-send-email-mdroth@linux.vnet.ibm.com>
On Wed, 15 Aug 2012 13:45:42 -0500
Michael Roth <mdroth@linux.vnet.ibm.com> wrote:
>
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
I've applied this series to the qmp branch for 1.2. I'll run some tests and if
all goes alright will send a pull request shortly.
> ---
> qlist.c | 13 +++++++++++++
> qlist.h | 1 +
> 2 files changed, 14 insertions(+)
>
> diff --git a/qlist.c b/qlist.c
> index 88498b1..b48ec5b 100644
> --- a/qlist.c
> +++ b/qlist.c
> @@ -124,6 +124,19 @@ int qlist_empty(const QList *qlist)
> return QTAILQ_EMPTY(&qlist->head);
> }
>
> +static void qlist_size_iter(QObject *obj, void *opaque)
> +{
> + size_t *count = opaque;
> + (*count)++;
> +}
> +
> +size_t qlist_size(const QList *qlist)
> +{
> + size_t count = 0;
> + qlist_iter(qlist, qlist_size_iter, &count);
> + return count;
> +}
> +
> /**
> * qobject_to_qlist(): Convert a QObject into a QList
> */
> diff --git a/qlist.h b/qlist.h
> index d426bd4..ae776f9 100644
> --- a/qlist.h
> +++ b/qlist.h
> @@ -49,6 +49,7 @@ void qlist_iter(const QList *qlist,
> QObject *qlist_pop(QList *qlist);
> QObject *qlist_peek(QList *qlist);
> int qlist_empty(const QList *qlist);
> +size_t qlist_size(const QList *qlist);
> QList *qobject_to_qlist(const QObject *obj);
>
> static inline const QListEntry *qlist_first(const QList *qlist)
next prev parent reply other threads:[~2012-08-16 13:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-15 18:45 [Qemu-devel] [PATCH for-1.2 v3 1/3] qlist: add qlist_size() Michael Roth
2012-08-15 18:45 ` [Qemu-devel] [PATCH for-1.2 v3 2/3] json-parser: don't replicate tokens at each level of recursion Michael Roth
2012-08-15 20:04 ` Eric Blake
2012-08-15 20:48 ` Michael Roth
2012-08-16 14:11 ` Luiz Capitulino
2012-08-16 19:17 ` Michael Roth
2012-08-15 18:45 ` [Qemu-devel] [PATCH for-1.2 v3 3/3] check-qjson: add test for large JSON objects Michael Roth
2012-08-15 19:52 ` [Qemu-devel] [PATCH for-1.2 v3 1/3] qlist: add qlist_size() Eric Blake
2012-08-15 20:31 ` Michael Roth
2012-08-16 13:40 ` Luiz Capitulino [this message]
2012-08-16 19:23 ` Michael Roth
2012-08-16 19:29 ` Luiz Capitulino
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=20120816104005.67581ecf@doriath.home \
--to=lcapitulino@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.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).