[Spice-devel] [spice-common PATCH 2/3 v2] ppc: Fix quic magic endianess
Christophe Fergeau
cfergeau at redhat.com
Thu Jul 2 04:43:21 PDT 2015
ACK.
On Mon, Jun 29, 2015 at 02:58:26PM +0200, Lukas Venhoda wrote:
> Runtime conversion from a string to uint32 is storing the magic with the same
> endianness on both LE and BE machines. This requires aditional byte swap
> when sending magic between LE/BE machines.
>
> Changing quic magic to a constant will ensure, that it will be always stored in
> native endianness, and the second byte swap won't be needed.
> ---
> Changes since v1:
> - Improved commit log
> ---
> common/quic.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/common/quic.c b/common/quic.c
> index 16290d4..498b9cc 100644
> --- a/common/quic.c
> +++ b/common/quic.c
> @@ -35,7 +35,8 @@
> //#define RLE_PRED_3
> #define QUIC_RGB
>
> -#define QUIC_MAGIC (*(uint32_t *)"QUIC")
> +/* ASCII "QUIC" */
> +#define QUIC_MAGIC 0x43495551
> #define QUIC_VERSION_MAJOR 0U
> #define QUIC_VERSION_MINOR 1U
> #define QUIC_VERSION ((QUIC_VERSION_MAJOR << 16) | (QUIC_VERSION_MAJOR & 0xffff))
> --
> 2.4.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- 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/20150702/9a6ddb34/attachment.sig>
More information about the Spice-devel
mailing list