From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88332 invoked by alias); 6 Jul 2015 16:18:02 -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 88291 invoked by uid 89); 6 Jul 2015 16:18:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-wg0-f47.google.com Received: from mail-wg0-f47.google.com (HELO mail-wg0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 06 Jul 2015 16:18:00 +0000 Received: by wgck11 with SMTP id k11so144914062wgc.0 for ; Mon, 06 Jul 2015 09:17:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7hm+TkpWU9eML2bHuF/B7evHtmNrtF62F47jHo4kWpg=; b=N7QQIaMcVW3CX0L11rRI+30T5V/p/Tgw6hKnFiYljHwiREcnUtR+htgGff6rOYyW3/ IOwPWtA14a9fr4zjBmNt4E2ZfWopBlm2JN+IKq6dLf3yjShBgM5YHzSlcPUExi0ACOS0 oAyH8wNzUP1oLHgzOOl1cqlYo41OGYv3HEunUiyN4VhCAF42f/ql+OGyb/mn47zI0Aqh qK55OECUV0TWJXYkgKVAhI27ygFS9hlnJExs6U7Dz4qdCty1KN1pRA9J8Qq15PjHqhLF FlyOxsZEb5gymigeNmMEiRnjdkPZBfg7gUkiddkNH3L3F2s/FlKqPa2VKHum24FUnRx0 qjgA== X-Gm-Message-State: ALoCoQmHRMXYwEwRS6UJhFgvQYzqAzSTL/G9YKknUtM9uPGI+Z9roz3wpdTCXI3JFezz9m062LEB X-Received: by 10.180.102.233 with SMTP id fr9mr74466550wib.3.1436199477276; Mon, 06 Jul 2015 09:17:57 -0700 (PDT) Received: from localhost (host81-131-205-201.range81-131.btcentralplus.com. [81.131.205.201]) by mx.google.com with ESMTPSA id i6sm28944659wjf.29.2015.07.06.09.17.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 09:17:56 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH] gdb/tui: Don't cast between window types. Date: Mon, 06 Jul 2015 16:18:00 -0000 Message-Id: X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00126.txt.bz2 I'll push the following patch as obvious in a couple of days if no one objects. Though the existing code is currently fine, I think the new version is clearer and more robust. OK to apply? Thanks, Andrew --- Instead of casting between structure types to get the 'tui_gen_win_info' info from a 'tui_win_info' access the generic member variable. This is inline with what is done throughout the rest of the tui code. gdb/ChangeLog: * tui/tui-win.c (tui_set_focus): Use structure member 'generic' instead of casting the structure type. --- gdb/ChangeLog | 5 +++++ gdb/tui/tui-win.c | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4636653..13d6da9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2015-07-06 Andrew Burgess + * tui/tui-win.c (tui_set_focus): Use structure member 'generic' + instead of casting the structure type. + +2015-07-06 Andrew Burgess + * tui/tui-data.c (tui_partial_win_by_name): Window name is const. (tui_win_name): Make parameter and result const. * tui/tui-data.h (tui_win_name): Make parameter and result const. diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index feb360b..629d54d 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -1059,8 +1059,7 @@ The window name specified must be valid and visible.\n")); tui_refresh_data_win (); xfree (buf_ptr); printf_filtered (_("Focus set to %s window.\n"), - tui_win_name ((struct tui_gen_win_info *) - tui_win_with_focus ())); + tui_win_name (&tui_win_with_focus ()->generic)); } else warning (_("Incorrect Number of Arguments.\n%s"), FOCUS_USAGE); -- 2.4.0