On Tue, Jan 25, 2011 at 07:17:26PM +0100, Marc-André Lureau wrote: > --- > common/ring.h | 13 +++++++++++++ > 1 files changed, 13 insertions(+), 0 deletions(-) > > diff --git a/common/ring.h b/common/ring.h > index cdfe7e1..0194959 100644 > --- a/common/ring.h > +++ b/common/ring.h > @@ -136,5 +136,18 @@ static inline RingItem *ring_prev(Ring *ring, RingItem > *pos) > return (ret == ring) ? NULL : ret; > } > > +static inline unsigned int ring_get_length(Ring *ring)
This won't compile if no one uses it - so you probably want to make it non static (or do a hack by doing (void)ring_get_length somewhere). We definitely don't want to ifdef this (beats the purpose of having it in gdb). > +{ > + RingItem *i; > + unsigned int ret = 0; > + > + for (i = ring_get_head(ring); > + i != NULL; > + i = ring_next(ring, i)) > + ret++; > + > + return ret; > +} > + > #endif > > -- > 1.7.3.4 > > _______________________________________________ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/spice-devel _______________________________________________ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel