From d83e0307ec3aa35c7462f125ec59a2cd4a483967 Mon Sep 17 00:00:00 2001 From: espes Date: Mon, 6 Jul 2015 03:07:24 +1000 Subject: [PATCH] minor cleanups to swizzle --- hw/xbox/swizzle.c | 12 +++++++----- hw/xbox/swizzle.h | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/xbox/swizzle.c b/hw/xbox/swizzle.c index cfb8bb3c13..d9c58ccd2d 100644 --- a/hw/xbox/swizzle.c +++ b/hw/xbox/swizzle.c @@ -72,7 +72,7 @@ static unsigned int get_swizzled_offset( } void swizzle_rect( - uint8_t *src_buf, + const uint8_t *src_buf, unsigned int width, unsigned int height, uint8_t *dst_buf, @@ -82,15 +82,16 @@ void swizzle_rect( int x, y; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { - uint8_t *src = src_buf + (y * pitch + x * bytes_per_pixel); - uint8_t *dst = dst_buf + get_swizzled_offset(x, y, width, height, bytes_per_pixel); + const uint8_t *src = src_buf+ (y * pitch + x * bytes_per_pixel); + uint8_t *dst = dst_buf + + get_swizzled_offset(x, y, width, height, bytes_per_pixel); memcpy(dst, src, bytes_per_pixel); } } } void unswizzle_rect( - uint8_t *src_buf, + const uint8_t *src_buf, unsigned int width, unsigned int height, uint8_t *dst_buf, @@ -100,7 +101,8 @@ void unswizzle_rect( int x, y; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { - uint8_t *src = src_buf + get_swizzled_offset(x, y, width, height, bytes_per_pixel); + const uint8_t *src = src_buf + + get_swizzled_offset(x, y, width, height, bytes_per_pixel); uint8_t *dst = dst_buf + (y * pitch + x * bytes_per_pixel); memcpy(dst, src, bytes_per_pixel); } diff --git a/hw/xbox/swizzle.h b/hw/xbox/swizzle.h index e23dc7682f..2b9acd07d6 100644 --- a/hw/xbox/swizzle.h +++ b/hw/xbox/swizzle.h @@ -23,7 +23,7 @@ #define HW_XBOX_SWIZZLE_H void swizzle_rect( - uint8_t *src_buf, + const uint8_t *src_buf, unsigned int width, unsigned int height, uint8_t *dst_buf, @@ -31,7 +31,7 @@ void swizzle_rect( unsigned int bytes_per_pixel); void unswizzle_rect( - uint8_t *src_buf, + const uint8_t *src_buf, unsigned int width, unsigned int height, uint8_t *dst_buf,