From: Emden R. Gansner Date: Mon, 10 Mar 2014 13:51:51 +0000 (-0400) Subject: Wrap debug traces in if(Verbose) X-Git-Tag: 2.38.0~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e3d4ed7fac8b9ed99fe4d8f620fd0b34e1e79fa;p=graphviz Wrap debug traces in if(Verbose) --- diff --git a/lib/edgepaint/edge_distinct_coloring.c b/lib/edgepaint/edge_distinct_coloring.c index ac62c2a05..f5b4d175d 100644 --- a/lib/edgepaint/edge_distinct_coloring.c +++ b/lib/edgepaint/edge_distinct_coloring.c @@ -182,7 +182,7 @@ Agraph_t* edge_distinct_coloring(char *color_scheme, char *lightness, Agraph_t* A = SparseMatrix_import_dot(g, dim, NULL, &x, NULL, NULL, FORMAT_COORD, NULL); if (!x){ - fprintf(stderr,"The gv file contains no or not proper 2D coordinates\n"); + fprintf(stderr,"The gv file contains no or improper 2D coordinates\n"); return NULL; } @@ -198,7 +198,8 @@ Agraph_t* edge_distinct_coloring(char *color_scheme, char *lightness, Agraph_t* } } - fprintf(stderr,"cos = %f, nz2 = %d\n", cos_critical, nz2); + if (Verbose) + fprintf(stderr,"cos = %f, nz2 = %d\n", cos_critical, nz2); /* now find edge collision */ nz = 0; B = SparseMatrix_new(nz2, nz2, 1, MATRIX_TYPE_REAL, FORMAT_COORD); @@ -294,7 +295,8 @@ Agraph_t* edge_distinct_coloring(char *color_scheme, char *lightness, Agraph_t* } #endif - fprintf(stderr,"The edge conflict graph has %d nodes and %d edges, final color_diff=%f color_diff_sum = %f\n", + if (Verbose) + fprintf(stderr,"The edge conflict graph has %d nodes and %d edges, final color_diff=%f color_diff_sum = %f\n", C->m, C->nz, color_diff, color_diff_sum); attach_edge_colors(g, cdim, colors); diff --git a/lib/edgepaint/lab.c b/lib/edgepaint/lab.c index d1fc4e7b1..578425727 100644 --- a/lib/edgepaint/lab.c +++ b/lib/edgepaint/lab.c @@ -176,7 +176,8 @@ double *lab_gamut_from_file(char *gamut_file, const char *lightness, int *n){ *n = 0; - fprintf(stderr,"LAB color lightness range = %d,%d\n", l1, l2); + if (Verbose) + fprintf(stderr,"LAB color lightness range = %d,%d\n", l1, l2); fp = fopen(gamut_file, "r"); if (!fp) return NULL; @@ -218,12 +219,13 @@ double *lab_gamut(const char *lightness, int *n){ } - - fprintf(stderr,"LAB color lightness range = %d,%d\n", l1, l2); + if (Verbose) + fprintf(stderr,"LAB color lightness range = %d,%d\n", l1, l2); m = sizeof(lab_gamut_data)/sizeof(lab_gamut_data[0]); - fprintf(stderr,"size of lab gamut = %d\n", m); + if (Verbose) + fprintf(stderr,"size of lab gamut = %d\n", m); x = malloc(sizeof(double)*3*m); xx = x; @@ -313,7 +315,8 @@ void color_blend_rgb2lab(char *color_list, const int maxpoints, double **colors0 for (i = 0; i < nc - 1; i++){ dists[i+1] += dists[i]; } - fprintf(stderr,"sum = %f\n", dists[nc-1]); + if (Verbose) + fprintf(stderr,"sum = %f\n", dists[nc-1]); if (!(*colors0)){ *colors0 = malloc(sizeof(double)*maxpoints*cdim); diff --git a/lib/edgepaint/node_distinct_coloring.c b/lib/edgepaint/node_distinct_coloring.c index 73d73ba80..b3d8295fa 100644 --- a/lib/edgepaint/node_distinct_coloring.c +++ b/lib/edgepaint/node_distinct_coloring.c @@ -244,7 +244,7 @@ void node_distinct_coloring(char *color_scheme, char *lightness, int weightedQ, cdim = *cdim0 = 3; if (strcmp(color_scheme, "lab") == 0){ - fprintf(stderr,"lab\n"); + if (Verbose) fprintf(stderr,"lab\n"); scheme = COLOR_LAB; qt = lab_gamut_quadtree("lab_gamut", lightness, max_qtree_level); if (!qt){ @@ -253,7 +253,7 @@ void node_distinct_coloring(char *color_scheme, char *lightness, int weightedQ, return; } } else if (strcmp(color_scheme, "rgb") == 0){ - fprintf(stderr,"rgb\n"); + if (Verbose) fprintf(stderr,"rgb\n"); scheme = COLOR_RGB; } else if (strcmp(color_scheme, "gray") == 0){ scheme = COLOR_GRAY;