]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: cosmetic - whitespace cleanup in allocator/memory-related code
authorPhil Carmody <phil@dovecot.fi>
Mon, 28 Jul 2014 13:45:33 +0000 (16:45 +0300)
committerPhil Carmody <phil@dovecot.fi>
Mon, 28 Jul 2014 13:45:33 +0000 (16:45 +0300)
Indentation used spaces. Some trailing whitespace found.

$ git diff -w
$

Signed-off-by: Phil Carmody <phil@dovecot.fi>
src/lib/data-stack.c
src/lib/data-stack.h
src/lib/imem.c
src/lib/mempool-alloconly.c
src/lib/mempool-system.c
src/lib/mempool.h

index bd4f95c7d023d093e9a9768a9f7d5d7008ebf51a..ad74340b5b8a30afa3f128339a1ba302a273c16c 100644 (file)
@@ -52,7 +52,7 @@ struct stack_frame_block {
        struct stack_frame_block *prev;
 
        struct stack_block *block[BLOCK_FRAME_COUNT];
-        size_t block_space_used[BLOCK_FRAME_COUNT];
+       size_t block_space_used[BLOCK_FRAME_COUNT];
        size_t last_alloc_size[BLOCK_FRAME_COUNT];
 #ifdef DEBUG
        const char *marker[BLOCK_FRAME_COUNT];
@@ -120,7 +120,7 @@ static void data_stack_last_buffer_reset(bool preserve_data ATTR_UNUSED)
 
 unsigned int t_push(const char *marker)
 {
-        struct stack_frame_block *frame_block;
+       struct stack_frame_block *frame_block;
 
        frame_pos++;
        if (frame_pos == BLOCK_FRAME_COUNT) {
@@ -158,7 +158,7 @@ unsigned int t_push(const char *marker)
        /* mark our current position */
        current_frame_block->block[frame_pos] = current_block;
        current_frame_block->block_space_used[frame_pos] = current_block->left;
-        current_frame_block->last_alloc_size[frame_pos] = 0;
+       current_frame_block->last_alloc_size[frame_pos] = 0;
 #ifdef DEBUG
        current_frame_block->marker[frame_pos] = marker;
        current_frame_block->alloc_bytes[frame_pos] = 0ULL;
@@ -167,7 +167,7 @@ unsigned int t_push(const char *marker)
        (void)marker; /* only used for debugging */
 #endif
 
-        return data_stack_frame++;
+       return data_stack_frame++;
 }
 
 unsigned int t_push_named(const char *format, ...)
@@ -295,7 +295,7 @@ unsigned int t_pop(void)
                unused_frame_blocks = frame_block;
        }
 
-        return --data_stack_frame;
+       return --data_stack_frame;
 }
 
 void t_pop_check(unsigned int *id)
@@ -384,7 +384,7 @@ static void *t_malloc_real(size_t size, bool permanent)
                        current_block->lowwater =
                                current_block->left - alloc_size;
                }
-                if (permanent)
+               if (permanent)
                        current_block->left -= alloc_size;
        } else {
                /* current block is full, see if we can use the unused_block */
@@ -433,12 +433,12 @@ static void *t_malloc_real(size_t size, bool permanent)
        /* we rely on errno not changing. it shouldn't. */
        i_assert(errno == old_errno);
 #endif
-        return ret;
+       return ret;
 }
 
 void *t_malloc(size_t size)
 {
-        return t_malloc_real(size, TRUE);
+       return t_malloc_real(size, TRUE);
 }
 
 void *t_malloc0(size_t size)
@@ -447,7 +447,7 @@ void *t_malloc0(size_t size)
 
        mem = t_malloc_real(size, TRUE);
        memset(mem, 0, size);
-        return mem;
+       return mem;
 }
 
 bool t_try_realloc(void *mem, size_t size)
@@ -502,17 +502,17 @@ void *t_buffer_get(size_t size)
 void *t_buffer_reget(void *buffer, size_t size)
 {
        size_t old_size;
-        void *new_buffer;
+       void *new_buffer;
 
        old_size = last_buffer_size;
        if (size <= old_size)
-                return buffer;
+               return buffer;
 
        new_buffer = t_buffer_get(size);
        if (new_buffer != buffer)
-                memcpy(new_buffer, buffer, old_size);
+               memcpy(new_buffer, buffer, old_size);
 
-        return new_buffer;
+       return new_buffer;
 }
 
 void t_buffer_alloc(size_t size)
@@ -573,7 +573,7 @@ void data_stack_deinit(void)
 
 #ifndef USE_GC
        while (unused_frame_blocks != NULL) {
-                struct stack_frame_block *frame_block = unused_frame_blocks;
+               struct stack_frame_block *frame_block = unused_frame_blocks;
                unused_frame_blocks = unused_frame_blocks->prev;
 
                free(frame_block);
index a805249cfa9822175a8c93dc753a903ded56e5c5..142981dab3fe116e9c1e58e905dd3b495acd63b2 100644 (file)
@@ -109,7 +109,7 @@ void *t_buffer_reget(void *buffer, size_t size) ATTR_RETURNS_NONNULL;
    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))
+       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 1c0869ba94f74bc67a2feed60f7b9bfb1be726ee..711f903792c9333fee030ad0c0ce35f28f42ea4f 100644 (file)
@@ -6,22 +6,22 @@ pool_t default_pool = &static_system_pool;
 
 void *i_malloc(size_t size)
 {
-        return p_malloc(default_pool, size);
+       return p_malloc(default_pool, size);
 }
 
 void *i_realloc(void *mem, size_t old_size, size_t new_size)
 {
-        return p_realloc(default_pool, mem, old_size, new_size);
+       return p_realloc(default_pool, mem, old_size, new_size);
 }
 
 char *i_strdup(const char *str)
 {
-        return p_strdup(default_pool, str);
+       return p_strdup(default_pool, str);
 }
 
 char *i_strdup_empty(const char *str)
 {
-        return p_strdup_empty(default_pool, str);
+       return p_strdup_empty(default_pool, str);
 }
 
 char *i_strdup_until(const void *str, const void *end)
@@ -31,30 +31,30 @@ char *i_strdup_until(const void *str, const void *end)
 
 char *i_strndup(const void *str, size_t max_chars)
 {
-        return p_strndup(default_pool, str, max_chars);
+       return p_strndup(default_pool, str, max_chars);
 }
 
 char *i_strdup_printf(const char *format, ...)
 {
        va_list args;
-        char *ret;
+       char *ret;
 
-        va_start(args, format);
+       va_start(args, format);
        ret = p_strdup_vprintf(default_pool, format, args);
        va_end(args);
-        return ret;
+       return ret;
 }
 
 char *i_strdup_vprintf(const char *format, va_list args)
 {
-        return p_strdup_vprintf(default_pool, format, args);
+       return p_strdup_vprintf(default_pool, format, args);
 }
 
 char *i_strconcat(const char *str1, ...)
 {
        va_list args;
        char *ret;
-        size_t len;
+       size_t len;
 
        va_start(args, str1);
 
@@ -71,5 +71,5 @@ char *i_strconcat(const char *str1, ...)
        } T_END;
 
        va_end(args);
-        return ret;
+       return ret;
 }
index 04f85aec03911c56a613fcdcf078746bcd7dc321..f6ee06d1888aa47c215937f7ad196c9c2689a9f1 100644 (file)
@@ -294,7 +294,7 @@ static void pool_alloconly_free(pool_t pool, void *mem)
             apool->block->last_alloc_size) == mem) {
                memset(mem, 0, apool->block->last_alloc_size);
                apool->block->left += apool->block->last_alloc_size;
-                apool->block->last_alloc_size = 0;
+               apool->block->last_alloc_size = 0;
        }
 }
 
@@ -342,7 +342,7 @@ static void *pool_alloconly_realloc(pool_t pool, void *mem,
                mem = new_mem;
        }
 
-        return mem;
+       return mem;
 }
 
 static void pool_alloconly_clear(pool_t pool)
index 5b0a40de4f850216a3f37b6275962c6c6e9555b5..d7bda6e447a9fd00a7292b25fc59b29eef7cefca 100644 (file)
@@ -136,11 +136,11 @@ static void *pool_system_realloc(pool_t pool ATTR_UNUSED, void *mem,
        }
 
        if (old_size < new_size) {
-                /* clear new data */
+               /* clear new data */
                memset((char *) mem + old_size, 0, new_size - old_size);
        }
 
-        return mem;
+       return mem;
 }
 
 static void ATTR_NORETURN
index 4db47359a408332682454b4c16f6102d9f456d33..aa2d34b2f0fad22a33210c2f7a0559dbcf7c5fb5 100644 (file)
@@ -88,8 +88,8 @@ p_realloc(pool_t pool, void *mem, size_t old_size, size_t new_size)
    in some "optimization".. */
 #define p_free(pool, mem) \
        STMT_START { \
-          p_free_internal(pool, mem); \
-          (mem) = NULL; \
+               p_free_internal(pool, mem);     \
+               (mem) = NULL;                   \
        } STMT_END
 
 /* A macro that's guaranteed to set mem = NULL. */