From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28222 invoked by alias); 28 Oct 2008 18:43:21 -0000 Received: (qmail 28209 invoked by uid 22791); 28 Oct 2008 18:43:20 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate8.de.ibm.com (HELO mtagate8.de.ibm.com) (195.212.29.157) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 28 Oct 2008 18:42:37 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.13.8/8.13.8) with ESMTP id m9SIg9q9433996 for ; Tue, 28 Oct 2008 18:42:09 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m9SIg9Hb3383442 for ; Tue, 28 Oct 2008 19:42:09 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m9SIg8ab021468 for ; Tue, 28 Oct 2008 19:42:09 +0100 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m9SIg8gc021463; Tue, 28 Oct 2008 19:42:08 +0100 Message-Id: <200810281842.m9SIg8gc021463@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 28 Oct 2008 19:42:08 +0100 Subject: Re: [RFC/RFA] add struct parse_context to all command functions To: tromey@redhat.com Date: Tue, 28 Oct 2008 20:00:00 -0000 From: "Ulrich Weigand" Cc: brobecker@adacore.com (Joel Brobecker), gdb-patches@sourceware.org In-Reply-To: from "Tom Tromey" at Oct 28, 2008 11:50:45 AM X-Mailer: ELM [version 2.5 PL2] 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: 2008-10/txt/msg00682.txt.bz2 Tom Tromey wrote: > Ulrich> - In some cases (e.g. print_subexp_standard) you have multiple instances > Ulrich> within the same function where a local "opts" variable is created; > Ulrich> maybe it would be clearer to have a common "opts" initialized once > Ulrich> for the whole function? > > In a long function, like print_subexp_standard, I find it clearer to > have variables declared as locally as possible, because it is simpler > to see all the code referencing the local at once. I agree, if the variables are really independent. In this case, my thought was that we really want all parts of print_subexp_standard to use the *same* consistent set of printing options, so it might make sense to make this explicit by using a single variable to hold them. (Also, this would make it simple to pull the options out as an argument, if we ever see the need for invoking print_subexp_standard with different print modes ...) But this is really just a minor issue; I'm fine with the way it is. Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com