Mesa (master): glsl: Move definition of exec_node member functions out of the struct.

Matt Turner mattst88 at kemper.freedesktop.org
Tue Jun 10 20:08:07 UTC 2014


Module: Mesa
Branch: master
Commit: cb5a0e59cf49421571563cd3afc0bfe0d4ee2aa8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb5a0e59cf49421571563cd3afc0bfe0d4ee2aa8

Author: Matt Turner <mattst88 at gmail.com>
Date:   Mon Jun  9 22:37:44 2014 -0700

glsl: Move definition of exec_node member functions out of the struct.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/glsl/list.h |  145 +++++++++++++++++++++++++++++++------------------------
 1 file changed, 83 insertions(+), 62 deletions(-)

diff --git a/src/glsl/list.h b/src/glsl/list.h
index 694b686..6216855 100644
--- a/src/glsl/list.h
+++ b/src/glsl/list.h
@@ -83,67 +83,29 @@ struct exec_node {
       /* empty */
    }
 
-   const exec_node *get_next() const
-   {
-      return next;
-   }
-
-   exec_node *get_next()
-   {
-      return next;
-   }
-
-   const exec_node *get_prev() const
-   {
-      return prev;
-   }
+   const exec_node *get_next() const;
+   exec_node *get_next();
 
-   exec_node *get_prev()
-   {
-      return prev;
-   }
+   const exec_node *get_prev() const;
+   exec_node *get_prev();
 
-   void remove()
-   {
-      next->prev = prev;
-      prev->next = next;
-      next = NULL;
-      prev = NULL;
-   }
+   void remove();
 
    /**
     * Link a node with itself
     *
     * This creates a sort of degenerate list that is occasionally useful.
     */
-   void self_link()
-   {
-      next = this;
-      prev = this;
-   }
+   void self_link();
 
    /**
     * Insert a node in the list after the current node
     */
-   void insert_after(exec_node *after)
-   {
-      after->next = this->next;
-      after->prev = this;
-
-      this->next->prev = after;
-      this->next = after;
-   }
+   void insert_after(exec_node *after);
    /**
     * Insert a node in the list before the current node
     */
-   void insert_before(exec_node *before)
-   {
-      before->next = this;
-      before->prev = this->prev;
-
-      this->prev->next = before;
-      this->prev = before;
-   }
+   void insert_before(exec_node *before);
 
    /**
     * Insert another list in the list before the current node
@@ -153,33 +115,92 @@ struct exec_node {
    /**
     * Replace the current node with the given node.
     */
-   void replace_with(exec_node *replacement)
-   {
-      replacement->prev = this->prev;
-      replacement->next = this->next;
-
-      this->prev->next = replacement;
-      this->next->prev = replacement;
-   }
+   void replace_with(exec_node *replacement);
 
    /**
     * Is this the sentinel at the tail of the list?
     */
-   bool is_tail_sentinel() const
-   {
-      return this->next == NULL;
-   }
+   bool is_tail_sentinel() const;
 
    /**
     * Is this the sentinel at the head of the list?
     */
-   bool is_head_sentinel() const
-   {
-      return this->prev == NULL;
-   }
+   bool is_head_sentinel() const;
 #endif
 };
 
+#ifdef __cplusplus
+inline const exec_node *exec_node::get_next() const
+{
+   return next;
+}
+
+inline exec_node *exec_node::get_next()
+{
+   return next;
+}
+
+inline const exec_node *exec_node::get_prev() const
+{
+   return prev;
+}
+
+inline exec_node *exec_node::get_prev()
+{
+   return prev;
+}
+
+inline void exec_node::remove()
+{
+   next->prev = prev;
+   prev->next = next;
+   next = NULL;
+   prev = NULL;
+}
+
+inline void exec_node::self_link()
+{
+   next = this;
+   prev = this;
+}
+
+inline void exec_node::insert_after(exec_node *after)
+{
+   after->next = this->next;
+   after->prev = this;
+
+   this->next->prev = after;
+   this->next = after;
+}
+
+inline void exec_node::insert_before(exec_node *before)
+{
+   before->next = this;
+   before->prev = this->prev;
+
+   this->prev->next = before;
+   this->prev = before;
+}
+
+inline void exec_node::replace_with(exec_node *replacement)
+{
+   replacement->prev = this->prev;
+   replacement->next = this->next;
+
+   this->prev->next = replacement;
+   this->next->prev = replacement;
+}
+
+inline bool exec_node::is_tail_sentinel() const
+{
+   return this->next == NULL;
+}
+
+inline bool exec_node::is_head_sentinel() const
+{
+   return this->prev == NULL;
+}
+#endif
 
 #ifdef __cplusplus
 /* This macro will not work correctly if `t' uses virtual inheritance.  If you




More information about the mesa-commit mailing list