From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18646 invoked by alias); 16 Sep 2011 14:38:47 -0000 Received: (qmail 18615 invoked by uid 22791); 16 Sep 2011 14:38:45 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,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, 16 Sep 2011 14:38:27 +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 p8GEcO2w016532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Sep 2011 10:38:24 -0400 Received: from host1.jankratochvil.net (ovpn-116-38.ams2.redhat.com [10.36.116.38]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p8GEcMKB009687 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Sep 2011 10:38:24 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p8GEcLxM007892; Fri, 16 Sep 2011 16:38:21 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p8GEcKsr007889; Fri, 16 Sep 2011 16:38:20 +0200 Date: Fri, 16 Sep 2011 14:44:00 -0000 From: Jan Kratochvil To: Abhijit Halder Cc: Pedro Alves , gdb-patches@sourceware.org Subject: Re: Some code-cleanup Message-ID: <20110916143820.GA5989@host1.jankratochvil.net> References: <201109121623.04292.pedro@codesourcery.com> <20110913092440.GA12661@host1.jankratochvil.net> <20110913215311.GA20018@host1.jankratochvil.net> <20110915081756.GA31743@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 2011-09/txt/msg00301.txt.bz2 On Fri, 16 Sep 2011 11:48:18 +0200, Abhijit Halder wrote: > On Thu, Sep 15, 2011 at 1:47 PM, Jan Kratochvil wrote: > > OK. > > Hi, still haven't copyright. But as I was told earlier, this patch need not > require a copyright assignment. Are we going to check this in? Sorry I missed you do not have the account/rights/assignment yet. This patch should not need the copyright assignment: http://www.gnu.org/prep/maintain/maintain.html#Legally-Significant Checked in. Thanks, Jan http://sourceware.org/ml/gdb-cvs/2011-09/msg00098.html --- src/gdb/ChangeLog 2011/09/15 18:33:15 1.13338 +++ src/gdb/ChangeLog 2011/09/16 14:36:52 1.13339 @@ -1,3 +1,16 @@ +2011-09-16 Abhijit Halder + + Code cleanup. + * parse.c (write_exp_elt): Change argument to pass a pointer of union + `exp_element' instead of an element of the same and make the function + static. + (write_exp_elt_opcode, write_exp_elt_sym, write_exp_elt_block) + (write_exp_elt_objfile, write_exp_elt_longcst, write_exp_elt_dblcst) + (write_exp_elt_decfloatcst, write_exp_elt_type, write_exp_elt_intern): + Change argument of `write_exp_elt' function call. + Remove extra spaces from comments. + * parser-defs.h (write_exp_elt): Remove prototype. + 2011-09-15 Paul Koning * python/py-cmd.c (gdbpy_string_to_argv): Decrement reference --- src/gdb/parse.c 2011/06/17 20:24:22 1.110 +++ src/gdb/parse.c 2011/09/16 14:36:55 1.111 @@ -23,7 +23,7 @@ along with this program. If not, see . */ /* Parse an expression from text in a string, - and return the result as a struct expression pointer. + and return the result as a struct expression pointer. That structure contains arithmetic operations in reverse polish, with constants represented by operations that are followed by special data. See expression.h for the details of the format. @@ -190,7 +190,7 @@ } } -/* This page contains the functions for adding data to the struct expression +/* This page contains the functions for adding data to the struct expression being constructed. */ /* Add one element to the end of the expression. */ @@ -198,8 +198,8 @@ /* To avoid a bug in the Sun 4 compiler, we pass things that can fit into a register through here. */ -void -write_exp_elt (union exp_element expelt) +static void +write_exp_elt (const union exp_element *expelt) { if (expout_ptr >= expout_size) { @@ -208,7 +208,7 @@ xrealloc ((char *) expout, sizeof (struct expression) + EXP_ELEM_TO_BYTES (expout_size)); } - expout->elts[expout_ptr++] = expelt; + expout->elts[expout_ptr++] = *expelt; } void @@ -218,7 +218,7 @@ memset (&tmp, 0, sizeof (union exp_element)); tmp.opcode = expelt; - write_exp_elt (tmp); + write_exp_elt (&tmp); } void @@ -228,7 +228,7 @@ memset (&tmp, 0, sizeof (union exp_element)); tmp.symbol = expelt; - write_exp_elt (tmp); + write_exp_elt (&tmp); } void @@ -238,7 +238,7 @@ memset (&tmp, 0, sizeof (union exp_element)); tmp.block = b; - write_exp_elt (tmp); + write_exp_elt (&tmp); } void @@ -248,7 +248,7 @@ memset (&tmp, 0, sizeof (union exp_element)); tmp.objfile = objfile; - write_exp_elt (tmp); + write_exp_elt (&tmp); } void @@ -258,7 +258,7 @@ memset (&tmp, 0, sizeof (union exp_element)); tmp.longconst = expelt; - write_exp_elt (tmp); + write_exp_elt (&tmp); } void @@ -268,7 +268,7 @@ memset (&tmp, 0, sizeof (union exp_element)); tmp.doubleconst = expelt; - write_exp_elt (tmp); + write_exp_elt (&tmp); } void @@ -280,7 +280,7 @@ for (index = 0; index < 16; index++) tmp.decfloatconst[index] = expelt[index]; - write_exp_elt (tmp); + write_exp_elt (&tmp); } void @@ -290,7 +290,7 @@ memset (&tmp, 0, sizeof (union exp_element)); tmp.type = expelt; - write_exp_elt (tmp); + write_exp_elt (&tmp); } void @@ -300,7 +300,7 @@ memset (&tmp, 0, sizeof (union exp_element)); tmp.internalvar = expelt; - write_exp_elt (tmp); + write_exp_elt (&tmp); } /* Add a string constant to the end of the expression. @@ -1059,7 +1059,7 @@ } /* Read an expression from the string *STRINGPTR points to, - parse it, and return a pointer to a struct expression that we malloc. + parse it, and return a pointer to a struct expression that we malloc. Use block BLOCK as the lexical context for variable names; if BLOCK is zero, use the block of the selected stack frame. Meanwhile, advance *STRINGPTR to point after the expression, --- src/gdb/parser-defs.h 2011/01/10 20:38:49 1.39 +++ src/gdb/parser-defs.h 2011/09/16 14:36:55 1.40 @@ -131,8 +131,6 @@ extern union type_stack_elt *type_stack; extern int type_stack_depth, type_stack_size; -extern void write_exp_elt (union exp_element); - extern void write_exp_elt_opcode (enum exp_opcode); extern void write_exp_elt_sym (struct symbol *);