This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 15/18] fix up vec
- From: Ondrej Oprala <ooprala at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Wed, 9 Oct 2013 19:17:30 +0200
- Subject: [PATCH 15/18] fix up vec
- Authentication-results: sourceware.org; auth=none
- References: <1381339053-14519-1-git-send-email-ooprala at redhat dot com>
From: Tom Tromey <tromey@redhat.com>
* common/vec.c (vec_p_preserve) : Add typedefs to struct vec_prefix *.
* common/vec.h (VEC_OP) : Add typedefs to VEC(T).
---
gdb/ChangeLog | 5 +++++
gdb/common/vec.c | 2 +-
gdb/common/vec.h | 8 ++++----
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fab9b6a..7cbf071 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -17,6 +17,11 @@
2013-10-09 Tom Tromey <tromey@redhat.com>
+ * common/vec.c (vec_p_preserve) : Add typedefs to struct vec_prefix *.
+ * common/vec.h (VEC_OP) : Add typedefs to VEC(T).
+
+2013-10-09 Tom Tromey <tromey@redhat.com>
+
* block.c (using_direct) : Renamed from using.
* block.h (using_direct) : Likewise.
diff --git a/gdb/common/vec.c b/gdb/common/vec.c
index 2a82afb..2890818 100644
--- a/gdb/common/vec.c
+++ b/gdb/common/vec.c
@@ -95,7 +95,7 @@ vec_p_reserve (void *vec, int reserve)
void *
vec_o_reserve (void *vec, int reserve, size_t vec_offset, size_t elt_size)
{
- struct vec_prefix *pfx = vec;
+ struct vec_prefix *pfx = (struct vec_prefix *) vec;
unsigned alloc = calculate_allocation (pfx, reserve);
if (!alloc)
diff --git a/gdb/common/vec.h b/gdb/common/vec.h
index 86564e7..7669edf 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