SHA256
1
0
forked from pool/graphviz
graphviz/aliasing-fixes.diff

123 lines
3.9 KiB
Diff

Index: graphviz-2.6/lib/agraph/edge.c
===================================================================
--- graphviz-2.6.orig/lib/agraph/edge.c
+++ graphviz-2.6/lib/agraph/edge.c
@@ -153,25 +153,29 @@ static Agedge_t *agfindedge_by_id(Agnode
void agedgesetop(Agraph_t * g, Agedge_t * e, int ins)
{
- Dtlink_t **seq_set, **id_set;
+ union {
+ Dtlink_t **dtlink;
+ Agedge_t **agedge;
+ } seq_set;
+ Dtlink_t **id_set;
Agnode_t *n; /* node where <e> is referenced */
if (AGTYPE(e) == AGOUTEDGE) {
n = AGOUT2IN(e)->node;
- seq_set = (Dtlink_t **) & (n->out);
+ seq_set.agedge = & (n->out);
id_set = &(n->outid);
} else {
n = AGIN2OUT(e)->node;
- seq_set = (Dtlink_t **) & (n->in);
+ seq_set.agedge = & (n->in);
id_set = &(n->inid);
}
- dtrestore(g->e_seq, *seq_set);
+ dtrestore(g->e_seq, *seq_set.dtlink);
if (ins)
dtinsert(g->e_seq, e);
else
dtdelete(g->e_seq, e);
- *seq_set = dtextract(g->e_seq);
+ *seq_set.dtlink = dtextract(g->e_seq);
dtrestore(g->e_id, *id_set);
if (ins)
Index: graphviz-2.6/lib/agraph/flatten.c
===================================================================
--- graphviz-2.6.orig/lib/agraph/flatten.c
+++ graphviz-2.6/lib/agraph/flatten.c
@@ -30,8 +30,14 @@ void agflatten_elist(Dict_t * d, Dtlink_
void agflatten_edges(Agraph_t * g, Agnode_t * n)
{
- agflatten_elist(g->e_seq, (Dtlink_t **) & (n->out));
- agflatten_elist(g->e_seq, (Dtlink_t **) & (n->in));
+ union {
+ Dtlink_t **dtlink;
+ Agedge_t **agedge;
+ } out, in;
+ out.agedge = & (n->out);
+ in.agedge = & (n->in);
+ agflatten_elist(g->e_seq, out.dtlink);
+ agflatten_elist(g->e_seq, in.dtlink);
}
void agflatten(Agraph_t * g, int flag)
Index: graphviz-2.6/lib/gd/fontwheeltest.c
===================================================================
--- graphviz-2.6.orig/lib/gd/fontwheeltest.c
+++ graphviz-2.6/lib/gd/fontwheeltest.c
@@ -21,7 +21,10 @@ void
dowheel (gdImagePtr im, int color, char *fontfile, int fontsize,
double angle, int x, int y, int offset, char *string)
{
- int brect[8];
+ union {
+ int coords[8];
+ gdPoint points[4];
+ } brect;
FILE *err;
double curangrads, curang, x0, y0;
char *cp;
@@ -40,16 +43,16 @@ dowheel (gdImagePtr im, int color, char
/* The case of newlines is taken care of in the gdImageStringTTF call */
#if defined(OLDER_GD)
- cp = gdImageStringTTF (im, brect, color, fontfile, fontsize,
+ cp = gdImageStringTTF (im, brect.coords, color, fontfile, fontsize,
curangrads, x0, y0, string);
#else
- cp = gdImageStringFT (im, brect, color, fontfile, fontsize,
+ cp = gdImageStringFT (im, brect.coords, color, fontfile, fontsize,
curangrads, x0, y0, string);
#endif
if (cp)
doerr (err, cp);
- gdImagePolygon (im, (gdPointPtr)brect, 4, color);
+ gdImagePolygon (im, brect.points, 4, color);
}
fclose (err);
Index: graphviz-2.6/tclpkg/tcldot/tcldot.c
===================================================================
--- graphviz-2.6.orig/tclpkg/tcldot/tcldot.c
+++ graphviz-2.6/tclpkg/tcldot/tcldot.c
@@ -1232,6 +1232,8 @@ static int graphcmd(ClientData clientDat
return TCL_OK;
} else if ((c == 'w') && (strncmp(argv[1], "write", length) == 0)) {
+ void *aliasing_dummy;
+
g = g->root;
if (argc < 3) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -1258,9 +1260,11 @@ static int graphcmd(ClientData clientDat
gvc->job->output_lang =
gvrender_select(gvc->job, gvc->job->output_langname);
+ aliasing_dummy = gvc->job->output_file;
if (Tcl_GetOpenFile (interp, argv[2], 1, 1,
- (ClientData *) &(gvc->job->output_file)) != TCL_OK)
+ (ClientData *) &aliasing_dummy) != TCL_OK)
return TCL_ERROR;
+ gvc->job->output_file = aliasing_dummy;
/* make sure that layout is done - unless canonical output */
if ((!GD_drawing(g) || argc > 4)