dovecot-2.2: Fixed some aliasing warnings with hash table API.

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 20 10:20:05 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/44013be2e3d8
changeset: 14925:44013be2e3d8
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 20 10:19:57 2012 +0300
description:
Fixed some aliasing warnings with hash table API.

diffstat:

 src/lib/hash.h |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (32 lines):

diff -r 6c55e57c98a1 -r 44013be2e3d8 src/lib/hash.h
--- a/src/lib/hash.h	Mon Aug 20 10:01:03 2012 +0300
+++ b/src/lib/hash.h	Mon Aug 20 10:19:57 2012 +0300
@@ -85,10 +85,10 @@
 #define hash_table_lookup_full(table, lookup_key, orig_key_r, value_r) \
 	hash_table_lookup_full((table)._table, \
 		(void *)((const char *)(lookup_key) + COMPILE_ERROR_IF_TYPES2_NOT_COMPATIBLE((table)._const_key, (table)._key, lookup_key)), \
-		(void **)(orig_key_r) + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE((table)._keyp, orig_key_r) + \
-			COMPILE_ERROR_IF_TRUE(sizeof(*orig_key_r) != sizeof(void *)), \
-		(void **)(value_r) + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE((table)._valuep, value_r) + \
-			COMPILE_ERROR_IF_TRUE(sizeof(*value_r) != sizeof(void *)))
+		(void **)(void *)((orig_key_r) + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE((table)._keyp, orig_key_r) + \
+			COMPILE_ERROR_IF_TRUE(sizeof(*orig_key_r) != sizeof(void *))), \
+		(void **)(void *)((value_r) + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE((table)._valuep, value_r) + \
+			COMPILE_ERROR_IF_TRUE(sizeof(*value_r) != sizeof(void *))))
 
 /* Insert/update node in hash table. The difference is that hash_table_insert()
    replaces the key in table to given one, while hash_table_update() doesnt. */
@@ -121,10 +121,10 @@
 			void **key_r, void **value_r);
 #define hash_table_iterate(ctx, table, key_r, value_r) \
 	hash_table_iterate(ctx, \
-		(void **)(key_r) + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE((table)._keyp, key_r) + \
+		(void **)(void *)((key_r) + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE((table)._keyp, key_r) + \
 			COMPILE_ERROR_IF_TRUE(sizeof(*key_r) != sizeof(void *)) + \
-			COMPILE_ERROR_IF_TRUE(sizeof(*value_r) != sizeof(void *)), \
-		(void **)(value_r) + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE((table)._valuep, value_r))
+			COMPILE_ERROR_IF_TRUE(sizeof(*value_r) != sizeof(void *))), \
+		(void **)(void *)((value_r) + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE((table)._valuep, value_r)))
 void hash_table_iterate_deinit(struct hash_iterate_context **ctx);
 
 /* Hash table isn't resized, and removed nodes aren't removed from


More information about the dovecot-cvs mailing list