From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23958 invoked by alias); 16 Sep 2011 14:47:01 -0000 Received: (qmail 23950 invoked by uid 22791); 16 Sep 2011 14:47:00 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ww0-f43.google.com (HELO mail-ww0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Sep 2011 14:46:46 +0000 Received: by wwf27 with SMTP id 27so4667208wwf.12 for ; Fri, 16 Sep 2011 07:46:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.163.3 with SMTP id z3mr2654933wek.44.1316184404757; Fri, 16 Sep 2011 07:46:44 -0700 (PDT) Received: by 10.216.93.81 with HTTP; Fri, 16 Sep 2011 07:46:44 -0700 (PDT) In-Reply-To: <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> <20110916143820.GA5989@host1.jankratochvil.net> Date: Fri, 16 Sep 2011 14:47:00 -0000 Message-ID: Subject: Re: Some code-cleanup From: Abhijit Halder To: Jan Kratochvil Cc: Pedro Alves , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg00303.txt.bz2 On Fri, Sep 16, 2011 at 8:08 PM, Jan Kratochvil wrote: > 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. > I am seriously waiting to have it done very soon. Still waiting for a response coming back from management. > This patch should not need the copyright assignment: > =A0 =A0 =A0 =A0http://www.gnu.org/prep/maintain/maintain.html#Legally-Sig= nificant > > Checked in. > Thanks. > > Thanks, > Jan > > > http://sourceware.org/ml/gdb-cvs/2011-09/msg00098.html > > --- src/gdb/ChangeLog =A0 2011/09/15 18:33:15 =A0 =A0 1.13338 > +++ src/gdb/ChangeLog =A0 2011/09/16 14:36:52 =A0 =A0 1.13339 > @@ -1,3 +1,16 @@ > +2011-09-16 =A0Abhijit Halder =A0 > + > + =A0 =A0 =A0 Code cleanup. > + =A0 =A0 =A0 * parse.c (write_exp_elt): Change argument to pass a pointe= r of union > + =A0 =A0 =A0 `exp_element' instead of an element of the same and make th= e function > + =A0 =A0 =A0 static. > + =A0 =A0 =A0 (write_exp_elt_opcode, write_exp_elt_sym, write_exp_elt_blo= ck) > + =A0 =A0 =A0 (write_exp_elt_objfile, write_exp_elt_longcst, write_exp_el= t_dblcst) > + =A0 =A0 =A0 (write_exp_elt_decfloatcst, write_exp_elt_type, write_exp_e= lt_intern): > + =A0 =A0 =A0 Change argument of `write_exp_elt' function call. > + =A0 =A0 =A0 Remove extra spaces from comments. > + =A0 =A0 =A0 * parser-defs.h (write_exp_elt): Remove prototype. > + > =A02011-09-15 =A0Paul Koning =A0 > > =A0 =A0 =A0 =A0* python/py-cmd.c (gdbpy_string_to_argv): Decrement refere= nce > --- src/gdb/parse.c =A0 =A0 2011/06/17 20:24:22 =A0 =A0 1.110 > +++ src/gdb/parse.c =A0 =A0 2011/09/16 14:36:55 =A0 =A0 1.111 > @@ -23,7 +23,7 @@ > =A0 =A0along with this program. =A0If not, see . =A0*/ > > =A0/* Parse an expression from text in a string, > - =A0 and return the result as a =A0struct expression =A0pointer. > + =A0 and return the result as a struct expression pointer. > =A0 =A0That structure contains arithmetic operations in reverse polish, > =A0 =A0with constants represented by operations that are followed by spec= ial data. > =A0 =A0See expression.h for the details of the format. > @@ -190,7 +190,7 @@ > =A0 =A0 } > =A0} > > -/* This page contains the functions for adding data to the =A0struct exp= ression > +/* This page contains the functions for adding data to the struct expres= sion > =A0 =A0being constructed. =A0*/ > > =A0/* Add one element to the end of the expression. =A0*/ > @@ -198,8 +198,8 @@ > =A0/* To avoid a bug in the Sun 4 compiler, we pass things that can fit i= nto > =A0 =A0a register through here. =A0*/ > > -void > -write_exp_elt (union exp_element expelt) > +static void > +write_exp_elt (const union exp_element *expelt) > =A0{ > =A0 if (expout_ptr >=3D expout_size) > =A0 =A0 { > @@ -208,7 +208,7 @@ > =A0 =A0 =A0 =A0xrealloc ((char *) expout, sizeof (struct expression) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+ EXP_ELEM_TO_BYTES (expout_size)); > =A0 =A0 } > - =A0expout->elts[expout_ptr++] =3D expelt; > + =A0expout->elts[expout_ptr++] =3D *expelt; > =A0} > > =A0void > @@ -218,7 +218,7 @@ > > =A0 memset (&tmp, 0, sizeof (union exp_element)); > =A0 tmp.opcode =3D expelt; > - =A0write_exp_elt (tmp); > + =A0write_exp_elt (&tmp); > =A0} > > =A0void > @@ -228,7 +228,7 @@ > > =A0 memset (&tmp, 0, sizeof (union exp_element)); > =A0 tmp.symbol =3D expelt; > - =A0write_exp_elt (tmp); > + =A0write_exp_elt (&tmp); > =A0} > > =A0void > @@ -238,7 +238,7 @@ > > =A0 memset (&tmp, 0, sizeof (union exp_element)); > =A0 tmp.block =3D b; > - =A0write_exp_elt (tmp); > + =A0write_exp_elt (&tmp); > =A0} > > =A0void > @@ -248,7 +248,7 @@ > > =A0 memset (&tmp, 0, sizeof (union exp_element)); > =A0 tmp.objfile =3D objfile; > - =A0write_exp_elt (tmp); > + =A0write_exp_elt (&tmp); > =A0} > > =A0void > @@ -258,7 +258,7 @@ > > =A0 memset (&tmp, 0, sizeof (union exp_element)); > =A0 tmp.longconst =3D expelt; > - =A0write_exp_elt (tmp); > + =A0write_exp_elt (&tmp); > =A0} > > =A0void > @@ -268,7 +268,7 @@ > > =A0 memset (&tmp, 0, sizeof (union exp_element)); > =A0 tmp.doubleconst =3D expelt; > - =A0write_exp_elt (tmp); > + =A0write_exp_elt (&tmp); > =A0} > > =A0void > @@ -280,7 +280,7 @@ > =A0 for (index =3D 0; index < 16; index++) > =A0 =A0 tmp.decfloatconst[index] =3D expelt[index]; > > - =A0write_exp_elt (tmp); > + =A0write_exp_elt (&tmp); > =A0} > > =A0void > @@ -290,7 +290,7 @@ > > =A0 memset (&tmp, 0, sizeof (union exp_element)); > =A0 tmp.type =3D expelt; > - =A0write_exp_elt (tmp); > + =A0write_exp_elt (&tmp); > =A0} > > =A0void > @@ -300,7 +300,7 @@ > > =A0 memset (&tmp, 0, sizeof (union exp_element)); > =A0 tmp.internalvar =3D expelt; > - =A0write_exp_elt (tmp); > + =A0write_exp_elt (&tmp); > =A0} > > =A0/* Add a string constant to the end of the expression. > @@ -1059,7 +1059,7 @@ > =A0} > > =A0/* Read an expression from the string *STRINGPTR points to, > - =A0 parse it, and return a pointer to a =A0struct expression =A0that we= malloc. > + =A0 parse it, and return a pointer to a struct expression that we mallo= c. > =A0 =A0Use block BLOCK as the lexical context for variable names; > =A0 =A0if BLOCK is zero, use the block of the selected stack frame. > =A0 =A0Meanwhile, advance *STRINGPTR to point after the expression, > --- src/gdb/parser-defs.h =A0 =A0 =A0 2011/01/10 20:38:49 =A0 =A0 1.39 > +++ src/gdb/parser-defs.h =A0 =A0 =A0 2011/09/16 14:36:55 =A0 =A0 1.40 > @@ -131,8 +131,6 @@ > =A0extern union type_stack_elt *type_stack; > =A0extern int type_stack_depth, type_stack_size; > > -extern void write_exp_elt (union exp_element); > - > =A0extern void write_exp_elt_opcode (enum exp_opcode); > > =A0extern void write_exp_elt_sym (struct symbol *); >