From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7760 invoked by alias); 23 Nov 2014 02:56:22 -0000 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 Received: (qmail 7725 invoked by uid 89); 23 Nov 2014 02:56:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 23 Nov 2014 02:56:10 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 20FD2116669; Sat, 22 Nov 2014 21:56:08 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 392SUTU3DRcr; Sat, 22 Nov 2014 21:56:08 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id B9F1A116668; Sat, 22 Nov 2014 21:56:07 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id D074B40F79; Sun, 23 Nov 2014 06:56:06 +0400 (RET) Date: Sun, 23 Nov 2014 02:56:00 -0000 From: Joel Brobecker To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Refine read_string Message-ID: <20141123025606.GW5774@adacore.com> References: <1408586943-24077-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1408586943-24077-1-git-send-email-yao@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-11/txt/msg00544.txt.bz2 Hi Yao, > In read_string, we have this line > > chunksize = (len == -1 ? min (8, fetchlimit) : fetchlimit); > > but chunksize is only used in the block that lne == -1, so IWBN to > move chunksize to the block in which it is used, and simplify the > condition setting chunksize. This patch also moves 'found_nul' to > inner block. This patch also splits a paragraph of comment into two, > and move them to different condition blocks (len > 0 and len == -1) > respectively. > > Rebuild GDB on x86-linux. Is it OK? > > gdb: > > 2014-08-21 Yao Qi > > * valprint.c (read_string): Move local variables 'found_nul', > 'chunksize' and 'limit' to inner scope. Update comments. Sorry for the delay in reviewing this. I like this small improvement. Would you mind applying it? -- Joel