[virt-tools-list] [PATCH virt-viewer 4/4] Fix missing field initializers

Pavel Grunt pgrunt at redhat.com
Wed Jun 22 20:16:48 UTC 2016


On Wed, 2016-06-22 at 14:59 -0300, Eduardo Lima (Etrunko) wrote:
> This is not actually necessary as of C99. You only need to initialize
> any field of a structure to get all other fields initialized too.

yes, I was just annoyed by the warning..

> 
> On 06/22/2016 03:17 AM, Pavel Grunt wrote:
> > ---
> >  src/virt-viewer-display-spice.c | 2 +-
> >  src/virt-viewer-display-vnc.c   | 2 +-
> >  src/virt-viewer-window.c        | 2 +-
> >  3 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-
> > spice.c
> > index ee07507..a604230 100644
> > --- a/src/virt-viewer-display-spice.c
> > +++ b/src/virt-viewer-display-spice.c
> > @@ -243,7 +243,7 @@ enable_accel_changed(VirtViewerApp *app,
> >                       GParamSpec *pspec G_GNUC_UNUSED,
> >                       VirtViewerDisplaySpice *self)
> >  {
> > -    GtkAccelKey key = { 0 };
> > +    GtkAccelKey key = {0, 0, 0};
> >      if (virt_viewer_app_get_enable_accel(app))
> >          gtk_accel_map_lookup_entry("<virt-viewer>/view/release-cursor",
> > &key);
> >  
> > diff --git a/src/virt-viewer-display-vnc.c b/src/virt-viewer-display-vnc.c
> > index 390c366..cb45c23 100644
> > --- a/src/virt-viewer-display-vnc.c
> > +++ b/src/virt-viewer-display-vnc.c
> > @@ -190,7 +190,7 @@ enable_accel_changed(VirtViewerApp *app,
> >                       GParamSpec *pspec G_GNUC_UNUSED,
> >                       VncDisplay *vnc)
> >  {
> > -    GtkAccelKey key = { 0 };
> > +    GtkAccelKey key = {0, 0, 0};
> >      if (virt_viewer_app_get_enable_accel(app))
> >          gtk_accel_map_lookup_entry("<virt-viewer>/view/release-cursor",
> > &key);
> >  
> > diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> > index 6bf0a2e..c828916 100644
> > --- a/src/virt-viewer-window.c
> > +++ b/src/virt-viewer-window.c
> > @@ -1176,7 +1176,7 @@ virt_viewer_window_update_title(VirtViewerWindow
> > *self)
> >  
> >      if (priv->grabbed) {
> >          gchar *label;
> > -        GtkAccelKey key = { 0 };
> > +        GtkAccelKey key = {0, 0, 0};
> >  
> >          if (virt_viewer_app_get_enable_accel(priv->app))
> >              gtk_accel_map_lookup_entry("<virt-viewer>/view/release-cursor", 
> > &key);
> > 
> 
> 




More information about the virt-tools-list mailing list