From: Matthew Fernandez Date: Wed, 23 Feb 2022 07:57:09 +0000 (-0800) Subject: cgraph: [nfc] remove unused return value from 'agxbmore' X-Git-Tag: 3.0.0~4^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1cf34517685c5b4e9f433d802b2ffed993a4489e;p=graphviz cgraph: [nfc] remove unused return value from 'agxbmore' --- diff --git a/lib/cgraph/agxbuf.c b/lib/cgraph/agxbuf.c index 7f2c07e0c..627e02b3f 100644 --- a/lib/cgraph/agxbuf.c +++ b/lib/cgraph/agxbuf.c @@ -39,7 +39,7 @@ void agxbinit(agxbuf * xb, unsigned int hint, unsigned char *init) /* agxbmore; * Expand buffer to hold at least ssz more bytes. */ -int agxbmore(agxbuf * xb, size_t ssz) +void agxbmore(agxbuf * xb, size_t ssz) { size_t cnt = 0; /* current no. of characters in buffer */ size_t size = 0; /* current buffer size */ @@ -61,7 +61,6 @@ int agxbmore(agxbuf * xb, size_t ssz) xb->buf = nbuf; xb->ptr = xb->buf + cnt; xb->eptr = xb->buf + nsize; - return 0; } int agxbprint(agxbuf * xb, const char *fmt, ...) { @@ -90,7 +89,7 @@ int agxbprint(agxbuf * xb, const char *fmt, ...) { size_t unused_space = (size_t)(xb->eptr - xb->ptr); if (unused_space < size) { size_t extra = size - unused_space; - (void)agxbmore(xb, extra); + agxbmore(xb, extra); } } diff --git a/lib/cgraph/agxbuf.h b/lib/cgraph/agxbuf.h index 1d098a7c4..2e11ba2fe 100644 --- a/lib/cgraph/agxbuf.h +++ b/lib/cgraph/agxbuf.h @@ -85,7 +85,7 @@ extern "C" { /* agxbmore: * Expand buffer to hold at least ssz more bytes. */ - AGXBUF_API int agxbmore(agxbuf * xb, size_t ssz); + AGXBUF_API void agxbmore(agxbuf * xb, size_t ssz); /* agxbputc: * Add character to buffer. @@ -93,9 +93,7 @@ extern "C" { */ static inline int agxbputc(agxbuf * xb, char c) { if (xb->ptr >= xb->eptr) { - if (agxbmore(xb, 1) != 0) { - return -1; - } + agxbmore(xb, 1); } *xb->ptr++ = (unsigned char)c; return 0;