[dovecot-cvs] dovecot/src/lib array.h,1.1,1.2

cras at dovecot.org cras at dovecot.org
Sat Mar 12 20:32:10 EET 2005


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

Modified Files:
	array.h 
Log Message:
Updated example code, it was using older API..



Index: array.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/array.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- array.h	12 Mar 2005 18:15:48 -0000	1.1
+++ array.h	12 Mar 2005 18:32:08 -0000	1.2
@@ -18,11 +18,11 @@
 	...
    };
 
-   ARRAY_CREATE(foo->bars, default_pool, struct bar, 10);
-   ARRAY_CREATE(foo->bars, default_pool, struct baz, 10); // compiler error
+   ARRAY_CREATE(&foo->bars, default_pool, struct bar, 10);
+   ARRAY_CREATE(&foo->bars, default_pool, struct baz, 10); // compiler warning
 
-   struct bar *bar = ARRAY_IDX(foo->bars, 5);
-   struct baz *baz = ARRAY_IDX(foo->bars, 5); // compiler warning
+   struct bar *bar = array_idx(&foo->bars, 5);
+   struct baz *baz = array_idx(&foo->bars, 5); // compiler warning
 */
 #if defined (DEBUG) && defined (__GNUC__)
 #  define ARRAY_DEFINE(name, array_type) name; array_type *name ## __ ## type



More information about the dovecot-cvs mailing list