[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dovecot-cvs
Subject:    dovecot-2.2: lib: array - array_foreach_idx is just a generic pt...
From:       dovecot () dovecot ! org (dovecot at dovecot ! org)
Date:       2014-11-28 8:58:08
Message-ID: hg.67b46a7f4ed2.1417165088.6920021320469856403 () talvi
[Download RAW message or body]

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,

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic