From: Matthew Fernandez Date: Sun, 29 Jan 2023 01:39:17 +0000 (-0800) Subject: gvpr colorxlate: use a char for 'c' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c19b8950f2c2e3fabdd94e13f06fdbf39514635;p=graphviz gvpr colorxlate: use a char for 'c' Similar to the previous commit, this allows dropping some casts. --- diff --git a/lib/gvpr/actions.c b/lib/gvpr/actions.c index 227490ff9..1e4bc361f 100644 --- a/lib/gvpr/actions.c +++ b/lib/gvpr/actions.c @@ -1048,7 +1048,6 @@ int colorxlate(char *str, gvcolor_t * color, color_type_t target_type) { static hsvrgbacolor_t *last; hsvrgbacolor_t fake; - unsigned char c; double H, S, V, A, R, G, B; double C, M, Y, K; unsigned int r, g, b, a; @@ -1113,11 +1112,12 @@ int colorxlate(char *str, gvcolor_t * color, color_type_t target_type) } /* test for hsv value such as: ".6,.5,.3" */ - if ((c = *p) == '.' || isdigit(c)) { + char c; + if ((c = *p) == '.' || isdigit((int)c)) { int cnt; agxbuf canon = {0}; while ((c = *p++)) { - agxbputc(&canon, c == ',' ? ' ' : (char)c); + agxbputc(&canon, c == ',' ? ' ' : c); } if ((cnt = sscanf(agxbuse(&canon), "%lf%lf%lf%lf", &H, &S, &V, &A)) >= 3) {