[dovecot-cvs] dovecot/src/lib hash.c,1.24,1.25 hash.h,1.14,1.15

cras at dovecot.org cras at dovecot.org
Tue Jan 17 16:03:47 EET 2006


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv6482

Modified Files:
	hash.c hash.h 
Log Message:
size_t -> unsigned int. It's enough.



Index: hash.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/hash.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- hash.c	14 Jan 2006 18:47:22 -0000	1.24
+++ hash.c	17 Jan 2006 14:03:45 -0000	1.25
@@ -20,9 +20,9 @@
 	pool_t table_pool, node_pool;
 
 	int frozen;
-	size_t initial_size, nodes_count, removed_count;
+	unsigned int initial_size, nodes_count, removed_count;
 
-	size_t size;
+	unsigned int size;
 	struct hash_node *nodes;
 	struct hash_node *free_nodes;
 
@@ -33,7 +33,7 @@
 struct hash_iterate_context {
 	struct hash_table *table;
 	struct hash_node *next;
-	size_t pos;
+	unsigned int pos;
 };
 
 static bool hash_resize(struct hash_table *table, bool grow);
@@ -50,7 +50,7 @@
 }
 
 struct hash_table *
-hash_create(pool_t table_pool, pool_t node_pool, size_t initial_size,
+hash_create(pool_t table_pool, pool_t node_pool, unsigned int initial_size,
 	    hash_callback_t *hash_cb, hash_cmp_callback_t *key_compare_cb)
 {
 	struct hash_table *table;
@@ -95,7 +95,7 @@
 
 static void hash_destroy_nodes(struct hash_table *table)
 {
-	size_t i;
+	unsigned int i;
 
 	for (i = 0; i < table->size; i++) {
 		if (table->nodes[i].next != NULL)
@@ -297,7 +297,7 @@
 
 static void hash_compress_removed(struct hash_table *table)
 {
-	size_t i;
+	unsigned int i;
 
 	for (i = 0; i < table->size; i++)
 		hash_compress(table, &table->nodes[i]);
@@ -325,7 +325,7 @@
 		hash_compress(table, &table->nodes[hash % table->size]);
 }
 
-size_t hash_size(const struct hash_table *table)
+unsigned int hash_size(const struct hash_table *table)
 {
 	return table->nodes_count;
 }
@@ -405,7 +405,7 @@
 static bool hash_resize(struct hash_table *table, bool grow)
 {
 	struct hash_node *old_nodes, *node, *next;
-	size_t next_size, old_size, i;
+	unsigned int next_size, old_size, i;
 	float nodes_per_list;
 
         nodes_per_list = (float) table->nodes_count / (float) table->size;

Index: hash.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/hash.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- hash.h	14 Jan 2006 18:47:22 -0000	1.14
+++ hash.h	17 Jan 2006 14:03:45 -0000	1.15
@@ -13,7 +13,7 @@
    for smaller allocations and can also be alloconly pool. The pools must not
    be free'd before hash_destroy() is called. */
 struct hash_table *
-hash_create(pool_t table_pool, pool_t node_pool, size_t initial_size,
+hash_create(pool_t table_pool, pool_t node_pool, unsigned int initial_size,
 	    hash_callback_t *hash_cb, hash_cmp_callback_t *key_compare_cb);
 void _hash_destroy(struct hash_table **table);
 #define hash_destroy(table) _hash_destroy(&(table))
@@ -32,7 +32,7 @@
 void hash_update(struct hash_table *table, void *key, void *value);
 
 void hash_remove(struct hash_table *table, const void *key);
-size_t hash_size(const struct hash_table *table);
+unsigned int hash_size(const struct hash_table *table);
 
 /* Iterates through all nodes in hash table. You may safely call hash_*()
    functions while iterating, but if you add any new nodes, they may or may



More information about the dovecot-cvs mailing list