This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Coding style


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]