]> granicus.if.org Git - graphviz/commitdiff
cgraph: [nfc] remove unused return value from 'agxbmore'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 23 Feb 2022 07:57:09 +0000 (23:57 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 24 Feb 2022 15:55:00 +0000 (07:55 -0800)
lib/cgraph/agxbuf.c
lib/cgraph/agxbuf.h

index 7f2c07e0cb8bd3c295459045719c706f4598a793..627e02b3f785c8553951af33d6a00f534de2f2cd 100644 (file)
@@ -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);
     }
   }
 
index 1d098a7c43fff87f2c79d096a9707014c021de5d..2e11ba2fe5b8f565a7c0fb7abba04630e06ef54e 100644 (file)
@@ -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;