[Spice-devel] [PATCH spice-common] canvas-base: Do not attempt useless cast on stride adjustment

Frediano Ziglio fziglio at redhat.com
Tue Jun 20 13:52:56 UTC 2017


memmove already deal with any alignment so there's no
reason to have row byte pointer cast to uint32_t.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 common/canvas_base.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/canvas_base.c b/common/canvas_base.c
index 5815e9c..5b3649d 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -522,9 +522,9 @@ static void canvas_fix_alignment(uint8_t *bits,
         int row;
         uint8_t *dest = bits;
         for (row = height - 1; row > 0; --row) {
-            uint32_t *dest_aligned, *dest_misaligned;
-            dest_aligned = SPICE_ALIGNED_CAST(uint32_t *,dest + stride_pixman*row);
-            dest_misaligned = SPICE_UNALIGNED_CAST(uint32_t*,dest + stride_encoded*row);
+            uint8_t *dest_aligned, *dest_misaligned;
+            dest_aligned = dest + stride_pixman*row;
+            dest_misaligned = dest + stride_encoded*row;
             memmove(dest_aligned, dest_misaligned, stride_encoded);
         }
     }
-- 
2.9.4



More information about the Spice-devel mailing list