summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorforeese <foreese@138bc75d-0d04-0410-961f-82ee72b054a4>2016-11-10 21:54:48 +0000
committerforeese <foreese@138bc75d-0d04-0410-961f-82ee72b054a4>2016-11-10 21:54:48 +0000
commitac1739da2f62064ef7cd6ed8000a5bd64030b43e (patch)
tree1b848f307ec6f5df1c86adced8e648c82b497701
parent31db86df8fa1d3248c97de6c47dbd76fb74eaa8e (diff)
downloadgcc-ac1739da2f62064ef7cd6ed8000a5bd64030b43e.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242057 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/decl.c182
-rw-r--r--gcc/fortran/interface.c64
3 files changed, 129 insertions, 123 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 012d211ff00..0872b494327 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+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>
* cpp.c (cpp_define_builtins): Define _OPENMP to 201511 instead
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 0120cebb322..1272f1fe529 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -8597,31 +8597,31 @@ get_struct_decl (const char *name, sym_flavor fl, locus *decl,
match
gfc_match_map (void)
{
- /* Counter used to give unique internal names to map structures. */
- static unsigned int gfc_map_id = 0;
- char name[GFC_MAX_SYMBOL_LEN + 1];
- gfc_symbol *sym;
- locus old_loc;
+ /* Counter used to give unique internal names to map structures. */
+ static unsigned int gfc_map_id = 0;
+ char name[GFC_MAX_SYMBOL_LEN + 1];
+ gfc_symbol *sym;
+ locus old_loc;
- old_loc = gfc_current_locus;
+ old_loc = gfc_current_locus;
- if (gfc_match_eos () != MATCH_YES)
- {
- gfc_error ("Junk after MAP statement at %C");
- gfc_current_locus = old_loc;
- return MATCH_ERROR;
- }
+ if (gfc_match_eos () != MATCH_YES)
+ {
+ gfc_error ("Junk after MAP statement at %C");
+ gfc_current_locus = old_loc;
+ return MATCH_ERROR;
+ }
- /* Map blocks are anonymous so we make up unique names for the symbol table
- which are invalid Fortran identifiers. */
- snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "MM$%u", gfc_map_id++);
+ /* Map blocks are anonymous so we make up unique names for the symbol table
+ which are invalid Fortran identifiers. */
+ snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "MM$%u", gfc_map_id++);
- if (!get_struct_decl (name, FL_STRUCT, &old_loc, &sym))
- return MATCH_ERROR;
+ if (!get_struct_decl (name, FL_STRUCT, &old_loc, &sym))
+ 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)
match
gfc_match_union (void)
{
- /* Counter used to give unique internal names to union types. */
- static unsigned int gfc_union_id = 0;
- char name[GFC_MAX_SYMBOL_LEN + 1];
- gfc_symbol *sym;
- locus old_loc;
+ /* Counter used to give unique internal names to union types. */
+ static unsigned int gfc_union_id = 0;
+ char name[GFC_MAX_SYMBOL_LEN + 1];
+ gfc_symbol *sym;
+ locus old_loc;
- old_loc = gfc_current_locus;
+ old_loc = gfc_current_locus;
- if (gfc_match_eos () != MATCH_YES)
- {
- gfc_error ("Junk after UNION statement at %C");
- gfc_current_locus = old_loc;
- return MATCH_ERROR;
- }
+ if (gfc_match_eos () != MATCH_YES)
+ {
+ gfc_error ("Junk after UNION statement at %C");
+ gfc_current_locus = old_loc;
+ return MATCH_ERROR;
+ }
- /* Unions are anonymous so we make up unique names for the symbol table
- which are invalid Fortran identifiers. */
- snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "UU$%u", gfc_union_id++);
+ /* Unions are anonymous so we make up unique names for the symbol table
+ which are invalid Fortran identifiers. */
+ snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "UU$%u", gfc_union_id++);
- if (!get_struct_decl (name, FL_UNION, &old_loc, &sym))
- return MATCH_ERROR;
+ if (!get_struct_decl (name, FL_UNION, &old_loc, &sym))
+ 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)
match
gfc_match_structure_decl (void)
{
- /* Counter used to give unique internal names to anonymous structures. */
- static unsigned int gfc_structure_id = 0;
- char name[GFC_MAX_SYMBOL_LEN + 1];
- gfc_symbol *sym;
- match m;
- locus where;
+ /* Counter used to give unique internal names to anonymous structures. */
+ static unsigned int gfc_structure_id = 0;
+ char name[GFC_MAX_SYMBOL_LEN + 1];
+ gfc_symbol *sym;
+ match m;
+ locus where;
- if(!flag_dec_structure)
- {
- gfc_error ("STRUCTURE at %C is a DEC extension, enable with "
- "-fdec-structure");
- return MATCH_ERROR;
- }
+ if (!flag_dec_structure)
+ {
+ gfc_error ("STRUCTURE at %C is a DEC extension, enable with "
+ "-fdec-structure");
+ return MATCH_ERROR;
+ }
- name[0] = '\0';
+ name[0] = '\0';
- m = gfc_match (" /%n/", name);
- if (m != MATCH_YES)
- {
- /* Non-nested structure declarations require a structure name. */
- if (!gfc_comp_struct (gfc_current_state ()))
- {
- gfc_error ("Structure name expected in non-nested structure "
- "declaration at %C");
- return MATCH_ERROR;
- }
- /* This is an anonymous structure; make up a unique name for it
- (upper-case letters never make it to symbol names from the source).
- The important thing is initializing the type variable
- and setting gfc_new_symbol, which is immediately used by
- parse_structure () and variable_decl () to add components of
- this type. */
- snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "SS$%u", gfc_structure_id++);
- }
+ m = gfc_match (" /%n/", name);
+ if (m != MATCH_YES)
+ {
+ /* Non-nested structure declarations require a structure name. */
+ if (!gfc_comp_struct (gfc_current_state ()))
+ {
+ gfc_error ("Structure name expected in non-nested structure "
+ "declaration at %C");
+ return MATCH_ERROR;
+ }
+ /* This is an anonymous structure; make up a unique name for it
+ (upper-case letters never make it to symbol names from the source).
+ The important thing is initializing the type variable
+ and setting gfc_new_symbol, which is immediately used by
+ parse_structure () and variable_decl () to add components of
+ this type. */
+ snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "SS$%u", gfc_structure_id++);
+ }
- where = gfc_current_locus;
- /* No field list allowed after non-nested structure declaration. */
- if (!gfc_comp_struct (gfc_current_state ())
- && gfc_match_eos () != MATCH_YES)
- {
- gfc_error ("Junk after non-nested STRUCTURE statement at %C");
- return MATCH_ERROR;
- }
+ where = gfc_current_locus;
+ /* No field list allowed after non-nested structure declaration. */
+ if (!gfc_comp_struct (gfc_current_state ())
+ && gfc_match_eos () != MATCH_YES)
+ {
+ gfc_error ("Junk after non-nested STRUCTURE statement at %C");
+ return MATCH_ERROR;
+ }
- /* Make sure the name is not the name of an intrinsic type. */
- if (gfc_is_intrinsic_typename (name))
- {
- gfc_error ("Structure name '%s' at %C cannot be the same as an"
- " intrinsic type", name);
- return MATCH_ERROR;
- }
+ /* Make sure the name is not the name of an intrinsic type. */
+ if (gfc_is_intrinsic_typename (name))
+ {
+ gfc_error ("Structure name '%s' at %C cannot be the same as an"
+ " intrinsic type", name);
+ return MATCH_ERROR;
+ }
- /* Store the actual type symbol for the structure with an upper-case first
- letter (an invalid Fortran identifier). */
+ /* Store the actual type symbol for the structure with an upper-case first
+ letter (an invalid Fortran identifier). */
- sprintf (name, gfc_dt_upper_string (name));
- if (!get_struct_decl (name, FL_STRUCT, &where, &sym))
- return MATCH_ERROR;
+ sprintf (name, gfc_dt_upper_string (name));
+ if (!get_struct_decl (name, FL_STRUCT, &where, &sym))
+ return MATCH_ERROR;
- gfc_new_block = sym;
- return MATCH_YES;
+ gfc_new_block = sym;
+ return MATCH_YES;
}
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 98a61dfe3bc..a0cb0bb9ce3 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -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 compare the maps sequentially. */
for (;;)
- {
- map1_t = map1->ts.u.derived;
- map2_t = map2->ts.u.derived;
+ {
+ map1_t = map1->ts.u.derived;
+ map2_t = map2->ts.u.derived;
- cmp1 = map1_t->components;
- cmp2 = map2_t->components;
+ cmp1 = map1_t->components;
+ cmp2 = map2_t->components;
- /* Protect against null components. */
- if (map1_t->attr.zero_comp != map2_t->attr.zero_comp)
- return 0;
+ /* Protect against null components. */
+ if (map1_t->attr.zero_comp != map2_t->attr.zero_comp)
+ return 0;
- if (map1_t->attr.zero_comp)
- return 1;
+ if (map1_t->attr.zero_comp)
+ return 1;
- for (;;)
- {
- /* 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
- declaration. Therefore don't worry about recursion here. */
- /* TODO: worry about recursion into parent types of the unions? */
- if (compare_components (cmp1, cmp2, map1_t, map2_t) == 0)
- return 0;
+ for (;;)
+ {
+ /* 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
+ declaration. Therefore don't worry about recursion here. */
+ /* TODO: worry about recursion into parent types of the unions? */
+ if (compare_components (cmp1, cmp2, map1_t, map2_t) == 0)
+ return 0;
- cmp1 = cmp1->next;
- cmp2 = cmp2->next;
+ cmp1 = cmp1->next;
+ cmp2 = cmp2->next;
- if (cmp1 == NULL && cmp2 == NULL)
- break;
- if (cmp1 == NULL || cmp2 == NULL)
- return 0;
- }
+ if (cmp1 == NULL && cmp2 == NULL)
+ break;
+ if (cmp1 == NULL || cmp2 == NULL)
+ return 0;
+ }
- map1 = map1->next;
- map2 = map2->next;
+ map1 = map1->next;
+ map2 = map2->next;
- if (map1 == NULL && map2 == NULL)
- break;
- if (map1 == NULL || map2 == NULL)
- return 0;
- }
+ if (map1 == NULL && map2 == NULL)
+ break;
+ if (map1 == NULL || map2 == NULL)
+ return 0;
+ }
return 1;
}