dovecot-2.2: lib: array - array_foreach_idx is just a generic pt...

dovecot at dovecot.org dovecot at dovecot.org
Fri Nov 28 08:58:08 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/67b46a7f4ed2
changeset: 18118:67b46a7f4ed2
user:      Phil Carmody <phil at dovecot.fi>
date:      Fri Nov 28 10:57:43 2014 +0200
description:
lib: array - array_foreach_idx is just a generic ptr_to_idx helper
Signed-off-by: Phil Carmody <phil at dovecot.fi>

diffstat:

 src/lib/array.h |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r 8a4b536705ad -r 67b46a7f4ed2 src/lib/array.h
--- a/src/lib/array.h	Fri Nov 28 10:57:43 2014 +0200
+++ b/src/lib/array.h	Fri Nov 28 10:57:43 2014 +0200
@@ -82,8 +82,10 @@
 	     (elem)++)
 #endif
 
+#define array_ptr_to_idx(array, elem) \
+	((elem) - (array)->v[0])
 #define array_foreach_idx(array, elem) \
-	((elem) - (array)->v[0])
+	array_ptr_to_idx(array, elem)
 
 static inline void
 array_create_from_buffer_i(struct array *array, buffer_t *buffer,


More information about the dovecot-cvs mailing list