[PATCH 02/14] Move AppendSpanGroup from miwideline.h to miwideline.c.

Jamey Sharp jamey at minilop.net
Sat May 8 16:39:17 PDT 2010


Also make it stop being a macro.

Signed-off-by: Jamey Sharp <jamey at minilop.net>
---
 mi/miwideline.c |   33 ++++++++++++++++++++++++++++++---
 mi/miwideline.h |   24 ------------------------
 2 files changed, 30 insertions(+), 27 deletions(-)

diff --git a/mi/miwideline.c b/mi/miwideline.c
index 7e18603..181b12e 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -52,6 +52,33 @@ from The Open Group.
 #include "miwideline.h"
 #include "mi.h"
 
+/*
+ * interface data to span-merging polygon filler
+ */
+
+typedef struct _SpanData {
+    SpanGroup	fgGroup, bgGroup;
+} SpanDataRec, *SpanDataPtr;
+
+static void
+AppendSpanGroup(GCPtr pGC, unsigned long pixel, Spans *spanPtr, SpanDataPtr spanData)
+{
+    SpanGroup *group, *othergroup = NULL;
+    if (pixel == pGC->fgPixel)
+    {
+	group = &spanData->fgGroup;
+	if (pGC->lineStyle == LineDoubleDash)
+	    othergroup = &spanData->bgGroup;
+    }
+    else
+    {
+	group = &spanData->bgGroup;
+	othergroup = &spanData->fgGroup;
+    }
+    miAppendSpans (group, othergroup, spanPtr);
+}
+
+
 static void miLineArc(DrawablePtr pDraw, GCPtr pGC,
 		      unsigned long pixel, SpanDataPtr spanData,
 		      LineFacePtr leftFace,
@@ -213,7 +240,7 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
     else
     {
 	spanRec.count = ppt - spanRec.points;
-	AppendSpanGroup (pGC, pixel, &spanRec, spanData)
+	AppendSpanGroup (pGC, pixel, &spanRec, spanData);
     }
 }
 
@@ -282,7 +309,7 @@ miFillRectPolyHelper (
 	    y++;
 	}
 	spanRec.count = ppt - spanRec.points;
-	AppendSpanGroup (pGC, pixel, &spanRec, spanData)
+	AppendSpanGroup (pGC, pixel, &spanRec, spanData);
     }
 }
 
@@ -1132,7 +1159,7 @@ miLineArc (
     else
     {
 	spanRec.count = n;
-	AppendSpanGroup (pGC, pixel, &spanRec, spanData)
+	AppendSpanGroup (pGC, pixel, &spanRec, spanData);
     }
 }
 
diff --git a/mi/miwideline.h b/mi/miwideline.h
index 41b8bb2..1665ebf 100644
--- a/mi/miwideline.h
+++ b/mi/miwideline.h
@@ -31,30 +31,6 @@ from The Open Group.
 #include "mispans.h"
 #include "mifpoly.h" /* for ICEIL */
 
-/* 
- * interface data to span-merging polygon filler
- */
-
-typedef struct _SpanData {
-    SpanGroup	fgGroup, bgGroup;
-} SpanDataRec, *SpanDataPtr;
-
-#define AppendSpanGroup(pGC, pixel, spanPtr, spanData) { \
-	SpanGroup   *group, *othergroup = NULL; \
-	if (pixel == pGC->fgPixel) \
-	{ \
-	    group = &spanData->fgGroup; \
-	    if (pGC->lineStyle == LineDoubleDash) \
-		othergroup = &spanData->bgGroup; \
-	} \
-	else \
-	{ \
-	    group = &spanData->bgGroup; \
-	    othergroup = &spanData->fgGroup; \
-	} \
-	miAppendSpans (group, othergroup, spanPtr); \
-}
-
 /*
  * Polygon edge description for integer wide-line routines
  */
-- 
1.7.0



More information about the xorg-devel mailing list