This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C PATCH]: tidy some code


Hi,
I've installed the attached as an obvious tidy up.

built & tested on i686-pc-linux-gnu.

nathan
--
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org

2002-11-26  Nathan Sidwell  <nathan@codesourcery.com>

	* c-decl.c: (start_struct): Commonize flag setting.

Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.354
diff -c -3 -p -r1.354 c-decl.c
*** c-decl.c	20 Nov 2002 10:37:08 -0000	1.354
--- c-decl.c	26 Nov 2002 15:16:50 -0000
*************** start_struct (code, name)
*** 4954,4978 ****
      ref = lookup_tag (code, name, current_binding_level, 1);
    if (ref && TREE_CODE (ref) == code)
      {
-       C_TYPE_BEING_DEFINED (ref) = 1;
-       TYPE_PACKED (ref) = flag_pack_struct;
        if (TYPE_FIELDS (ref))
          {
  	  if (code == UNION_TYPE)
! 	    error ("redefinition of `union %s'",
! 		   IDENTIFIER_POINTER (name));
            else
! 	    error ("redefinition of `struct %s'",
! 		   IDENTIFIER_POINTER (name));
  	}  
- 
-       return ref;
      }
  
!   /* Otherwise create a forward-reference just so the tag is in scope.  */
! 
!   ref = make_node (code);
!   pushtag (name, ref);
    C_TYPE_BEING_DEFINED (ref) = 1;
    TYPE_PACKED (ref) = flag_pack_struct;
    return ref;
--- 4954,4975 ----
      ref = lookup_tag (code, name, current_binding_level, 1);
    if (ref && TREE_CODE (ref) == code)
      {
        if (TYPE_FIELDS (ref))
          {
  	  if (code == UNION_TYPE)
! 	    error ("redefinition of `union %s'", IDENTIFIER_POINTER (name));
            else
! 	    error ("redefinition of `struct %s'", IDENTIFIER_POINTER (name));
  	}  
      }
+   else
+     {
+       /* Otherwise create a forward-reference just so the tag is in scope.  */
  
!       ref = make_node (code);
!       pushtag (name, ref);
!     }
!   
    C_TYPE_BEING_DEFINED (ref) = 1;
    TYPE_PACKED (ref) = flag_pack_struct;
    return ref;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]