From: Emden Gansner Date: Thu, 12 Jan 2012 20:52:51 +0000 (-0500) Subject: Fix label library to use agerr. X-Git-Tag: LAST_LIBGRAPH~32^2~557^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af5daa526ee1115c10ce2413fec405ce3059aa2a;p=graphviz Fix label library to use agerr. --- diff --git a/lib/label/Makefile.am b/lib/label/Makefile.am index 3195fe75f..6c2f7b59c 100644 --- a/lib/label/Makefile.am +++ b/lib/label/Makefile.am @@ -1,12 +1,16 @@ # $Id$ $Revision$ ## Process this file with automake to produce Makefile.in +if WITH_CGRAPH +GRAPH = cgraph +else +GRAPH = graph +endif + AM_CPPFLAGS = \ -I$(top_srcdir) \ - -I$(top_srcdir)/lib/gvc \ - -I$(top_srcdir)/lib/pathplan \ -I$(top_srcdir)/lib/common \ - -I$(top_srcdir)/lib/graph \ + -I$(top_srcdir)/lib/$(GRAPH) \ -I$(top_srcdir)/lib/cdt noinst_HEADERS = xlabels.h index.h node.h rectangle.h split.q.h diff --git a/lib/label/rectangle.c b/lib/label/rectangle.c index 4364c99e6..fba5da540 100644 --- a/lib/label/rectangle.c +++ b/lib/label/rectangle.c @@ -10,6 +10,10 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "index.h" #include #include @@ -17,6 +21,11 @@ #include "logic.h" #include "arith.h" #include "rectangle.h" +#ifdef WITH_CGRAPH +#include +#else +#include +#endif #define Undefined(x) ((x)->boundary[0] > (x)->boundary[NUMDIMS]) @@ -116,7 +125,6 @@ void PrintRect(Rect_t * r) /*----------------------------------------------------------------------------- | Calculate the n-dimensional area of a rectangle -----------------------------------------------------------------------------*/ -void agerror(char *); #if SIZEOF_LONG_LONG > SIZEOF_INT unsigned int RectArea(Rect_t * r) @@ -135,7 +143,7 @@ unsigned int RectArea(Rect_t * r) for (i = 0; i < NUMDIMS; i++) { long long a_test = area * r->boundary[i + NUMDIMS] - r->boundary[i]; if( a_test > UINT_MAX) { - agerror("label: area too large for rtree\n"); + agerr (AGERR, "label: area too large for rtree\n"); return UINT_MAX; } area = a_test; @@ -159,7 +167,7 @@ unsigned int RectArea(Rect_t * r) unsigned int b = r->boundary[i + NUMDIMS] - r->boundary[i]; a *= b; if( (a / b ) != area) { - agerror("label: area too large for rtree\n"); + agerr (AGERR, "label: area too large for rtree\n"); return UINT_MAX; } area = a;