[dovecot-cvs] dovecot/src/lib-settings settings.h,1.5,1.6

tss at dovecot.org tss at dovecot.org
Fri Dec 15 18:10:59 UTC 2006


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

Modified Files:
	settings.h 
Log Message:
Type safe callbacks weren't as easy as I thought. Only callback(void
*context) can be handled generically. Others can be handled specially, but
only if all the parameters are pointers, otherwise eg. int parameter can be
replaced with long without compiler giving any warnings.



Index: settings.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-settings/settings.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- settings.h	15 Dec 2006 16:55:42 -0000	1.5
+++ settings.h	15 Dec 2006 18:10:57 -0000	1.6
@@ -32,10 +32,15 @@
 		   settings_section_callback_t *sect_callback, void *context);
 #ifdef CONTEXT_TYPE_SAFETY
 #  define settings_read(path, section, callback, sect_callback, context) \
-	({(void)(1 ? 0 : callback(0, 0, context)); \
-	  (void)(1 ? 0 : sect_callback(0, 0, context, 0)); \
+	({(void)(1 ? 0 : callback((const char *)0, (const char *)0, context)); \
+	  (void)(1 ? 0 : sect_callback((const char *)0, (const char *)0, \
+				       context, (const char **)0)); \
 	  settings_read(path, section, (settings_callback_t *)callback, \
 		(settings_section_callback_t *)sect_callback, context); })
+#else
+#  define settings_read(path, section, callback, sect_callback, context) \
+	  settings_read(path, section, (settings_callback_t *)callback, \
+		(settings_section_callback_t *)sect_callback, context)
 #endif
 
 #endif



More information about the dovecot-cvs mailing list