Re: [linux/vd-agent v1 5/7] coverity: allow pass by value with XEvent

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

 



On Mon, Jul 15, 2019 at 05:16:03AM -0400, Frediano Ziglio wrote:
> > Subject:  [linux/vd-agent v1 5/7] coverity: allow pass by value with XEvent
> 
> I would say that this patch is ignoring a warning, the code is
> compiling.

Hmm, I can rewrite shortlog but my feeling is that allowing
something means that wasn't that great but you allow it, not too
far from ignoring the problem, that is, both ways of saying this
are similar to me.

> > 
> > From: Victor Toso <me@xxxxxxxxxxxxxx>
> > 
> > Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
> > ---
> >  src/vdagent/x11-randr.c | 4 ++--
> >  src/vdagent/x11.c       | 1 +
> >  2 files changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/vdagent/x11-randr.c b/src/vdagent/x11-randr.c
> > index d000e28..924f5ec 100644
> > --- a/src/vdagent/x11-randr.c
> > +++ b/src/vdagent/x11-randr.c
> > @@ -528,8 +528,8 @@ void vdagent_x11_randr_handle_root_size_change(struct
> > vdagent_x11 *x11,
> >      }
> >  }
> >  
> > -int vdagent_x11_randr_handle_event(struct vdagent_x11 *x11,
> > -    XEvent event)
> > +/* coverity[pass_by_value] */
> > +int vdagent_x11_randr_handle_event(struct vdagent_x11 *x11, XEvent event)
> >  {
> >      int handled = TRUE;
> >  
> > diff --git a/src/vdagent/x11.c b/src/vdagent/x11.c
> > index c2515a8..90d08a1 100644
> > --- a/src/vdagent/x11.c
> > +++ b/src/vdagent/x11.c
> > @@ -494,6 +494,7 @@ static int vdagent_x11_get_clipboard_selection(struct
> > vdagent_x11 *x11,
> >  }
> >  #endif
> >  
> > +/* coverity[pass_by_value] */
> >  static void vdagent_x11_handle_event(struct vdagent_x11 *x11, XEvent event)
> >  {
> >      int i, handled = 0;
> 
> Have you though about converting to "const XEvent*" ?
> The structure is not that small.

I did but wasn't sure this was worth the effort? Wayland > X11,
risk of regressions, etc. If you fee this is worth, I can work on
it too.

Thanks,

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]