st/va: move post processing function into own file
[mesa.git] / src / glsl / ir_function_detect_recursion.cpp
index b02c32518ccf679a282fadaa0c8f0909ba39f8fd..b2334d2e403316a3cb0c6c820bb012abfc31160b 100644 (file)
 #include "program/hash_table.h"
 #include "program.h"
 
+namespace {
+
 struct call_node : public exec_node {
    class function *func;
 };
@@ -222,18 +224,18 @@ public:
    bool progress;
 };
 
+} /* anonymous namespace */
+
 static void
 destroy_links(exec_list *list, function *f)
 {
-   foreach_list_safe(node, list) {
-      struct call_node *n = (struct call_node *) node;
-
+   foreach_in_list_safe(call_node, node, list) {
       /* If this is the right function, remove it.  Note that the loop cannot
        * terminate now.  There can be multiple links to a function if it is
        * either called multiple times or calls multiple times.
        */
-      if (n->func == f)
-        n->remove();
+      if (node->func == f)
+        node->remove();
    }
 }