Mesa (glsl2): glsl2: Use new foreach_list_safe abstraction.

Ian Romanick idr at kemper.freedesktop.org
Fri Jul 9 17:43:17 UTC 2010


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Jul  8 13:08:14 2010 -0700

glsl2: Use new foreach_list_safe abstraction.

---

 src/glsl/ir_hv_accept.cpp |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/glsl/ir_hv_accept.cpp b/src/glsl/ir_hv_accept.cpp
index 1a88c59..46bc5b1 100644
--- a/src/glsl/ir_hv_accept.cpp
+++ b/src/glsl/ir_hv_accept.cpp
@@ -32,20 +32,16 @@
 /**
  * Process a list of nodes using a hierarchical vistor
  *
- * \warning
  * This function will operate correctly if a node being processed is removed
- * from list.  However, if nodes are added to the list after the node being
- * processed, some of the added noded may not be processed.
+ * from the list.  If nodes are inserted before the current node, they will be
+ * processed next.
  */
 ir_visitor_status
 visit_list_elements(ir_hierarchical_visitor *v, exec_list *l)
 {
-   exec_node *next;
    ir_instruction *prev_base_ir = v->base_ir;
 
-   for (exec_node *n = l->head; n->next != NULL; n = next) {
-      next = n->next;
-
+   foreach_list_safe(n, l) {
       ir_instruction *const ir = (ir_instruction *) n;
       v->base_ir = ir;
       ir_visitor_status s = ir->accept(v);




More information about the mesa-commit mailing list