]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Remove t_buffer_*_type()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 12 Dec 2016 01:55:54 +0000 (03:55 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 16 Dec 2016 21:40:22 +0000 (23:40 +0200)
The t_buffer_*() shouldn't normally be used anyway except in some low-level
string/buffer manipulation code, so there's not much point in trying to make
easier to use versions of them.

src/lib/data-stack.h
src/lib/test-data-stack.c

index 6570565d78d5fe302e803a3b1a6734741152561e..72b5244ea1a45936e7544428efbb755bdded452c 100644 (file)
@@ -101,20 +101,14 @@ size_t t_get_bytes_available(void) ATTR_PURE;
    in the size parameter. If return value doesn't point to the same value
    as last time, you need to memcpy() data from the old buffer to the
    new one (or do some other trickery). See t_buffer_reget(). */
-#define t_buffer_get_type(type, size) \
-       t_buffer_get(sizeof(type) * (size))
 void *t_buffer_get(size_t size) ATTR_RETURNS_NONNULL;
 
 /* Grow the buffer, memcpy()ing the memory to new location if needed. */
-#define t_buffer_reget_type(buffer, type, size) \
-       t_buffer_reget(buffer, sizeof(type) * (size))
 void *t_buffer_reget(void *buffer, size_t size) ATTR_RETURNS_NONNULL;
 
 /* Make the last t_buffer_get()ed buffer permanent. Note that size MUST be
    less or equal than the size you gave with last t_buffer_get() or the
    result will be undefined. */
-#define t_buffer_alloc_type(type, size) \
-       t_buffer_alloc(sizeof(type) * (size))
 void t_buffer_alloc(size_t size);
 /* Allocate the last t_buffer_get()ed data entirely. */
 void t_buffer_alloc_last_full(void);
index 94996b5ff684eeb5da9a5e90463e00e44ccc4bde..6d7642c1c15e138264a661851d8fd9a62b09f939 100644 (file)
@@ -94,9 +94,9 @@ static void test_ds_recurse(int depth, int number, size_t size)
        char tag[2] = { depth+1, '\0' };
        int try_fails = 0;
        data_stack_frame_t t_id = t_push_named("test_ds_recurse[%i]", depth);
-       ps = t_buffer_get_type(char *, number);
+       ps = t_buffer_get(sizeof(char *) * number);
        i_assert(ps != NULL);
-       t_buffer_alloc_type(char *, number);
+       t_buffer_alloc(sizeof(char *) * number);
 
        for (i = 0; i < number; i++) {
                ps[i] = t_malloc_no0(size/2);