vec.h (VEC_space): Return true if there _is_ space.
authorNathan Sidwell <nathan@codesourcery.com>
Wed, 22 Sep 2004 10:51:42 +0000 (10:51 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 22 Sep 2004 10:51:42 +0000 (10:51 +0000)
* 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.

From-SVN: r87852

gcc/ChangeLog
gcc/java/ChangeLog
gcc/java/parse.y
gcc/vec.h

index dce40399ab2732f4d14ea48a6287530300b34ef8..01e949c7de132dba3720f5edef3ac0da77db8b4b 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-22  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * vec.h (VEC_space): Return true if there _is_ space.
+       (VEC_reserve): Adjust.
+
 2004-09-22  Richard Sandiford  <rsandifo@redhat.com>
 
        * config/mips/mips.c (mips_function_value): For o32, o64, n32 and n64,
index 0d705828e32389f50f88ce4e07aca3b32fc5c69a..94bbe670ffa601bb670a937f31c18aeb57714064 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-22  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * parse.y (patch_anonymous_class): VEC_space returns true if there
+       is space.
+
 2004-09-21  Matt Austern  <austern@apple.com>
 
        Fix bootstrap.
index 377c195323b14d2a1cf0c698be624863987a5591..b221a4c9f591894c1566f522c2caec632cadeec7 100644 (file)
@@ -3904,7 +3904,7 @@ patch_anonymous_class (tree type_decl, tree class_decl, tree wfl)
       if (parser_check_super_interface (type_decl, class_decl, wfl))
        return;
 
-      if (VEC_space (tree, BINFO_BASE_BINFOS (binfo), 1))
+      if (!VEC_space (tree, BINFO_BASE_BINFOS (binfo), 1))
        {
           /* Extend the binfo - by reallocating and copying it. */
          tree new_binfo;
index 3e272d40c4717ac88054de89cb94eb87f8e0b12d..3ab775d1f3b0bb57efaf36e06656b3205f360352 100644 (file)
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -452,13 +452,13 @@ static inline int VEC_OP (TDEF,space)                                       \
      (VEC (TDEF) *vec_, int alloc_)                                      \
 {                                                                        \
   return vec_ ? ((vec_)->alloc - (vec_)->num                             \
-                < (unsigned)(alloc_ < 0 ? 1 : alloc_)) : alloc_ != 0;    \
+                >= (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_);                      \
+  int extend = !VEC_OP (TDEF,space) (*vec_, alloc_);                     \
                                                                          \
   if (extend)                                                            \
     *vec_ = (VEC (TDEF) *) vec_##a##_p_reserve (*vec_, alloc_ PASS_MEM_STAT);   \
@@ -683,13 +683,13 @@ static inline int VEC_OP (TDEF,space)                                       \
      (VEC (TDEF) *vec_, int alloc_)                                      \
 {                                                                        \
   return vec_ ? ((vec_)->alloc - (vec_)->num                             \
-                < (unsigned)(alloc_ < 0 ? 1 : alloc_)) : alloc_ != 0;    \
+                >= (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_);                      \
+  int extend = !VEC_OP (TDEF,space) (*vec_, alloc_);                     \
                                                                          \
   if (extend)                                                            \
     *vec_ = (VEC (TDEF) *) vec_##a##_o_reserve (*vec_, alloc_,           \