Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=e69c17d431c618857e2cb628e7d6088f2a9c94da
commit e69c17d431c618857e2cb628e7d6088f2a9c94da Author: Michel Hermier <herm...@frugalware.org> Date: Tue Nov 4 11:40:38 2014 +0100 libpacman: Move FCListItem inside flib. diff --git a/lib/libpacman/util/flist.h b/lib/libpacman/util/flist.h index a363995..b052734 100644 --- a/lib/libpacman/util/flist.h +++ b/lib/libpacman/util/flist.h @@ -299,97 +299,95 @@ namespace flib public: /* FIXME: Make protected/private */ iterable m_iterable; }; -} -class FCListItem -{ -public: - friend struct flib::iterable_traits<FCListItem *>; + class FCListItem + { + public: + friend struct flib::iterable_traits<FCListItem *>; - typedef void *value_type; - typedef value_type *pointer; - typedef size_t size_type; - typedef value_type &reference; + typedef void *value_type; + typedef value_type *pointer; + typedef size_t size_type; + typedef value_type &reference; - FCListItem() - : FCListItem(NULL, NULL) - { } + FCListItem() + : FCListItem(NULL, NULL) + { } - FCListItem(FCListItem *previous, FCListItem *next) - : m_next(next), m_previous(previous) - { } + FCListItem(FCListItem *previous, FCListItem *next) + : m_next(next), m_previous(previous) + { } - virtual ~FCListItem() - { } // FIXME: Make pure virtual + virtual ~FCListItem() + { } // FIXME: Make pure virtual #if 0 - virtual void *c_data() const - { return m_data; } // FIXME: Make pure virtual + virtual void *c_data() const + { return m_data; } // FIXME: Make pure virtual #endif - bool insert_after(FCListItem *previous) - { - FCListItem *next; + bool insert_after(FCListItem *previous) + { + FCListItem *next; - ASSERT(previous != NULL, RET_ERR(PM_ERR_WRONG_ARGS, false)); + ASSERT(previous != NULL, RET_ERR(PM_ERR_WRONG_ARGS, false)); - next = previous->m_next; - previous->m_next = this; - m_next = next; - m_previous = previous; + next = previous->m_next; + previous->m_next = this; + m_next = next; + m_previous = previous; #ifndef F_NOCOMPAT - if (next != NULL) + if (next != NULL) #endif - next->m_previous = this; - return true; - } - - FCListItem *next() const - { - return m_next; - } + next->m_previous = this; + return true; + } - FCListItem *previous() const - { - return m_previous; - } + FCListItem *next() const + { + return m_next; + } - void swap(FCListItem &o) - { - std::swap(m_next, o.m_next); - std::swap(m_previous, o.m_previous); - if(m_next != &o) { - m_next->m_previous = this; - m_previous->m_next = this; - } else { - m_next = m_previous = this; + FCListItem *previous() const + { + return m_previous; } - if(o.m_next != this) { - o.m_next->m_previous = &o; - o.m_previous->m_next = &o; - } else { - o.m_next = o.m_previous = &o; + + void swap(FCListItem &o) + { + std::swap(m_next, o.m_next); + std::swap(m_previous, o.m_previous); + if(m_next != &o) { + m_next->m_previous = this; + m_previous->m_next = this; + } else { + m_next = m_previous = this; + } + if(o.m_next != this) { + o.m_next->m_previous = &o; + o.m_previous->m_next = &o; + } else { + o.m_next = o.m_previous = &o; + } } - } - void remove() - { - m_next->m_previous = m_previous; - m_previous->m_next = m_next; - m_next = m_previous = NULL; - } + void remove() + { + m_next->m_previous = m_previous; + m_previous->m_next = m_next; + m_next = m_previous = NULL; + } - void reverse() - { - std::swap(m_next, m_previous); - } + void reverse() + { + std::swap(m_next, m_previous); + } -protected: - FCListItem *m_next; - FCListItem *m_previous; -}; + protected: + FCListItem *m_next; + FCListItem *m_previous; + }; -namespace flib { template <> struct iterable_traits<FCListItem *> { @@ -432,7 +430,7 @@ namespace flib { template <typename T> class FListItem - : public FCListItem + : public flib::FCListItem { public: friend struct flib::iterable_traits<FListItem *>; @@ -558,7 +556,7 @@ namespace flib { template <typename T> class FList - : protected FCListItem + : protected flib::FCListItem { public: typedef FListItem<T> *iterable; _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git