From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22922 invoked by alias); 17 Sep 2012 10:46:25 -0000 Received: (qmail 22913 invoked by uid 22791); 17 Sep 2012 10:46:24 -0000 X-SWARE-Spam-Status: No, hits=-7.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 Sep 2012 10:46:06 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8HAk4fs013037 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 17 Sep 2012 06:46:04 -0400 Received: from spoyarek (vpn-224-34.phx2.redhat.com [10.3.224.34]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q8HAk27R004393; Mon, 17 Sep 2012 06:46:03 -0400 Date: Mon, 17 Sep 2012 10:46:00 -0000 From: Siddhesh Poyarekar To: Yao Qi Cc: Subject: Re: [obv][commit] Replace one/two use variables with their values Message-ID: <20120917161521.682a1273@spoyarek> In-Reply-To: <5056FC44.8090207@codesourcery.com> References: <20120917143102.467b3fce@spoyarek> <5056FC44.8090207@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: 2012-09/txt/msg00312.txt.bz2 On Mon, 17 Sep 2012 18:32:36 +0800, Yao wrote: > ... this part. We define a local variable 'eltlen', and use it > twice. Isn't a common programming practise? I don't object to this > patch, but want to know why do we do this change? Sorry, I should have mentioned this in my original email. I have been working on adding support for 64-bit struct offset and sizes, which meant expansion of the bitpos offset and the type.length to 64-bit. The discussion is here: http://sourceware.org/ml/gdb-patches/2012-08/msg00144.html These commits are an attempt to push in some of the more trivial fixes independently so that the final changeset is as small as possible. The net change size is still currently at about 7k lines, so I've not succeeded all that much with this patch at my goal of reducing the patch size, but I'm still trying :) Without these independent patches, the bitpos patch would have all these local variables expanded to ULONGEST, which is more of a mechanical change that can be avoided in the large patch. > > - else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4) > > + else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) > > == 4) regcache_raw_read (regcache, M68K_A0_REGNUM, valbuf); > > b.t.w, looks your mailer wrap your patch incorrectly. > Sorry about that; I copy-pasted the patch when I should have attached it, due to which claws mercilessly wrapped it at 72 lines. Will watch out for this. Regards, Siddhesh