This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

[PATCH 15/18] fix up vec


From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* common/vec.c (vec_o_preserve): Add casts to struct vec_prefix *.
	* common/vec.h (vec_free_): Add a cast to VEC(T).
	(DEF_VEC_ALLOC_FUNC_I): Add a cast to VEC(T) where necessary
	in the definitions of VEC_OP.
	(DEF_VEC_ALLOC_FUNC_P): Likewise.
	(DEF_VEC_ALLOC_FUNC_O): Likewise.
---
 gdb/common/vec.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/common/vec.h b/gdb/common/vec.h
index 86564e7..8de353c 100644
--- a/gdb/common/vec.h
+++ b/gdb/common/vec.h
@@ -391,7 +391,7 @@
 /* Reallocate an array of elements with prefix.  */
 extern void *vec_p_reserve (void *, int);
 extern void *vec_o_reserve (void *, int, size_t, size_t);
-#define vec_free_(V) xfree (V)
+#define vec_free_(V) xfree ((void *) (V))
 
 #define VEC_ASSERT_INFO ,__FILE__,__LINE__
 #define VEC_ASSERT_DECL ,const char *file_,unsigned line_
@@ -501,7 +501,7 @@ static inline void VEC_OP (T,free)					  \
 static inline void VEC_OP (T,cleanup)					  \
      (void *arg_)							  \
 {									  \
-  VEC(T) **vec_ = arg_;							  \
+  VEC(T) **vec_ = (VEC(T) **) arg_;					  \
   if (*vec_)								  \
     vec_free_ (*vec_);							  \
   *vec_ = NULL;								  \
@@ -748,7 +748,7 @@ static inline void VEC_OP (T,free)					  \
 static inline void VEC_OP (T,cleanup)					  \
      (void *arg_)							  \
 {									  \
-  VEC(T) **vec_ = arg_;							  \
+  VEC(T) **vec_ = (VEC(T) **) arg_;					  \
   if (*vec_)								  \
     vec_free_ (*vec_);							  \
   *vec_ = NULL;								  \
@@ -1058,7 +1058,7 @@ static inline void VEC_OP (T,free)					  \
 static inline void VEC_OP (T,cleanup)					  \
      (void *arg_)							  \
 {									  \
-  VEC(T) **vec_ = arg_;							  \
+  VEC(T) **vec_ = (VEC(T) **) arg_;					  \
   if (*vec_)								  \
     vec_free_ (*vec_);							  \
   *vec_ = NULL;								  \
-- 
1.8.3.1


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