Re: [PATCH virt-viewer v2 3/3] Write vm name to config file as comment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- Original Message ----- 

> From: "Fabiano Fidêncio" <fabiano@xxxxxxxxxxxx>
> To: "Jonathon Jongsma" <jjongsma@xxxxxxxxxx>
> Cc: virt-tools-list@xxxxxxxxxx
> Sent: Tuesday, July 22, 2014 9:06:59 AM
> Subject: Re:  [PATCH virt-viewer v2 3/3] Write vm name to
> config file as comment

> On Mon, Jun 30, 2014 at 10:49 PM, Jonathon Jongsma < jjongsma@xxxxxxxxxx >
> wrote:

> > ---
> > src/virt-viewer-app.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> 
> > diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> > index 6bd49f4..158a638 100644
> > --- a/src/virt-viewer-app.c
> > +++ b/src/virt-viewer-app.c
> > @@ -242,6 +242,20 @@ virt_viewer_app_save_config(VirtViewerApp *self)
> > g_warning("failed to create config directory");
> > g_free(dir);
> 
> > + if (priv->uuid && priv->guest_name) {
> > + // if there's no comment for this uuid settings group, add a comment
> > + // with the vm name so user can make sense of it later.
> > + gchar* comment = g_key_file_get_comment(priv->config, priv->uuid, NULL,
> > &error);
> 
> Coding style here, use: gchar *comment (...)


I've been meaning to bring this up for some time actually. Currently, the spice coding style definitions ( http://www.spice-space.org/docs/spice_style.pdf ) state that '*' should be attached to the type name, not the variable name (section 24.5). On the other hand, much of the code does not follow this guideline. It seems that in virt-viewer, the "wrong" way (according to the coding style document) is more common than the "right" way.  This is not a perfect measurement, but it's a decent approximation:

$ git grep "\w\* " -- src/ |wc -l
238
$ git grep " \*\w" -- src/ |wc -l
1777

So, should we just adopt the majority format and use "Type *varname" for all new code?

Jonathon

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list





[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux