[Spice-devel] [spice-server v2 2/9] qxl: Remove 'blackness' and 'invers' put/get methods

Christophe Fergeau cfergeau at redhat.com
Tue Apr 17 16:19:17 UTC 2018


SpiceWhiteness/SpiceBlackness/SpiceInvers are 3 typedef for the same
type, no need to have 3 identical red_put_xxx/red_get_xxx methods.

Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
---
 server/red-parse-qxl.c | 25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/server/red-parse-qxl.c b/server/red-parse-qxl.c
index b766e9935..4a45c0f76 100644
--- a/server/red-parse-qxl.c
+++ b/server/red-parse-qxl.c
@@ -986,27 +986,10 @@ static void red_put_whiteness(SpiceWhiteness *red)
     red_put_qmask(&red->mask);
 }
 
-static void red_get_blackness_ptr(RedMemSlotInfo *slots, int group_id,
-                                  SpiceBlackness *red, QXLBlackness *qxl, uint32_t flags)
-{
-    red_get_qmask_ptr(slots, group_id, &red->mask, &qxl->mask, flags);
-}
-
-static void red_put_blackness(SpiceWhiteness *red)
-{
-    red_put_qmask(&red->mask);
-}
-
-static void red_get_invers_ptr(RedMemSlotInfo *slots, int group_id,
-                               SpiceInvers *red, QXLInvers *qxl, uint32_t flags)
-{
-    red_get_qmask_ptr(slots, group_id, &red->mask, &qxl->mask, flags);
-}
-
-static void red_put_invers(SpiceWhiteness *red)
-{
-    red_put_qmask(&red->mask);
-}
+#define red_get_invers_ptr red_get_whiteness_ptr
+#define red_get_blackness_ptr red_get_whiteness_ptr
+#define red_put_invers red_put_whiteness
+#define red_put_blackness red_put_whiteness
 
 static void red_get_clip_ptr(RedMemSlotInfo *slots, int group_id,
                              SpiceClip *red, QXLClip *qxl)
-- 
2.14.3



More information about the Spice-devel mailing list