From de807d1a740effe60da62d07dcfeae7c01012d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 7 Jan 2018 10:10:15 +0100 Subject: [PATCH] test/amdgpu: fix compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SWAP_32() should mask first and then shift. Signed-off-by: Christian König Reviewed-by: Marek Olšák --- tests/amdgpu/basic_tests.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c index 474a679c..9c918951 100644 --- a/tests/amdgpu/basic_tests.c +++ b/tests/amdgpu/basic_tests.c @@ -253,10 +253,10 @@ CU_TestInfo basic_tests[] = { -#define SWAP_32(num) ((num>>24)&0xff) | \ - ((num<<8)&0xff0000) | \ - ((num>>8)&0xff00) | \ - ((num<<24)&0xff000000) +#define SWAP_32(num) (((num & 0xff000000) >> 24) | \ + ((num & 0x0000ff00) << 8) | \ + ((num & 0x00ff0000) >> 8) | \ + ((num & 0x000000ff) << 24)) /* Shader code