From: Michael Snyder <msnyder@vmware.com>
To: "tromey@redhat.com" <tromey@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [patch] eval, valops, valarith, valprint, printcmd.c: delete unused variables.
Date: Fri, 07 May 2010 18:49:00 -0000 [thread overview]
Message-ID: <4BE4609E.1010506@vmware.com> (raw)
In-Reply-To: <m3aasbhbhf.fsf@fleche.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 652 bytes --]
Tom Tromey wrote:
>>>>>> "Michael" == Michael Snyder <msnyder@vmware.com> writes:
>
> Michael> struct value *
> Michael> value_cast_pointers (struct type *type, struct value *arg2)
> Michael> {
> Michael> - struct type *type1 = check_typedef (type);
> Michael> struct type *type2 = check_typedef (value_type (arg2));
> Michael> struct type *t1 = check_typedef (TYPE_TARGET_TYPE (type));
> Michael> struct type *t2 = check_typedef (TYPE_TARGET_TYPE (type2));
>
> In this case I think the intent is for t1 to reference type1, and not type.
> I would recommend making that change rather than deleting type1.
OK -- committed as attached.
[-- Attachment #2: type1.txt --]
[-- Type: text/plain, Size: 895 bytes --]
2010-05-07 Michael Snyder <msnyder@vmware.com>
* valops.c (value_cast_pointers): Restore unused variable 'type1',
and use it to compute variable 't1'.
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.241
diff -u -p -r1.241 valops.c
--- valops.c 7 May 2010 14:46:26 -0000 1.241
+++ valops.c 7 May 2010 18:48:11 -0000
@@ -300,8 +300,9 @@ value_cast_structs (struct type *type, s
struct value *
value_cast_pointers (struct type *type, struct value *arg2)
{
+ struct type *type1 = check_typedef (type);
struct type *type2 = check_typedef (value_type (arg2));
- struct type *t1 = check_typedef (TYPE_TARGET_TYPE (type));
+ struct type *t1 = check_typedef (TYPE_TARGET_TYPE (type1));
struct type *t2 = check_typedef (TYPE_TARGET_TYPE (type2));
if (TYPE_CODE (t1) == TYPE_CODE_STRUCT
prev parent reply other threads:[~2010-05-07 18:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-06 18:32 Michael Snyder
2010-05-07 17:23 ` Tom Tromey
2010-05-07 18:49 ` Michael Snyder [this message]
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=4BE4609E.1010506@vmware.com \
--to=msnyder@vmware.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/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