[Spice-devel] [spice-common][PATCH 2/2] ppc: Fix quic magic endianess

Christophe Fergeau cfergeau at redhat.com
Tue May 19 02:29:59 PDT 2015


On Tue, May 19, 2015 at 05:18:44AM -0400, Frediano Ziglio wrote:
> > 
> > ---
> >  common/quic.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/common/quic.c b/common/quic.c
> > index 16290d4..0fbe6c5 100644
> > --- a/common/quic.c
> > +++ b/common/quic.c
> > @@ -23,6 +23,8 @@
> >  #include <config.h>
> >  #endif
> >  
> > +#include <glib.h>
> > +
> >  #include "quic.h"
> >  #include "spice_common.h"
> >  #include "bitops.h"
> > @@ -1277,7 +1279,7 @@ int quic_encode(QuicContext *quic, QuicImageType type,
> > int width, int height,
> >      encoder->io_word = 0;
> >      encoder->io_available_bits = 32;
> >  
> > -    encode_32(encoder, QUIC_MAGIC);
> > +    encode_32(encoder, GUINT32_TO_LE(QUIC_MAGIC));
> >      encode_32(encoder, QUIC_VERSION);
> >      encode_32(encoder, type);
> >      encode_32(encoder, width);
> 
> Why don't you define QUIC_MAGIC as a constant like
> 
> /* ASCII "QUIC" */
> #define QUIC_MAGIC 0x43495551
> 
> instead ?

Yes, that's probably better given that we can't keep that self-contained
(ie something similar would be needed in spice-gtk).

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150519/b8260338/attachment.sig>


More information about the Spice-devel mailing list