qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-1.2 v3 1/3] qlist: add qlist_size()


From: Michael Roth
Subject: Re: [Qemu-devel] [PATCH for-1.2 v3 1/3] qlist: add qlist_size()
Date: Thu, 16 Aug 2012 14:23:40 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Aug 16, 2012 at 10:40:05AM -0300, Luiz Capitulino wrote:
> On Wed, 15 Aug 2012 13:45:42 -0500
> Michael Roth <address@hidden> wrote:
> 
> > 
> > Signed-off-by: Michael Roth <address@hidden>
> 
> 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.
> 

I just noticed via our fancy #qemu github bot that Anthony
applied these already, but I asked about and if you want to
test/submit through your queue it should all work out. So either
way.

Thanks!

> > ---
> >  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)
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]