From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110284 invoked by alias); 26 Nov 2015 12:37:36 -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 110269 invoked by uid 89); 26 Nov 2015 12:37:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 26 Nov 2015 12:37:34 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id A9AD042E5C0; Thu, 26 Nov 2015 12:37:33 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAQCbW0G011720; Thu, 26 Nov 2015 07:37:32 -0500 Message-ID: <5656FD0B.9060001@redhat.com> Date: Thu, 26 Nov 2015 12:37:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Andrew Burgess , gdb-patches@sourceware.org Subject: Re: [PATCH 3/7] gdb: Small code restructure for list_command. References: <1c3dd6d5b28b0bb19a0d0b94e83c9182306722ab.1448411121.git.andrew.burgess@embecosm.com> In-Reply-To: <1c3dd6d5b28b0bb19a0d0b94e83c9182306722ab.1448411121.git.andrew.burgess@embecosm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-11/txt/msg00551.txt.bz2 On 11/25/2015 12:34 AM, Andrew Burgess wrote: > Move handling of special +/- arguments to the list_command function > inside a single if block, this helps group all related functionality > together. There should be no user visible changes after this commit. > > gdb/ChangeLog: > > * cli/cli-cmds.c (list_command): Move all handling of +/- > arguments into a single if block. OK. > + if (arg == NULL || strcmp (arg, "+") == 0) > + { > + print_source_lines (cursal.symtab, cursal.line, > + cursal.line + get_lines_to_list (), 0); > + return; > + } > ... > + if (strcmp (arg, "-") == 0) > + { > + print_source_lines (cursal.symtab, > + max (get_first_line_listed () > + - get_lines_to_list (), 1), > + get_first_line_listed (), 0); > + return; > + } > } (Seems to me you could hoist the returns out now.) Thanks, Pedro Alves