[dovecot-cvs] dovecot/src/lib hash.c,1.5,1.6 hash.h,1.2,1.3

cras at procontrol.fi cras at procontrol.fi
Tue Nov 26 22:35:49 EET 2002


Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv11194/lib

Modified Files:
	hash.c hash.h 
Log Message:
Removed const from key and value of hash_insert() and hash_update().



Index: hash.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/hash.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- hash.c	8 Sep 2002 15:34:27 -0000	1.5
+++ hash.c	26 Nov 2002 20:35:47 -0000	1.6
@@ -66,14 +66,13 @@
 	return POINTER_CAST_TO(p, unsigned int);
 }
 
-static HashNode *hash_node_create(Pool pool, const void *key,
-				  const void *value)
+static HashNode *hash_node_create(Pool pool, void *key, void *value)
 {
 	HashNode *node;
 
         node = p_new(pool, HashNode, 1);
-	node->key = (void *) key;
-	node->value = (void *) value;
+	node->key = key;
+	node->value = value;
 
 	return node;
 }
@@ -189,8 +188,8 @@
 	return TRUE;
 }
 
-static void hash_insert_full(HashTable *table, const void *key,
-			     const void *value, int replace_key)
+static void hash_insert_full(HashTable *table, void *key, void *value,
+			     int replace_key)
 {
 	HashNode **node;
 
@@ -205,20 +204,20 @@
 			hash_resize(table);
 	} else {
 		if (replace_key || (*node)->destroyed) {
-			(*node)->key = (void *) key;
+			(*node)->key = key;
 			(*node)->destroyed = FALSE;
 		}
 
-		(*node)->value = (void *) value;
+		(*node)->value = value;
 	}
 }
 
-void hash_insert(HashTable *table, const void *key, const void *value)
+void hash_insert(HashTable *table, void *key, void *value)
 {
 	hash_insert_full(table, key, value, TRUE);
 }
 
-void hash_update(HashTable *table, const void *key, const void *value)
+void hash_update(HashTable *table, void *key, void *value)
 {
 	hash_insert_full(table, key, value, FALSE);
 }

Index: hash.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/hash.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hash.h	22 Aug 2002 12:48:38 -0000	1.2
+++ hash.h	26 Nov 2002 20:35:47 -0000	1.3
@@ -30,8 +30,8 @@
 
 /* Insert/update node in hash table. The difference is that hash_insert()
    replaces the key in table to given one, while hash_update() doesnt. */
-void hash_insert(HashTable *table, const void *key, const void *value);
-void hash_update(HashTable *table, const void *key, const void *value);
+void hash_insert(HashTable *table, void *key, void *value);
+void hash_update(HashTable *table, void *key, void *value);
 
 void hash_remove(HashTable *table, const void *key);
 unsigned int hash_size(HashTable *table);




More information about the dovecot-cvs mailing list