From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17562 invoked by alias); 13 Oct 2013 17:29:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 17548 invoked by uid 89); 13 Oct 2013 17:29:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 13 Oct 2013 17:29:28 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9DHTQSb012189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 13 Oct 2013 13:29:27 -0400 Received: from host2.jankratochvil.net (ovpn-116-94.ams2.redhat.com [10.36.116.94]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9DHTNKD003285 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 13 Oct 2013 13:29:25 -0400 Date: Sun, 13 Oct 2013 17:29:00 -0000 From: Jan Kratochvil To: Ondrej Oprala Cc: gdb-patches@sourceware.org, Tom Tromey Subject: Re: [PATCH 15/18] fix up vec Message-ID: <20131013172922.GK12719@host2.jankratochvil.net> References: <1381339053-14519-1-git-send-email-ooprala@redhat.com> <1381339053-14519-16-git-send-email-ooprala@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1381339053-14519-16-git-send-email-ooprala@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00417.txt.bz2 On Wed, 09 Oct 2013 19:17:30 +0200, Ondrej Oprala wrote: > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -17,6 +17,11 @@ > > 2013-10-09 Tom Tromey > > + * common/vec.c (vec_p_preserve) : Add typedefs to struct vec_prefix *. The function is called vec_o_reserve. And it is not 'typedefs', it is 'cast'. > + * common/vec.h (VEC_OP) : Add typedefs to VEC(T). Here you should described many modified entries like vec_free_ or DEF_VEC_ALLOC_FUNC_I. ChangeLog is not correct, described elsewhere. > + > +2013-10-09 Tom Tromey > + > * 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) I find safer here: #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 Thanks, Jan