From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8938 invoked by alias); 19 Oct 2005 12:28:28 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 8903 invoked by uid 22791); 19 Oct 2005 12:28:23 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 19 Oct 2005 12:28:23 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1ESD3J-0001jw-1r; Wed, 19 Oct 2005 08:28:17 -0400 Date: Wed, 19 Oct 2005 12:28:00 -0000 From: Daniel Jacobowitz To: Andrew STUBBS Cc: Eli Zaretskii , gdb-patches@sources.redhat.com Subject: Re: PATCH: Problem union comparision in TUI Message-ID: <20051019122816.GA6583@nevyn.them.org> Mail-Followup-To: Andrew STUBBS , Eli Zaretskii , gdb-patches@sources.redhat.com References: <4353BA69.1030401@st.com> <43561685.3010300@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43561685.3010300@st.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-10/txt/msg00158.txt.bz2 On Wed, Oct 19, 2005 at 10:48:53AM +0100, Andrew STUBBS wrote: > Is there any reason for using a union here? It's not like one value is > float and the other int - both are ints and the fact that you can't tell > which you are using shows nobody actually uses the distinction (unless I > have missed something). The union doesn't save any space, nor does it > make the code any more efficient. > > We could just use: > > CORE_ADDR line_or_address; > > and leave it at that. I'd rather that. It seems possible to figure out which one it's using - always file line numbers for source displays and addresses for assembly displays. if ((win == TUI_SRC_WIN && bp->source_file && (strcmp (src->filename, bp->source_file) == 0) && bp->line_number == line->line_or_addr.line_no) || (win == TUI_DISASM_WIN && bp->loc->address == line->line_or_addr.addr)) But why bother... -- Daniel Jacobowitz CodeSourcery, LLC