[Spice-devel] Function definition style

Marc-André Lureau mlureau at redhat.com
Mon Oct 10 18:11:41 UTC 2016


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.


More information about the Spice-devel mailing list