From: Ian Romanick Date: Thu, 25 Feb 2010 20:49:55 +0000 (-0800) Subject: Replace tacky wrapper macros with tacky in-line type-casts X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e41a1cd4d534639272938210c5491077688ccd37;p=mesa.git Replace tacky wrapper macros with tacky in-line type-casts --- diff --git a/ast.h b/ast.h index 1f659933e98..b04cf75c371 100644 --- a/ast.h +++ b/ast.h @@ -33,18 +33,6 @@ struct _mesa_glsl_parse_state; struct YYLTYPE; -#define _mesa_ast_print(n) \ - ((ast_node *) n)->print() - -#define _mesa_ast_to_hir(n, instr, s) \ - ((struct ast_node *) n)->vtbl->to_hir((struct ast_node *) n, instr, s) - -#define _mesa_ast_function_call_to_hir(n, p, s) \ - ((struct ast_node *) n)->vtbl->function_call_to_hir( \ - (struct ast_node *) n, \ - (struct ast_node *) p, \ - s) - class ast_node : public simple_node { public: virtual ~ast_node(); diff --git a/glsl_parser_extras.cpp b/glsl_parser_extras.cpp index a0fad52d62a..54d510c1a19 100644 --- a/glsl_parser_extras.cpp +++ b/glsl_parser_extras.cpp @@ -211,7 +211,7 @@ ast_compound_statement::print(void) const printf("{\n"); foreach(ptr, & statements) { - _mesa_ast_print(ptr); + ((ast_node *)ptr)->print(); } printf("}\n"); @@ -304,7 +304,7 @@ ast_expression::print(void) const parameters->print(); foreach (ptr, (struct simple_node *) parameters) { printf(", "); - _mesa_ast_print(ptr); + ((ast_node *)ptr)->print(); } } @@ -343,7 +343,7 @@ ast_expression::print(void) const if (ptr != head) printf(", "); - _mesa_ast_print(ptr); + ((ast_node *)ptr)->print(); } printf(") "); break; @@ -394,7 +394,7 @@ ast_function::print(void) const printf(" %s (", identifier); foreach(ptr, & parameters) { - _mesa_ast_print(ptr); + ((ast_node *)ptr)->print(); } printf(")"); @@ -475,7 +475,7 @@ ast_declarator_list::print(void) const if (ptr != head) printf(", "); - _mesa_ast_print(ptr); + ((ast_node *)ptr)->print(); } printf("; "); @@ -610,7 +610,7 @@ ast_struct_specifier::print(void) const printf("struct %s { ", name); foreach (ptr, & declarations) { - _mesa_ast_print(ptr); + ((ast_node *)ptr)->print(); } printf("} "); } @@ -695,7 +695,7 @@ main(int argc, char **argv) _mesa_glsl_lexer_dtor(& state); foreach (ptr, & state.translation_unit) { - _mesa_ast_print(ptr); + ((ast_node *)ptr)->print(); } #if 0