[Spice-devel] [PATCH spice-common 1/3] lz: Move ENCODE_PIXEL for RGB24 and RGB32 to a common place

Frediano Ziglio fziglio at redhat.com
Wed May 9 13:10:37 UTC 2018


The macro for both depth is the same, reuse the definition.

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

diff --git a/common/lz_compress_tmpl.c b/common/lz_compress_tmpl.c
index 1bb5c75..69e69a6 100644
--- a/common/lz_compress_tmpl.c
+++ b/common/lz_compress_tmpl.c
@@ -125,17 +125,16 @@
 #ifdef LZ_RGB24
 #define PIXEL rgb24_pixel_t
 #define FNAME(name) lz_rgb24_##name
-#define ENCODE_PIXEL(e, pix) {encode(e, (pix).b); encode(e, (pix).g); encode(e, (pix).r);}
 #endif
 
 #ifdef LZ_RGB32
 #define PIXEL rgb32_pixel_t
 #define FNAME(name) lz_rgb32_##name
-#define ENCODE_PIXEL(e, pix) {encode(e, (pix).b); encode(e, (pix).g); encode(e, (pix).r);}
 #endif
 
 
 #if  defined(LZ_RGB24) || defined(LZ_RGB32)
+#define ENCODE_PIXEL(e, pix) {encode(e, (pix).b); encode(e, (pix).g); encode(e, (pix).r);}
 #define GET_r(pix) ((pix).r)
 #define GET_g(pix) ((pix).g)
 #define GET_b(pix) ((pix).b)
-- 
2.17.0



More information about the Spice-devel mailing list