public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [obv] Code cleanup: Move print_command_1 expr variable scope
Date: Thu, 26 Mar 2015 17:46:00 -0000	[thread overview]
Message-ID: <20150326174630.GA3349@host1.jankratochvil.net> (raw)


[-- Attachment #0: Type: message/rfc822, Size: 1567 bytes --]

From: Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: [PATCH] Code cleanup: Move print_command_1 expr variable scope
Date: Thu, 26 Mar 2015 18:44:38 +0100

gdb/ChangeLog
2015-03-26  Jan Kratochvil  <jan.kratochvil@redhat.com>

	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  <jan.kratochvil@redhat.com>
 
 	Code cleanup.
+	* printcmd.c (print_command_1): Move expr variable scope.
+
+2015-03-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Code cleanup.
 	* printcmd.c (validate_format): Make the parameter cmdname const.
 
 2015-03-26  Don Breazeal  <donb@codesourcery.com>
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

             reply	other threads:[~2015-03-26 17:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 17:46 Jan Kratochvil [this message]
2015-03-27 19:15 ` Simon Marchi
2015-03-27 19:22   ` Revert: " Jan Kratochvil
2015-03-27 19:24     ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150326174630.GA3349@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).