From: John Ellson Date: Tue, 22 Dec 2015 18:26:09 +0000 (-0500) Subject: janitor - use void return from agxput() X-Git-Tag: TRAVIS_CI_BUILD_EXPERIMENTAL~85 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9c03e5afc7b8df018aa777a028f995a7cd75209;p=graphviz janitor - use void return from agxput() --- diff --git a/lib/cgraph/agxbuf.h b/lib/cgraph/agxbuf.h index e5e3e3d00..a36ce23bc 100644 --- a/lib/cgraph/agxbuf.h +++ b/lib/cgraph/agxbuf.h @@ -64,8 +64,7 @@ extern "C" { * Add character to buffer. * int agxbputc(agxbuf*, char) */ -#define agxbputc(X,C) ((((X)->ptr >= (X)->eptr) ? agxbmore(X,1) : 0), \ - (int)(*(X)->ptr++ = ((unsigned char)C))) +#define agxbputc(X,C) ((((X)->ptr >= (X)->eptr) ? agxbmore(X,1) : 0), (void)(*(X)->ptr++ = ((unsigned char)C))) /* agxbuse: * Null-terminates buffer; resets and returns pointer to data; diff --git a/lib/common/htmllex.c b/lib/common/htmllex.c index 8c303beee..bdc9a4211 100644 --- a/lib/common/htmllex.c +++ b/lib/common/htmllex.c @@ -749,7 +749,7 @@ static void endElement(void *user, const char *name) */ static void characterData(void *user, const char *s, int length) { - int i, rc, cnt = 0; + int i, cnt = 0; unsigned char c; if (state.inCell) { @@ -757,7 +757,7 @@ static void characterData(void *user, const char *s, int length) c = *s++; if (c >= ' ') { cnt++; - rc = agxbputc(state.xb, c); + agxbputc(state.xb, c); } } if (cnt) state.tok = T_string; @@ -845,7 +845,6 @@ static char *findNext(char *s, agxbuf* xb) { char* t = s + 1; char c; - int rc; if (*s == '<') { if ((*t == '!') && !strncmp(t + 1, "--", 2)) @@ -865,7 +864,7 @@ static char *findNext(char *s, agxbuf* xb) t = scanEntity(t + 1, xb); } else { - rc = agxbputc(xb, c); + agxbputc(xb, c); t++; } } diff --git a/lib/common/psusershape.c b/lib/common/psusershape.c index a68c24fd7..051d237ce 100644 --- a/lib/common/psusershape.c +++ b/lib/common/psusershape.c @@ -272,7 +272,6 @@ char *ps_string(char *ins, int chset) char *base; static agxbuf xb; static int warned; - int rc; switch (chset) { case CHAR_UTF8 : @@ -305,12 +304,12 @@ char *ps_string(char *ins, int chset) if (xb.buf == NULL) agxbinit (&xb, 0, NULL); - rc = agxbputc (&xb, LPAREN); + agxbputc (&xb, LPAREN); s = base; while (*s) { if ((*s == LPAREN) || (*s == RPAREN) || (*s == '\\')) - rc = agxbputc (&xb, '\\'); - rc = agxbputc (&xb, *s++); + agxbputc (&xb, '\\'); + agxbputc (&xb, *s++); } agxbputc (&xb, RPAREN); if (base != ins) free (base); diff --git a/lib/common/utils.c b/lib/common/utils.c index 48e547b39..064a651fc 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -1435,8 +1435,6 @@ char* htmlEntityUTF8 (char* s, graph_t* g) int uc; int ui; - NOTUSED(ignored); - if (lastg != g) { lastg = g; warned = 0; @@ -1476,12 +1474,12 @@ char* htmlEntityUTF8 (char* s, graph_t* g) if (v < 0x7F) /* entity needs 1 byte in UTF8 */ c = v; else if (v < 0x07FF) { /* entity needs 2 bytes in UTF8 */ - ignored = agxbputc(&xb, (v >> 6) | 0xC0); + agxbputc(&xb, (v >> 6) | 0xC0); c = (v & 0x3F) | 0x80; } else { /* entity needs 3 bytes in UTF8 */ - ignored = agxbputc(&xb, (v >> 12) | 0xE0); - ignored = agxbputc(&xb, ((v >> 6) & 0x3F) | 0x80); + agxbputc(&xb, (v >> 12) | 0xE0); + agxbputc(&xb, ((v >> 6) & 0x3F) | 0x80); c = (v & 0x3F) | 0x80; } } @@ -1489,7 +1487,7 @@ char* htmlEntityUTF8 (char* s, graph_t* g) else /* copy n byte UTF8 characters */ for (ui = 0; ui < uc; ++ui) if ((*s & 0xC0) == 0x80) { - ignored = agxbputc(&xb, c); + agxbputc(&xb, c); c = *(unsigned char*)s++; } else { @@ -1500,7 +1498,7 @@ char* htmlEntityUTF8 (char* s, graph_t* g) c = cvtAndAppend (c, &xb); break; } - ignored = agxbputc(&xb, c); + agxbputc(&xb, c); } ns = strdup (agxbuse(&xb)); agxbfree(&xb); @@ -1518,10 +1516,7 @@ char* latin1ToUTF8 (char* s) agxbuf xb; unsigned char buf[BUFSIZ]; unsigned int v; - int ignored; - NOTUSED(ignored); - agxbinit(&xb, BUFSIZ, buf); /* Values are either a byte (<= 256) or come from htmlEntity, whose @@ -1533,15 +1528,15 @@ char* latin1ToUTF8 (char* s) if (!v) v = '&'; } if (v < 0x7F) - ignored = agxbputc(&xb, v); + agxbputc(&xb, v); else if (v < 0x07FF) { - ignored = agxbputc(&xb, (v >> 6) | 0xC0); - ignored = agxbputc(&xb, (v & 0x3F) | 0x80); + agxbputc(&xb, (v >> 6) | 0xC0); + agxbputc(&xb, (v & 0x3F) | 0x80); } else { - ignored = agxbputc(&xb, (v >> 12) | 0xE0); - ignored = agxbputc(&xb, ((v >> 6) & 0x3F) | 0x80); - ignored = agxbputc(&xb, (v & 0x3F) | 0x80); + agxbputc(&xb, (v >> 12) | 0xE0); + agxbputc(&xb, ((v >> 6) & 0x3F) | 0x80); + agxbputc(&xb, (v & 0x3F) | 0x80); } } ns = strdup (agxbuse(&xb)); @@ -1562,20 +1557,17 @@ utf8ToLatin1 (char* s) unsigned char buf[BUFSIZ]; unsigned char c; unsigned char outc; - int ignored; - NOTUSED(ignored); - agxbinit(&xb, BUFSIZ, buf); while ((c = *(unsigned char*)s++)) { if (c < 0x7F) - ignored = agxbputc(&xb, c); + agxbputc(&xb, c); else { outc = (c & 0x03) << 6; c = *(unsigned char*)s++; outc = outc | (c & 0x3F); - ignored = agxbputc(&xb, outc); + agxbputc(&xb, outc); } } ns = strdup (agxbuse(&xb)); diff --git a/plugin/core/gvrender_core_dot.c b/plugin/core/gvrender_core_dot.c index d3c3b8f8f..939672776 100644 --- a/plugin/core/gvrender_core_dot.c +++ b/plugin/core/gvrender_core_dot.c @@ -165,9 +165,9 @@ static void xdot_points(GVJ_t *job, char c, pointf * A, int n) { emit_state_t emit_state = job->obj->emit_state; char buf[BUFSIZ]; - int i, rc; + int i; - rc = agxbputc(xbufs[emit_state], c); + agxbputc(xbufs[emit_state], c); sprintf(buf, " %d ", n); agxbput(xbufs[emit_state], buf); for (i = 0; i < n; i++)