diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-04-19 17:06:40 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-04-20 17:45:52 +0100 |
commit | 1d78f4a9fb520ec024d0b2cb7fc9eca5babdb5ce (patch) | |
tree | 5b61db0de0455b7ff8d6c02cc6468256c9064548 | |
parent | 86e7d89052ef4cd7dd3b47d2f3274b2c16cca06f (diff) |
tp_intset_iter_{init,reset}: demacroify
Previously, tp_intset_iter_init (resp. _reset) was a macro, which was
implemented using tp_intset_iter_init_inline, which was a static inline
function defined in the header.
This seems unnecessary, particularly for an iterator type documented to
be slow and old and semi-deprecated in favour of the faster variant,
which uses a regular function to init.
-rw-r--r-- | telepathy-glib/intset.c | 18 | ||||
-rw-r--r-- | telepathy-glib/intset.h | 21 |
2 files changed, 18 insertions, 21 deletions
diff --git a/telepathy-glib/intset.c b/telepathy-glib/intset.c index 025e5221c..5546fe91c 100644 --- a/telepathy-glib/intset.c +++ b/telepathy-glib/intset.c @@ -139,7 +139,15 @@ tp_intset_get_type (void) * * Reset the iterator @iter to the beginning and make it iterate over @set. */ -/* (inline, see header) */ +void +tp_intset_iter_init ( + TpIntsetIter *iter, + const TpIntset *set) +{ + g_return_if_fail (iter != NULL); + iter->set = set; + iter->element = (guint)(-1); +} /** * tp_intset_iter_reset: @@ -148,7 +156,13 @@ tp_intset_get_type (void) * Reset the iterator @iter to the beginning. It must already be associated * with a set. */ -/* (inline, see header) */ +void +tp_intset_iter_reset (TpIntsetIter *iter) +{ + g_return_if_fail (iter != NULL); + g_return_if_fail (iter->set != NULL); + iter->element = (guint)(-1); +} /** * TpIntset: diff --git a/telepathy-glib/intset.h b/telepathy-glib/intset.h index 5b9d907a5..9ac73c002 100644 --- a/telepathy-glib/intset.h +++ b/telepathy-glib/intset.h @@ -92,25 +92,8 @@ typedef struct { typedef TpIntsetIter TpIntSetIter; #define TP_INTSET_ITER_INIT(set) { (set), (guint)(-1) } - -#define tp_intset_iter_init(iter, set) tp_intset_iter_init_inline (iter, set) -static inline void -tp_intset_iter_init_inline (TpIntsetIter *iter, const TpIntset *set) -{ - g_return_if_fail (iter != NULL); - iter->set = set; - iter->element = (guint)(-1); -} - -#define tp_intset_iter_reset(iter) tp_intset_iter_reset_inline (iter) -static inline void -tp_intset_iter_reset_inline (TpIntsetIter *iter) -{ - g_return_if_fail (iter != NULL); - g_return_if_fail (iter->set != NULL); - iter->element = (guint)(-1); -} - +void tp_intset_iter_init (TpIntsetIter *iter, const TpIntset *set); +void tp_intset_iter_reset (TpIntsetIter *iter); gboolean tp_intset_iter_next (TpIntsetIter *iter); typedef struct { |