[PATCH 5/7] spice-ppc: avoid casts to lessers types!

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

 



From: Fabiano Fidêncio <fabiano@xxxxxxxxxxxx>

    It's breaking PPC's keyboard functionality, once this cast is
    getting the first byte (from left to right) on any architecture,
    what's wrong when we think in a PPC (we should get the last one,
    instead).

Signed-off-by: Erlon R. Cruz <erlon.cruz@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Fabiano Fidêncio <Fabiano.Fidêncio@xxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Rafael F. Santos <Rafael.Santos@xxxxxxxxxxxxxxxxxxxxx>

---
 server/inputs_channel.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/inputs_channel.c b/server/inputs_channel.c
index e14e995..015f7b5 100644
--- a/server/inputs_channel.c
+++ b/server/inputs_channel.c
@@ -289,7 +289,7 @@ static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, ui
 {
     InputsChannel *inputs_channel = (InputsChannel *)rcc->channel;
     InputsChannelClient *icc = (InputsChannelClient *)rcc;
-    uint8_t *buf = (uint8_t *)message;
+    uint32_t *buf = message;
 
     spice_assert(g_inputs_channel == inputs_channel);
     switch (type) {
@@ -302,8 +302,8 @@ static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, ui
     }
     case SPICE_MSGC_INPUTS_KEY_UP: {
         SpiceMsgcKeyDown *key_down = (SpiceMsgcKeyDown *)buf;
-        uint8_t *now = (uint8_t *)&key_down->code;
-        uint8_t *end = now + sizeof(key_down->code);
+        uint32_t *now = &key_down->code;
+        uint32_t *end = now + sizeof(key_down->code);
         for (; now < end && *now; now++) {
             kbd_push_scan(keyboard, *now);
         }
-- 
1.7.4.1

_______________________________________________
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]