[Spice-devel,spice-gtk,v1] spicy: use gboolean for GtkSettings properties

Submitted by Victor Toso on March 6, 2017, 10:09 a.m.

Details

Message ID 20170306100941.26403-1-victortoso@redhat.com
State Accepted
Commit ecb4de270587fba087073f6816a8105ea5bf4ee5
Headers show
Series "spicy: use gboolean for GtkSettings properties" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Victor Toso March 6, 2017, 10:09 a.m.
From: Victor Toso <me@victortoso.com>

As gboolean is 4 bytes long while bool is 1 byte, valgrind will complain
about it.

Invalid write of size 4
   at 0xAE9F4FB: value_lcopy_boolean (gvaluetypes.c:78)
   by 0xAE7CFD3: g_object_get_valist (gobject.c:2236)
   by 0xAE7D40B: g_object_get (gobject.c:2324)
   by 0x40758F: keyboard_grab_cb (spicy.c:566)
   by 0xAE753E4: g_closure_invoke (gclosure.c:804)
   by 0xAE87431: signal_emit_unlocked_R (gsignal.c:3635)
   by 0xAE9005E: g_signal_emit_valist (gsignal.c:3391)
   by 0xAE9043E: g_signal_emit (gsignal.c:3447)
   by 0x4E4A6FB: try_keyboard_grab (spice-widget.c:889)
   by 0x4E4CAB1: focus_in_event (spice-widget.c:1834)
   by 0x9325E70: _gtk_marshal_BOOLEAN__BOXEDv (gtkmarshalers.c:131)
   by 0xAE75561: _g_closure_invoke_va (gclosure.c:867)

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 tools/spicy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tools/spicy.c b/tools/spicy.c
index cd1677f..2772cfa 100644
--- a/tools/spicy.c
+++ b/tools/spicy.c
@@ -75,8 +75,8 @@  struct _SpiceWindow {
     gint             win_x;
     gint             win_y;
 #endif
-    bool             enable_accels_save;
-    bool             enable_mnemonics_save;
+    gboolean         enable_accels_save;
+    gboolean         enable_mnemonics_save;
 };
 
 struct _SpiceWindowClass

Comments

ACK

Thanks,
Pavel

I think some of these setting properties are deprecated

On Mon, 2017-03-06 at 11:09 +0100, Victor Toso wrote:
> From: Victor Toso <me@victortoso.com>
> 
> As gboolean is 4 bytes long while bool is 1 byte, valgrind will
> complain
> about it.
> 
> Invalid write of size 4
>    at 0xAE9F4FB: value_lcopy_boolean (gvaluetypes.c:78)
>    by 0xAE7CFD3: g_object_get_valist (gobject.c:2236)
>    by 0xAE7D40B: g_object_get (gobject.c:2324)
>    by 0x40758F: keyboard_grab_cb (spicy.c:566)
>    by 0xAE753E4: g_closure_invoke (gclosure.c:804)
>    by 0xAE87431: signal_emit_unlocked_R (gsignal.c:3635)
>    by 0xAE9005E: g_signal_emit_valist (gsignal.c:3391)
>    by 0xAE9043E: g_signal_emit (gsignal.c:3447)
>    by 0x4E4A6FB: try_keyboard_grab (spice-widget.c:889)
>    by 0x4E4CAB1: focus_in_event (spice-widget.c:1834)
>    by 0x9325E70: _gtk_marshal_BOOLEAN__BOXEDv (gtkmarshalers.c:131)
>    by 0xAE75561: _g_closure_invoke_va (gclosure.c:867)
> 
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  tools/spicy.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/spicy.c b/tools/spicy.c
> index cd1677f..2772cfa 100644
> --- a/tools/spicy.c
> +++ b/tools/spicy.c
> @@ -75,8 +75,8 @@ struct _SpiceWindow {
>      gint             win_x;
>      gint             win_y;
>  #endif
> -    bool             enable_accels_save;
> -    bool             enable_mnemonics_save;
> +    gboolean         enable_accels_save;
> +    gboolean         enable_mnemonics_save;
>  };
>  
>  struct _SpiceWindowClass
Hi,

On Mon, Mar 06, 2017 at 11:15:58AM +0100, Pavel Grunt wrote:
> ACK
>
> Thanks,
> Pavel
> 
> I think some of these setting properties are deprecated

Oh, true. The second one here is deprecated and ignored from gtk v3.10
onwards. I'll send a followup patch.

>
> On Mon, 2017-03-06 at 11:09 +0100, Victor Toso wrote:
> > From: Victor Toso <me@victortoso.com>
> > 
> > As gboolean is 4 bytes long while bool is 1 byte, valgrind will
> > complain
> > about it.
> > 
> > Invalid write of size 4
> >    at 0xAE9F4FB: value_lcopy_boolean (gvaluetypes.c:78)
> >    by 0xAE7CFD3: g_object_get_valist (gobject.c:2236)
> >    by 0xAE7D40B: g_object_get (gobject.c:2324)
> >    by 0x40758F: keyboard_grab_cb (spicy.c:566)
> >    by 0xAE753E4: g_closure_invoke (gclosure.c:804)
> >    by 0xAE87431: signal_emit_unlocked_R (gsignal.c:3635)
> >    by 0xAE9005E: g_signal_emit_valist (gsignal.c:3391)
> >    by 0xAE9043E: g_signal_emit (gsignal.c:3447)
> >    by 0x4E4A6FB: try_keyboard_grab (spice-widget.c:889)
> >    by 0x4E4CAB1: focus_in_event (spice-widget.c:1834)
> >    by 0x9325E70: _gtk_marshal_BOOLEAN__BOXEDv (gtkmarshalers.c:131)
> >    by 0xAE75561: _g_closure_invoke_va (gclosure.c:867)
> > 
> > Signed-off-by: Victor Toso <victortoso@redhat.com>
> > ---
> >  tools/spicy.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/spicy.c b/tools/spicy.c
> > index cd1677f..2772cfa 100644
> > --- a/tools/spicy.c
> > +++ b/tools/spicy.c
> > @@ -75,8 +75,8 @@ struct _SpiceWindow {
> >      gint             win_x;
> >      gint             win_y;
> >  #endif
> > -    bool             enable_accels_save;
> > -    bool             enable_mnemonics_save;
> > +    gboolean         enable_accels_save;
> > +    gboolean         enable_mnemonics_save;
> >  };
> >  
> >  struct _SpiceWindowClass
Hi,

On Mon, Mar 06, 2017 at 11:26:15AM +0100, Victor Toso wrote:
> Hi,
> 
> On Mon, Mar 06, 2017 at 11:15:58AM +0100, Pavel Grunt wrote:
> > ACK
> >
> > Thanks,
> > Pavel
> > 
> > I think some of these setting properties are deprecated
> 
> Oh, true. The second one here is deprecated and ignored from gtk v3.10
> onwards. I'll send a followup patch.

Ah, i missread the docs. It isn't being ignored now but it will be
ignored in the future.

  "This setting can still be used for application overrides, but will be
   ignored in the future"

I'll keep the patch as it is then.

Thanks!
> 
> >
> > On Mon, 2017-03-06 at 11:09 +0100, Victor Toso wrote:
> > > From: Victor Toso <me@victortoso.com>
> > > 
> > > As gboolean is 4 bytes long while bool is 1 byte, valgrind will
> > > complain
> > > about it.
> > > 
> > > Invalid write of size 4
> > >    at 0xAE9F4FB: value_lcopy_boolean (gvaluetypes.c:78)
> > >    by 0xAE7CFD3: g_object_get_valist (gobject.c:2236)
> > >    by 0xAE7D40B: g_object_get (gobject.c:2324)
> > >    by 0x40758F: keyboard_grab_cb (spicy.c:566)
> > >    by 0xAE753E4: g_closure_invoke (gclosure.c:804)
> > >    by 0xAE87431: signal_emit_unlocked_R (gsignal.c:3635)
> > >    by 0xAE9005E: g_signal_emit_valist (gsignal.c:3391)
> > >    by 0xAE9043E: g_signal_emit (gsignal.c:3447)
> > >    by 0x4E4A6FB: try_keyboard_grab (spice-widget.c:889)
> > >    by 0x4E4CAB1: focus_in_event (spice-widget.c:1834)
> > >    by 0x9325E70: _gtk_marshal_BOOLEAN__BOXEDv (gtkmarshalers.c:131)
> > >    by 0xAE75561: _g_closure_invoke_va (gclosure.c:867)
> > > 
> > > Signed-off-by: Victor Toso <victortoso@redhat.com>
> > > ---
> > >  tools/spicy.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/tools/spicy.c b/tools/spicy.c
> > > index cd1677f..2772cfa 100644
> > > --- a/tools/spicy.c
> > > +++ b/tools/spicy.c
> > > @@ -75,8 +75,8 @@ struct _SpiceWindow {
> > >      gint             win_x;
> > >      gint             win_y;
> > >  #endif
> > > -    bool             enable_accels_save;
> > > -    bool             enable_mnemonics_save;
> > > +    gboolean         enable_accels_save;
> > > +    gboolean         enable_mnemonics_save;
> > >  };
> > >  
> > >  struct _SpiceWindowClass