]> granicus.if.org Git - graphviz/commitdiff
Various small fixes.
authorEmden Gansner <emdenrg@google.com>
Wed, 21 Oct 2015 19:11:41 +0000 (15:11 -0400)
committerEmden Gansner <emdenrg@google.com>
Wed, 21 Oct 2015 19:11:41 +0000 (15:11 -0400)
lib/gd/gd.c
lib/label/index.c
lib/osage/osageinit.c
lib/pack/pack.c
plugin/core/gvrender_core_pic.c
plugin/gd/gvrender_gd.c
plugin/gd/gvtextlayout_gd.c

index 30920c0949343e3a28f1535da7730f78b1ed2944..d227af5f4c5d07f6b85d79885cd94a717ece3671 100644 (file)
@@ -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;
index d3b673265c9d2b6436879f5bf45fab3245168e89..27c8498f5379bc4e0ace6dee2792e453fa4659d6 100644 (file)
@@ -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;
 
index d1de2801615bc87001ad1f0fb6dcac41fee97987..a8e1fdbba421eb8d6378d23386a60bce8d0f9b81 100644 (file)
@@ -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));
index 229857b459df6897b5811dfc1da36e2bfe8d9e4e..ae3d76751c935fc1b36f0363d3449ecd99422611 100644 (file)
@@ -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;
index 68547831f316f6c5ba5fd8bda16b35ca70e40f13..1aaac4bae7f00055f1b61a71aa0dafd4fc78cfca 100644 (file)
@@ -26,6 +26,7 @@
 #include "agxbuf.h"
 #include "utils.h"
 #include "color.h"
+#include "colorprocs.h"
 
 #include "const.h"
 
index a57dfcd4ab45c630c4275ec840195cd66895474f..0f4a0571d2c5df17b07ff62f6ab0d19587bf52b9 100644 (file)
@@ -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) {
index 1ba6df9ccb41bab1de7ab87ed10eaf0f30b06187..0c2328ea90733e9e86512e2a0e101353d45547df 100644 (file)
@@ -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;