[spice-common PATCH 3/3] ppc: Fix quic decode endianess

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

 



Converts all decoded words in quic from little endian to local
machine endianness.
---
 common/quic.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/common/quic.c b/common/quic.c
index 498b9cc..a9bd215 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"
@@ -477,7 +479,7 @@ static inline void flush(Encoder *encoder)
 static void __read_io_word(Encoder *encoder)
 {
     more_io_words(encoder);
-    encoder->io_next_word = *(encoder->io_now++);
+    encoder->io_next_word = GUINT32_FROM_LE(*(encoder->io_now++));
 }

 static void (*__read_io_word_ptr)(Encoder *encoder) = __read_io_word;
@@ -490,7 +492,7 @@ static inline void read_io_word(Encoder *encoder)
         return;
     }
     spice_assert(encoder->io_now < encoder->io_end);
-    encoder->io_next_word = *(encoder->io_now++);
+    encoder->io_next_word = GUINT32_FROM_LE(*(encoder->io_now++));
 }

 static inline void decode_eatbits(Encoder *encoder, int len)
@@ -764,7 +766,7 @@ static inline unsigned int decode_run(Encoder *encoder)

 static inline void init_decode_io(Encoder *encoder)
 {
-    encoder->io_next_word = encoder->io_word = *(encoder->io_now++);
+    encoder->io_next_word = encoder->io_word = GUINT32_FROM_LE(*(encoder->io_now++));
     encoder->io_available_bits = 0;
 }

--
2.4.3

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




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