Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] ARI fix: Remove OP at end of line in xstormy16-tdep.c
@ 2011-04-19 10:41 Pierre Muller
  2011-04-19 11:08 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Muller @ 2011-04-19 10:41 UTC (permalink / raw)
  To: gdb-patches

  Still trying to reduce the number of files appearing in ARI list.

  To avoid both operator at end of line and stay below 80-column limit,
I had to use another formatting option for the third parameter of
regcache_cooked_write_unsigned function call:
  As the parameter is aa long function call with multiple parameters, 
I just indented it with 2 spaces relative to regcache_cooked_write_unsigned
start.

Is this type of indentation OK?


Pierre Muller
GDB pascal language maintainer

2011-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>

	* xstormy16-tdep.c (xstormy16_push_dummy_call): Avoid == at end of
	line as this is against GNU coding standards.

Index: xstormy16-tdep.c
===================================================================
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 10:35:47 -0000
@@ -264,11 +264,9 @@ xstormy16_push_dummy_call (struct gdbarc
       val = value_contents (args[i]);
       for (j = 0; j < typelen; j += xstormy16_reg_size)
 	regcache_cooked_write_unsigned (regcache, argreg++,
-			extract_unsigned_integer (val + j,
-						  typelen - j ==
-						  1 ? 1 :
-						  xstormy16_reg_size,
-						  byte_order));
+	  extract_unsigned_integer (val + j,
+				    typelen - j == 1 ? 1 :
xstormy16_reg_size,
+				    byte_order));
     }
 
   /* Align SP */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFA] ARI fix: Remove OP at end of line in xstormy16-tdep.c
  2011-04-19 10:41 [RFA] ARI fix: Remove OP at end of line in xstormy16-tdep.c Pierre Muller
@ 2011-04-19 11:08 ` Pedro Alves
  2011-04-19 12:41   ` Pierre Muller
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2011-04-19 11:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Pierre Muller

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 = value_contents (args[i]);
>        for (j = 0; j < typelen; j += xstormy16_reg_size)
>         regcache_cooked_write_unsigned (regcache, argreg++,
> -                       extract_unsigned_integer (val + j,
> -                                                 typelen - j ==
> -                                                 1 ? 1 :
> -                                                 xstormy16_reg_size,
> -                                                 byte_order));
> +         extract_unsigned_integer (val + j,
> +                                   typelen - j == 1 ? 1 :
> xstormy16_reg_size,
> +                                   byte_order));

A sign that temporary variables would help, IMO:

       for (j = 0; j < typelen; j += xstormy16_reg_size)
		  {
	       ULONGEST regval;
          int size;

			size = typelen - j == 1 ? 1 : xstormy16_reg_size;
          val = extract_unsigned_integer (val + j, size, byte_order);
          regcache_cooked_write_unsigned (regcache, argreg++, regval);
         );

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [RFA] ARI fix: Remove OP at end of line in xstormy16-tdep.c
  2011-04-19 11:08 ` Pedro Alves
@ 2011-04-19 12:41   ` Pierre Muller
  2011-04-19 12:52     ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Muller @ 2011-04-19 12:41 UTC (permalink / raw)
  To: 'Pedro Alves', gdb-patches; +Cc: 'Corinna Vinschen'

Thank you for the suggestion, this makes the things
cleaner.


> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé : mardi 19 avril 2011 13:08
> À : gdb-patches@sourceware.org
> Cc : Pierre Muller
> Objet : Re: [RFA] ARI fix: Remove OP at end of line in xstormy16-tdep.c
> 
> 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 = value_contents (args[i]);
> >        for (j = 0; j < typelen; j += xstormy16_reg_size)
> >         regcache_cooked_write_unsigned (regcache, argreg++,
> > -                       extract_unsigned_integer (val + j,
> > -                                                 typelen - j ==
> > -                                                 1 ? 1 :
> > -                                                 xstormy16_reg_size,
> > -                                                 byte_order));
> > +         extract_unsigned_integer (val + j,
> > +                                   typelen - j == 1 ? 1 :
> > xstormy16_reg_size,
> > +                                   byte_order));
> 
> A sign that temporary variables would help, IMO:
> 
>        for (j = 0; j < typelen; j += xstormy16_reg_size)
> 		  {
> 	       ULONGEST regval;
>           int size;
> 
> 			size = typelen - j == 1 ? 1 : xstormy16_reg_size;
>           val = 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  <muller@ics.u-strasbg.fr>
	    Pedro Alves  <pedro@codesourcery.com>

	* xstormy16-tdep.c (xstormy16_push_dummy_call): Add local
	variables to simplify code and avoid == operator at end of
	line as this is against GNU coding standards.

Index: xstormy16-tdep.c
===================================================================
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 = value_contents (args[i]);
       for (j = 0; j < typelen; j += xstormy16_reg_size)
-	regcache_cooked_write_unsigned (regcache, argreg++,
-			extract_unsigned_integer (val + j,
-						  typelen - j ==
-						  1 ? 1 :
-						  xstormy16_reg_size,
-						  byte_order));
+	{
+	  ULONGEST regval;
+	  int size = (typelen -j == 1) ? 1 : xstormy16_reg_size;
+
+	  regval = extract_unsigned_integer (val + j, size, byte_order);
+	  regcache_cooked_write_unsigned (regcache, argreg++, regval);
+	}
     }
 
   /* Align SP */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFA] ARI fix: Remove OP at end of line in xstormy16-tdep.c
  2011-04-19 12:41   ` Pierre Muller
@ 2011-04-19 12:52     ` Corinna Vinschen
  2011-04-19 12:58       ` Pierre Muller
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2011-04-19 12:52 UTC (permalink / raw)
  To: gdb-patches

On Apr 19 14:41, Pierre Muller wrote:
> Thank you for the suggestion, this makes the things
> cleaner.
> [...]
>   So here is the new proposal:
> 
> Corinna, you are listed as maintainer of
> xstormy16-tdep, could you tell if this is OK?

Except for a missing space, yes.

> Pierre Muller
> 
> 
> 2011-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
> 	    Pedro Alves  <pedro@codesourcery.com>
> 
> 	* xstormy16-tdep.c (xstormy16_push_dummy_call): Add local
> 	variables to simplify code and avoid == operator at end of
> 	line as this is against GNU coding standards.
> 
> Index: xstormy16-tdep.c
> ===================================================================
> 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 = value_contents (args[i]);
>        for (j = 0; j < typelen; j += xstormy16_reg_size)
> -	regcache_cooked_write_unsigned (regcache, argreg++,
> -			extract_unsigned_integer (val + j,
> -						  typelen - j ==
> -						  1 ? 1 :
> -						  xstormy16_reg_size,
> -						  byte_order));
> +	{
> +	  ULONGEST regval;
> +	  int size = (typelen -j == 1) ? 1 : xstormy16_reg_size;
                              ^^^
                              - j

> +
> +	  regval = extract_unsigned_integer (val + j, size, byte_order);
> +	  regcache_cooked_write_unsigned (regcache, argreg++, regval);
> +	}
>      }
>  
>    /* Align SP */

Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [RFA] ARI fix: Remove OP at end of line in xstormy16-tdep.c
  2011-04-19 12:52     ` Corinna Vinschen
@ 2011-04-19 12:58       ` Pierre Muller
  0 siblings, 0 replies; 5+ messages in thread
From: Pierre Muller @ 2011-04-19 12:58 UTC (permalink / raw)
  To: gdb-patches; +Cc: 'Pedro Alves', 'Corinna Vinschen'



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Corinna Vinschen
> Envoyé : mardi 19 avril 2011 14:51
> À : gdb-patches@sourceware.org
> Objet : Re: [RFA] ARI fix: Remove OP at end of line in xstormy16-tdep.c
> 
> On Apr 19 14:41, Pierre Muller wrote:
> > Thank you for the suggestion, this makes the things
> > cleaner.
> > [...]
> >   So here is the new proposal:
> >
> > Corinna, you are listed as maintainer of
> > xstormy16-tdep, could you tell if this is OK?
> 
> Except for a missing space, yes.

  Thanks for noticing this,
patch committed with space added.

Pierre


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-19 12:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-19 10:41 [RFA] ARI fix: Remove OP at end of line in xstormy16-tdep.c Pierre Muller
2011-04-19 11:08 ` Pedro Alves
2011-04-19 12:41   ` Pierre Muller
2011-04-19 12:52     ` Corinna Vinschen
2011-04-19 12:58       ` Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox