From bca74fb6c9c8a15fe75b0e9454bf67b73c95b2d2 Mon Sep 17 00:00:00 2001 From: Haochen Tong Date: Fri, 10 Jul 2020 22:15:55 +0200 Subject: [PATCH] pixman_utils: fix clang "unused functions" warning Signed-off-by: Haochen Tong Acked-by: Frediano Ziglio --- common/pixman_utils.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/common/pixman_utils.c b/common/pixman_utils.c index a3aba0a..44336be 100644 --- a/common/pixman_utils.c +++ b/common/pixman_utils.c @@ -1035,26 +1035,6 @@ pixman_image_t *spice_bitmap_try_as_pixman(int src_format, #define UINT32_FROM_LE(x) (x) #endif -static inline uint32_t rgb_16_555_to_32(uint16_t color) -{ - uint32_t ret; - - ret = ((color & 0x001f) << 3) | ((color & 0x001c) >> 2); - ret |= ((color & 0x03e0) << 6) | ((color & 0x0380) << 1); - ret |= ((color & 0x7c00) << 9) | ((color & 0x7000) << 4); - - return ret; -} - -static inline uint16_t rgb_32_to_16_555(uint32_t color) -{ - return - (((color) >> 3) & 0x001f) | - (((color) >> 6) & 0x03e0) | - (((color) >> 9) & 0x7c00); -} - - static void bitmap_32_to_32(uint8_t* dest, int dest_stride, uint8_t* src, int src_stride, int width, uint8_t* end) @@ -1387,6 +1367,25 @@ static void bitmap_1be_16_to_16_555(uint8_t* dest, int dest_stride, #ifdef NOT_USED_ATM +static inline uint32_t rgb_16_555_to_32(uint16_t color) +{ + uint32_t ret; + + ret = ((color & 0x001f) << 3) | ((color & 0x001c) >> 2); + ret |= ((color & 0x03e0) << 6) | ((color & 0x0380) << 1); + ret |= ((color & 0x7c00) << 9) | ((color & 0x7000) << 4); + + return ret; +} + +static inline uint16_t rgb_32_to_16_555(uint32_t color) +{ + return + (((color) >> 3) & 0x001f) | + (((color) >> 6) & 0x03e0) | + (((color) >> 9) & 0x7c00); +} + static void bitmap_16_to_32(uint8_t* dest, int dest_stride, uint8_t* src, int src_stride, int width, uint8_t* end)