[Spice-devel] [PATCH] Make sure g_object_new receive the correct data

Daniel P. Berrange berrange at redhat.com
Fri Jun 3 11:25:23 UTC 2016


On Fri, Jun 03, 2016 at 07:16:57AM -0400, Frediano Ziglio wrote:

> > > diff --git a/server/spicevmc.c b/server/spicevmc.c
> > > index b662d94..a863e39 100644
> > > --- a/server/spicevmc.c
> > > +++ b/server/spicevmc.c
> > > @@ -580,8 +580,8 @@ red_char_device_spicevmc_new(SpiceCharDeviceInstance
> > > *sin,
> > >      return g_object_new(RED_TYPE_CHAR_DEVICE_SPICEVMC,
> > >                          "sin", sin,
> > >                          "spice-server", reds,
> > > -                        "client-tokens-interval", 0ULL,
> > > -                        "self-tokens", ~0ULL,
> > > +                        "client-tokens-interval", (guint64) 0ULL,
> > > +                        "self-tokens", (guint64) ~0ULL,
> > >                          "opaque", opaque,
> > >                          NULL);
> > 
> > AFAICT, these are all redundant since the ULL suffice on the constant
> > should already ensure it is passed as a 64-bit type.
> > 
> 
> Not really portable assumption, in theory could be 128 bit or 256 in
> a remote future. I think Gcc already support 128 bit integers.

Haha, this will be the least of our worries if platforms actually
get created using 128 bit or larger integers. It'll make the
switch from 32-bit to 64-bit look like child's play. Pretty much
every piece of software I've seen will break horribly in multiple
ways.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


More information about the Spice-devel mailing list