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]

[VEC] Fix VEC_space's result value


This patch fixes the sense of VEC_space's result to match the
documentation.  A forthcoming patch fell over this snafu.

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

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2004-09-22  Nathan Sidwell  <nathan@codesourcery.com>

	* vec.h (VEC_space): Return true if there _is_ space.
	(VEC_reserve): Adjust.

	* java/parse.y (patch_anonymous_class): VEC_space returns true if
	there is space.

Index: vec.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/vec.h,v
retrieving revision 2.21
diff -c -3 -p -r2.21 vec.h
*** vec.h	17 Sep 2004 09:14:12 -0000	2.21
--- vec.h	22 Sep 2004 08:38:26 -0000
*************** static inline int VEC_OP (TDEF,space)	  
*** 452,464 ****
       (VEC (TDEF) *vec_, int alloc_)					  \
  {									  \
    return vec_ ? ((vec_)->alloc - (vec_)->num				  \
! 		 < (unsigned)(alloc_ < 0 ? 1 : alloc_)) : alloc_ != 0;	  \
  }									  \
  									  \
  static inline int VEC_OP (TDEF,reserve)	       				  \
       (VEC (TDEF) **vec_, int alloc_ MEM_STAT_DECL)			  \
  {									  \
!   int extend = VEC_OP (TDEF,space) (*vec_, alloc_);			  \
  		  							  \
    if (extend)	  							  \
      *vec_ = (VEC (TDEF) *) vec_##a##_p_reserve (*vec_, alloc_ PASS_MEM_STAT);   \
--- 452,464 ----
       (VEC (TDEF) *vec_, int alloc_)					  \
  {									  \
    return vec_ ? ((vec_)->alloc - (vec_)->num				  \
! 		 >= (unsigned)(alloc_ < 0 ? 1 : alloc_)) : !alloc_;	  \
  }									  \
  									  \
  static inline int VEC_OP (TDEF,reserve)	       				  \
       (VEC (TDEF) **vec_, int alloc_ MEM_STAT_DECL)			  \
  {									  \
!   int extend = !VEC_OP (TDEF,space) (*vec_, alloc_);			  \
  		  							  \
    if (extend)	  							  \
      *vec_ = (VEC (TDEF) *) vec_##a##_p_reserve (*vec_, alloc_ PASS_MEM_STAT);   \
*************** static inline int VEC_OP (TDEF,space)	  
*** 683,695 ****
       (VEC (TDEF) *vec_, int alloc_)					  \
  {									  \
    return vec_ ? ((vec_)->alloc - (vec_)->num				  \
! 		 < (unsigned)(alloc_ < 0 ? 1 : alloc_)) : alloc_ != 0;	  \
  }									  \
  									  \
  static inline int VEC_OP (TDEF,reserve)	   	    			  \
       (VEC (TDEF) **vec_, int alloc_ MEM_STAT_DECL)			  \
  {									  \
!   int extend = VEC_OP (TDEF,space) (*vec_, alloc_);			  \
  									  \
    if (extend)								  \
      *vec_ = (VEC (TDEF) *) vec_##a##_o_reserve (*vec_, alloc_,		  \
--- 683,695 ----
       (VEC (TDEF) *vec_, int alloc_)					  \
  {									  \
    return vec_ ? ((vec_)->alloc - (vec_)->num				  \
! 		 >= (unsigned)(alloc_ < 0 ? 1 : alloc_)) : !alloc_;	  \
  }									  \
  									  \
  static inline int VEC_OP (TDEF,reserve)	   	    			  \
       (VEC (TDEF) **vec_, int alloc_ MEM_STAT_DECL)			  \
  {									  \
!   int extend = !VEC_OP (TDEF,space) (*vec_, alloc_);			  \
  									  \
    if (extend)								  \
      *vec_ = (VEC (TDEF) *) vec_##a##_o_reserve (*vec_, alloc_,		  \
Index: java/parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.505
diff -c -3 -p -r1.505 parse.y
*** java/parse.y	17 Sep 2004 21:55:01 -0000	1.505
--- java/parse.y	22 Sep 2004 08:38:59 -0000
*************** patch_anonymous_class (tree type_decl, t
*** 3904,3910 ****
        if (parser_check_super_interface (type_decl, class_decl, wfl))
  	return;
  
!       if (VEC_space (tree, BINFO_BASE_BINFOS (binfo), 1))
  	{
  	   /* Extend the binfo - by reallocating and copying it. */
  	  tree new_binfo;
--- 3904,3910 ----
        if (parser_check_super_interface (type_decl, class_decl, wfl))
  	return;
  
!       if (!VEC_space (tree, BINFO_BASE_BINFOS (binfo), 1))
  	{
  	   /* Extend the binfo - by reallocating and copying it. */
  	  tree new_binfo;

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