changeset 330:1b503c732877 HEAD

more ANSI-C fixes.
author Timo Sirainen <tss@iki.fi>
date Sun, 29 Sep 2002 20:47:41 +0300
parents 39c9a9fc190b
children 0903ba071661
files src/lib/mempool-alloconly.c src/lib/mempool-system.c
diffstat 2 files changed, 39 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/mempool-alloconly.c	Sun Sep 29 20:42:00 2002 +0300
+++ b/src/lib/mempool-alloconly.c	Sun Sep 29 20:47:41 2002 +0300
@@ -66,11 +66,28 @@
 } PoolAlloc;
 #define SIZEOF_POOLALLOC (sizeof(PoolAlloc)-MEM_ALIGN_SIZE)
 
-static struct Pool static_alloconly_pool;
+static void pool_alloconly_ref(Pool pool);
+static void pool_alloconly_unref(Pool pool);
+static void *pool_alloconly_malloc(Pool pool, size_t size);
+static void pool_alloconly_free(Pool pool, void *mem);
+static void *pool_alloconly_realloc(Pool pool, void *mem, size_t size);
+static void *pool_alloconly_realloc_min(Pool pool, void *mem, size_t size);
 static void pool_alloconly_clear(Pool pool);
 
 static void block_alloc(AlloconlyPool *pool, size_t size);
-static void *pool_alloconly_realloc_min(Pool pool, void *mem, size_t size);
+
+static struct Pool static_alloconly_pool = {
+	pool_alloconly_ref,
+	pool_alloconly_unref,
+
+	pool_alloconly_malloc,
+	pool_alloconly_free,
+
+	pool_alloconly_realloc,
+	pool_alloconly_realloc_min,
+
+	pool_alloconly_clear
+};
 
 Pool pool_alloconly_create(const char *name, size_t size)
 {
@@ -241,16 +258,3 @@
 
 	apool->last_alloc_size = 0;
 }
-
-static struct Pool static_alloconly_pool = {
-	pool_alloconly_ref,
-	pool_alloconly_unref,
-
-	pool_alloconly_malloc,
-	pool_alloconly_free,
-
-	pool_alloconly_realloc,
-	pool_alloconly_realloc_min,
-
-	pool_alloconly_clear
-};
--- a/src/lib/mempool-system.c	Sun Sep 29 20:42:00 2002 +0300
+++ b/src/lib/mempool-system.c	Sun Sep 29 20:47:41 2002 +0300
@@ -38,7 +38,26 @@
 	/* void data[]; */
 } PoolAlloc;
 
-static struct Pool static_system_pool;
+static void pool_system_ref(Pool pool);
+static void pool_system_unref(Pool pool);
+static void *pool_system_malloc(Pool pool, size_t size);
+static void pool_system_free(Pool pool, void *mem);
+static void *pool_system_realloc(Pool pool, void *mem, size_t size);
+static void *pool_system_realloc_min(Pool pool, void *mem, size_t size);
+static void pool_system_clear(Pool pool);
+
+static struct Pool static_system_pool = {
+	pool_system_ref,
+	pool_system_unref,
+
+	pool_system_malloc,
+	pool_system_free,
+
+	pool_system_realloc,
+	pool_system_realloc_min,
+
+	pool_system_clear
+};
 
 Pool system_pool = &static_system_pool;
 
@@ -125,16 +144,3 @@
 {
 	i_panic("pool_system_clear() must not be called");
 }
-
-static struct Pool static_system_pool = {
-	pool_system_ref,
-	pool_system_unref,
-
-	pool_system_malloc,
-	pool_system_free,
-
-	pool_system_realloc,
-	pool_system_realloc_min,
-
-	pool_system_clear
-};