Mesa (master): exec_list: Add pop_head
Ian Romanick
idr at kemper.freedesktop.org
Fri Sep 3 19:01:03 UTC 2010
Module: Mesa
Branch: master
Commit: 29eebe9a9a0486f12e33e2818c192ef683fdfede
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=29eebe9a9a0486f12e33e2818c192ef683fdfede
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Mon Aug 16 18:02:11 2010 -0700
exec_list: Add pop_head
---
src/glsl/list.h | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/src/glsl/list.h b/src/glsl/list.h
index a70b79d..7647774 100644
--- a/src/glsl/list.h
+++ b/src/glsl/list.h
@@ -378,6 +378,23 @@ struct exec_list {
}
/**
+ * Remove the first node from a list and return it
+ *
+ * \return
+ * The first node in the list or \c NULL if the list is empty.
+ *
+ * \sa exec_list::get_head
+ */
+ exec_node *pop_head()
+ {
+ exec_node *const n = this->get_head();
+ if (n != NULL)
+ n->remove();
+
+ return n;
+ }
+
+ /**
* Move all of the nodes from this list to the target list
*/
void move_nodes_to(exec_list *target)
More information about the mesa-commit
mailing list