From: Emden Gansner Date: Wed, 21 Oct 2015 19:11:41 +0000 (-0400) Subject: Various small fixes. X-Git-Tag: TRAVIS_CI_BUILD_EXPERIMENTAL~96 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f35d57239a8fcddae148aac5281c546ecd1e69a;p=graphviz Various small fixes. --- diff --git a/lib/gd/gd.c b/lib/gd/gd.c index 30920c094..d227af5f4 100644 --- a/lib/gd/gd.c +++ b/lib/gd/gd.c @@ -3502,7 +3502,7 @@ static void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int co gdImageSetAAPixelColor(im, x1, y1, col, 0xFF); return; } - if (abs(dx) > abs(dy)) { + if (labs(dx) > labs(dy)) { if (dx < 0) { tmp = x1; x1 = x2; diff --git a/lib/label/index.c b/lib/label/index.c index d3b673265..27c8498f5 100644 --- a/lib/label/index.c +++ b/lib/label/index.c @@ -368,7 +368,7 @@ int RTreeDelete(RTree_t * rtp, Rect_t * r, void *data, Node_t ** nn) assert(r && nn); assert(*nn); - assert(data >= 0); + assert(data); rtp->Deleting = TRUE; diff --git a/lib/osage/osageinit.c b/lib/osage/osageinit.c index d1de28016..a8e1fdbba 100644 --- a/lib/osage/osageinit.c +++ b/lib/osage/osageinit.c @@ -129,7 +129,7 @@ layout (Agraph_t* g, int depth) cattr = agattr(root, AGRAPH, "sortv", 0); vattr = agattr(root, AGNODE, "sortv", 0); if (cattr || vattr) - pinfo.vals = N_NEW(total, unsigned int); + pinfo.vals = N_NEW(total, packval_t); else agerr (AGWARN, "Graph %s has array packing with user values but no \"sortv\" attributes are defined.", agnameof(g)); diff --git a/lib/pack/pack.c b/lib/pack/pack.c index 229857b45..ae3d76751 100644 --- a/lib/pack/pack.c +++ b/lib/pack/pack.c @@ -919,7 +919,7 @@ point *putGraphs(int ng, Agraph_t ** gs, Agraph_t * root, int i, v; boxf* bbs; Agraph_t* g; - point* pts = 0; + point* pts = NULL; char* s; if (ng <= 0) return NULL; diff --git a/plugin/core/gvrender_core_pic.c b/plugin/core/gvrender_core_pic.c index 68547831f..1aaac4bae 100644 --- a/plugin/core/gvrender_core_pic.c +++ b/plugin/core/gvrender_core_pic.c @@ -26,6 +26,7 @@ #include "agxbuf.h" #include "utils.h" #include "color.h" +#include "colorprocs.h" #include "const.h" diff --git a/plugin/gd/gvrender_gd.c b/plugin/gd/gvrender_gd.c index a57dfcd4a..0f4a0571d 100644 --- a/plugin/gd/gvrender_gd.c +++ b/plugin/gd/gvrender_gd.c @@ -368,7 +368,9 @@ static void gdgen_textspan(GVJ_t * job, pointf p, textspan_t * span) pointf spf, epf; double spanwidth = span->size.x * job->zoom * job->dpi.x / POINTS_PER_INCH; char* fontname; +#ifdef HAVE_GD_FONTCONFIG PostscriptAlias *pA; +#endif if (!im) return; @@ -415,7 +417,7 @@ static void gdgen_textspan(GVJ_t * job, pointf p, textspan_t * span) span->str); } -static int gdgen_set_penstyle(GVJ_t * job, gdImagePtr im, gdImagePtr brush) +static int gdgen_set_penstyle(GVJ_t * job, gdImagePtr im, gdImagePtr* brush) { obj_state_t *obj = job->obj; int i, pen, width, dashstyle[40]; @@ -445,15 +447,15 @@ static int gdgen_set_penstyle(GVJ_t * job, gdImagePtr im, gdImagePtr brush) /* use brush instead of Thickness to improve end butts */ if (width != PENWIDTH_NORMAL) { if (im->trueColor) { - brush = gdImageCreateTrueColor(width,width); + *brush = gdImageCreateTrueColor(width,width); } else { - brush = gdImageCreate(width, width); - gdImagePaletteCopy(brush, im); + *brush = gdImageCreate(width, width); + gdImagePaletteCopy(*brush, im); } - gdImageFilledRectangle(brush, 0, 0, width - 1, width - 1, + gdImageFilledRectangle(*brush, 0, 0, width - 1, width - 1, obj->pencolor.u.index); - gdImageSetBrush(im, brush); + gdImageSetBrush(im, *brush); if (pen == gdStyled) pen = gdStyledBrushed; else @@ -478,7 +480,7 @@ gdgen_bezier(GVJ_t * job, pointf * A, int n, int arrow_at_start, if (!im) return; - pen = gdgen_set_penstyle(job, im, brush); + pen = gdgen_set_penstyle(job, im, &brush); pen_ok = (pen != gdImageGetTransparent(im)); fill_ok = (filled && obj->fillcolor.u.index != gdImageGetTransparent(im)); @@ -522,7 +524,7 @@ static void gdgen_polygon(GVJ_t * job, pointf * A, int n, int filled) if (!im) return; - pen = gdgen_set_penstyle(job, im, brush); + pen = gdgen_set_penstyle(job, im, &brush); pen_ok = (pen != gdImageGetTransparent(im)); fill_ok = (filled && obj->fillcolor.u.index != gdImageGetTransparent(im)); @@ -557,7 +559,7 @@ static void gdgen_ellipse(GVJ_t * job, pointf * A, int filled) if (!im) return; - pen = gdgen_set_penstyle(job, im, brush); + pen = gdgen_set_penstyle(job, im, &brush); pen_ok = (pen != gdImageGetTransparent(im)); fill_ok = (filled && obj->fillcolor.u.index != gdImageGetTransparent(im)); @@ -587,7 +589,7 @@ static void gdgen_polyline(GVJ_t * job, pointf * A, int n) if (!im) return; - pen = gdgen_set_penstyle(job, im, brush); + pen = gdgen_set_penstyle(job, im, &brush); pen_ok = (pen != gdImageGetTransparent(im)); if (pen_ok) { diff --git a/plugin/gd/gvtextlayout_gd.c b/plugin/gd/gvtextlayout_gd.c index 1ba6df9cc..0c2328ea9 100644 --- a/plugin/gd/gvtextlayout_gd.c +++ b/plugin/gd/gvtextlayout_gd.c @@ -125,7 +125,9 @@ static boolean gd_textlayout(textspan_t * span, char **fontpath) double fontsize; int brect[8]; gdFTStringExtra strex; +#ifdef HAVE_GD_FONTCONFIG PostscriptAlias *pA; +#endif fontname = span->font->name; fontsize = span->font->size;