From: ellson Date: Thu, 23 Oct 2008 01:49:26 +0000 (+0000) Subject: replace "(char*)0" with "NULL" X-Git-Tag: LAST_LIBGRAPH~32^2~3007 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b366ee3d40aaacd4ff598a8fc0f17ea78211a53f;p=graphviz replace "(char*)0" with "NULL" --- diff --git a/lib/circogen/circularinit.c b/lib/circogen/circularinit.c index a2e60457a..783f6bf3c 100644 --- a/lib/circogen/circularinit.c +++ b/lib/circogen/circularinit.c @@ -164,7 +164,7 @@ Agraph_t **circomps(Agraph_t * g, int *cnt) #ifndef WITH_CGRAPH agedge(dg, dt, dh); #else /* WITH_CGRAPH */ - agbindrec(agedge(dg, dt, dh,(char*)0,1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data + agbindrec(agedge(dg, dt, dh, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data #endif /* WITH_CGRAPH */ } } @@ -206,7 +206,7 @@ Agraph_t **circomps(Agraph_t * g, int *cnt) ep = agedge(dg, n, dh); aginsert(sg, ep); #else /* WITH_CGRAPH */ - ep = agedge(dg, n, dh,(char*)0,1); + ep = agedge(dg, n, dh, NULL, 1); agbindrec(ep, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data agsubedge(sg,ep,1); #endif /* WITH_CGRAPH */ diff --git a/lib/common/emit.c b/lib/common/emit.c index c36f40c79..29a166f89 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -1940,8 +1940,8 @@ static void init_gvc(GVC_t * gvc, graph_t * g) G_peripheries = agfindattr(g, "peripheries"); G_penwidth = agfindattr(g, "penwidth"); #else - G_peripheries = agattr(g, AGRAPH,"peripheries",(char*)0); - G_penwidth = agattr(g, AGRAPH,"penwidth",(char*)0); + G_peripheries = agattr(g, AGRAPH,"peripheries", NULL); + G_penwidth = agattr(g, AGRAPH,"penwidth", NULL); #endif /* default font */ diff --git a/lib/common/input.c b/lib/common/input.c index 1d7774158..3ffa478cc 100644 --- a/lib/common/input.c +++ b/lib/common/input.c @@ -549,7 +549,7 @@ static int findCharset (graph_t * g) char* p; #ifdef WITH_CGRAPH - p = late_nnstring(g,agattr(g,AGRAPH,"charset",(char*)0),"utf-8"); + p = late_nnstring(g,agattr(g,AGRAPH,"charset", NULL),"utf-8"); #else p = late_nnstring(g,agfindattr(g,"charset"),"utf-8"); #endif @@ -647,7 +647,7 @@ void graph_init(graph_t * g, boolean use_rankdir) #ifdef WITH_CGRAPH GD_drawing(g)->quantum = - late_double(g, agattr(g, AGRAPH, "quantum",(char*)0), 0.0, 0.0); + late_double(g, agattr(g, AGRAPH, "quantum", NULL), 0.0, 0.0); #else GD_drawing(g)->quantum = late_double(g, agfindattr(g, "quantum"), 0.0, 0.0); @@ -675,7 +675,7 @@ void graph_init(graph_t * g, boolean use_rankdir) SET_RANKDIR (g, (rankdir << 2)); #ifdef WITH_CGRAPH - xf = late_double(g, agattr(g, AGRAPH, "nodesep",(char*)0), + xf = late_double(g, agattr(g, AGRAPH, "nodesep", NULL), DEFAULT_NODESEP, MIN_NODESEP); #else xf = late_double(g, agfindattr(g, "nodesep"), @@ -702,8 +702,8 @@ void graph_init(graph_t * g, boolean use_rankdir) GD_ranksep(g) = POINTS(xf); #ifdef WITH_CGRAPH - GD_showboxes(g) = late_int(g, agattr(g,AGRAPH, "showboxes",(char*)0), 0, 0); - p = late_string(g, agattr(g, AGRAPH,"fontnames",(char*)0), NULL); + GD_showboxes(g) = late_int(g, agattr(g,AGRAPH, "showboxes", NULL), 0, 0); + p = late_string(g, agattr(g, AGRAPH,"fontnames", NULL), NULL); #else GD_showboxes(g) = late_int(g, agfindattr(g, "showboxes"), 0, 0); p = late_string(g, agfindattr(g, "fontnames"), NULL); @@ -741,32 +741,32 @@ void graph_init(graph_t * g, boolean use_rankdir) /* initialize nodes */ #ifdef WITH_CGRAPH - N_height = agattr(g, AGNODE,"height",(char*)0); - N_width = agattr(g, AGNODE, "width",(char*)0); - N_shape = agattr(g, AGNODE, "shape",(char*)0); - N_color = agattr(g, AGNODE, "color",(char*)0); - N_fillcolor = agattr(g, AGNODE, "fillcolor",(char*)0); - N_style = agattr(g, AGNODE, "style",(char*)0); - N_fontsize = agattr(g, AGNODE, "fontsize",(char*)0); - N_fontname = agattr(g, AGNODE, "fontname",(char*)0); - N_fontcolor = agattr(g, AGNODE, "fontcolor",(char*)0); - N_label = agattr(g, AGNODE, "label",(char*)0); - N_showboxes = agattr(g, AGNODE, "showboxes",(char*)0); - N_penwidth = agattr(g, AGNODE, "penwidth",(char*)0); + N_height = agattr(g, AGNODE,"height", NULL); + N_width = agattr(g, AGNODE, "width", NULL); + N_shape = agattr(g, AGNODE, "shape", NULL); + N_color = agattr(g, AGNODE, "color", NULL); + N_fillcolor = agattr(g, AGNODE, "fillcolor", NULL); + N_style = agattr(g, AGNODE, "style", NULL); + N_fontsize = agattr(g, AGNODE, "fontsize", NULL); + N_fontname = agattr(g, AGNODE, "fontname", NULL); + N_fontcolor = agattr(g, AGNODE, "fontcolor", NULL); + N_label = agattr(g, AGNODE, "label", NULL); + N_showboxes = agattr(g, AGNODE, "showboxes", NULL); + N_penwidth = agattr(g, AGNODE, "penwidth", NULL); /* attribs for polygon shapes */ - N_sides = agattr(g, AGNODE, "sides",(char*)0); - N_peripheries = agattr(g, AGNODE, "peripheries",(char*)0); - N_skew = agattr(g, AGNODE, "skew",(char*)0); - N_orientation = agattr(g, AGNODE, "orientation",(char*)0); - N_distortion = agattr(g, AGNODE, "distortion",(char*)0); - N_fixed = agattr(g, AGNODE, "fixedsize",(char*)0); - N_imagescale = agattr(g, AGNODE, "imagescale",(char*)0); - N_nojustify = agattr(g, AGNODE, "nojustify",(char*)0); - N_layer = agattr(g, AGNODE, "layer",(char*)0); - N_group = agattr(g, AGNODE, "group",(char*)0); - N_comment = agattr(g, AGNODE, "comment",(char*)0); - N_vertices = agattr(g, AGNODE, "vertices",(char*)0); - N_z = agattr(g, AGNODE, "z",(char*)0); + N_sides = agattr(g, AGNODE, "sides", NULL); + N_peripheries = agattr(g, AGNODE, "peripheries", NULL); + N_skew = agattr(g, AGNODE, "skew", NULL); + N_orientation = agattr(g, AGNODE, "orientation", NULL); + N_distortion = agattr(g, AGNODE, "distortion", NULL); + N_fixed = agattr(g, AGNODE, "fixedsize", NULL); + N_imagescale = agattr(g, AGNODE, "imagescale", NULL); + N_nojustify = agattr(g, AGNODE, "nojustify", NULL); + N_layer = agattr(g, AGNODE, "layer", NULL); + N_group = agattr(g, AGNODE, "group", NULL); + N_comment = agattr(g, AGNODE, "comment", NULL); + N_vertices = agattr(g, AGNODE, "vertices", NULL); + N_z = agattr(g, AGNODE, "z", NULL); #else N_height = agfindattr(g->proto->n, "height"); N_width = agfindattr(g->proto->n, "width"); @@ -798,36 +798,36 @@ void graph_init(graph_t * g, boolean use_rankdir) /* initialize edges */ #ifdef WITH_CGRAPH - E_weight = agattr(g, AGEDGE, "weight",(char*)0); - E_color = agattr(g, AGEDGE, "color",(char*)0); - E_fontsize = agattr(g, AGEDGE, "fontsize",(char*)0); - E_fontname = agattr(g, AGEDGE, "fontname",(char*)0); - E_fontcolor = agattr(g, AGEDGE, "fontcolor",(char*)0); - E_label = agattr(g, AGEDGE, "label",(char*)0); - E_label_float = agattr(g, AGEDGE, "labelfloat",(char*)0); + E_weight = agattr(g, AGEDGE, "weight", NULL); + E_color = agattr(g, AGEDGE, "color", NULL); + E_fontsize = agattr(g, AGEDGE, "fontsize", NULL); + E_fontname = agattr(g, AGEDGE, "fontname", NULL); + E_fontcolor = agattr(g, AGEDGE, "fontcolor", NULL); + E_label = agattr(g, AGEDGE, "label", NULL); + E_label_float = agattr(g, AGEDGE, "labelfloat", NULL); /* vladimir */ - E_dir = agattr(g, AGEDGE, "dir",(char*)0); - E_arrowhead = agattr(g, AGEDGE, "arrowhead",(char*)0); - E_arrowtail = agattr(g, AGEDGE, "arrowtail",(char*)0); - E_headlabel = agattr(g, AGEDGE, "headlabel",(char*)0); - E_taillabel = agattr(g, AGEDGE, "taillabel",(char*)0); - E_labelfontsize = agattr(g, AGEDGE, "labelfontsize",(char*)0); - E_labelfontname = agattr(g, AGEDGE, "labelfontname",(char*)0); - E_labelfontcolor = agattr(g, AGEDGE, "labelfontcolor",(char*)0); - E_labeldistance = agattr(g, AGEDGE, "labeldistance",(char*)0); - E_labelangle = agattr(g, AGEDGE, "labelangle",(char*)0); + E_dir = agattr(g, AGEDGE, "dir", NULL); + E_arrowhead = agattr(g, AGEDGE, "arrowhead", NULL); + E_arrowtail = agattr(g, AGEDGE, "arrowtail", NULL); + E_headlabel = agattr(g, AGEDGE, "headlabel", NULL); + E_taillabel = agattr(g, AGEDGE, "taillabel", NULL); + E_labelfontsize = agattr(g, AGEDGE, "labelfontsize", NULL); + E_labelfontname = agattr(g, AGEDGE, "labelfontname", NULL); + E_labelfontcolor = agattr(g, AGEDGE, "labelfontcolor", NULL); + E_labeldistance = agattr(g, AGEDGE, "labeldistance", NULL); + E_labelangle = agattr(g, AGEDGE, "labelangle", NULL); /* end vladimir */ - E_minlen = agattr(g, AGEDGE, "minlen",(char*)0); - E_showboxes = agattr(g, AGEDGE, "showboxes",(char*)0); - E_style = agattr(g, AGEDGE, "style",(char*)0); - E_decorate = agattr(g, AGEDGE, "decorate",(char*)0); - E_arrowsz = agattr(g, AGEDGE, "arrowsize",(char*)0); - E_constr = agattr(g, AGEDGE, "constraint",(char*)0); - E_layer = agattr(g, AGEDGE, "layer",(char*)0); - E_comment = agattr(g, AGEDGE, "comment",(char*)0); - E_tailclip = agattr(g, AGEDGE, "tailclip",(char*)0); - E_headclip = agattr(g, AGEDGE, "headclip",(char*)0); - E_penwidth = agattr(g, AGEDGE, "penwidth",(char*)0); + E_minlen = agattr(g, AGEDGE, "minlen", NULL); + E_showboxes = agattr(g, AGEDGE, "showboxes", NULL); + E_style = agattr(g, AGEDGE, "style", NULL); + E_decorate = agattr(g, AGEDGE, "decorate", NULL); + E_arrowsz = agattr(g, AGEDGE, "arrowsize", NULL); + E_constr = agattr(g, AGEDGE, "constraint", NULL); + E_layer = agattr(g, AGEDGE, "layer", NULL); + E_comment = agattr(g, AGEDGE, "comment", NULL); + E_tailclip = agattr(g, AGEDGE, "tailclip", NULL); + E_headclip = agattr(g, AGEDGE, "headclip", NULL); + E_penwidth = agattr(g, AGEDGE, "penwidth", NULL); #else E_weight = agfindattr(g->proto->e, "weight"); E_color = agfindattr(g->proto->e, "color"); @@ -921,11 +921,11 @@ void do_graph_label(graph_t * sg) #ifdef WITH_CGRAPH GD_label(sg) = make_label(agroot(sg), str, (aghtmlstr(str) ? LT_HTML : LT_NONE), - late_double(sg, agattr(sg,AGRAPH,"fontsize",(char*)0), + late_double(sg, agattr(sg,AGRAPH,"fontsize", NULL), DEFAULT_FONTSIZE, MIN_FONTSIZE), - late_nnstring(sg, agattr(sg,AGRAPH, "fontname",(char*)0), + late_nnstring(sg, agattr(sg,AGRAPH, "fontname", NULL), DEFAULT_FONTNAME), - late_nnstring(sg, agattr(sg,AGRAPH, "fontcolor",(char*)0), + late_nnstring(sg, agattr(sg,AGRAPH, "fontcolor", NULL), DEFAULT_COLOR)); #else GD_label(sg) = make_label((void*)sg, str, (aghtmlstr(str) ? LT_HTML : LT_NONE), diff --git a/lib/common/utils.c b/lib/common/utils.c index 7e69b63b0..79ecf7c87 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -1326,7 +1326,7 @@ safe_dcl(graph_t * g, int obj_kind, char *name, char *def) if (a == NULL) a = fun(g, name, def); #else /* WITH_CGRAPH */ - attrsym_t *a = agattr(g,obj_kind,name,(char*)0); + attrsym_t *a = agattr(g,obj_kind,name, NULL); if (!a) /*attribute exists*/ a=agattr(g,obj_kind,name,def); #endif /* WITH_CGRAPH */ diff --git a/lib/dotgen/dotsplines.c b/lib/dotgen/dotsplines.c index 646009860..767167004 100644 --- a/lib/dotgen/dotsplines.c +++ b/lib/dotgen/dotsplines.c @@ -666,9 +666,9 @@ cloneGraph (graph_t* g) E_sametail = agfindattr(auxg->proto->e, "sametail"); E_weight = agfindattr(auxg->proto->e, "weight"); #else /* WITH_CGRAPH */ - E_samehead = agattr(auxg,AGEDGE, "samehead",(char*)0); - E_sametail = agattr(auxg,AGEDGE, "sametail",(char*)0); - E_weight = agattr(auxg,AGEDGE, "weight",(char*)0); + E_samehead = agattr(auxg,AGEDGE, "samehead", NULL); + E_sametail = agattr(auxg,AGEDGE, "sametail", NULL); + E_weight = agattr(auxg,AGEDGE, "weight", NULL); #endif /* WITH_CGRAPH */ if (!E_weight) #ifndef WITH_CGRAPH diff --git a/lib/fdpgen/fdpinit.c b/lib/fdpgen/fdpinit.c index dbd51b525..adf0331f8 100644 --- a/lib/fdpgen/fdpinit.c +++ b/lib/fdpgen/fdpinit.c @@ -41,14 +41,14 @@ static void initialPositions(graph_t * g) #ifndef WITH_CGRAPH possym = agfindattr(g->proto->n, "pos"); #else /* WITH_CGRAPH */ - possym = agattr(g,AGNODE, "pos",(char*)0); + possym = agattr(g,AGNODE, "pos", NULL); #endif /* WITH_CGRAPH */ if (!possym) return; #ifndef WITH_CGRAPH pinsym = agfindattr(g->proto->n, "pin"); #else /* WITH_CGRAPH */ - pinsym = agattr(g,AGNODE, "pin",(char*)0); + pinsym = agattr(g,AGNODE, "pin", NULL); #endif /* WITH_CGRAPH */ for (i = 0; (np = GD_neato_nlist(g)[i]); i++) { #ifndef WITH_CGRAPH @@ -122,7 +122,7 @@ void fdp_init_node_edge(graph_t * g) #ifndef WITH_CGRAPH E_len = agfindattr(g->proto->e, "len"); #else /* WITH_CGRAPH */ - E_len = agattr(g,AGEDGE, "len",(char*)0); + E_len = agattr(g,AGEDGE, "len", NULL); #endif /* WITH_CGRAPH */ for (n = agfstnode(g); n; n = agnxtnode(g, n)) { for (e = agfstout(g, n); e; e = agnxtout(g, e)) { diff --git a/lib/fdpgen/layout.c b/lib/fdpgen/layout.c index 77de9884d..554799329 100644 --- a/lib/fdpgen/layout.c +++ b/lib/fdpgen/layout.c @@ -427,9 +427,9 @@ copyAttr (graph_t* g, graph_t* dg, char* attr) ov_val = agxget(g,ov->index); ov = agfindattr(dg, attr); #else /* WITH_CGRAPH */ - if ((ov = agattr(g,AGRAPH, attr,(char*)0))) { + if ((ov = agattr(g,AGRAPH, attr, NULL))) { ov_val = agxget(g,ov); - ov = agattr(dg,AGRAPH, attr,(char*)0); + ov = agattr(dg,AGRAPH, attr, NULL); #endif /* WITH_CGRAPH */ if (ov) #ifndef WITH_CGRAPH @@ -565,13 +565,13 @@ static graph_t *deriveGraph(graph_t * g, layout_info * infop) #ifndef WITH_CGRAPH de = agedge(dg, tl, hd); #else /* WITH_CGRAPH */ - de = agedge(dg, tl, hd,(char*)0,1); + de = agedge(dg, tl, hd, NULL,1); #endif /* WITH_CGRAPH */ else #ifndef WITH_CGRAPH de = agedge(dg, hd, tl); #else /* WITH_CGRAPH */ - de = agedge(dg, hd, tl,(char*)0,1); + de = agedge(dg, hd, tl, NULL,1); agbindrec(de, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data #endif /* WITH_CGRAPH */ ED_dist(de) = ED_dist(e); @@ -607,13 +607,13 @@ static graph_t *deriveGraph(graph_t * g, layout_info * infop) #ifndef WITH_CGRAPH de = agedge(dg, m, dn); #else /* WITH_CGRAPH */ - de = agedge(dg, m, dn,(char*)0,1); + de = agedge(dg, m, dn, NULL,1); #endif /* WITH_CGRAPH */ else #ifndef WITH_CGRAPH de = agedge(dg, dn, m); #else /* WITH_CGRAPH */ - de = agedge(dg, dn, m,(char*)0,1); + de = agedge(dg, dn, m, NULL,1); #endif /* WITH_CGRAPH */ ED_dist(de) = ED_dist(pp->e); ED_factor(de) = ED_factor(pp->e); @@ -1058,9 +1058,9 @@ void init_info(graph_t * g, layout_info * infop) infop->G_width = agfindattr(g, "width"); infop->G_height = agfindattr(g, "height"); #else /* WITH_CGRAPH */ - infop->G_coord = agattr(g,AGRAPH, "coords",(char*)0); - infop->G_width = agattr(g,AGRAPH, "width",(char*)0); - infop->G_height = agattr(g, AGRAPH,"height",(char*)0); + infop->G_coord = agattr(g,AGRAPH, "coords", NULL); + infop->G_width = agattr(g,AGRAPH, "width", NULL); + infop->G_height = agattr(g, AGRAPH,"height", NULL); #endif /* WITH_CGRAPH */ infop->rootg = g; infop->gid = 0; @@ -1135,7 +1135,7 @@ void fdp_init_graph(Agraph_t * g) g->u.ndim = late_int(g, agfindattr(g, "dim"), 2, 2); Ndim = g->u.ndim = MIN(g->u.ndim, MAXDIM); #else /* WITH_CGRAPH */ - GD_ndim(g) = late_int(g, agattr(g,AGRAPH, "dim",(char*)0), 2, 2); + GD_ndim(g) = late_int(g, agattr(g,AGRAPH, "dim", NULL), 2, 2); Ndim = GD_ndim(g) = MIN(GD_ndim(g), MAXDIM); #endif /* WITH_CGRAPH */ diff --git a/lib/fdpgen/tlayout.c b/lib/fdpgen/tlayout.c index 24d1f90ed..4169989f2 100644 --- a/lib/fdpgen/tlayout.c +++ b/lib/fdpgen/tlayout.c @@ -197,14 +197,14 @@ void fdp_initParams(graph_t * g) T_maxIters = late_int(g, agfindattr(g, "maxiter"), DFLT_maxIters, 0); D_K = T_K = late_double(g, agfindattr(g, "K"), DFLT_K, 0.0); #else /* WITH_CGRAPH */ - T_maxIters = late_int(g, agattr(g,AGRAPH, "maxiter",(char*)0), DFLT_maxIters, 0); - D_K = T_K = late_double(g, agattr(g,AGRAPH, "K",(char*)0), DFLT_K, 0.0); + T_maxIters = late_int(g, agattr(g,AGRAPH, "maxiter", NULL), DFLT_maxIters, 0); + D_K = T_K = late_double(g, agattr(g,AGRAPH, "K", NULL), DFLT_K, 0.0); #endif /* WITH_CGRAPH */ if (D_T0 == -1.0) { #ifndef WITH_CGRAPH T_T0 = late_double(g, agfindattr(g, "T0"), -1.0, 0.0); #else /* WITH_CGRAPH */ - T_T0 = late_double(g, agattr(g,AGRAPH, "T0",(char*)0), -1.0, 0.0); + T_T0 = late_double(g, agattr(g,AGRAPH, "T0", NULL), -1.0, 0.0); #endif /* WITH_CGRAPH */ } else T_T0 = D_T0;