From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30913 invoked by alias); 7 May 2010 18:49:08 -0000 Received: (qmail 30901 invoked by uid 22791); 7 May 2010 18:49:08 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 May 2010 18:49:04 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id CF6AB28063; Fri, 7 May 2010 11:49:02 -0700 (PDT) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost4.vmware.com (Postfix) with ESMTP id C50F8C9CF9; Fri, 7 May 2010 11:49:02 -0700 (PDT) Message-ID: <4BE4609E.1010506@vmware.com> Date: Fri, 07 May 2010 18:49:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.22 (X11/20090609) MIME-Version: 1.0 To: "tromey@redhat.com" CC: "gdb-patches@sourceware.org" Subject: Re: [patch] eval, valops, valarith, valprint, printcmd.c: delete unused variables. References: <4BE30B48.9040800@vmware.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------020603090602030900080403" X-IsSubscribed: yes 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 X-SW-Source: 2010-05/txt/msg00197.txt.bz2 This is a multi-part message in MIME format. --------------020603090602030900080403 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 652 Tom Tromey wrote: >>>>>> "Michael" == Michael Snyder 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. --------------020603090602030900080403 Content-Type: text/plain; name="type1.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="type1.txt" Content-length: 895 2010-05-07 Michael Snyder * 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 --------------020603090602030900080403--