[Spice-devel] Function definition style

Jonathon Jongsma jjongsma at redhat.com
Mon Oct 10 21:41:02 UTC 2016


On Mon, 2016-10-10 at 14:11 -0400, Marc-André Lureau wrote:
> Hi
> 
> ----- Original Message -----
> > 
> > Hi,
> > 
> > On Mon, Oct 10, 2016 at 12:54:26PM -0400, Frediano Ziglio wrote:
> > > 
> > > Hi,
> > >   I noted that in recent patches we started using this style:
> > > 
> > > static void
> > > function_name(type name)
> > > {
> > > }
> > > 
> > > instead of the "classic" (in our code)
> > > 
> > > static void function_name(type name)
> > > {
> > > }
> > > 
> > > Personally I like the first and I don't complain (and other
> > > people
> > > seems to not complain too) however sometimes it does not fit as
> > > the
> > > other style is used.
> > > 
> > > Do we agree we can use both styles or we just didn't pay much
> > > attention?
> > 
> > The later? I'm often writing functions as the first style approach
> > which
> > is not common style in spice*. For the same reason, I don't pay
> > much
> > attention of that on reviews.
> > 
> > I would not mind to keep both styles.. or we should really write a
> > hook
> > to start checking for code style because this is quite common
> > mistake...
> 
> In spice-gtk we use both style, I don't mind, but I have a slight
> preference for the first.
> 
> declarations are however almost always
> 
> static void function_name(type name);
> 
> in short, I like glib/gtk style best for no very rationale reasons.
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel


To be honest, I don't really have much of a preference. I guess the
first style is a little better when you want to keep the lines from
getting too long. Perhaps it would be better to choose one and try to
stick with it, but I don't mind too much if we have both in the code
base.

Jonathon


More information about the Spice-devel mailing list