From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22285 invoked by alias); 14 Sep 2012 02:38:34 -0000 Received: (qmail 22272 invoked by uid 22791); 14 Sep 2012 02:38:33 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Sep 2012 02:38:20 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TCLnP-0001Xk-M6 from Yao_Qi@mentor.com ; Thu, 13 Sep 2012 19:38:19 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 13 Sep 2012 19:38:19 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.1.289.1; Thu, 13 Sep 2012 19:38:18 -0700 Message-ID: <5052985F.70402@codesourcery.com> Date: Fri, 14 Sep 2012 02:38:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: CC: Subject: Re: [PATCH 1/4] new gdb_queue.h in common/. References: <1345775139-13576-1-git-send-email-yao@codesourcery.com> <1345775139-13576-2-git-send-email-yao@codesourcery.com> <20535.52070.49473.442620@ruffy2.mtv.corp.google.com> <503DE3E0.5070803@codesourcery.com> <20550.27760.260327.470212@ruffy2.mtv.corp.google.com> <50495FFA.5080107@codesourcery.com> <20558.20947.170261.875294@ruffy2.mtv.corp.google.com> <50509AD9.7010408@codesourcery.com> <20562.454.680299.970360@ruffy2.mtv.corp.google.com> In-Reply-To: <20562.454.680299.970360@ruffy2.mtv.corp.google.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2012-09/txt/msg00258.txt.bz2 On 09/13/2012 11:54 PM, dje@google.com wrote: > > +void \ > > +queue_ ## TYPE ## _remove_elem (QUEUE (TYPE) *q, \ > > + QUEUE_ITER (TYPE) *iter) \ > > +{ \ > > gdb_assert (q != NULL); > gdb_assert (iter != NULL && iter->p != NULL); > > > + if (iter->p == q->head || iter->p == q->tail) \ > > + { \ > > + if (iter->p == q->head) \ > > + q->head = iter->p->next; \ > > + if (iter->p == q->tail) \ > > + q->tail = iter->prev; \ > > + } \ > > + else \ > > + iter->prev->next = iter->p->next; \ > > + \ > > Need to check if q->free_func != NULL and call it on p->data. We don't have to delete p->data here, because we just remove element, and p->data may be used by user later, like function _remove, for example. User has to take care of deleting p->data in his 'operate' function. > I'm happy with the above nits fixed. Doug, thanks a lot for your patient review. Looks queue.h is in shape, and I'll post a V2 of this series. -- Yao