From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28970 invoked by alias); 29 Jan 2007 10:53:45 -0000 Received: (qmail 28952 invoked by uid 22791); 29 Jan 2007 10:53:43 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 29 Jan 2007 10:53:39 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1HBU8l-0000Ue-I9 for gdb-patches@sources.redhat.com; Mon, 29 Jan 2007 13:53:36 +0300 Received: from localhost ([127.0.0.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.50) id 1HBU8G-0000TT-RL; Mon, 29 Jan 2007 13:53:05 +0300 From: Vladimir Prus To: Nick Roberts Subject: Re: -var-info-path-expression Date: Mon, 29 Jan 2007 10:53:00 -0000 User-Agent: KMail/1.9.1 Cc: Daniel Jacobowitz , gdb-patches@sources.redhat.com References: <200612251200.42622.ghost@cs.msu.su> <200701281056.31488.ghost@cs.msu.su> <17852.24626.705301.541755@kahikatea.snap.net.nz> In-Reply-To: <17852.24626.705301.541755@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701291353.02239.ghost@cs.msu.su> 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: 2007-01/txt/msg00575.txt.bz2 On Sunday 28 January 2007 11:34, Nick Roberts wrote: > > > and propagate these changes back to struct language_specific so we have: > > > > > > static char * > > > name_of_child (struct varobj *var, int index) > > > { > > > return (char *) (*var->root->lang->describe_child) (CHILD_NAME, var, index); > > > > And have casts from void* to the right type? I'm not sure that's any > > advantage. > > Maybe using making a cast is as sinful as using a goto statement, I wouldn't > know, but I would call having four times fewer functions an advantage. "functions"? You mean having just one function pointer in language_specific? Yes, I agree that would be superiour and I plan to make such a change, separately. > Perhaps it would be better to use a macro e.g > > #define name_of_child(var, index) \ > (char *) (*var->root->lang->describe_child) (CHILD_NAME, var, index) I'm not sure, I don't quite see reason to introduce macros if we can avoid them. - Volodya