Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: score-tdep.c: avoid mixed declarations and statements
@ 2007-01-08 23:03 Jim Blandy
  2007-01-08 23:13 ` Daniel Jacobowitz
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jim Blandy @ 2007-01-08 23:03 UTC (permalink / raw)
  To: qinwei; +Cc: gdb-patches


We recently added -Wdeclaration-after-statement to GDB's set of build
warnings, which caught the new S+core port.

Okay to commit?

gdb/ChangeLog:
2007-01-08  Jim Blandy  <jimb@codesourcery.com>

	* score-tdep.c (score_push_dummy_call): Don't mix declarations and
	statements.

? gdb/autom4te.cache
Index: gdb/score-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/score-tdep.c,v
retrieving revision 1.1
diff -u -p -r1.1 score-tdep.c
--- gdb/score-tdep.c	4 Jan 2007 07:09:54 -0000	1.1
+++ gdb/score-tdep.c	8 Jan 2007 22:57:33 -0000
@@ -435,14 +435,15 @@ score_push_dummy_call (struct gdbarch *g
     {
       struct value *arg = args[argnum];
       struct type *arg_type = check_typedef (value_type (arg));
-      arglen = TYPE_LENGTH (arg_type);
       enum type_code typecode = TYPE_CODE (arg_type);
       const gdb_byte *val = value_contents (arg);
       int downward_offset = 0;
+      int odd_sized_struct_p;
+      int arg_last_part_p = 0;
 
-      int odd_sized_struct_p = (arglen > SCORE_REGSIZE
+      arglen = TYPE_LENGTH (arg_type);
+      odd_sized_struct_p = (arglen > SCORE_REGSIZE
                                 && arglen % SCORE_REGSIZE != 0);
-      int arg_last_part_p = 0;
 
       /* If a arg should be aligned to 8 bytes (long long or double),
          the value should be put to even register numbers.  */


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

* Re: RFA: score-tdep.c: avoid mixed declarations and statements
  2007-01-08 23:03 RFA: score-tdep.c: avoid mixed declarations and statements Jim Blandy
@ 2007-01-08 23:13 ` Daniel Jacobowitz
  2007-01-09  3:38 ` qinwei
  2007-01-09 10:04 ` Mark Kettenis
  2 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2007-01-08 23:13 UTC (permalink / raw)
  To: Jim Blandy; +Cc: qinwei, gdb-patches

On Mon, Jan 08, 2007 at 03:04:09PM -0800, Jim Blandy wrote:
> 
> We recently added -Wdeclaration-after-statement to GDB's set of build
> warnings, which caught the new S+core port.
> 
> Okay to commit?

OK.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: RFA: score-tdep.c: avoid mixed declarations and statements
  2007-01-08 23:03 RFA: score-tdep.c: avoid mixed declarations and statements Jim Blandy
  2007-01-08 23:13 ` Daniel Jacobowitz
@ 2007-01-09  3:38 ` qinwei
  2007-01-09 21:25   ` Jim Blandy
  2007-01-09 10:04 ` Mark Kettenis
  2 siblings, 1 reply; 5+ messages in thread
From: qinwei @ 2007-01-09  3:38 UTC (permalink / raw)
  To: Jim Blandy; +Cc: gdb-patches

> We recently added -Wdeclaration-after-statement to GDB's set of build
> warnings, which caught the new S+core port.
> 
> Okay to commit?
> 
> gdb/ChangeLog:
> 2007-01-08  Jim Blandy  <jimb@codesourcery.com>
> 
>    * score-tdep.c (score_push_dummy_call): Don't mix declarations and
>    statements.
> 
> ? gdb/autom4te.cache
> Index: gdb/score-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/score-tdep.c,v
> retrieving revision 1.1
> diff -u -p -r1.1 score-tdep.c
> --- gdb/score-tdep.c   4 Jan 2007 07:09:54 -0000   1.1
> +++ gdb/score-tdep.c   8 Jan 2007 22:57:33 -0000
> @@ -435,14 +435,15 @@ score_push_dummy_call (struct gdbarch *g
>      {
>        struct value *arg = args[argnum];
>        struct type *arg_type = check_typedef (value_type (arg));
> -      arglen = TYPE_LENGTH (arg_type);
>        enum type_code typecode = TYPE_CODE (arg_type);
>        const gdb_byte *val = value_contents (arg);
>        int downward_offset = 0;
> +      int odd_sized_struct_p;
> +      int arg_last_part_p = 0;
> 
> -      int odd_sized_struct_p = (arglen > SCORE_REGSIZE
> +      arglen = TYPE_LENGTH (arg_type);
> +      odd_sized_struct_p = (arglen > SCORE_REGSIZE
>                                  && arglen % SCORE_REGSIZE != 0);
> -      int arg_last_part_p = 0;
> 
>        /* If a arg should be aligned to 8 bytes (long long or double),
>           the value should be put to even register numbers.  */

OK.

Best regards,
Qinwei
Mail  qinwei@sunnorth.com.cn
Phone +86-010-62981668-2708
Fax   +86-010-62985972


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

* Re: RFA: score-tdep.c: avoid mixed declarations and statements
  2007-01-08 23:03 RFA: score-tdep.c: avoid mixed declarations and statements Jim Blandy
  2007-01-08 23:13 ` Daniel Jacobowitz
  2007-01-09  3:38 ` qinwei
@ 2007-01-09 10:04 ` Mark Kettenis
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Kettenis @ 2007-01-09 10:04 UTC (permalink / raw)
  To: jimb; +Cc: qinwei, gdb-patches

> From: Jim Blandy <jimb@codesourcery.com>
> Date: Mon, 08 Jan 2007 15:04:09 -0800
> 
> We recently added -Wdeclaration-after-statement to GDB's set of build
> warnings, which caught the new S+core port.
> 
> Okay to commit?

I'd say this is abvious.

> gdb/ChangeLog:
> 2007-01-08  Jim Blandy  <jimb@codesourcery.com>
> 
> 	* score-tdep.c (score_push_dummy_call): Don't mix declarations and
> 	statements.


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

* Re: RFA: score-tdep.c: avoid mixed declarations and statements
  2007-01-09  3:38 ` qinwei
@ 2007-01-09 21:25   ` Jim Blandy
  0 siblings, 0 replies; 5+ messages in thread
From: Jim Blandy @ 2007-01-09 21:25 UTC (permalink / raw)
  To: qinwei; +Cc: gdb-patches


qinwei<qinwei@sunnorth.com.cn> writes:
>> gdb/ChangeLog:
>> 2007-01-08  Jim Blandy  <jimb@codesourcery.com>
>> 
>>    * score-tdep.c (score_push_dummy_call): Don't mix declarations and
>>    statements.
>> 
>
> OK.

Committed --- thanks.


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

end of thread, other threads:[~2007-01-09 21:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-08 23:03 RFA: score-tdep.c: avoid mixed declarations and statements Jim Blandy
2007-01-08 23:13 ` Daniel Jacobowitz
2007-01-09  3:38 ` qinwei
2007-01-09 21:25   ` Jim Blandy
2007-01-09 10:04 ` Mark Kettenis

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