Commit 05b8fcb4 by Fritz O. Reese Committed by Fritz Reese

Fix some whitespace.

	gcc/fortran/
	* decl.c (get_struct_decl, gfc_match_map, gfc_match_union): Fix
	whitespace.
	* interface.c (gfc_compare_union_types): Likewise.

From-SVN: r242057
parent f065303f
2016-11-10 Fritz O. Reese <fritzoreese@gmail.com>
* decl.c (get_struct_decl, gfc_match_map, gfc_match_union): Fix
whitespace.
* interface.c (gfc_compare_union_types): Likewise.
2016-11-10 Jakub Jelinek <jakub@redhat.com> 2016-11-10 Jakub Jelinek <jakub@redhat.com>
* cpp.c (cpp_define_builtins): Define _OPENMP to 201511 instead * cpp.c (cpp_define_builtins): Define _OPENMP to 201511 instead
......
...@@ -8597,31 +8597,31 @@ get_struct_decl (const char *name, sym_flavor fl, locus *decl, ...@@ -8597,31 +8597,31 @@ get_struct_decl (const char *name, sym_flavor fl, locus *decl,
match match
gfc_match_map (void) gfc_match_map (void)
{ {
/* Counter used to give unique internal names to map structures. */ /* Counter used to give unique internal names to map structures. */
static unsigned int gfc_map_id = 0; static unsigned int gfc_map_id = 0;
char name[GFC_MAX_SYMBOL_LEN + 1]; char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_symbol *sym; gfc_symbol *sym;
locus old_loc; locus old_loc;
old_loc = gfc_current_locus; old_loc = gfc_current_locus;
if (gfc_match_eos () != MATCH_YES) if (gfc_match_eos () != MATCH_YES)
{ {
gfc_error ("Junk after MAP statement at %C"); gfc_error ("Junk after MAP statement at %C");
gfc_current_locus = old_loc; gfc_current_locus = old_loc;
return MATCH_ERROR; return MATCH_ERROR;
} }
/* Map blocks are anonymous so we make up unique names for the symbol table /* Map blocks are anonymous so we make up unique names for the symbol table
which are invalid Fortran identifiers. */ which are invalid Fortran identifiers. */
snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "MM$%u", gfc_map_id++); snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "MM$%u", gfc_map_id++);
if (!get_struct_decl (name, FL_STRUCT, &old_loc, &sym)) if (!get_struct_decl (name, FL_STRUCT, &old_loc, &sym))
return MATCH_ERROR; return MATCH_ERROR;
gfc_new_block = sym; gfc_new_block = sym;
return MATCH_YES; return MATCH_YES;
} }
...@@ -8630,31 +8630,31 @@ gfc_match_map (void) ...@@ -8630,31 +8630,31 @@ gfc_match_map (void)
match match
gfc_match_union (void) gfc_match_union (void)
{ {
/* Counter used to give unique internal names to union types. */ /* Counter used to give unique internal names to union types. */
static unsigned int gfc_union_id = 0; static unsigned int gfc_union_id = 0;
char name[GFC_MAX_SYMBOL_LEN + 1]; char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_symbol *sym; gfc_symbol *sym;
locus old_loc; locus old_loc;
old_loc = gfc_current_locus; old_loc = gfc_current_locus;
if (gfc_match_eos () != MATCH_YES) if (gfc_match_eos () != MATCH_YES)
{ {
gfc_error ("Junk after UNION statement at %C"); gfc_error ("Junk after UNION statement at %C");
gfc_current_locus = old_loc; gfc_current_locus = old_loc;
return MATCH_ERROR; return MATCH_ERROR;
} }
/* Unions are anonymous so we make up unique names for the symbol table /* Unions are anonymous so we make up unique names for the symbol table
which are invalid Fortran identifiers. */ which are invalid Fortran identifiers. */
snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "UU$%u", gfc_union_id++); snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "UU$%u", gfc_union_id++);
if (!get_struct_decl (name, FL_UNION, &old_loc, &sym)) if (!get_struct_decl (name, FL_UNION, &old_loc, &sym))
return MATCH_ERROR; return MATCH_ERROR;
gfc_new_block = sym; gfc_new_block = sym;
return MATCH_YES; return MATCH_YES;
} }
...@@ -8666,67 +8666,67 @@ gfc_match_union (void) ...@@ -8666,67 +8666,67 @@ gfc_match_union (void)
match match
gfc_match_structure_decl (void) gfc_match_structure_decl (void)
{ {
/* Counter used to give unique internal names to anonymous structures. */ /* Counter used to give unique internal names to anonymous structures. */
static unsigned int gfc_structure_id = 0; static unsigned int gfc_structure_id = 0;
char name[GFC_MAX_SYMBOL_LEN + 1]; char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_symbol *sym; gfc_symbol *sym;
match m; match m;
locus where; locus where;
if(!flag_dec_structure) if (!flag_dec_structure)
{ {
gfc_error ("STRUCTURE at %C is a DEC extension, enable with " gfc_error ("STRUCTURE at %C is a DEC extension, enable with "
"-fdec-structure"); "-fdec-structure");
return MATCH_ERROR; return MATCH_ERROR;
} }
name[0] = '\0'; name[0] = '\0';
m = gfc_match (" /%n/", name); m = gfc_match (" /%n/", name);
if (m != MATCH_YES) if (m != MATCH_YES)
{ {
/* Non-nested structure declarations require a structure name. */ /* Non-nested structure declarations require a structure name. */
if (!gfc_comp_struct (gfc_current_state ())) if (!gfc_comp_struct (gfc_current_state ()))
{ {
gfc_error ("Structure name expected in non-nested structure " gfc_error ("Structure name expected in non-nested structure "
"declaration at %C"); "declaration at %C");
return MATCH_ERROR; return MATCH_ERROR;
} }
/* This is an anonymous structure; make up a unique name for it /* This is an anonymous structure; make up a unique name for it
(upper-case letters never make it to symbol names from the source). (upper-case letters never make it to symbol names from the source).
The important thing is initializing the type variable The important thing is initializing the type variable
and setting gfc_new_symbol, which is immediately used by and setting gfc_new_symbol, which is immediately used by
parse_structure () and variable_decl () to add components of parse_structure () and variable_decl () to add components of
this type. */ this type. */
snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "SS$%u", gfc_structure_id++); snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "SS$%u", gfc_structure_id++);
} }
where = gfc_current_locus; where = gfc_current_locus;
/* No field list allowed after non-nested structure declaration. */ /* No field list allowed after non-nested structure declaration. */
if (!gfc_comp_struct (gfc_current_state ()) if (!gfc_comp_struct (gfc_current_state ())
&& gfc_match_eos () != MATCH_YES) && gfc_match_eos () != MATCH_YES)
{ {
gfc_error ("Junk after non-nested STRUCTURE statement at %C"); gfc_error ("Junk after non-nested STRUCTURE statement at %C");
return MATCH_ERROR; return MATCH_ERROR;
} }
/* Make sure the name is not the name of an intrinsic type. */ /* Make sure the name is not the name of an intrinsic type. */
if (gfc_is_intrinsic_typename (name)) if (gfc_is_intrinsic_typename (name))
{ {
gfc_error ("Structure name '%s' at %C cannot be the same as an" gfc_error ("Structure name '%s' at %C cannot be the same as an"
" intrinsic type", name); " intrinsic type", name);
return MATCH_ERROR; return MATCH_ERROR;
} }
/* Store the actual type symbol for the structure with an upper-case first /* Store the actual type symbol for the structure with an upper-case first
letter (an invalid Fortran identifier). */ letter (an invalid Fortran identifier). */
sprintf (name, gfc_dt_upper_string (name)); sprintf (name, gfc_dt_upper_string (name));
if (!get_struct_decl (name, FL_STRUCT, &where, &sym)) if (!get_struct_decl (name, FL_STRUCT, &where, &sym))
return MATCH_ERROR; return MATCH_ERROR;
gfc_new_block = sym; gfc_new_block = sym;
return MATCH_YES; return MATCH_YES;
} }
......
...@@ -558,46 +558,46 @@ gfc_compare_union_types (gfc_symbol *un1, gfc_symbol *un2) ...@@ -558,46 +558,46 @@ gfc_compare_union_types (gfc_symbol *un1, gfc_symbol *un2)
we will say they are not equal for the purposes of this test; therefore we will say they are not equal for the purposes of this test; therefore
we compare the maps sequentially. */ we compare the maps sequentially. */
for (;;) for (;;)
{ {
map1_t = map1->ts.u.derived; map1_t = map1->ts.u.derived;
map2_t = map2->ts.u.derived; map2_t = map2->ts.u.derived;
cmp1 = map1_t->components; cmp1 = map1_t->components;
cmp2 = map2_t->components; cmp2 = map2_t->components;
/* Protect against null components. */ /* Protect against null components. */
if (map1_t->attr.zero_comp != map2_t->attr.zero_comp) if (map1_t->attr.zero_comp != map2_t->attr.zero_comp)
return 0; return 0;
if (map1_t->attr.zero_comp) if (map1_t->attr.zero_comp)
return 1; return 1;
for (;;) for (;;)
{ {
/* No two fields will ever point to the same map type unless they are /* No two fields will ever point to the same map type unless they are
the same component, because one map field is created with its type the same component, because one map field is created with its type
declaration. Therefore don't worry about recursion here. */ declaration. Therefore don't worry about recursion here. */
/* TODO: worry about recursion into parent types of the unions? */ /* TODO: worry about recursion into parent types of the unions? */
if (compare_components (cmp1, cmp2, map1_t, map2_t) == 0) if (compare_components (cmp1, cmp2, map1_t, map2_t) == 0)
return 0; return 0;
cmp1 = cmp1->next; cmp1 = cmp1->next;
cmp2 = cmp2->next; cmp2 = cmp2->next;
if (cmp1 == NULL && cmp2 == NULL) if (cmp1 == NULL && cmp2 == NULL)
break; break;
if (cmp1 == NULL || cmp2 == NULL) if (cmp1 == NULL || cmp2 == NULL)
return 0; return 0;
} }
map1 = map1->next; map1 = map1->next;
map2 = map2->next; map2 = map2->next;
if (map1 == NULL && map2 == NULL) if (map1 == NULL && map2 == NULL)
break; break;
if (map1 == NULL || map2 == NULL) if (map1 == NULL || map2 == NULL)
return 0; return 0;
} }
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment