mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 23:00:11 +01:00
glsl2: Remove unnecessary use of 'struct' before type names
In C++ you don't have to say 'struct' or 'class' if the declaration of the type has been seen. Some compilers will complain if you use 'struct' when 'class' should have been used and vice versa. Fixes bugzilla #29539.
This commit is contained in:
parent
d960b61ea3
commit
768b55a526
6 changed files with 57 additions and 58 deletions
|
|
@ -29,7 +29,6 @@
|
|||
#include "list.h"
|
||||
#include "glsl_parser_extras.h"
|
||||
|
||||
struct ir_instruction;
|
||||
struct _mesa_glsl_parse_state;
|
||||
|
||||
struct YYLTYPE;
|
||||
|
|
@ -657,8 +656,8 @@ public:
|
|||
extern void
|
||||
_mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state);
|
||||
|
||||
extern struct ir_rvalue *
|
||||
_mesa_ast_field_selection_to_hir(const struct ast_expression *expr,
|
||||
extern ir_rvalue *
|
||||
_mesa_ast_field_selection_to_hir(const ast_expression *expr,
|
||||
exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
|
|
|
|||
|
|
@ -986,7 +986,7 @@ ast_expression::hir(exec_list *instructions,
|
|||
|
||||
assert(operations[this->oper] == ir_binop_mod);
|
||||
|
||||
struct ir_rvalue *temp_rhs;
|
||||
ir_rvalue *temp_rhs;
|
||||
temp_rhs = new(ctx) ir_expression(operations[this->oper], type,
|
||||
op[0], op[1]);
|
||||
|
||||
|
|
@ -1107,7 +1107,7 @@ ast_expression::hir(exec_list *instructions,
|
|||
|
||||
type = arithmetic_result_type(op[0], op[1], false, state, & loc);
|
||||
|
||||
struct ir_rvalue *temp_rhs;
|
||||
ir_rvalue *temp_rhs;
|
||||
temp_rhs = new(ctx) ir_expression(operations[this->oper], type,
|
||||
op[0], op[1]);
|
||||
|
||||
|
|
@ -1131,7 +1131,7 @@ ast_expression::hir(exec_list *instructions,
|
|||
|
||||
type = arithmetic_result_type(op[0], op[1], false, state, & loc);
|
||||
|
||||
struct ir_rvalue *temp_rhs;
|
||||
ir_rvalue *temp_rhs;
|
||||
temp_rhs = new(ctx) ir_expression(operations[this->oper], type,
|
||||
op[0], op[1]);
|
||||
|
||||
|
|
@ -1453,7 +1453,7 @@ ast_type_specifier::glsl_type(const char **name,
|
|||
|
||||
static void
|
||||
apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
|
||||
struct ir_variable *var,
|
||||
ir_variable *var,
|
||||
struct _mesa_glsl_parse_state *state,
|
||||
YYLTYPE *loc)
|
||||
{
|
||||
|
|
@ -1620,7 +1620,7 @@ ast_declarator_list::hir(exec_list *instructions,
|
|||
|
||||
foreach_list_typed (ast_declaration, decl, link, &this->declarations) {
|
||||
const struct glsl_type *var_type;
|
||||
struct ir_variable *var;
|
||||
ir_variable *var;
|
||||
|
||||
/* FINISHME: Emit a warning if a variable declaration shadows a
|
||||
* FINISHME: declaration at a higher scope.
|
||||
|
|
|
|||
|
|
@ -347,21 +347,21 @@ typedef union YYSTYPE
|
|||
unsigned i;
|
||||
} type_qualifier;
|
||||
|
||||
struct ast_node *node;
|
||||
struct ast_type_specifier *type_specifier;
|
||||
struct ast_fully_specified_type *fully_specified_type;
|
||||
struct ast_function *function;
|
||||
struct ast_parameter_declarator *parameter_declarator;
|
||||
struct ast_function_definition *function_definition;
|
||||
struct ast_compound_statement *compound_statement;
|
||||
struct ast_expression *expression;
|
||||
struct ast_declarator_list *declarator_list;
|
||||
struct ast_struct_specifier *struct_specifier;
|
||||
struct ast_declaration *declaration;
|
||||
ast_node *node;
|
||||
ast_type_specifier *type_specifier;
|
||||
ast_fully_specified_type *fully_specified_type;
|
||||
ast_function *function;
|
||||
ast_parameter_declarator *parameter_declarator;
|
||||
ast_function_definition *function_definition;
|
||||
ast_compound_statement *compound_statement;
|
||||
ast_expression *expression;
|
||||
ast_declarator_list *declarator_list;
|
||||
ast_struct_specifier *struct_specifier;
|
||||
ast_declaration *declaration;
|
||||
|
||||
struct {
|
||||
struct ast_node *cond;
|
||||
struct ast_expression *rest;
|
||||
ast_node *cond;
|
||||
ast_expression *rest;
|
||||
} for_rest_statement;
|
||||
|
||||
|
||||
|
|
@ -4609,7 +4609,7 @@ yyreduce:
|
|||
/* Line 1455 of yacc.c */
|
||||
#line 1193 "glsl_parser.ypp"
|
||||
{
|
||||
(yyval.node) = (struct ast_node *) (yyvsp[(1) - (1)].declarator_list);
|
||||
(yyval.node) = (ast_node *) (yyvsp[(1) - (1)].declarator_list);
|
||||
(yyvsp[(1) - (1)].declarator_list)->link.self_link();
|
||||
;}
|
||||
break;
|
||||
|
|
@ -4619,7 +4619,7 @@ yyreduce:
|
|||
/* Line 1455 of yacc.c */
|
||||
#line 1198 "glsl_parser.ypp"
|
||||
{
|
||||
(yyval.node) = (struct ast_node *) (yyvsp[(1) - (2)].node);
|
||||
(yyval.node) = (ast_node *) (yyvsp[(1) - (2)].node);
|
||||
(yyval.node)->link.insert_before(& (yyvsp[(2) - (2)].declarator_list)->link);
|
||||
;}
|
||||
break;
|
||||
|
|
@ -4687,7 +4687,7 @@ yyreduce:
|
|||
|
||||
/* Line 1455 of yacc.c */
|
||||
#line 1263 "glsl_parser.ypp"
|
||||
{ (yyval.node) = (struct ast_node *) (yyvsp[(1) - (1)].compound_statement); ;}
|
||||
{ (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].compound_statement); ;}
|
||||
break;
|
||||
|
||||
case 234:
|
||||
|
|
@ -4730,7 +4730,7 @@ yyreduce:
|
|||
|
||||
/* Line 1455 of yacc.c */
|
||||
#line 1297 "glsl_parser.ypp"
|
||||
{ (yyval.node) = (struct ast_node *) (yyvsp[(1) - (1)].compound_statement); ;}
|
||||
{ (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].compound_statement); ;}
|
||||
break;
|
||||
|
||||
case 242:
|
||||
|
|
@ -4855,7 +4855,7 @@ yyreduce:
|
|||
/* Line 1455 of yacc.c */
|
||||
#line 1385 "glsl_parser.ypp"
|
||||
{
|
||||
(yyval.node) = (struct ast_node *) (yyvsp[(1) - (1)].expression);
|
||||
(yyval.node) = (ast_node *) (yyvsp[(1) - (1)].expression);
|
||||
;}
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -245,21 +245,21 @@ typedef union YYSTYPE
|
|||
unsigned i;
|
||||
} type_qualifier;
|
||||
|
||||
struct ast_node *node;
|
||||
struct ast_type_specifier *type_specifier;
|
||||
struct ast_fully_specified_type *fully_specified_type;
|
||||
struct ast_function *function;
|
||||
struct ast_parameter_declarator *parameter_declarator;
|
||||
struct ast_function_definition *function_definition;
|
||||
struct ast_compound_statement *compound_statement;
|
||||
struct ast_expression *expression;
|
||||
struct ast_declarator_list *declarator_list;
|
||||
struct ast_struct_specifier *struct_specifier;
|
||||
struct ast_declaration *declaration;
|
||||
ast_node *node;
|
||||
ast_type_specifier *type_specifier;
|
||||
ast_fully_specified_type *fully_specified_type;
|
||||
ast_function *function;
|
||||
ast_parameter_declarator *parameter_declarator;
|
||||
ast_function_definition *function_definition;
|
||||
ast_compound_statement *compound_statement;
|
||||
ast_expression *expression;
|
||||
ast_declarator_list *declarator_list;
|
||||
ast_struct_specifier *struct_specifier;
|
||||
ast_declaration *declaration;
|
||||
|
||||
struct {
|
||||
struct ast_node *cond;
|
||||
struct ast_expression *rest;
|
||||
ast_node *cond;
|
||||
ast_expression *rest;
|
||||
} for_rest_statement;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -59,21 +59,21 @@
|
|||
unsigned i;
|
||||
} type_qualifier;
|
||||
|
||||
struct ast_node *node;
|
||||
struct ast_type_specifier *type_specifier;
|
||||
struct ast_fully_specified_type *fully_specified_type;
|
||||
struct ast_function *function;
|
||||
struct ast_parameter_declarator *parameter_declarator;
|
||||
struct ast_function_definition *function_definition;
|
||||
struct ast_compound_statement *compound_statement;
|
||||
struct ast_expression *expression;
|
||||
struct ast_declarator_list *declarator_list;
|
||||
struct ast_struct_specifier *struct_specifier;
|
||||
struct ast_declaration *declaration;
|
||||
ast_node *node;
|
||||
ast_type_specifier *type_specifier;
|
||||
ast_fully_specified_type *fully_specified_type;
|
||||
ast_function *function;
|
||||
ast_parameter_declarator *parameter_declarator;
|
||||
ast_function_definition *function_definition;
|
||||
ast_compound_statement *compound_statement;
|
||||
ast_expression *expression;
|
||||
ast_declarator_list *declarator_list;
|
||||
ast_struct_specifier *struct_specifier;
|
||||
ast_declaration *declaration;
|
||||
|
||||
struct {
|
||||
struct ast_node *cond;
|
||||
struct ast_expression *rest;
|
||||
ast_node *cond;
|
||||
ast_expression *rest;
|
||||
} for_rest_statement;
|
||||
}
|
||||
|
||||
|
|
@ -1191,12 +1191,12 @@ struct_specifier:
|
|||
struct_declaration_list:
|
||||
struct_declaration
|
||||
{
|
||||
$$ = (struct ast_node *) $1;
|
||||
$$ = (ast_node *) $1;
|
||||
$1->link.self_link();
|
||||
}
|
||||
| struct_declaration_list struct_declaration
|
||||
{
|
||||
$$ = (struct ast_node *) $1;
|
||||
$$ = (ast_node *) $1;
|
||||
$$->link.insert_before(& $2->link);
|
||||
}
|
||||
;
|
||||
|
|
@ -1260,7 +1260,7 @@ statement:
|
|||
;
|
||||
|
||||
statement_matched:
|
||||
compound_statement { $$ = (struct ast_node *) $1; }
|
||||
compound_statement { $$ = (ast_node *) $1; }
|
||||
| simple_statement
|
||||
;
|
||||
|
||||
|
|
@ -1294,7 +1294,7 @@ compound_statement:
|
|||
;
|
||||
|
||||
statement_no_new_scope:
|
||||
compound_statement_no_new_scope { $$ = (struct ast_node *) $1; }
|
||||
compound_statement_no_new_scope { $$ = (ast_node *) $1; }
|
||||
| simple_statement
|
||||
;
|
||||
|
||||
|
|
@ -1383,7 +1383,7 @@ selection_statement_unmatched:
|
|||
condition:
|
||||
expression
|
||||
{
|
||||
$$ = (struct ast_node *) $1;
|
||||
$$ = (ast_node *) $1;
|
||||
}
|
||||
| fully_specified_type IDENTIFIER '=' initializer
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include "ast.h"
|
||||
#include "glsl_types.h"
|
||||
|
||||
struct ir_rvalue *
|
||||
ir_rvalue *
|
||||
_mesa_ast_field_selection_to_hir(const ast_expression *expr,
|
||||
exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue