diff src/dmgrowbuf.c @ 1692:9611ecd2c4fb

Get rid of dmGrowBufInit().
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 05 Jun 2018 09:50:08 +0300
parents 383ca5f6e78b
children ce8d4552ffd5
line wrap: on
line diff
--- a/src/dmgrowbuf.c	Tue Jun 05 09:37:37 2018 +0300
+++ b/src/dmgrowbuf.c	Tue Jun 05 09:50:08 2018 +0300
@@ -15,29 +15,16 @@
 #endif
 
 
-int dmGrowBufInit(DMGrowBuf *buf)
+int dmGrowBufAlloc(DMGrowBuf *buf, const size_t initial, const size_t mingrow)
 {
-    DM_DBG("dmGrowBufInit(%p)\n", buf);
+    DM_DBG("dmGrowBufAlloc(%p, %" DM_PRIu_SIZE_T ", %" DM_PRIu_SIZE_T ")\n",
+        buf, initial, mingrow);
 
     if (buf == NULL)
         return DMERR_NULLPTR;
 
     memset(buf, 0, sizeof(DMGrowBuf));
 
-    return DMERR_OK;
-}
-
-
-int dmGrowBufAlloc(DMGrowBuf *buf, const size_t initial, const size_t mingrow)
-{
-    int res;
-
-    DM_DBG("dmGrowBufAlloc(%p, %" DM_PRIu_SIZE_T ", %" DM_PRIu_SIZE_T ")\n",
-        buf, initial, mingrow);
-
-    if ((res = dmGrowBufInit(buf)) != DMERR_OK)
-        return res;
-
     buf->len  = 0;
     buf->offs = 0;
     buf->size = initial;