From b728bed56719a2edcc3d50b12ce8d2ce1d5abe18 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Mon, 7 Nov 2022 14:12:11 +0800 Subject: [PATCH] util: use void * instead of byte * for util_copy_rect in u_format.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit As ubyte comes from p_compiler.h, so do not use it, and the code calles util_copy_rect may use args with type uint8_t*, ubyte* or unsigned char*, so use the type void* that consistence with memcpy Signed-off-by: Yonggang Luo Reviewed-by: Marek Olšák Part-of: --- src/util/format/u_format.c | 6 ++++-- src/util/format/u_format.h | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/util/format/u_format.c b/src/util/format/u_format.c index 209d929..a1edafe 100644 --- a/src/util/format/u_format.c +++ b/src/util/format/u_format.c @@ -48,18 +48,20 @@ * src_stride may be negative to do vertical flip of pixels from source. */ void -util_copy_rect(ubyte * dst, +util_copy_rect(void * dst_in, enum pipe_format format, unsigned dst_stride, unsigned dst_x, unsigned dst_y, unsigned width, unsigned height, - const ubyte * src, + const void * src_in, int src_stride, unsigned src_x, unsigned src_y) { + uint8_t *dst = dst_in; + const uint8_t *src = src_in; unsigned i; int src_stride_pos = src_stride < 0 ? -src_stride : src_stride; int blocksize = util_format_get_blocksize(format); diff --git a/src/util/format/u_format.h b/src/util/format/u_format.h index 4df46e9..b304922 100644 --- a/src/util/format/u_format.h +++ b/src/util/format/u_format.h @@ -1684,9 +1684,9 @@ enum pipe_format util_format_snorm_to_sint(enum pipe_format format) ATTRIBUTE_CONST; extern void -util_copy_rect(ubyte * dst, enum pipe_format format, +util_copy_rect(void * dst, enum pipe_format format, unsigned dst_stride, unsigned dst_x, unsigned dst_y, - unsigned width, unsigned height, const ubyte * src, + unsigned width, unsigned height, const void * src, int src_stride, unsigned src_x, unsigned src_y); /** -- 2.7.4