X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fglsl%2Fir_function_detect_recursion.cpp;h=b2334d2e403316a3cb0c6c820bb012abfc31160b;hb=ec6ef1cbfed0aad21849863b6ee8c8e767b5b7c0;hp=b02c32518ccf679a282fadaa0c8f0909ba39f8fd;hpb=81a3759bb51a1a12ba1c6c6ad586c5ff5f31c411;p=mesa.git diff --git a/src/glsl/ir_function_detect_recursion.cpp b/src/glsl/ir_function_detect_recursion.cpp index b02c32518cc..b2334d2e403 100644 --- a/src/glsl/ir_function_detect_recursion.cpp +++ b/src/glsl/ir_function_detect_recursion.cpp @@ -127,6 +127,8 @@ #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(); } }