From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4587 invoked by alias); 14 Sep 2012 08:10:48 -0000 Received: (qmail 4578 invoked by uid 22791); 14 Sep 2012 08:10:45 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,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; Fri, 14 Sep 2012 08:10:29 +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 q8E8ASed009534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Sep 2012 04:10:28 -0400 Received: from host2.jankratochvil.net (ovpn-113-58.phx2.redhat.com [10.3.113.58]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q8E8APHv016081 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 14 Sep 2012 04:10:27 -0400 Date: Fri, 14 Sep 2012 08:10:00 -0000 From: Jan Kratochvil To: Siddhesh Poyarekar Cc: gdb-patches@sourceware.org Subject: Re: [obv][commit] Eliminate single-use variable PARAM_LEN Message-ID: <20120914081024.GA12094@host2.jankratochvil.net> References: <20120914123417.31bcf90b@spoyarek> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120914123417.31bcf90b@spoyarek> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-09/txt/msg00272.txt.bz2 Hi Siddhesh, On Fri, 14 Sep 2012 09:04:17 +0200, Siddhesh Poyarekar wrote: > I just committed a trivial commit to printcmd.c, replacing a single-use > variable with its value (TYPE_LENGTH). FYI one should post the patch content for list readers convenience, not just the reference. Thanks, Jan http://sourceware.org/ml/gdb-cvs/2012-09/msg00065.html --- src/gdb/ChangeLog 2012/09/14 00:54:57 1.14656 +++ src/gdb/ChangeLog 2012/09/14 07:00:37 1.14657 @@ -1,3 +1,8 @@ +2012-09-14 Siddhesh Poyarekar + + * printcmd.c (ui_printf): Eliminate single-use variable + PARAM_LEN. + 2012-09-14 Yao Qi Pedro Alves --- src/gdb/printcmd.c 2012/09/11 21:26:16 1.211 +++ src/gdb/printcmd.c 2012/09/14 07:00:42 1.212 @@ -2267,7 +2267,6 @@ /* Parameter data. */ struct type *param_type = value_type (val_args[i]); - unsigned int param_len = TYPE_LENGTH (param_type); struct gdbarch *gdbarch = get_type_arch (param_type); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -2329,8 +2328,8 @@ /* Conversion between different DFP types. */ if (TYPE_CODE (param_type) == TYPE_CODE_DECFLOAT) - decimal_convert (param_ptr, param_len, byte_order, - dec, dfp_len, byte_order); + decimal_convert (param_ptr, TYPE_LENGTH (param_type), + byte_order, dec, dfp_len, byte_order); else /* If this is a non-trivial conversion, just output 0. A correct converted value can be displayed by explicitly