From 6de551b5041d4a1c8e248d8381772b2264ae6bcf Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 10 Nov 2004 13:30:55 +0000 Subject: [PATCH] Fix many sparse warnings. (#157253, Kjartan Maraas. 2004-11-10 Matthias Clasen * gdk/linux-fb/*: Fix many sparse warnings. (#157253, Kjartan Maraas. --- ChangeLog | 3 + ChangeLog.pre-2-10 | 3 + ChangeLog.pre-2-6 | 3 + ChangeLog.pre-2-8 | 3 + gdk/linux-fb/gdkcursor-fb.c | 2 +- gdk/linux-fb/gdkkeyboard-fb.c | 2 +- gdk/linux-fb/gdkmain-fb.c | 2 +- gdk/linux-fb/gdkmouse-fb.c | 2 +- gdk/linux-fb/gdkpixmap-fb.c | 2 +- gdk/linux-fb/gdkselection-fb.c | 8 +- gdk/linux-fb/gdkwindow-fb.c | 2 +- gdk/linux-fb/miarc.c | 224 ++++++++++----------------------- gdk/linux-fb/midash.c | 24 ++-- gdk/linux-fb/mifillarc.c | 66 +++------- gdk/linux-fb/mifillarc.h | 49 ++------ gdk/linux-fb/mifpoly.h | 21 ++-- gdk/linux-fb/mifpolycon.c | 12 +- gdk/linux-fb/miline.h | 34 +++-- gdk/linux-fb/mipoly.c | 18 +-- gdk/linux-fb/mipoly.h | 49 ++------ gdk/linux-fb/mipolygen.c | 6 +- gdk/linux-fb/mipolyutil.c | 30 ++--- gdk/linux-fb/mispans.c | 36 ++---- gdk/linux-fb/mispans.h | 66 ++-------- gdk/linux-fb/miwideline.c | 161 +++++++----------------- gdk/linux-fb/miwideline.h | 91 ++++---------- gdk/linux-fb/mizerclip.c | 16 +-- gdk/linux-fb/mizerline.c | 16 +-- 28 files changed, 276 insertions(+), 675 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a31bed91b..869257f36c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-11-10 Matthias Clasen + * gdk/linux-fb/*: Fix many sparse warnings. (#157253, + Kjartan Maraas. + * NEWS: Updates 2004-11-09 Matthias Clasen diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 9a31bed91b..869257f36c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2004-11-10 Matthias Clasen + * gdk/linux-fb/*: Fix many sparse warnings. (#157253, + Kjartan Maraas. + * NEWS: Updates 2004-11-09 Matthias Clasen diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 9a31bed91b..869257f36c 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,8 @@ 2004-11-10 Matthias Clasen + * gdk/linux-fb/*: Fix many sparse warnings. (#157253, + Kjartan Maraas. + * NEWS: Updates 2004-11-09 Matthias Clasen diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 9a31bed91b..869257f36c 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,8 @@ 2004-11-10 Matthias Clasen + * gdk/linux-fb/*: Fix many sparse warnings. (#157253, + Kjartan Maraas. + * NEWS: Updates 2004-11-09 Matthias Clasen diff --git a/gdk/linux-fb/gdkcursor-fb.c b/gdk/linux-fb/gdkcursor-fb.c index 4253c04784..737abafe84 100644 --- a/gdk/linux-fb/gdkcursor-fb.c +++ b/gdk/linux-fb/gdkcursor-fb.c @@ -357,7 +357,7 @@ gdk_fb_cursor_invalidate (void) } void -gdk_fb_cursor_unhide() +gdk_fb_cursor_unhide (void) { GdkFBDrawingContext *mydc = gdk_fb_cursor_dc; GdkCursorPrivateFB *last_private; diff --git a/gdk/linux-fb/gdkkeyboard-fb.c b/gdk/linux-fb/gdkkeyboard-fb.c index 0c1f2aa0f9..f06794064c 100644 --- a/gdk/linux-fb/gdkkeyboard-fb.c +++ b/gdk/linux-fb/gdkkeyboard-fb.c @@ -170,7 +170,7 @@ gdk_keymap_get_direction (GdkKeymap *keymap) } guint -gdk_fb_keyboard_modifiers () +gdk_fb_keyboard_modifiers (void) { return gdk_fb_keyboard->modifier_state; } diff --git a/gdk/linux-fb/gdkmain-fb.c b/gdk/linux-fb/gdkmain-fb.c index d785e44eb6..0242d80b07 100644 --- a/gdk/linux-fb/gdkmain-fb.c +++ b/gdk/linux-fb/gdkmain-fb.c @@ -715,7 +715,7 @@ gdk_fb_switch (int sig) } static GdkFBDisplay * -gdk_fb_display_new () +gdk_fb_display_new (void) { GdkFBDisplay *display; gchar *fb_filename; diff --git a/gdk/linux-fb/gdkmouse-fb.c b/gdk/linux-fb/gdkmouse-fb.c index c95b0a09d2..78c0e4b49c 100644 --- a/gdk/linux-fb/gdkmouse-fb.c +++ b/gdk/linux-fb/gdkmouse-fb.c @@ -658,7 +658,7 @@ gdk_fb_mouse_ms_open (GdkFBMouse *mouse) } while ((i = read (fd, buf, sizeof(buf))) > 0) - g_print ("Got %d bytes of junk from %s\n", mouse->file, i); + g_print ("Got %d bytes of junk from %s\n", i, mouse->file); tcgetattr (fd, &tty); tty.c_iflag = IGNBRK | IGNPAR; diff --git a/gdk/linux-fb/gdkpixmap-fb.c b/gdk/linux-fb/gdkpixmap-fb.c index bafeb96e2e..00b58c4b4c 100644 --- a/gdk/linux-fb/gdkpixmap-fb.c +++ b/gdk/linux-fb/gdkpixmap-fb.c @@ -203,7 +203,7 @@ gdk_pixmap_create_from_data (GdkDrawable *window, GdkPixmap* gdk_pixmap_foreign_new (GdkNativeWindow anid) { - return (GdkPixmap*) gdk_drawable_ref (anid); + return (GdkPixmap*) gdk_drawable_ref ((GdkDrawable *)anid); } GdkPixmap* diff --git a/gdk/linux-fb/gdkselection-fb.c b/gdk/linux-fb/gdkselection-fb.c index 33b5284f4c..374cf3f208 100644 --- a/gdk/linux-fb/gdkselection-fb.c +++ b/gdk/linux-fb/gdkselection-fb.c @@ -138,7 +138,7 @@ gdk_selection_convert (GdkWindow *requestor, if (event_window) { event = gdk_event_make (event_window, GDK_SELECTION_REQUEST, TRUE); - event->selection.requestor = requestor; + event->selection.requestor = (unsigned int)requestor; event->selection.selection = selection; event->selection.target = target; event->selection.property = _gdk_selection_property; @@ -173,7 +173,7 @@ gdk_selection_property_get (GdkWindow *requestor, if (!gdk_property_get (requestor, _gdk_selection_property, - 0/*AnyPropertyType?*/, + NULL/*AnyPropertyType?*/, 0, 0, FALSE, &prop_type, &prop_format, &prop_len, @@ -190,7 +190,7 @@ gdk_selection_property_get (GdkWindow *requestor, if (!gdk_property_get (requestor, _gdk_selection_property, - 0/*AnyPropertyType?*/, + NULL/*AnyPropertyType?*/, 0, prop_len + 1, FALSE, &prop_type, &prop_format, &prop_len, @@ -268,7 +268,7 @@ gchar * gdk_utf8_to_string_target (const gchar *str) { g_warning ("gdk_utf8_to_string_target() not implemented\n"); - return 0; + return NULL; } gboolean diff --git a/gdk/linux-fb/gdkwindow-fb.c b/gdk/linux-fb/gdkwindow-fb.c index 9e7e90352e..8e278c2a8d 100644 --- a/gdk/linux-fb/gdkwindow-fb.c +++ b/gdk/linux-fb/gdkwindow-fb.c @@ -2343,7 +2343,7 @@ GdkWindow* gdk_window_foreign_new_for_display (GdkDisplay *display, GdkNativeWindow anid) { - return (GdkWindow*) gdk_drawable_ref (anid); + return (GdkWindow*) gdk_drawable_ref ((GdkDrawable *)anid); } GdkWindow* diff --git a/gdk/linux-fb/miarc.c b/gdk/linux-fb/miarc.c index d937a534d4..ab42d276a6 100644 --- a/gdk/linux-fb/miarc.c +++ b/gdk/linux-fb/miarc.c @@ -1198,8 +1198,7 @@ miPolyArc(GdkDrawable *pDraw, GdkGC *pGC, int narcs, miArc *parcs) } static double -angleBetween (center, point1, point2) - SppPointRec center, point1, point2; +angleBetween (SppPointRec center, SppPointRec point1, SppPointRec point2) { double a1, a2, a; @@ -1218,10 +1217,7 @@ angleBetween (center, point1, point2) } static void -translateBounds (b, x, y, fx, fy) -miArcFacePtr b; -int x, y; -double fx, fy; +translateBounds (miArcFacePtr b, int x, int y, double fx, double fy) { fx += x; fy += y; @@ -1342,13 +1338,8 @@ miArcJoin (GdkDrawable *pDraw, GdkGC *pGC, miArcFacePtr pLeft, miArcFacePtr pRig /*ARGSUSED*/ static void -miArcCap (pDraw, pGC, pFace, end, xOrg, yOrg, xFtrans, yFtrans) - GdkDrawable* pDraw; - GdkGC* pGC; - miArcFacePtr pFace; - int end; - int xOrg, yOrg; - double xFtrans, yFtrans; +miArcCap (GdkDrawable *pDraw, GdkGC *pGC, miArcFacePtr pFace, int end, + int xOrg, int yOrg, double xFtrans, double yFtrans) { SppPointRec corner, otherCorner, center, endPoint, poly[5]; @@ -1400,7 +1391,6 @@ static void miRoundCap(GdkDrawable *pDraw, GdkGC *pGC, SppPointRec pCenter, SppP { int cpt; double width; - double miDatan2 (); SppArcRec arc; SppPointPtr pArcPts; @@ -1410,7 +1400,7 @@ static void miRoundCap(GdkDrawable *pDraw, GdkGC *pGC, SppPointRec pCenter, SppP arc.y = pCenter.y - width/2; arc.width = width; arc.height = width; - arc.angle1 = -miDatan2 (pCorner.y - pCenter.y, pCorner.x - pCenter.x); + arc.angle1 = -(miDatan2 (pCorner.y - pCenter.y, pCorner.x - pCenter.x)); if(PTISEQUAL(pCenter, pEnd)) arc.angle2 = - 180.0; else { @@ -1446,8 +1436,7 @@ static void miRoundCap(GdkDrawable *pDraw, GdkGC *pGC, SppPointRec pCenter, SppP # define mod(a,b) ((a) >= 0 ? (a) % (b) : (b) - (-a) % (b)) static double -miDcos (a) -double a; +miDcos (double a) { int i; @@ -1464,8 +1453,7 @@ double a; } static double -miDsin (a) -double a; +miDsin (double a) { int i; @@ -1482,8 +1470,7 @@ double a; } static double -miDasin (v) -double v; +miDasin (double v) { if (v == 0) return 0.0; @@ -1495,8 +1482,7 @@ double v; } static double -miDatan2 (dy, dx) -double dy, dx; +miDatan2 (double dy, double dx) { if (dy == 0) { if (dx >= 0) @@ -1631,10 +1617,7 @@ struct arcData { # define ADD_REALLOC_STEP 20 static void -addCap (capsp, ncapsp, sizep, end, arcIndex) - miArcCapPtr *capsp; - int *ncapsp, *sizep; - int end, arcIndex; +addCap (miArcCapPtr *capsp, int *ncapsp, int *sizep, int end, int arcIndex) { int newsize; miArcCapPtr cap; @@ -1656,10 +1639,8 @@ addCap (capsp, ncapsp, sizep, end, arcIndex) } static void -addJoin (joinsp, njoinsp, sizep, end0, index0, phase0, end1, index1, phase1) - miArcJoinPtr *joinsp; - int *njoinsp, *sizep; - int end0, index0, phase0, end1, index1, phase1; +addJoin (miArcJoinPtr *joinsp, int *njoinsp, int *sizep, int end0, int index0, + int phase0, int end1, int index1, int phase1) { int newsize; miArcJoinPtr join; @@ -1685,10 +1666,7 @@ addJoin (joinsp, njoinsp, sizep, end0, index0, phase0, end1, index1, phase1) } static miArcDataPtr -addArc (arcsp, narcsp, sizep, xarc) - miArcDataPtr *arcsp; - int *narcsp, *sizep; - miArc *xarc; +addArc (miArcDataPtr *arcsp, int *narcsp, int *sizep, miArc *xarc) { int newsize; miArcDataPtr arc; @@ -1742,9 +1720,7 @@ miFreeArcs(miPolyArcPtr arcs, GdkGC *pGC) # define dashXAngleStep (((double) (90 * 64)) / ((double) (DASH_MAP_SIZE - 1))) static void -computeDashMap (arcp, map) - miArc *arcp; - dashMap *map; +computeDashMap (miArc *arcp, dashMap *map) { int di; double a, x, y, prevx = 0.0, prevy = 0.0, dist; @@ -1823,15 +1799,15 @@ miComputeArcs (miArc *parcs, int narcs, GdkGC *pGC) for (iphase = 0; iphase < (isDoubleDash ? 2 : 1); iphase++) { arcs[iphase].njoins = 0; - arcs[iphase].joins = 0; + arcs[iphase].joins = NULL; joinSize[iphase] = 0; arcs[iphase].ncaps = 0; - arcs[iphase].caps = 0; + arcs[iphase].caps = NULL; capSize[iphase] = 0; arcs[iphase].narcs = 0; - arcs[iphase].arcs = 0; + arcs[iphase].arcs = NULL; arcSize[iphase] = 0; } @@ -1937,7 +1913,7 @@ miComputeArcs (miArc *parcs, int narcs, GdkGC *pGC) /* * add dashed arcs to each bucket */ - arc = 0; + arc = NULL; while (dashAngle != endAngle) { prevDashAngle = dashAngle; if (arcType == OTHER) { @@ -2161,9 +2137,7 @@ arcfail: } static double -angleToLength (angle, map) - int angle; - dashMap *map; +angleToLength (int angle, dashMap *map) { double len, excesslen, sidelen = map->map[DASH_MAP_SIZE - 1], totallen; int di; @@ -2211,9 +2185,7 @@ angleToLength (angle, map) */ static int -lengthToAngle (len, map) - double len; - dashMap *map; +lengthToAngle (double len, dashMap *map) { double sidelen = map->map[DASH_MAP_SIZE - 1]; int angle, angleexcess; @@ -2324,12 +2296,8 @@ static int computeAngleFromPath(int startAngle, int endAngle, dashMap *map, int */ static void -drawZeroArc (pDraw, pGC, tarc, lw, left, right) - GdkDrawable* pDraw; - GdkGC* pGC; - miArc *tarc; - int lw; - miArcFacePtr right, left; +drawZeroArc (GdkDrawable *pDraw, GdkGC *pGC, miArc *tarc, int lw, + miArcFacePtr left, miArcFacePtr right) { double x0 = 0.0, y0 = 0.0, x1 = 0.0, y1 = 0.0, w, h, x, y; double xmax, ymax, xmin, ymin; @@ -2454,9 +2422,7 @@ drawZeroArc (pDraw, pGC, tarc, lw, left, right) */ static void -tailEllipseY (def, acc) - struct arc_def *def; - struct accelerators *acc; +tailEllipseY (struct arc_def *def, struct accelerators *acc) { double t; @@ -2483,46 +2449,35 @@ tailEllipseY (def, acc) */ static double -outerXfromXY (x, y, def, acc) - double x, y; - struct arc_def *def; - struct accelerators *acc; +outerXfromXY (double x, double y, + struct arc_def *def, struct accelerators *acc) { return x + (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4); } static double -outerYfromXY (x, y, def, acc) - double x, y; - struct arc_def *def; - struct accelerators *acc; +outerYfromXY (double x, double y, + struct arc_def *def, struct accelerators *acc) { return y + (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4); } static double -innerXfromXY (x, y, def, acc) - double x, y; - struct arc_def *def; - struct accelerators *acc; +innerXfromXY (double x, double y, + struct arc_def *def, struct accelerators *acc) { return x - (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4); } static double -innerYfromXY (x, y, def, acc) - double x, y; - struct arc_def *def; - struct accelerators *acc; +innerYfromXY (double x, double y, + struct arc_def *def, struct accelerators *acc) { return y - (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4); } static double -innerYfromY (y, def, acc) - double y; - struct arc_def *def; - struct accelerators *acc; +innerYfromY (double y, struct arc_def *def, struct accelerators *acc) { double x; @@ -2532,9 +2487,7 @@ innerYfromY (y, def, acc) } static void -computeLine (x1, y1, x2, y2, line) - double x1, y1, x2, y2; - struct line *line; +computeLine (double x1, double y1, double x2, double y2, struct line *line) { if (y1 == y2) line->valid = 0; @@ -2552,11 +2505,7 @@ computeLine (x1, y1, x2, y2, line) */ static void -computeAcc (tarc, lw, def, acc) - miArc *tarc; - int lw; - struct arc_def *def; - struct accelerators *acc; +computeAcc (miArc *tarc, int lw, struct arc_def *def, struct accelerators *acc) { def->w = ((double) tarc->width) / 2.0; def->h = ((double) tarc->height) / 2.0; @@ -2582,11 +2531,8 @@ computeAcc (tarc, lw, def, acc) */ static void -computeBound (def, bound, acc, right, left) - struct arc_def *def; - struct arc_bound *bound; - struct accelerators *acc; - miArcFacePtr right, left; +computeBound (struct arc_def *def, struct arc_bound *bound, + struct accelerators *acc, miArcFacePtr right, miArcFacePtr left) { double t; double innerTaily; @@ -2722,11 +2668,8 @@ computeBound (def, bound, acc, right, left) */ static double -hookEllipseY (scan_y, bound, acc, left) - double scan_y; - struct arc_bound *bound; - struct accelerators *acc; - int left; +hookEllipseY (double scan_y, struct arc_bound *bound, + struct accelerators *acc, int left) { double ret; @@ -2748,12 +2691,8 @@ hookEllipseY (scan_y, bound, acc, left) */ static double -hookX (scan_y, def, bound, acc, left) - double scan_y; - struct arc_def *def; - struct arc_bound *bound; - struct accelerators *acc; - int left; +hookX (double scan_y, struct arc_def *def, + struct arc_bound *bound, struct accelerators *acc, int left) { double ellipse_y, x; double maxMin; @@ -2805,16 +2744,9 @@ hookX (scan_y, def, bound, acc, left) */ static void -arcSpan (y, lx, lw, rx, rw, def, bounds, acc, mask) - int y; - int lx; - int lw; - int rx; - int rw; - struct arc_def *def; - struct arc_bound *bounds; - struct accelerators *acc; - int mask; +arcSpan (int y, int lx, int lw, int rx, int rw, + struct arc_def *def, struct arc_bound *bounds, + struct accelerators *acc, int mask) { int linx, loutx, rinx, routx; double x, altx; @@ -2875,15 +2807,9 @@ arcSpan (y, lx, lw, rx, rw, def, bounds, acc, mask) } static void -arcSpan0 (lx, lw, rx, rw, def, bounds, acc, mask) - int lx; - int lw; - int rx; - int rw; - struct arc_def *def; - struct arc_bound *bounds; - struct accelerators *acc; - int mask; +arcSpan0 (int lx, int lw, int rx, int rw, + struct arc_def *def, struct arc_bound *bounds, + struct accelerators *acc, int mask) { double x; @@ -2903,14 +2829,9 @@ arcSpan0 (lx, lw, rx, rw, def, bounds, acc, mask) } static void -tailSpan (y, lw, rw, def, bounds, acc, mask) - int y; - int lw; - int rw; - struct arc_def *def; - struct arc_bound *bounds; - struct accelerators *acc; - int mask; +tailSpan (int y, int lw, int rw, + struct arc_def *def, struct arc_bound *bounds, + struct accelerators *acc, int mask) { double yy, xalt, x, lx, rx; int n; @@ -2975,7 +2896,7 @@ static struct finalSpan *freeFinalSpans, *tmpFinalSpan; # define allocFinalSpan() (freeFinalSpans ?\ ((tmpFinalSpan = freeFinalSpans), \ (freeFinalSpans = freeFinalSpans->next), \ - (tmpFinalSpan->next = 0), \ + (tmpFinalSpan->next = NULL), \ tmpFinalSpan) : \ realAllocSpan ()) @@ -2989,7 +2910,7 @@ struct finalSpanChunk { static struct finalSpanChunk *chunks; struct finalSpan * -realAllocSpan () +realAllocSpan (void) { register struct finalSpanChunk *newChunk; register struct finalSpan *span; @@ -3005,14 +2926,14 @@ realAllocSpan () span->next = span+1; span++; } - span->next = 0; + span->next = NULL; span = newChunk->data; - span->next = 0; + span->next = NULL; return span; } static void -disposeFinalSpans () +disposeFinalSpans (void) { struct finalSpanChunk *chunk, *next; @@ -3020,16 +2941,14 @@ disposeFinalSpans () next = chunk->next; g_free (chunk); } - chunks = 0; - freeFinalSpans = 0; + chunks = NULL; + freeFinalSpans = NULL; g_free(finalSpans); - finalSpans = 0; + finalSpans = NULL; } static void -fillSpans (pDrawable, pGC) - GdkDrawable* pDrawable; - GdkGC* pGC; +fillSpans (GdkDrawable *pDrawable, GdkGC *pGC) { register struct finalSpan *span; register GdkSpan* xSpan; @@ -3075,8 +2994,7 @@ fillSpans (pDrawable, pGC) realFindSpan (y)) static struct finalSpan ** -realFindSpan (y) - int y; +realFindSpan (int y) { struct finalSpan **newSpans; int newSize, newMiny, newMaxy; @@ -3127,9 +3045,7 @@ realFindSpan (y) } static void -newFinalSpan (y, xmin, xmax) - int y; - register int xmin, xmax; +newFinalSpan (int y, register int xmin, register int xmax) { register struct finalSpan *x; register struct finalSpan **f; @@ -3139,9 +3055,9 @@ newFinalSpan (y, xmin, xmax) f = findSpan (y); if (!f) return; - oldx = 0; + oldx = NULL; for (;;) { - prev = 0; + prev = NULL; for (x = *f; x; x=x->next) { if (x == oldx) { prev = x; @@ -3184,9 +3100,7 @@ newFinalSpan (y, xmin, xmax) } static void -mirrorSppPoint (quadrant, sppPoint) - int quadrant; - SppPointPtr sppPoint; +mirrorSppPoint (int quadrant, SppPointPtr sppPoint) { switch (quadrant) { case 0: @@ -3387,7 +3301,7 @@ drawArc (miArc *tarc, int l, int a0, int a1, miArcFacePtr right, miArcFacePtr le computeAcc (tarc, l, &def, &acc); for (j = 0; j < sweepno; j++) { mask = sweep[j].mask; - passRight = passLeft = 0; + passRight = passLeft = NULL; if (mask & (1 << rightq)) { if (sweep[j].a0 == righta) passRight = right; @@ -3454,13 +3368,9 @@ drawArc (miArc *tarc, int l, int a0, int a1, miArcFacePtr right, miArcFacePtr le } static void -drawQuadrant (def, acc, a0, a1, mask, right, left, spdata) - struct arc_def *def; - struct accelerators *acc; - int a0, a1; - int mask; - miArcFacePtr right, left; - miArcSpanData *spdata; +drawQuadrant (struct arc_def *def, struct accelerators *acc, + int a0, int a1, int mask, miArcFacePtr right, + miArcFacePtr left, miArcSpanData *spdata) { struct arc_bound bound; double yy, x, xalt; diff --git a/gdk/linux-fb/midash.c b/gdk/linux-fb/midash.c index 6c087ee957..0e90516a60 100644 --- a/gdk/linux-fb/midash.c +++ b/gdk/linux-fb/midash.c @@ -45,7 +45,8 @@ SOFTWARE. #include #include "mi.h" -static miDashPtr CheckDashStorage(); +static miDashPtr +CheckDashStorage(miDashPtr *ppseg, int nseg, int *pnsegMax); /* return a list of DashRec. there will be an extra entry at the end holding the last point of the polyline. @@ -79,13 +80,8 @@ enum { EVEN_DASH=0, ODD_DASH=1 }; #define sign(x) ((x)>0)?1:( ((x)<0)?-1:0 ) miDashPtr -miDashLine(npt, ppt, nDash, pDash, offset, pnseg) -int npt; -GdkPoint* ppt; -unsigned int nDash; -unsigned char *pDash; -unsigned int offset; -int *pnseg; +miDashLine(int npt, GdkPoint *ppt, unsigned int nDash, + unsigned char *pDash, unsigned int offset, int *pnseg) { GdkPoint pt1, pt2; int lenCur; /* npt used from this dash */ @@ -248,12 +244,13 @@ necessary. this interface seems unnecessarily cumbersome. */ -static -miDashPtr -CheckDashStorage(ppseg, nseg, pnsegMax) +static miDashPtr +CheckDashStorage(miDashPtr *ppseg, int nseg, int *pnsegMax) +#if 0 miDashPtr *ppseg; /* base pointer */ int nseg; /* number of segment we want to write to */ int *pnsegMax; /* size (in segments) of list so far */ +#endif { if (nseg > *pnsegMax) { @@ -273,12 +270,15 @@ int *pnsegMax; /* size (in segments) of list so far */ } void -miStepDash (dist, pDashIndex, pDash, numInDashList, pDashOffset) +miStepDash (int dist, int *pDashIndex, unsigned char *pDash, + int numInDashList, int *pDashOffset) +#if 0 int dist; /* distance to step */ int *pDashIndex; /* current dash */ unsigned char *pDash; /* dash list */ int numInDashList; /* total length of dash list */ int *pDashOffset; /* offset into current dash */ +#endif { int dashIndex, dashOffset; int totallen; diff --git a/gdk/linux-fb/mifillarc.c b/gdk/linux-fb/mifillarc.c index 2283529fb1..5f12067993 100644 --- a/gdk/linux-fb/mifillarc.c +++ b/gdk/linux-fb/mifillarc.c @@ -43,9 +43,7 @@ Author: Bob Scheifler, MIT X Consortium #define Dcos(d) cos((double)d*(M_PI/11520.0)) void -miFillArcSetup(arc, info) - register miArc *arc; - register miFillArcRec *info; +miFillArcSetup(register miArc *arc, register miFillArcRec *info) { info->y = arc->height >> 1; info->dy = arc->height & 1; @@ -98,9 +96,7 @@ miFillArcSetup(arc, info) } void -miFillArcDSetup(arc, info) - register miArc *arc; - register miFillArcDRec *info; +miFillArcDSetup(register miArc *arc, register miFillArcDRec *info) { /* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */ /* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */ @@ -130,11 +126,8 @@ miFillArcDSetup(arc, info) } static void -miGetArcEdge(arc, edge, k, top, left) - register miArc *arc; - register miSliceEdgePtr edge; - int k; - gboolean top, left; +miGetArcEdge(register miArc *arc, register miSliceEdgePtr edge, int k, + gboolean top, gboolean left) { register int xady, y; @@ -178,14 +171,8 @@ miGetArcEdge(arc, edge, k, top, left) } void -miEllipseAngleToSlope (angle, width, height, dxp, dyp, d_dxp, d_dyp) - int angle; - int width; - int height; - int *dxp; - int *dyp; - double *d_dxp; - double *d_dyp; +miEllipseAngleToSlope (int angle, int width, int height, int *dxp, int *dyp, + double *d_dxp, double *d_dyp) { int dx, dy; double d_dx, d_dy, scale; @@ -259,16 +246,13 @@ miEllipseAngleToSlope (angle, width, height, dxp, dyp, d_dxp, d_dyp) } static void -miGetPieEdge(arc, angle, edge, top, left) - register miArc *arc; - register int angle; - register miSliceEdgePtr edge; - gboolean top, left; +miGetPieEdge(register miArc *arc, register int angle, + register miSliceEdgePtr edge, gboolean top, gboolean left) { register int k; int dx, dy; - miEllipseAngleToSlope (angle, arc->width, arc->height, &dx, &dy, 0, 0); + miEllipseAngleToSlope (angle, arc->width, arc->height, &dx, &dy, NULL, NULL); if (dy == 0) { @@ -303,10 +287,8 @@ miGetPieEdge(arc, angle, edge, top, left) } void -miFillArcSliceSetup(arc, slice, pGC) - register miArc *arc; - register miArcSliceRec *slice; - GdkGC* pGC; +miFillArcSliceSetup(register miArc *arc, register miArcSliceRec *slice, + GdkGC *pGC) { register int angle1, angle2; @@ -532,10 +514,7 @@ miFillArcSliceSetup(arc, slice, pGC) } static void -miFillEllipseI(pDraw, pGC, arc) - GdkDrawable* pDraw; - GdkGC* pGC; - miArc *arc; +miFillEllipseI(GdkDrawable *pDraw, GdkGC *pGC, miArc *arc) { register int x, y, e; int yk, xk, ym, xm, dx, dy, xorg, yorg; @@ -561,10 +540,7 @@ miFillEllipseI(pDraw, pGC, arc) } static void -miFillEllipseD(pDraw, pGC, arc) - GdkDrawable* pDraw; - GdkGC* pGC; - miArc *arc; +miFillEllipseD(GdkDrawable *pDraw, GdkGC *pGC, miArc *arc) { register int x, y; int xorg, yorg, dx, dy, slw; @@ -611,10 +587,7 @@ miFillEllipseD(pDraw, pGC, arc) } static void -miFillArcSliceI(pDraw, pGC, arc) - GdkDrawable* pDraw; - GdkGC* pGC; - miArc *arc; +miFillArcSliceI(GdkDrawable *pDraw, GdkGC *pGC, miArc *arc) { int yk, xk, ym, xm, dx, dy, xorg, yorg, slw; register int x, y, e; @@ -658,10 +631,7 @@ miFillArcSliceI(pDraw, pGC, arc) } static void -miFillArcSliceD(pDraw, pGC, arc) - GdkDrawable* pDraw; - GdkGC* pGC; - miArc *arc; +miFillArcSliceD(GdkDrawable *pDraw, GdkGC *pGC, miArc *arc) { register int x, y; int dx, dy, xorg, yorg, slw; @@ -710,11 +680,7 @@ miFillArcSliceD(pDraw, pGC, arc) * fill each arc as it comes. */ void -miPolyFillArc(pDraw, pGC, narcs, parcs) - GdkDrawable* pDraw; - GdkGC* pGC; - int narcs; - miArc *parcs; +miPolyFillArc(GdkDrawable *pDraw, GdkGC *pGC, int narcs, miArc *parcs) { register int i; register miArc *arc; diff --git a/gdk/linux-fb/mifillarc.h b/gdk/linux-fb/mifillarc.h index 99a75d6423..f11c53ebbb 100644 --- a/gdk/linux-fb/mifillarc.h +++ b/gdk/linux-fb/mifillarc.h @@ -174,51 +174,18 @@ typedef struct _miArcSlice { #define miFillInArcLower(slw) (((iny + dy) != 0) && \ ((slw > 1) || (ine != inxk))) -extern int miFreeArcCache( -#if NeedFunctionPrototypes - gpointer /*data*/, - guint /*id*/ -#endif -); +extern int miFreeArcCache(gpointer data, guint id); -extern struct finalSpan *realAllocSpan( -#if NeedFunctionPrototypes - void -#endif -); +extern struct finalSpan *realAllocSpan(void); -extern void miFillArcSetup( -#if NeedFunctionPrototypes - miArc * /*arc*/, - miFillArcRec * /*info*/ -#endif -); +extern void miFillArcSetup(miArc *arc, miFillArcRec *info); -extern void miFillArcDSetup( -#if NeedFunctionPrototypes - miArc * /*arc*/, - miFillArcDRec * /*info*/ -#endif -); +extern void miFillArcDSetup(miArc *arc, miFillArcDRec *info); -extern void miEllipseAngleToSlope( -#if NeedFunctionPrototypes - int /*angle*/, - int /*width*/, - int /*height*/, - int * /*dxp*/, - int * /*dyp*/, - double * /*d_dxp*/, - double * /*d_dyp*/ -#endif -); +extern void miEllipseAngleToSlope(int angle, int width, int height, int *dxp, + int *dyp, double *d_dxp, double *d_dyp); -extern void miFillArcSliceSetup( -#if NeedFunctionPrototypes - miArc * /*arc*/, - miArcSliceRec * /*slice*/, - GdkGC* /*pGC*/ -#endif -); +extern void miFillArcSliceSetup(miArc *arc, miArcSliceRec *slice, GdkGC* pGC); #endif + diff --git a/gdk/linux-fb/mifpoly.h b/gdk/linux-fb/mifpoly.h index fd56f57ea1..a405fd6a88 100644 --- a/gdk/linux-fb/mifpoly.h +++ b/gdk/linux-fb/mifpoly.h @@ -69,8 +69,7 @@ SOFTWARE. #else #ifdef __GNUC__ #define ICEIL ICIEL -static __inline int ICEIL(x) - double x; +static __inline int ICEIL(double x) { int _cTmp = x; return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp+1; @@ -97,16 +96,14 @@ typedef struct _SppArc { /* mifpolycon.c */ extern void miFillSppPoly( -#if NeedFunctionPrototypes - GdkDrawable* /*dst*/, - GdkGC* /*pgc*/, - int /*count*/, - SppPointPtr /*ptsIn*/, - int /*xTrans*/, - int /*yTrans*/, - double /*xFtrans*/, - double /*yFtrans*/ -#endif + GdkDrawable* dst, + GdkGC* pgc, + int count, + SppPointPtr ptsIn, + int xTrans, + int yTrans, + double xFtrans, + double yFtrans ); #endif /* MIFPOLY_H */ diff --git a/gdk/linux-fb/mifpolycon.c b/gdk/linux-fb/mifpolycon.c index 9c94500b57..70e4dcdd75 100644 --- a/gdk/linux-fb/mifpolycon.c +++ b/gdk/linux-fb/mifpolycon.c @@ -46,7 +46,8 @@ SOFTWARE. #include "mi.h" #include "mifpoly.h" -static int GetFPolyYBounds(); +static int +GetFPolyYBounds(register SppPointPtr pts, int n, double yFtrans, int *by, int *ty); #ifdef ICEILTEMPDECL ICEILTEMPDECL @@ -228,13 +229,8 @@ miFillSppPoly(GdkDrawable *dst, GdkGC *pgc, int count, SppPointPtr ptsIn, int xT /* Find the index of the point with the smallest y.also return the * smallest and largest y */ -static -int -GetFPolyYBounds(pts, n, yFtrans, by, ty) - register SppPointPtr pts; - int n; - double yFtrans; - int *by, *ty; +static int +GetFPolyYBounds(register SppPointPtr pts, int n, double yFtrans, int *by, int *ty) { register SppPointPtr ptMin; double ymin, ymax; diff --git a/gdk/linux-fb/miline.h b/gdk/linux-fb/miline.h index a4ccf2c325..4ac4695cd7 100644 --- a/gdk/linux-fb/miline.h +++ b/gdk/linux-fb/miline.h @@ -154,24 +154,22 @@ extern void miSetZeroLineBias( extern int miZeroLineScreenIndex; extern int miZeroClipLine( -#if NeedFunctionPrototypes - int /*xmin*/, - int /*ymin*/, - int /*xmax*/, - int /*ymax*/, - int * /*new_x1*/, - int * /*new_y1*/, - int * /*new_x2*/, - int * /*new_y2*/, - unsigned int /*adx*/, - unsigned int /*ady*/, - int * /*pt1_clipped*/, - int * /*pt2_clipped*/, - int /*octant*/, - unsigned int /*bias*/, - int /*oc1*/, - int /*oc2*/ -#endif + int xmin, + int ymin, + int xmax, + int ymax, + int * new_x1, + int * new_y1, + int * new_x2, + int * new_y2, + unsigned int adx, + unsigned int ady, + int * pt1_clipped, + int * pt2_clipped, + int octant, + unsigned int bias, + int oc1, + int oc2 ); #endif /* MILINE_H */ diff --git a/gdk/linux-fb/mipoly.c b/gdk/linux-fb/mipoly.c index 3854a60311..fdb4b5eef8 100644 --- a/gdk/linux-fb/mipoly.c +++ b/gdk/linux-fb/mipoly.c @@ -54,22 +54,12 @@ SOFTWARE. #include #include "mi.h" -extern gboolean miFillGeneralPoly( -#if NeedFunctionPrototypes - GdkDrawable* /*dst*/, - GdkGC* /*pgc*/, - int /*count*/, - GdkPoint* /*ptsIn*/ -#endif -); +extern gboolean miFillGeneralPoly(GdkDrawable* dst, GdkGC* pgc, + int count, GdkPoint* ptsIn); void -miFillPolygon(dst, pgc, shape, mode, count, pPts) - GdkDrawable* dst; - register GdkGC* pgc; - int shape, mode; - register int count; - GdkPoint* pPts; +miFillPolygon(GdkDrawable *dst, register GdkGC *pgc, int shape, + int mode, register int count, GdkPoint *pPts) { if (count == 0) return; diff --git a/gdk/linux-fb/mipoly.h b/gdk/linux-fb/mipoly.h index d8dfe19664..545aa00e26 100644 --- a/gdk/linux-fb/mipoly.h +++ b/gdk/linux-fb/mipoly.h @@ -181,50 +181,19 @@ typedef struct _ScanLineListBlock { /* mipolyutil.c */ -extern gboolean miInsertEdgeInET( -#if NeedFunctionPrototypes - EdgeTable * /*ET*/, - EdgeTableEntry * /*ETE*/, - int /*scanline*/, - ScanLineListBlock ** /*SLLBlock*/, - int * /*iSLLBlock*/ -#endif -); +extern gboolean miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, + ScanLineListBlock **SLLBlock, int *iSLLBlock); -extern gboolean miCreateETandAET( -#if NeedFunctionPrototypes - int /*count*/, - GdkPoint* /*pts*/, - EdgeTable * /*ET*/, - EdgeTableEntry * /*AET*/, - EdgeTableEntry * /*pETEs*/, - ScanLineListBlock * /*pSLLBlock*/ -#endif -); +extern gboolean miCreateETandAET(int count, GdkPoint* pts, EdgeTable *ET, + EdgeTableEntry *AET, EdgeTableEntry *pETEs, + ScanLineListBlock *pSLLBlock); -extern void miloadAET( -#if NeedFunctionPrototypes - EdgeTableEntry * /*AET*/, - EdgeTableEntry * /*ETEs*/ -#endif -); +extern void miloadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs); -extern void micomputeWAET( -#if NeedFunctionPrototypes - EdgeTableEntry * /*AET*/ -#endif -); +extern void micomputeWAET(EdgeTableEntry *AET); -extern int miInsertionSort( -#if NeedFunctionPrototypes - EdgeTableEntry * /*AET*/ -#endif -); +extern int miInsertionSort(EdgeTableEntry *AET); -extern void miFreeStorage( -#if NeedFunctionPrototypes - ScanLineListBlock * /*pSLLBlock*/ -#endif -); +extern void miFreeStorage(ScanLineListBlock *pSLLBlock); #endif diff --git a/gdk/linux-fb/mipolygen.c b/gdk/linux-fb/mipolygen.c index d27d01c653..bb7a4bbd66 100644 --- a/gdk/linux-fb/mipolygen.c +++ b/gdk/linux-fb/mipolygen.c @@ -56,11 +56,7 @@ SOFTWARE. */ gboolean -miFillGeneralPoly(dst, pgc, count, ptsIn) - GdkDrawable* dst; - GdkGC* pgc; - int count; /* number of points */ - GdkPoint* ptsIn; /* the points */ +miFillGeneralPoly(GdkDrawable *dst, GdkGC *pgc, int count, GdkPoint *ptsIn) { register EdgeTableEntry *pAET; /* the Active Edge Table */ register int y; /* the current scanline */ diff --git a/gdk/linux-fb/mipolyutil.c b/gdk/linux-fb/mipolyutil.c index a47d6a49ef..7f0a187da7 100644 --- a/gdk/linux-fb/mipolyutil.c +++ b/gdk/linux-fb/mipolyutil.c @@ -68,12 +68,8 @@ SOFTWARE. * */ gboolean -miInsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock) - EdgeTable *ET; - EdgeTableEntry *ETE; - int scanline; - ScanLineListBlock **SLLBlock; - int *iSLLBlock; +miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, + ScanLineListBlock **SLLBlock, int *iSLLBlock) { register EdgeTableEntry *start, *prev; register ScanLineList *pSLL, *pPrevSLL; @@ -159,13 +155,9 @@ miInsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock) */ gboolean -miCreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock) - register int count; - register GdkPoint* pts; - EdgeTable *ET; - EdgeTableEntry *AET; - register EdgeTableEntry *pETEs; - ScanLineListBlock *pSLLBlock; +miCreateETandAET(register int count, register GdkPoint *pts, EdgeTable *ET, + EdgeTableEntry *AET, register EdgeTableEntry *pETEs, + ScanLineListBlock *pSLLBlock) { register GdkPoint* top, *bottom; register GdkPoint* PrevPt, *CurrPt; @@ -255,8 +247,7 @@ miCreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock) */ void -miloadAET(AET, ETEs) - register EdgeTableEntry *AET, *ETEs; +miloadAET(register EdgeTableEntry *AET, register EdgeTableEntry *ETEs) { register EdgeTableEntry *pPrevAET; register EdgeTableEntry *tmp; @@ -303,8 +294,7 @@ miloadAET(AET, ETEs) * */ void -micomputeWAET(AET) - register EdgeTableEntry *AET; +micomputeWAET(register EdgeTableEntry *AET) { register EdgeTableEntry *pWETE; register int inside = 1; @@ -342,8 +332,7 @@ micomputeWAET(AET) */ int -miInsertionSort(AET) - register EdgeTableEntry *AET; +miInsertionSort(register EdgeTableEntry *AET) { register EdgeTableEntry *pETEchase; register EdgeTableEntry *pETEinsert; @@ -379,8 +368,7 @@ miInsertionSort(AET) * Clean up our act. */ void -miFreeStorage(pSLLBlock) - register ScanLineListBlock *pSLLBlock; +miFreeStorage(register ScanLineListBlock *pSLLBlock) { register ScanLineListBlock *tmpSLLBlock; diff --git a/gdk/linux-fb/mispans.c b/gdk/linux-fb/mispans.c index 0b96716810..49071e7902 100644 --- a/gdk/linux-fb/mispans.c +++ b/gdk/linux-fb/mispans.c @@ -59,8 +59,7 @@ Written by Joel McCormack, Summer 1989. */ -void miInitSpanGroup(spanGroup) - SpanGroup *spanGroup; +void miInitSpanGroup(SpanGroup *spanGroup) { spanGroup->size = 0; spanGroup->count = 0; @@ -72,9 +71,7 @@ void miInitSpanGroup(spanGroup) #define YMIN(spans) (spans->points[0].y) #define YMAX(spans) (spans->points[spans->count-1].y) -void miSubtractSpans (spanGroup, sub) - SpanGroup *spanGroup; - Spans *sub; +void miSubtractSpans (SpanGroup *spanGroup, Spans *sub) { int i, subCount, spansCount; int ymin, ymax, xmin, xmax; @@ -164,10 +161,7 @@ void miSubtractSpans (spanGroup, sub) } } -void miAppendSpans(spanGroup, otherGroup, spans) - SpanGroup *spanGroup; - SpanGroup *otherGroup; - Spans *spans; +void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup, Spans *spans) { register int ymin, ymax; register int spansCount; @@ -199,15 +193,12 @@ void miAppendSpans(spanGroup, otherGroup, spans) } } /* AppendSpans */ -void miFreeSpanGroup(spanGroup) - SpanGroup *spanGroup; +void miFreeSpanGroup(SpanGroup *spanGroup) { if (spanGroup->group != NULL) g_free(spanGroup->group); } -static void QuickSortSpansX(points, numSpans) - register GdkSpan points[]; - register int numSpans; +static void QuickSortSpansX(register GdkSpan points[], register int numSpans) { register int x; register int i, j, m; @@ -286,9 +277,7 @@ static void QuickSortSpansX(points, numSpans) } /* QuickSortSpans */ -static int UniquifySpansX(spans, newPoints, newWidths) - Spans *spans; - register GdkSpan *newPoints; +static int UniquifySpansX(Spans *spans, register GdkSpan *newPoints) { register int newx1, newx2, oldpt, i, y; GdkSpan *oldPoints, *startNewPoints = newPoints; @@ -331,8 +320,7 @@ static int UniquifySpansX(spans, newPoints, newWidths) } /* UniquifySpansX */ void -miDisposeSpanGroup (spanGroup) - SpanGroup *spanGroup; +miDisposeSpanGroup (SpanGroup *spanGroup) { int i; Spans *spans; @@ -344,10 +332,7 @@ miDisposeSpanGroup (spanGroup) } } -void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) - GdkDrawable* pDraw; - GdkGC* pGC; - SpanGroup *spanGroup; +void miFillUniqueSpanGroup(GdkDrawable *pDraw, GdkGC *pGC, SpanGroup *spanGroup) { register int i; register Spans *spans; @@ -485,10 +470,7 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) } -void miFillSpanGroup(pDraw, pGC, spanGroup) - GdkDrawable* pDraw; - GdkGC* pGC; - SpanGroup *spanGroup; +void miFillSpanGroup(GdkDrawable *pDraw, GdkGC *pGC, SpanGroup *spanGroup) { register int i; register Spans *spans; diff --git a/gdk/linux-fb/mispans.h b/gdk/linux-fb/mispans.h index a620b938dc..f46c44d19f 100644 --- a/gdk/linux-fb/mispans.h +++ b/gdk/linux-fb/mispans.h @@ -56,70 +56,30 @@ typedef struct { } SpanGroup; /* Initialize SpanGroup. MUST BE DONE before use. */ -extern void miInitSpanGroup( -#if NeedFunctionPrototypes - SpanGroup * /*spanGroup*/ -#endif -); +extern void miInitSpanGroup(SpanGroup *spanGroup); /* Add a Spans to a SpanGroup. The spans MUST BE in y-sorted order */ -extern void miAppendSpans( -#if NeedFunctionPrototypes - SpanGroup * /*spanGroup*/, - SpanGroup * /*otherGroup*/, - Spans * /*spans*/ -#endif -); +extern void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup, + Spans *spans); /* Paint a span group, possibly with some overlap */ -extern void miFillSpanGroup( -#if NeedFunctionPrototypes - GdkDrawable* /*pDraw*/, - GdkGC* /*pGC*/, - SpanGroup * /*spanGroup*/ -#endif -); +extern void miFillSpanGroup(GdkDrawable* pDraw, GdkGC* pGC, + SpanGroup *spanGroup); /* Paint a span group, insuring that each pixel is painted at most once */ -extern void miFillUniqueSpanGroup( -#if NeedFunctionPrototypes - GdkDrawable* /*pDraw*/, - GdkGC* /*pGC*/, - SpanGroup * /*spanGroup*/ -#endif -); +extern void miFillUniqueSpanGroup(GdkDrawable* pDraw, GdkGC* pGC, + SpanGroup *spanGroup); /* Free up data in a span group. MUST BE DONE or you'll suffer memory leaks */ -extern void miFreeSpanGroup( -#if NeedFunctionPrototypes - SpanGroup * /*spanGroup*/ -#endif -); +extern void miFreeSpanGroup(SpanGroup *spanGroup); -extern void miSubtractSpans( -#if NeedFunctionPrototypes - SpanGroup * /*spanGroup*/, - Spans * /*sub*/ -#endif -); +extern void miSubtractSpans(SpanGroup *spanGroup, Spans *sub); -extern void miDisposeSpanGroup( -#if NeedFunctionPrototypes - SpanGroup * /*spanGroup*/ -#endif -); +extern void miDisposeSpanGroup(SpanGroup *spanGroup); -extern int miClipSpans( -#if NeedFunctionPrototypes - GdkRegion* /*prgnDst*/, - GdkPoint* /*ppt*/, - int * /*pwidth*/, - int /*nspans*/, - GdkPoint* /*pptNew*/, - int * /*pwidthNew*/, - int /*fSorted*/ -#endif -); +extern int miClipSpans(GdkRegion* prgnDst, GdkPoint* ppt, + int *pwidth, int nspans, GdkPoint* pptNew, + int *pwidthNew, int fSorted); /* Rops which must use span groups */ #define miSpansCarefulRop(rop) (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2) diff --git a/gdk/linux-fb/miwideline.c b/gdk/linux-fb/miwideline.c index bc653554f8..508dfa3b54 100644 --- a/gdk/linux-fb/miwideline.c +++ b/gdk/linux-fb/miwideline.c @@ -57,16 +57,10 @@ miLineArc (GdkDrawable *pDraw, GdkGC *pGC, GdkColor *pixel, SpanDataPtr spanData */ void -miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height, - left, right, left_count, right_count) - GdkDrawable* pDrawable; - GdkGC* pGC; - GdkColor *pixel; - SpanDataPtr spanData; - int y; /* start y coordinate */ - int overall_height; /* height of entire segment */ - PolyEdgePtr left, right; - int left_count, right_count; +miFillPolyHelper (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel, + SpanDataPtr spanData, int y, int overall_height, + PolyEdgePtr left, PolyEdgePtr right, int left_count, + int right_count) { register int left_x = 0, left_e = 0; int left_stepx = 0; @@ -157,12 +151,8 @@ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height, } static void -miFillRectPolyHelper (pDrawable, pGC, pixel, spanData, x, y, w, h) - GdkDrawable* pDrawable; - GdkGC* pGC; - GdkColor* pixel; - SpanDataPtr spanData; - int x, y, w, h; +miFillRectPolyHelper (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel, + SpanDataPtr spanData, int x, int y, int w, int h) { register GdkSpan* ppt; GdkColor oldPixel; @@ -202,13 +192,9 @@ miFillRectPolyHelper (pDrawable, pGC, pixel, spanData, x, y, w, h) } /* static */ int -miPolyBuildEdge (x0, y0, k, dx, dy, xi, yi, left, edge) - double x0, y0; - double k; /* x0 * dy - y0 * dx */ - register int dx, dy; - int xi, yi; - int left; - register PolyEdgePtr edge; +miPolyBuildEdge (double x0, double y0, double k, register int dx, + register int dy, int xi, int yi, int left, + register PolyEdgePtr edge) { int x, y, e; int xady; @@ -261,14 +247,9 @@ miPolyBuildEdge (x0, y0, k, dx, dy, xi, yi, left, edge) #define StepAround(v, incr, max) (((v) + (incr) < 0) ? (max - 1) : ((v) + (incr) == max) ? 0 : ((v) + (incr))) /* static */ int -miPolyBuildPoly (vertices, slopes, count, xi, yi, left, right, pnleft, pnright, h) - register PolyVertexPtr vertices; - register PolySlopePtr slopes; - int count; - int xi, yi; - PolyEdgePtr left, right; - int *pnleft, *pnright; - int *h; +miPolyBuildPoly (register PolyVertexPtr vertices, register PolySlopePtr slopes, + int count, int xi, int yi, PolyEdgePtr left, PolyEdgePtr right, + int *pnleft, int *pnright, int *h) { int top, bottom; double miny, maxy; @@ -371,12 +352,8 @@ miPolyBuildPoly (vertices, slopes, count, xi, yi, left, right, pnleft, pnright, } static void -miLineOnePoint (pDrawable, pGC, pixel, spanData, x, y) - GdkDrawable* pDrawable; - GdkGC* pGC; - GdkColor* pixel; - SpanDataPtr spanData; - int x, y; +miLineOnePoint (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel, + SpanDataPtr spanData, int x, int y) { GdkColor oldPixel; GdkSpan span; @@ -391,7 +368,8 @@ miLineOnePoint (pDrawable, pGC, pixel, spanData, x, y) } static void -miLineJoin (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel, SpanDataPtr spanData, LineFacePtr pLeft, LineFacePtr pRight) +miLineJoin (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel, + SpanDataPtr spanData, LineFacePtr pLeft, LineFacePtr pRight) { double mx, my; double denom = 0.0; @@ -533,11 +511,7 @@ miLineJoin (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel, SpanDataPtr spa } static int -miLineArcI (pDraw, pGC, xorg, yorg, points) - GdkDrawable* pDraw; - GdkGC* pGC; - int xorg, yorg; - GdkSpan* points; +miLineArcI (GdkDrawable *pDraw, GdkGC *pGC, int xorg, int yorg, GdkSpan *points) { register GdkSpan* tpts, *bpts; register int x, y, e, ex, slw; @@ -610,15 +584,9 @@ miLineArcI (pDraw, pGC, xorg, yorg, points) } static int -miLineArcD (pDraw, pGC, xorg, yorg, points, - edge1, edgey1, edgeleft1, edge2, edgey2, edgeleft2) - GdkDrawable* pDraw; - GdkGC* pGC; - double xorg, yorg; - GdkSpan* points; - PolyEdgePtr edge1, edge2; - int edgey1, edgey2; - gboolean edgeleft1, edgeleft2; +miLineArcD (GdkDrawable *pDraw, GdkGC *pGC, double xorg, double yorg, GdkSpan *points, + PolyEdgePtr edge1, int edgey1, gboolean edgeleft1, + PolyEdgePtr edge2, int edgey2, gboolean edgeleft2) { register GdkSpan* pts; double radius, x0, y0, el, er, yk, xlk, xrk, k; @@ -766,10 +734,8 @@ miLineArcD (pDraw, pGC, xorg, yorg, points, } int -miRoundJoinFace (face, edge, leftEdge) - register LineFacePtr face; - register PolyEdgePtr edge; - gboolean *leftEdge; +miRoundJoinFace (register LineFacePtr face, register PolyEdgePtr edge, + gboolean *leftEdge) { int y; int dx, dy; @@ -815,11 +781,9 @@ miRoundJoinFace (face, edge, leftEdge) } void -miRoundJoinClip (pLeft, pRight, edge1, edge2, y1, y2, left1, left2) - register LineFacePtr pLeft, pRight; - PolyEdgePtr edge1, edge2; - int *y1, *y2; - gboolean *left1, *left2; +miRoundJoinClip (register LineFacePtr pLeft, register LineFacePtr pRight, + PolyEdgePtr edge1, PolyEdgePtr edge2, int *y1, int *y2, + gboolean *left1, gboolean *left2) { double denom; @@ -840,11 +804,8 @@ miRoundJoinClip (pLeft, pRight, edge1, edge2, y1, y2, left1, left2) } int -miRoundCapClip (face, isInt, edge, leftEdge) - register LineFacePtr face; - gboolean isInt; - register PolyEdgePtr edge; - gboolean *leftEdge; +miRoundCapClip (register LineFacePtr face, gboolean isInt, + register PolyEdgePtr edge, gboolean *leftEdge) { int y; register int dx, dy; @@ -890,14 +851,10 @@ miRoundCapClip (face, isInt, edge, leftEdge) } static void -miLineArc (pDraw, pGC, pixel, spanData, leftFace, rightFace, xorg, yorg, isInt) - GdkDrawable* pDraw; - register GdkGC* pGC; - GdkColor* pixel; - SpanDataPtr spanData; - register LineFacePtr leftFace, rightFace; - double xorg, yorg; - gboolean isInt; +miLineArc (GdkDrawable *pDraw, GdkGC *pGC, GdkColor *pixel, + SpanDataPtr spanData, register LineFacePtr leftFace, + register LineFacePtr rightFace, double xorg, double yorg, + gboolean isInt) { GdkSpan* points; int xorgi = 0, yorgi = 0; @@ -987,15 +944,9 @@ miLineArc (pDraw, pGC, pixel, spanData, leftFace, rightFace, xorg, yorg, isInt) } void -miLineProjectingCap (pDrawable, pGC, pixel, spanData, face, isLeft, xorg, yorg, isInt) - GdkDrawable* pDrawable; - register GdkGC* pGC; - GdkColor *pixel; - SpanDataPtr spanData; - register LineFacePtr face; - gboolean isLeft; - double xorg, yorg; - gboolean isInt; +miLineProjectingCap (GdkDrawable *pDrawable, register GdkGC *pGC, GdkColor *pixel, + SpanDataPtr spanData, register LineFacePtr face, + gboolean isLeft, double xorg, double yorg, gboolean isInt) { int xorgi = 0, yorgi = 0; int lw; @@ -1366,10 +1317,7 @@ miWideSegment (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel, SpanDataPtr } SpanDataPtr -miSetupSpanData (pGC, spanData, npt) - register GdkGC* pGC; - SpanDataPtr spanData; - int npt; +miSetupSpanData (register GdkGC *pGC, SpanDataPtr spanData, int npt) { if ((npt < 3 && GDK_GC_FBDATA(pGC)->values.cap_style != GDK_CAP_ROUND) || miSpansEasyRop(GDK_GC_FBDATA(pGC)->alu)) return (SpanDataPtr) NULL; @@ -1380,10 +1328,7 @@ miSetupSpanData (pGC, spanData, npt) } void -miCleanupSpanData (pDrawable, pGC, spanData) - GdkDrawable* pDrawable; - GdkGC* pGC; - SpanDataPtr spanData; +miCleanupSpanData (GdkDrawable *pDrawable, GdkGC *pGC, SpanDataPtr spanData) { if (GDK_GC_FBDATA(pGC)->values.line_style == GDK_LINE_DOUBLE_DASH) { @@ -1403,12 +1348,8 @@ miCleanupSpanData (pDrawable, pGC, spanData) } void -miWideLine (pDrawable, pGC, mode, npt, pPts) - GdkDrawable* pDrawable; - register GdkGC* pGC; - int mode; - register int npt; - register GdkPoint* pPts; +miWideLine (GdkDrawable *pDrawable, GdkGC *pGC, int mode, + register int npt, register GdkPoint *pPts) { int x1, y1, x2, y2; SpanDataRec spanDataRec; @@ -1544,15 +1485,11 @@ miWideLine (pDrawable, pGC, mode, npt, pPts) #define V_LEFT 3 static void -miWideDashSegment (pDrawable, pGC, spanData, pDashOffset, pDashIndex, - x1, y1, x2, y2, projectLeft, projectRight, leftFace, rightFace) - GdkDrawable* pDrawable; - register GdkGC* pGC; - int *pDashOffset, *pDashIndex; - SpanDataPtr spanData; - int x1, y1, x2, y2; - gboolean projectLeft, projectRight; - LineFacePtr leftFace, rightFace; +miWideDashSegment (GdkDrawable *pDrawable, register GdkGC *pGC, + SpanDataPtr spanData, int *pDashOffset, int *pDashIndex, + int x1, int y1, int x2, int y2, gboolean projectLeft, + gboolean projectRight, LineFacePtr leftFace, + LineFacePtr rightFace) { int dashIndex, dashRemain; unsigned char *pDash; @@ -1898,12 +1835,8 @@ miWideDashSegment (pDrawable, pGC, spanData, pDashOffset, pDashIndex, } void -miWideDash (pDrawable, pGC, mode, npt, pPts) - GdkDrawable* pDrawable; - register GdkGC* pGC; - int mode; - register int npt; - register GdkPoint* pPts; +miWideDash (GdkDrawable *pDrawable, register GdkGC *pGC, int mode, + register int npt, register GdkPoint *pPts) { int x1, y1, x2, y2; GdkColor pixel; @@ -2085,11 +2018,11 @@ miWideDash (pDrawable, pGC, mode, npt, pPts) /* these are stubs to allow old ddx miValidateGCs to work without change */ void -miMiter() +miMiter(void) { } void -miNotMiter() +miNotMiter(void) { } diff --git a/gdk/linux-fb/miwideline.h b/gdk/linux-fb/miwideline.h index a39b6c13bf..b4e60bc3c0 100644 --- a/gdk/linux-fb/miwideline.h +++ b/gdk/linux-fb/miwideline.h @@ -157,8 +157,7 @@ typedef struct _LineFace { #else #ifdef __GNUC__ #define ICEIL ICIEL -static __inline int ICEIL(x) - double x; +static __inline int ICEIL(double x) { int _cTmp = x; return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp+1; @@ -170,79 +169,31 @@ static __inline int ICEIL(x) #endif #endif -extern void miFillPolyHelper( -#if NeedFunctionPrototypes - GdkDrawable* /*pDrawable*/, - GdkGC* /*pGC*/, - GdkColor * /*pixel*/, - SpanDataPtr /*spanData*/, - int /*y*/, - int /*overall_height*/, - PolyEdgePtr /*left*/, - PolyEdgePtr /*right*/, - int /*left_count*/, - int /*right_count*/ -#endif -); -extern int miRoundJoinFace( -#if NeedFunctionPrototypes - LineFacePtr /*face*/, - PolyEdgePtr /*edge*/, - gboolean * /*leftEdge*/ -#endif -); +extern void miFillPolyHelper(GdkDrawable* pDrawable, GdkGC* pGC, + GdkColor * pixel, SpanDataPtr spanData, int y, + int overall_height, PolyEdgePtr left, + PolyEdgePtr right, int left_count, + int right_count); -extern void miRoundJoinClip( -#if NeedFunctionPrototypes - LineFacePtr /*pLeft*/, - LineFacePtr /*pRight*/, - PolyEdgePtr /*edge1*/, - PolyEdgePtr /*edge2*/, - int * /*y1*/, - int * /*y2*/, - gboolean * /*left1*/, - gboolean * /*left2*/ -#endif -); +extern int miRoundJoinFace(LineFacePtr face, PolyEdgePtr edge, + gboolean * leftEdge); -extern int miRoundCapClip( -#if NeedFunctionPrototypes - LineFacePtr /*face*/, - gboolean /*isInt*/, - PolyEdgePtr /*edge*/, - gboolean * /*leftEdge*/ -#endif -); +extern void miRoundJoinClip(LineFacePtr pLeft, LineFacePtr pRight, + PolyEdgePtr edge1, PolyEdgePtr edge2, int *y1, + int *y2, gboolean *left1, gboolean *left2); -extern void miLineProjectingCap( -#if NeedFunctionPrototypes - GdkDrawable* /*pDrawable*/, - GdkGC* /*pGC*/, - GdkColor * /*pixel*/, - SpanDataPtr /*spanData*/, - LineFacePtr /*face*/, - gboolean /*isLeft*/, - double /*xorg*/, - double /*yorg*/, - gboolean /*isInt*/ -#endif -); +extern int miRoundCapClip(LineFacePtr face, gboolean isInt, PolyEdgePtr edge, + gboolean *leftEdge); -extern SpanDataPtr miSetupSpanData( -#if NeedFunctionPrototypes - GdkGC* /*pGC*/, - SpanDataPtr /*spanData*/, - int /*npt*/ -#endif -); +extern void miLineProjectingCap(GdkDrawable* pDrawable, GdkGC* pGC, + GdkColor *pixel, SpanDataPtr spanData, + LineFacePtr face, gboolean isLeft, + double xorg, double yorg, gboolean isInt); -extern void miCleanupSpanData( -#if NeedFunctionPrototypes - GdkDrawable* /*pDrawable*/, - GdkGC* /*pGC*/, - SpanDataPtr /*spanData*/ -#endif -); +extern SpanDataPtr miSetupSpanData(GdkGC* pGC, SpanDataPtr spanData, int npt); + +extern void miCleanupSpanData(GdkDrawable* pDrawable, GdkGC* pGC, + SpanDataPtr spanData); extern int miPolyBuildEdge(double x0, double y0, double k, int dx, int dy, int xi, int yi, int left, PolyEdgePtr edge); diff --git a/gdk/linux-fb/mizerclip.c b/gdk/linux-fb/mizerclip.c index 52c5817a0d..72b6bc7566 100644 --- a/gdk/linux-fb/mizerclip.c +++ b/gdk/linux-fb/mizerclip.c @@ -393,17 +393,11 @@ the numerator is therefore (2^32 - 1), which does not overflow an unsigned * */ int -miZeroClipLine(xmin, ymin, xmax, ymax, - new_x1, new_y1, new_x2, new_y2, - adx, ady, - pt1_clipped, pt2_clipped, octant, bias, oc1, oc2) - int xmin, ymin, xmax, ymax; - int *new_x1, *new_y1, *new_x2, *new_y2; - int *pt1_clipped, *pt2_clipped; - unsigned int adx, ady; - int octant; - unsigned int bias; - int oc1, oc2; +miZeroClipLine(int xmin, int ymin, int xmax, int ymax, + int *new_x1, int *new_y1, int *new_x2, int *new_y2, + unsigned int adx, unsigned int ady, + int *pt1_clipped, int *pt2_clipped, int octant, + unsigned int bias, int oc1, int oc2) { int swapped = 0; int clipDone = 0; diff --git a/gdk/linux-fb/mizerline.c b/gdk/linux-fb/mizerline.c index 0821bf210d..c9a5ce163f 100644 --- a/gdk/linux-fb/mizerline.c +++ b/gdk/linux-fb/mizerline.c @@ -86,12 +86,8 @@ SOFTWARE. } void -miZeroLine(pDraw, pGC, mode, npt, pptInit) - GdkDrawable* pDraw; - GdkGC* pGC; - int mode; /* Origin or Previous */ - int npt; /* number of points */ - GdkPoint* pptInit; +miZeroLine(GdkDrawable *pDraw, GdkGC *pGC, + int mode, int npt, GdkPoint *pptInit) { int Nspans, current_y = 0; GdkPoint* ppt; @@ -318,12 +314,8 @@ miZeroLine(pDraw, pGC, mode, npt, pptInit) } void -miZeroDashLine(dst, pgc, mode, nptInit, pptInit) -GdkDrawable* dst; -GdkGC* pgc; -int mode; -int nptInit; /* number of points in polyline */ -GdkPoint *pptInit; /* points in the polyline */ +miZeroDashLine(GdkDrawable *dst, GdkGC *pgc, + int mode, int nptInit, GdkPoint *pptInit) { /* XXX kludge until real zero-width dash code is written */ GDK_GC_FBDATA(pgc)->values.line_width = 1;