From 6ec01c16e0630cda45b4fa15d45931c84f2df299 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 25 Jun 2021 19:26:28 -0700 Subject: [PATCH] remove commented out code in lib/common --- lib/common/emit.c | 64 ------------------------------------------- lib/common/labels.c | 17 ------------ lib/common/routespl.c | 12 -------- lib/common/shapes.c | 14 ---------- lib/common/splines.c | 56 ------------------------------------- lib/common/taper.c | 11 -------- 6 files changed, 174 deletions(-) diff --git a/lib/common/emit.c b/lib/common/emit.c index a08b5c286..16140810a 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -1698,24 +1698,6 @@ static void setup_page(GVJ_t * job, graph_t * g) else job->translation.y = - job->clip.LL.y + job->canvasBox.LL.y / job->zoom; } - -#if 0 -fprintf(stderr,"width=%d height=%d dpi=%g,%g\npad=%g,%g focus=%g,%g view=%g,%g zoom=%g\npageBox=%g,%g,%g,%g pagesArraySize=%d,%d pageSize=%g,%g canvasBox=%g,%g,%g,%g pageOffset=%g,%g\ntranslation=%g,%g clip=%g,%g,%g,%g margin=%g,%g\n", - job->width, job->height, - job->dpi.x, job->dpi.y, - job->pad.x, job->pad.y, - job->focus.x, job->focus.y, - job->view.x, job->view.y, - job->zoom, - job->pageBox.LL.x, job->pageBox.LL.y, job->pageBox.UR.x, job->pageBox.UR.y, - job->pagesArraySize.x, job->pagesArraySize.y, - job->pageSize.x, job->pageSize.y, - job->canvasBox.LL.x, job->canvasBox.LL.y, job->canvasBox.UR.x, job->canvasBox.UR.y, - job->pageOffset.x, job->pageOffset.y, - job->translation.x, job->translation.y, - job->clip.LL.x, job->clip.LL.y, job->clip.UR.x, job->clip.UR.y, - job->margin.x, job->margin.y); -#endif } static boolean node_in_layer(GVJ_t *job, graph_t * g, node_t * n) @@ -2757,48 +2739,22 @@ static void nodeIntersect (GVJ_t * job, pointf p, { obj_state_t *obj = job->obj; char* url; -#if 0 - char* tooltip; - char* target; -#endif boolean explicit; if (explicit_iurl) url = iurl; else url = obj->url; if (explicit_itooltip) { -#if 0 - tooltip = itooltip; -#endif explicit = TRUE; } else if (obj->explicit_tooltip) { -#if 0 - tooltip = obj->tooltip; -#endif explicit = TRUE; } else { -#if 0 - tooltip = itooltip; -#endif explicit = FALSE; } -#if 0 - if (explicit_itarget) - target = itarget; - else if (obj->explicit_edgetarget) - target = obj->target; - else - target = itarget; -#endif if (url || explicit) { map_point(job, p); -#if 0 -/* this doesn't work because there is nothing contained in the anchor */ - gvrender_begin_anchor(job, url, tooltip, target, obj->id); - gvrender_end_anchor(job); -#endif } } @@ -3282,12 +3238,6 @@ static void init_job_viewport(GVJ_t * job, graph_t * g) job->zoom = Z; /* scaling factor */ job->focus.x = x; job->focus.y = y; -#if 0 -fprintf(stderr, "view=%g,%g, zoom=%g, focus=%g,%g\n", - job->view.x, job->view.y, - job->zoom, - job->focus.x, job->focus.y); -#endif } static void emit_cluster_colors(GVJ_t * job, graph_t * g) @@ -3552,10 +3502,6 @@ void emit_graph(GVJ_t * job, graph_t * g) job->view.x = job->width / job->scale.x; job->view.y = job->height / job->scale.y; } -#if 0 -fprintf(stderr,"focus=%g,%g view=%g,%g\n", - job->focus.x, job->focus.y, job->view.x, job->view.y); -#endif s = late_string(g, agattr(g, AGRAPH, "comment", 0), ""); gvrender_comment(job, s); @@ -3858,13 +3804,6 @@ static int style_token(char **s, agxbuf * xb) static unsigned char outbuf[SMALLBUF]; static agxbuf ps_xb; -#if 0 -static void cleanup(void) -{ - agxbfree(&ps_xb); -} -#endif - /* parse_style: * This is one of the worst internal designs in graphviz. * The use of '\0' characters within strings seems cute but it @@ -3886,9 +3825,6 @@ char **parse_style(char *s) if (is_first) { agxbinit(&ps_xb, SMALLBUF, outbuf); -#if 0 - atexit(cleanup); -#endif is_first = FALSE; } diff --git a/lib/common/labels.c b/lib/common/labels.c index b327b10a9..d9ea71c86 100644 --- a/lib/common/labels.c +++ b/lib/common/labels.c @@ -523,9 +523,6 @@ char *xml_url_string(char *s) static char *buf = NULL; static int bufsize = 0; char *p, *sub; -#if 0 - char *prev = NULL; -#endif int len, pos = 0; if (!buf) { @@ -555,17 +552,6 @@ char *xml_url_string(char *s) sub = ">"; len = 4; } -#if 0 - else if (*s == '-') { /* can't be used in xml comment strings */ - sub = "-"; - len = 5; - } - else if (*s == ' ' && prev && *prev == ' ') { - /* substitute 2nd and subsequent spaces with required_spaces */ - sub = " "; /* inkscape doesn't recognise   */ - len = 6; - } -#endif else if (*s == '"') { sub = """; len = 6; @@ -582,9 +568,6 @@ char *xml_url_string(char *s) *p++ = *sub++; pos++; } -#if 0 - prev = s; -#endif s++; } *p = '\0'; diff --git a/lib/common/routespl.c b/lib/common/routespl.c index fedfa2cda..da70501a9 100644 --- a/lib/common/routespl.c +++ b/lib/common/routespl.c @@ -243,19 +243,7 @@ simpleSplineRoute (pointf tp, pointf hp, Ppoly_t poly, int* n_spl_pts, edges[i].a = poly.ps[i]; edges[i].b = poly.ps[(i + 1) % poly.pn]; } -#if 0 - if (pp->start.constrained) { - evs[0].x = cos(pp->start.theta); - evs[0].y = sin(pp->start.theta); - } else -#endif evs[0].x = evs[0].y = 0; -#if 0 - if (pp->end.constrained) { - evs[1].x = -cos(pp->end.theta); - evs[1].y = -sin(pp->end.theta); - } else -#endif evs[1].x = evs[1].y = 0; if (Proutespline(edges, poly.pn, pl, evs, &spl) < 0) return NULL; diff --git a/lib/common/shapes.c b/lib/common/shapes.c index 78af16254..1aca97d02 100644 --- a/lib/common/shapes.c +++ b/lib/common/shapes.c @@ -4034,20 +4034,6 @@ static void cylinder_draw(GVJ_t * job, pointf * AF, int sides, int style, int fi gvrender_beziercurve(job, vertices, 7, FALSE, FALSE, FALSE); } -#if 0 -/* cylinder_inside: - * At present, we use just the polygonal outline provided by vertices. - * This cold be made more precise by using a finer-grained polyline path - * to the spline top and bottom. Another approach might be to approximate - * the top and bottom by ellipses. Then the test would involve a check if - * the point is in the rectangle or one of the two ellipses. - */ -static boolean cylinder_inside(inside_t * inside_context, pointf p) -{ - return TRUE; -} -#endif - static char *side_port[] = { "s", "e", "n", "w" }; static point cvtPt(pointf p, int rankdir) diff --git a/lib/common/splines.c b/lib/common/splines.c index c262494b9..d0f8cd98c 100644 --- a/lib/common/splines.c +++ b/lib/common/splines.c @@ -1340,62 +1340,6 @@ edgeMidpoint (graph_t* g, edge_t * e) */ void addEdgeLabels(graph_t* g, edge_t * e, pointf rp, pointf rq) { -#if 0 - int et = EDGE_TYPE (g); - pointf p, q; - pointf d; /* midpoint of segment p-q */ - point ld; - point del; - pointf spf; - double f, ht, wd, dist2; - int leftOf; - - if (ED_label(e) && !ED_label(e)->set) { - endPoints(ED_spl(e), &p, &q); - if (APPROXEQPT(p, q, MILLIPOINT)) { /* degenerate spline */ - p = rp; - q = rq; - spf = p; - } - else if (et == ET_SPLINE) { - d.x = (q.x + p.x) / 2.; - d.y = (p.y + q.y) / 2.; - spf = dotneato_closest(ED_spl(e), d); - } - else { /* ET_PLINE, ET_ORTHO or ET_LINE */ - spf = polylineMidpoint (ED_spl(e), &p, &q); - } - del.x = q.x - p.x; - del.y = q.y - p.y; - dist2 = del.x*del.x + del.y*del.y; - ht = (ED_label(e)->dimen.y + 2)/2.0; - if (dist2) { - wd = (MIN(ED_label(e)->dimen.x + 2, MAXLABELWD))/2.0; - leftOf = LEFTOF(p, q, spf); - if ((leftOf && (del.y >= 0)) || (!leftOf && (del.y < 0))) { - if (del.x*del.y >= 0) - ht *= -1; - } - else { - wd *= -1; - if (del.x*del.y < 0) - ht *= -1; - } - f = (del.y*wd - del.x*ht)/dist2; - ld.x = -f*del.y; - ld.y = f*del.x; - } - else { /* end points the same */ - ld.x = 0; - ld.y = -ht; - } - - ED_label(e)->pos.x = spf.x + ld.x; - ED_label(e)->pos.y = spf.y + ld.y; - ED_label(e)->set = TRUE; - updateBB(agraphof(agtail(e)), ED_label(e)); - } -#endif makePortLabels(e); } diff --git a/lib/common/taper.c b/lib/common/taper.c index d101d981c..6da4acb4e 100644 --- a/lib/common/taper.c +++ b/lib/common/taper.c @@ -69,17 +69,6 @@ static void arcn (stroke_t* p, double x, double y, double r, double a1, double a addto (p, x+r*cos(a1-i*theta), y+r*sin(a1-i*theta)); } -#if 0 -static void closepath (stroke_t* p) -{ - pointf pt = p->vertices[0]; - - addto (p, pt.x, pt.y); - if (p->flags > p->nvertices) - p->vertices = RALLOC(p->nvertices,p->vertices,pointf); -} -#endif - /* * handle zeros */ -- 2.49.0