From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17761 invoked by alias); 19 Apr 2011 12:41:46 -0000 Received: (qmail 17750 invoked by uid 22791); 19 Apr 2011 12:41:45 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT,TW_EG X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Apr 2011 12:41:22 +0000 Received: from md2.u-strasbg.fr (md2.u-strasbg.fr [IPv6:2001:660:2402::187]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id p3JCfB5o067149 ; Tue, 19 Apr 2011 14:41:11 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [130.79.204.11]) by md2.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p3JCfAwh038737 ; Tue, 19 Apr 2011 14:41:11 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p3JCf9Ii060042 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Tue, 19 Apr 2011 14:41:10 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Pedro Alves'" , Cc: "'Corinna Vinschen'" References: <006e01cbfe7e$5a8dadc0$0fa90940$@muller@ics-cnrs.unistra.fr> <201104191208.01363.pedro@codesourcery.com> In-Reply-To: <201104191208.01363.pedro@codesourcery.com> Subject: RE: [RFA] ARI fix: Remove OP at end of line in xstormy16-tdep.c Date: Tue, 19 Apr 2011 12:41:00 -0000 Message-ID: <007e01cbfe8f$0f9e4480$2edacd80$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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-04/txt/msg00311.txt.bz2 Thank you for the suggestion, this makes the things cleaner. > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Pedro Alves > Envoy=E9=A0: mardi 19 avril 2011 13:08 > =C0=A0: gdb-patches@sourceware.org > Cc=A0: Pierre Muller > Objet=A0: Re: [RFA] ARI fix: Remove OP at end of line in xstormy16-tdep.c >=20 > On Tuesday 19 April 2011 11:41:34, Pierre Muller wrote: > > --- xstormy16-tdep.c 18 Mar 2011 18:52:32 -0000 1.114 > > +++ xstormy16-tdep.c 19 Apr 2011 10:35:47 -0000 > > @@ -264,11 +264,9 @@ xstormy16_push_dummy_call (struct gdbarc > > val =3D value_contents (args[i]); > > for (j =3D 0; j < typelen; j +=3D xstormy16_reg_size) > > regcache_cooked_write_unsigned (regcache, argreg++, > > - extract_unsigned_integer (val + j, > > - typelen - j =3D=3D > > - 1 ? 1 : > > - xstormy16_reg_size, > > - byte_order)); > > + extract_unsigned_integer (val + j, > > + typelen - j =3D=3D 1 ? 1 : > > xstormy16_reg_size, > > + byte_order)); >=20 > A sign that temporary variables would help, IMO: >=20 > for (j =3D 0; j < typelen; j +=3D xstormy16_reg_size) > { > ULONGEST regval; > int size; >=20 > size =3D typelen - j =3D=3D 1 ? 1 : xstormy16_reg_size; > val =3D extract_unsigned_integer (val + j, size, byte_order); > regcache_cooked_write_unsigned (regcache, argreg++, regval); > ); So here is the new proposal: Corinna, you are listed as maintainer of xstormy16-tdep, could you tell if this is OK? Pierre Muller 2011-04-19 Pierre Muller Pedro Alves * xstormy16-tdep.c (xstormy16_push_dummy_call): Add local variables to simplify code and avoid =3D=3D operator at end of line as this is against GNU coding standards. Index: xstormy16-tdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/xstormy16-tdep.c,v retrieving revision 1.114 diff -u -p -r1.114 xstormy16-tdep.c --- xstormy16-tdep.c 18 Mar 2011 18:52:32 -0000 1.114 +++ xstormy16-tdep.c 19 Apr 2011 12:34:34 -0000 @@ -263,12 +263,13 @@ xstormy16_push_dummy_call (struct gdbarc /* Put argument into registers wordwise. */ val =3D value_contents (args[i]); for (j =3D 0; j < typelen; j +=3D xstormy16_reg_size) - regcache_cooked_write_unsigned (regcache, argreg++, - extract_unsigned_integer (val + j, - typelen - j =3D=3D - 1 ? 1 : - xstormy16_reg_size, - byte_order)); + { + ULONGEST regval; + int size =3D (typelen -j =3D=3D 1) ? 1 : xstormy16_reg_size; + + regval =3D extract_unsigned_integer (val + j, size, byte_order); + regcache_cooked_write_unsigned (regcache, argreg++, regval); + } } =20 /* Align SP */