From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102872 invoked by alias); 26 Mar 2015 17:46:57 -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 102854 invoked by uid 89); 26 Mar 2015 17:46:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 26 Mar 2015 17:46:55 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2QHksZq024310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 26 Mar 2015 13:46:54 -0400 Received: from host1.jankratochvil.net (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2QHkcm4010114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 26 Mar 2015 13:46:47 -0400 Date: Thu, 26 Mar 2015 17:46:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [obv] Code cleanup: Move print_command_1 expr variable scope Message-ID: <20150326174630.GA3349@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: message/rfc822 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00862.txt.bz2 From: Jan Kratochvil Date: Thu, 26 Mar 2015 18:44:38 +0100 Subject: [PATCH] Code cleanup: Move print_command_1 expr variable scope Content-length: 1387 gdb/ChangeLog 2015-03-26 Jan Kratochvil Code cleanup. * printcmd.c (print_command_1): Move expr variable scope. --- gdb/ChangeLog | 5 +++++ gdb/printcmd.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 55a8383..94ef5c8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,6 +1,11 @@ 2015-03-26 Jan Kratochvil Code cleanup. + * printcmd.c (print_command_1): Move expr variable scope. + +2015-03-26 Jan Kratochvil + + Code cleanup. * printcmd.c (validate_format): Make the parameter cmdname const. 2015-03-26 Don Breazeal diff --git a/gdb/printcmd.c b/gdb/printcmd.c index deb501a..a1451f8 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -946,7 +946,6 @@ validate_format (struct format_data fmt, const char *cmdname) static void print_command_1 (const char *exp, int voidprint) { - struct expression *expr; struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); char format = 0; struct value *val; @@ -969,6 +968,8 @@ print_command_1 (const char *exp, int voidprint) if (exp && *exp) { + struct expression *expr; + expr = parse_expression (exp); make_cleanup (free_current_contents, &expr); val = evaluate_expression (expr); -- 2.3.4