[Spice-devel] [PATCH qxl-win v2 2/8] display: fix broken debug in checked

Alon Levy alevy at redhat.com
Mon Jun 20 05:37:02 PDT 2011


The dropped ASSERTS in GetCosmeticAttr contain undefined allcaps defines,
so dropping them.

The rest are mostly moved structs that didn't update the ASSERT contents.
---
 display/driver.c |    6 ------
 display/quic.c   |    4 ++++
 display/res.c    |    6 +++---
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/display/driver.c b/display/driver.c
index dbe6978..871aecb 100644
--- a/display/driver.c
+++ b/display/driver.c
@@ -1074,10 +1074,6 @@ FIX FlotaToFixed(FLOATL val, FLOATL scale)
 static BOOL GetCosmeticAttr(PDev *pdev, QXLDrawable *drawable, QXLLineAttr *q_line_attr,
                             LINEATTRS *line_attr)
 {
-    ASSERT(pdev, LINE_CAP_ROUND == ENDCAP_ROUND && LINE_CAP_SQUARE == ENDCAP_SQUARE &&
-           LINE_CAP_BUTT == ENDCAP_BUTT && LINE_JOIN_ROUND == JOIN_ROUND &&
-           LINE_JOIN_BEVEL == JOIN_BEVEL && LINE_JOIN_MITER == JOIN_MITER);
-
     q_line_attr->join_style = JOIN_MITER;
     q_line_attr->end_style = ENDCAP_BUTT;
     q_line_attr->width = 1 << 4;
@@ -1089,8 +1085,6 @@ static BOOL GetCosmeticAttr(PDev *pdev, QXLDrawable *drawable, QXLLineAttr *q_li
         FIX *end;
         UINT32 nseg;
 
-        ASSERT(pdev, LA_STYLED == LINE_STYLED);
-        ASSERT(pdev, LA_STARTGAP == LINE_START_WITH_GAP);
         q_line_attr->flags = (UINT8)(line_attr->fl & (LA_STYLED | LA_STARTGAP));
         nseg = (line_attr->fl & LA_ALTERNATE) ? 2 : line_attr->cstyle;
         if ( nseg > 100) {
diff --git a/display/quic.c b/display/quic.c
index 2c23d9a..5dc66d4 100644
--- a/display/quic.c
+++ b/display/quic.c
@@ -63,6 +63,10 @@
 
 #define ABS(a) ((a) >= 0 ? (a) : -(a))
 
+#ifdef ASSERT
+#undef ASSERT
+#endif
+
 #ifdef DEBUG
 
 #define ASSERT(usr, x) \
diff --git a/display/res.c b/display/res.c
index 4e2cdfe..5dc6e10 100644
--- a/display/res.c
+++ b/display/res.c
@@ -627,7 +627,7 @@ QXLSurfaceCmd *SurfaceCmd(PDev *pdev, UINT8 type, UINT32 surface_id)
 {
     QXLSurfaceCmd *surface_cmd;
 
-    ASSERT(pdev, pdev && area);
+    ASSERT(pdev, pdev);
 
     surface_cmd = GetSurfaceCmd(pdev);
     surface_cmd->surface_id = surface_id;
@@ -2141,7 +2141,7 @@ BOOL QXLGetBitmap(PDev *pdev, QXLDrawable *drawable, QXLPHYSICAL *image_phys, SU
         alloc_size = sizeof(Resource) + sizeof(InternalImage);
         image_res = AllocMem(pdev, MSPACE_TYPE_DEVRAM, alloc_size);
 
-        ONDBG(pdev->num_bits_pages++);
+        ONDBG(pdev->Res->num_bits_pages++);
         image_res->refs = 1;
         image_res->free = FreeSurfaceImage;
 
@@ -2307,7 +2307,7 @@ BOOL QXLGetAlphaBitmap(PDev *pdev, QXLDrawable *drawable, QXLPHYSICAL *image_phy
         alloc_size = sizeof(Resource) + sizeof(InternalImage);
         image_res = AllocMem(pdev, MSPACE_TYPE_DEVRAM, alloc_size);
 
-        ONDBG(pdev->num_bits_pages++);
+        ONDBG(pdev->Res->num_bits_pages++);
         image_res->refs = 1;
         image_res->free = FreeSurfaceImage;
 
-- 
1.7.5.4



More information about the Spice-devel mailing list