This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Coding style
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Andrew Cagney <ac131313 at redhat dot com>
- Cc: Mark Kettenis <kettenis at chello dot nl>, gdb at sources dot redhat dot com, Richard dot Earnshaw at arm dot com
- Date: Sat, 03 May 2003 10:54:12 +0100
- Subject: Re: Coding style
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> makes sense, but when contracted into:
>
> > int
> > max_register_size (struct gdbarch *gdbarch)
> > {
> > struct regcache_descr *descr = regcache_descr (gdbarch);
> >
> > return descr->max_register_size;
> > }
>
> or:
>
> > int
> > max_register_size (struct gdbarch *gdbarch)
> > {
> > struct regcache_descr *descr = regcache_descr (gdbarch);
> > return descr->max_register_size;
> > }
>
> things get pretty arbitrary. Is "descr" a declaration or code body?
I find the break helpful to delimit the extent of the declarations. I'm
not too bothered if there is code in the declarations, provided it's
straight-forward initializations, not complex conditional operations and
the like.
R.