Mercurial > hg > dmlib
comparison src/dmgrowbuf.c @ 1693:ce8d4552ffd5
Get rid of dmGrowBufResize().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 05 Jun 2018 09:52:53 +0300 |
parents | 9611ecd2c4fb |
children | e568535e1a96 |
comparison
equal
deleted
inserted
replaced
1692:9611ecd2c4fb | 1693:ce8d4552ffd5 |
---|---|
186 | 186 |
187 return TRUE; | 187 return TRUE; |
188 } | 188 } |
189 | 189 |
190 | 190 |
191 int dmGrowBufResize(DMGrowBuf *buf) | |
192 { | |
193 if (buf == NULL) | |
194 return DMERR_NULLPTR; | |
195 | |
196 buf->size = buf->len; | |
197 if (buf->len == 0) | |
198 return DMERR_OK; | |
199 | |
200 if (!dmGrowBufRealloc(buf, buf->size, FALSE)) | |
201 return DMERR_MALLOC; | |
202 | |
203 return DMERR_OK; | |
204 } | |
205 | |
206 | |
207 BOOL dmGrowBufPutU8(DMGrowBuf *buf, const Uint8 value) | 191 BOOL dmGrowBufPutU8(DMGrowBuf *buf, const Uint8 value) |
208 { | 192 { |
209 if (!dmGrowBufGrow(buf, sizeof(Uint8))) | 193 if (!dmGrowBufGrow(buf, sizeof(Uint8))) |
210 return FALSE; | 194 return FALSE; |
211 | 195 |