[Spice-devel] [PATCH 4/7] spice-ppc: fix glz magic endianess
Christophe Fergeau
cfergeau at redhat.com
Thu Aug 9 05:21:51 PDT 2012
On Thu, Aug 09, 2012 at 08:37:46AM -0300, Erlon Cruz wrote:
> On Wed, Aug 8, 2012 at 5:18 AM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> > On Tue, Aug 07, 2012 at 03:43:11PM -0300, Erlon Cruz wrote:
> >> From: Erlon Cruz <erlon.cruz at br.flextronics.com>
> >>
> >> Signed-off-by: Erlon R. Cruz <erlon.cruz at br.flextronics.com>
> >> Signed-off-by: Fabiano Fidêncio <Fabiano.Fidêncio at fit-tecnologia.org.br>
> >> Signed-off-by: Rafael F. Santos <Rafael.Santos at fit-tecnologia.org.br>
> >> ---
> >> server/glz_encoder.c | 2 +-
> >> 1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/server/glz_encoder.c b/server/glz_encoder.c
> >> index 1ec1f9b..f8415a8 100644
> >> --- a/server/glz_encoder.c
> >> +++ b/server/glz_encoder.c
> >> @@ -261,7 +261,7 @@ int glz_encode(GlzEncoderContext *opaque_encoder,
> >> encoder->cur_image.id = dict_image->id;
> >> encoder->cur_image.first_win_seg = dict_image->first_seg;
> >>
> >> - encode_32(encoder, LZ_MAGIC);
> >> + encode_32(encoder, htole32(LZ_MAGIC));
> >
> > LZ_MAGIC really should be a string that we encode using something like
> > encode_array(encoder, LZ_MAGIC, sizeof(LZ_MAGIC)), but we don't have such
> > facilities in glz_encoder.c, so why not. Have you tested that a ppc encoded
> > glz stream can be decoded on an x86 client? (thinking of it, it might be
> > the only setup you have tested for now).
>
> Didn't get the point here, it doesn't makes sent to me once the
> problem here is that this 4 byte array is cast to integer. A generic
> encode_array would have to swap bytes and wouldn't be useful for
> encoding strings.
The point of it would be to not swap bytes, it would encode uint8_t[] which
don't need to be swapped. But this is just wishful thinking, your patch is
good enough as is, no need to make these changes imo.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120809/5e2afeae/attachment.pgp>
More information about the Spice-devel
mailing list