From: erg Date: Wed, 13 May 2009 21:28:21 +0000 (+0000) Subject: Fix various errors and warnings; remove constant and HUGE, using MAXFLOAT. X-Git-Tag: LAST_LIBGRAPH~32^2~2076 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3125d4f80eb96e0a5b8a2c71bdc223a5ba36c307;p=graphviz Fix various errors and warnings; remove constant and HUGE, using MAXFLOAT. --- diff --git a/cmd/smyrna/smyrnadefs.h b/cmd/smyrna/smyrnadefs.h index 81e88274c..a0c1187aa 100644 --- a/cmd/smyrna/smyrnadefs.h +++ b/cmd/smyrna/smyrnadefs.h @@ -75,7 +75,6 @@ #define SPHERE_SLICE_COUNT 6 #define DOT_SIZE_CORRECTION_FAC 0.3 -#define HUGE_NUMBER 99999999999 typedef enum { nodshapedot,nodeshapecircle} node_shape; typedef enum { leftmousebutton,rightmousebutton,thirdmousebutton} clicked_mouse_button; diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c index 46fbac7eb..f86596ecd 100755 --- a/cmd/smyrna/topview.c +++ b/cmd/smyrna/topview.c @@ -30,6 +30,7 @@ #include "selection.h" #include "topviewdata.h" #include "hier.h" +#include "arith.h" #include "topfisheyeview.h" #ifdef WIN32 #include "regex_win32.h" @@ -108,7 +109,7 @@ static int setpositioninfo(float* x,float* y,float* z,char* buf) /*find out if 2D or 3 d, count commas*/ if (!buf) return 0; - for (ind;ind < (int)strlen(buf); ind=ind +1) + for (;ind < (int)strlen(buf); ind=ind +1) { if( buf[ind]==',') commacount ++; @@ -144,9 +145,9 @@ static void setRGBcolor(RGBColor* c,char* colorstr) void settvposinfo(Agraph_t* g,topview* t) { int ind; - float maxedgelen,len,minedgelen; + float maxedgelen,len,minedgelen; maxedgelen=0; - minedgelen=HUGE_NUMBER; + minedgelen=MAXFLOAT; /*loop nodes*/ for (ind=0;ind < t->Nodecount ; ind ++) { @@ -236,13 +237,12 @@ void preparetopview(Agraph_t * g, topview * t) Agedge_t *e; Agsym_t *sym; int ind, ind2, data_type_count; //number of columns for custom view->Topview data ,IP ,HOST, etc - int maxlabelsize=0; - float maxedgelen,minedgelen,edgelength; + float maxedgelen,minedgelen,edgelength; - maxedgelen=0; - minedgelen=(float)99999999.00000; //FIX ME if you have a giant graph or fix your graph - edgelength=0; + maxedgelen=0; + minedgelen=MAXFLOAT; + edgelength=0; ind = 0; ind2 = 0; diff --git a/cmd/smyrna/viewport.c b/cmd/smyrna/viewport.c index ad09e3244..569d2efc5 100755 --- a/cmd/smyrna/viewport.c +++ b/cmd/smyrna/viewport.c @@ -1046,7 +1046,6 @@ void apply_gvpr(Agraph_t* g,char* prog) #ifdef WIN32 Agraph_t* a=exec_gvpr(prog,g); #endif - return 1; } float interpol(float minv,float maxv,float minc,float maxc,float x) {