]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Fix buffer_t aliasing problems with LTO
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 1 Apr 2021 18:42:02 +0000 (21:42 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 13 Apr 2021 11:52:27 +0000 (11:52 +0000)
This changes the buffer_t slightly, which requires adding extra braces
when buffer_t contents are directly defined.

This changes Dovecot to require C11 compatible compiler, because it uses
anonymous union and struct. GNU99 extensions are also enough.

32 files changed:
src/anvil/anvil-settings.c
src/auth/auth-settings.c
src/config/config-settings.c
src/config/settings-get.pl
src/dict/dict-settings.c
src/director/director-settings.c
src/dns/dns-client-settings.c
src/doveadm/doveadm-settings.c
src/imap-hibernate/imap-hibernate-settings.c
src/imap-login/imap-login-settings.c
src/imap-urlauth/imap-urlauth-login-settings.c
src/imap-urlauth/imap-urlauth-settings.c
src/imap-urlauth/imap-urlauth-worker-settings.c
src/imap/imap-settings.c
src/indexer/indexer-settings.c
src/indexer/indexer-worker-settings.c
src/ipc/ipc-settings.c
src/lib/buffer.c
src/lib/buffer.h
src/lib/test-buffer.c
src/lmtp/lmtp-settings.c
src/log/log-settings.c
src/old-stats/stats-settings.c
src/plugins/fts-lucene/Snowball.cc
src/plugins/fts-lucene/lucene-wrapper.cc
src/pop3-login/pop3-login-settings.c
src/pop3/pop3-settings.c
src/replication/aggregator/aggregator-settings.c
src/replication/replicator/replicator-settings.c
src/stats/stats-settings.c
src/submission-login/submission-login-settings.c
src/submission/submission-settings.c

index a6cac93a5df8c863f993cf57b9122394c0ae378c..a94823e02fc1de0eca8bec87bb9ced9783da9d11 100644 (file)
@@ -17,7 +17,7 @@ static struct file_listener_settings *anvil_unix_listeners[] = {
        &anvil_unix_listeners_array[1]
 };
 static buffer_t anvil_unix_listeners_buf = {
-       anvil_unix_listeners, sizeof(anvil_unix_listeners), { NULL, }
+       { { anvil_unix_listeners, sizeof(anvil_unix_listeners) } }
 };
 /* </settings checks> */
 
index d9db5db1f83c50a3924f3b19f078d889425981be..241e775b63c98dd0a91dfc6d5d5a969dc39f8ece 100644 (file)
@@ -33,7 +33,7 @@ static struct file_listener_settings *auth_unix_listeners[] = {
        &auth_unix_listeners_array[5]
 };
 static buffer_t auth_unix_listeners_buf = {
-       auth_unix_listeners, sizeof(auth_unix_listeners), { NULL, }
+       { { auth_unix_listeners, sizeof(auth_unix_listeners) } }
 };
 /* </settings checks> */
 
@@ -73,7 +73,7 @@ static struct file_listener_settings *auth_worker_unix_listeners[] = {
        &auth_worker_unix_listeners_array[0]
 };
 static buffer_t auth_worker_unix_listeners_buf = {
-       auth_worker_unix_listeners, sizeof(auth_worker_unix_listeners), { NULL, }
+       { { auth_worker_unix_listeners, sizeof(auth_worker_unix_listeners) } }
 };
 /* </settings checks> */
 
index 2b1fe9e8b26ed55d2474e7dfea4a2ed28fa2c949..d19fe4ec6c4bdf34ec49c76e97f76799f16e27c3 100644 (file)
@@ -15,7 +15,7 @@ static struct file_listener_settings *config_unix_listeners[] = {
        &config_unix_listeners_array[0]
 };
 static buffer_t config_unix_listeners_buf = {
-       config_unix_listeners, sizeof(config_unix_listeners), { NULL, }
+       { { config_unix_listeners, sizeof(config_unix_listeners) } }
 };
 /* </settings checks> */
 
index e28d356980d8b6d7a76934af1387d42281d4c544..eec117fd1fdc5b08f66794a08d026c1119dc805a 100755 (executable)
@@ -140,7 +140,7 @@ for (my $i = 0; $i < scalar(@services); $i++) {
 }
 print "};\n";
 print "buffer_t config_all_services_buf = {\n";
-print "\tconfig_all_services, sizeof(config_all_services), { NULL, }\n";
+print "\t{ { config_all_services, sizeof(config_all_services) } }\n";
 print "};\n";
 
 print "const struct setting_parser_info *all_default_roots[] = {\n";
index 01e9f15c3fec3ee8550965f49cb1ee9b7953819c..23c33f63df78f4b232e0cc953480c0113bebe86c 100644 (file)
@@ -14,7 +14,7 @@ static struct file_listener_settings *dict_unix_listeners[] = {
        &dict_unix_listeners_array[0]
 };
 static buffer_t dict_unix_listeners_buf = {
-       dict_unix_listeners, sizeof(dict_unix_listeners), { NULL, }
+       { { dict_unix_listeners, sizeof(dict_unix_listeners) } }
 };
 
 static struct file_listener_settings dict_async_unix_listeners_array[] = {
@@ -24,7 +24,7 @@ static struct file_listener_settings *dict_async_unix_listeners[] = {
        &dict_async_unix_listeners_array[0]
 };
 static buffer_t dict_async_unix_listeners_buf = {
-       dict_async_unix_listeners, sizeof(dict_async_unix_listeners), { NULL, }
+       { { dict_async_unix_listeners, sizeof(dict_async_unix_listeners) } }
 };
 /* </settings checks> */
 
index a43eb6f13f4592aedace16d64da4d10aa23b243a..f74d68354d664a16d31f08b7d75e806c39066989 100644 (file)
@@ -18,8 +18,7 @@ static struct file_listener_settings *director_unix_listeners[] = {
        &director_unix_listeners_array[1]
 };
 static buffer_t director_unix_listeners_buf = {
-       director_unix_listeners,
-       sizeof(director_unix_listeners), { NULL, }
+       { { director_unix_listeners, sizeof(director_unix_listeners) } }
 };
 static struct file_listener_settings director_fifo_listeners_array[] = {
        { "login/proxy-notify", 0, "", "" }
@@ -28,8 +27,7 @@ static struct file_listener_settings *director_fifo_listeners[] = {
        &director_fifo_listeners_array[0]
 };
 static buffer_t director_fifo_listeners_buf = {
-       director_fifo_listeners,
-       sizeof(director_fifo_listeners), { NULL, }
+       { { director_fifo_listeners, sizeof(director_fifo_listeners) } }
 };
 /* </settings checks> */
 
index 1fd36f0666ad6f1fa7170bb8a9e0a8853c8f9281..082e73523ade350ac6ec8ad853e94bcdbadf57a6 100644 (file)
@@ -17,7 +17,7 @@ static struct file_listener_settings *dns_client_unix_listeners[] = {
         &dns_client_unix_listeners_array[1],
 };
 static buffer_t dns_client_unix_listeners_buf = {
-       dns_client_unix_listeners, sizeof(dns_client_unix_listeners), { NULL, }
+       { { dns_client_unix_listeners, sizeof(dns_client_unix_listeners) } }
 };
 /* </settings checks> */
 
index e39f0060059f265ac5a0d5bae86b969164e8fd76..35cce5cdb0ebbb3fc1004f6e5d777a6877ea0ae7 100644 (file)
@@ -21,7 +21,7 @@ static struct file_listener_settings *doveadm_unix_listeners[] = {
        &doveadm_unix_listeners_array[0]
 };
 static buffer_t doveadm_unix_listeners_buf = {
-       doveadm_unix_listeners, sizeof(doveadm_unix_listeners), { NULL, }
+       { { doveadm_unix_listeners, sizeof(doveadm_unix_listeners) } }
 };
 /* </settings checks> */
 
index 368364871b8cb0a6b1b03fecbff787799f4e23b5..d7618c02483b9fb18ff5191bd27d00243ea179e1 100644 (file)
@@ -16,7 +16,7 @@ static struct file_listener_settings *imap_hibernate_unix_listeners[] = {
        &imap_hibernate_unix_listeners_array[0]
 };
 static buffer_t imap_hibernate_unix_listeners_buf = {
-       imap_hibernate_unix_listeners, sizeof(imap_hibernate_unix_listeners), { NULL, }
+       { { imap_hibernate_unix_listeners, sizeof(imap_hibernate_unix_listeners) } }
 };
 /* </settings checks> */
 
index f3715f2ba8812f8565f3ce7f65d46aa08fb9a58b..74ab65c7b8fbebfe79e61b5818547d3e5b67eb26 100644 (file)
@@ -19,7 +19,7 @@ static struct inet_listener_settings *imap_login_inet_listeners[] = {
        &imap_login_inet_listeners_array[1]
 };
 static buffer_t imap_login_inet_listeners_buf = {
-       imap_login_inet_listeners, sizeof(imap_login_inet_listeners), { NULL, }
+       { { imap_login_inet_listeners, sizeof(imap_login_inet_listeners) } }
 };
 /* </settings checks> */
 
index e3e700cbc98a30c54ccd6b8731423e1df6f6a772..3dc41f69c0f41bba819903b1a92dbbf2b9491dac 100644 (file)
@@ -18,8 +18,8 @@ static struct file_listener_settings *imap_urlauth_login_unix_listeners[] = {
        &imap_urlauth_login_unix_listeners_array[0]
 };
 static buffer_t imap_urlauth_login_unix_listeners_buf = {
-       imap_urlauth_login_unix_listeners,
-               sizeof(imap_urlauth_login_unix_listeners), { NULL, }
+       { { imap_urlauth_login_unix_listeners,
+           sizeof(imap_urlauth_login_unix_listeners) } }
 };
 /* </settings checks> */
 
index 56fb2670465ed033c6fb220f0b684ca0272d2cc8..73c3220cce3ba3d357457249784d491e14cfc747 100644 (file)
@@ -17,7 +17,7 @@ static struct file_listener_settings *imap_urlauth_unix_listeners[] = {
        &imap_urlauth_unix_listeners_array[0]
 };
 static buffer_t imap_urlauth_unix_listeners_buf = {
-       imap_urlauth_unix_listeners, sizeof(imap_urlauth_unix_listeners), { NULL, }
+       { { imap_urlauth_unix_listeners, sizeof(imap_urlauth_unix_listeners) } }
 };
 /* </settings checks> */
 
index 7eef397f496a2d96d278fc95117ec72f21b6a84d..a459aed601f15d7deff7dfb477d12d67d8fc8f47 100644 (file)
@@ -18,7 +18,8 @@ static struct file_listener_settings *imap_urlauth_worker_unix_listeners[] = {
        &imap_urlauth_worker_unix_listeners_array[0]
 };
 static buffer_t imap_urlauth_worker_unix_listeners_buf = {
-       imap_urlauth_worker_unix_listeners, sizeof(imap_urlauth_worker_unix_listeners), { NULL, }
+       { { imap_urlauth_worker_unix_listeners,
+           sizeof(imap_urlauth_worker_unix_listeners) } }
 };
 /* </settings checks> */
 
index 71dcb745911909e8da20d99ebab0d7f10d9f788d..2acf9dd8edbebfd08c738906f581e08a74af21e0 100644 (file)
@@ -25,7 +25,7 @@ static struct file_listener_settings *imap_unix_listeners[] = {
        &imap_unix_listeners_array[1]
 };
 static buffer_t imap_unix_listeners_buf = {
-       imap_unix_listeners, sizeof(imap_unix_listeners), { NULL, }
+       { { imap_unix_listeners, sizeof(imap_unix_listeners) } }
 };
 /* </settings checks> */
 
index 3363f72f01b9a176e92192eb1a7a8ff7441fe490..837582972b1cd31855ffe64890fe151b646955da 100644 (file)
@@ -17,7 +17,7 @@ static struct file_listener_settings *indexer_unix_listeners[] = {
        &indexer_unix_listeners_array[0]
 };
 static buffer_t indexer_unix_listeners_buf = {
-       indexer_unix_listeners, sizeof(indexer_unix_listeners), { NULL, }
+       { { indexer_unix_listeners, sizeof(indexer_unix_listeners) } }
 };
 /* </settings checks> */
 
index 6d4caf3f46c9024437f469be757f76454d904554..8627954cba6ae3b4211f683cabc7b6f509b26afa 100644 (file)
@@ -15,7 +15,7 @@ static struct file_listener_settings *indexer_worker_unix_listeners[] = {
        &indexer_worker_unix_listeners_array[0]
 };
 static buffer_t indexer_worker_unix_listeners_buf = {
-       indexer_worker_unix_listeners, sizeof(indexer_worker_unix_listeners), { NULL, }
+       { { indexer_worker_unix_listeners, sizeof(indexer_worker_unix_listeners) } }
 };
 /* </settings checks> */
 
index ec191ac1898284879f198eb28c098ba413e90011..664565c62052ef3ab846f71b61dd67c7602cc89c 100644 (file)
@@ -17,7 +17,7 @@ static struct file_listener_settings *ipc_unix_listeners[] = {
        &ipc_unix_listeners_array[1]
 };
 static buffer_t ipc_unix_listeners_buf = {
-       ipc_unix_listeners, sizeof(ipc_unix_listeners), { NULL, }
+       { { ipc_unix_listeners, sizeof(ipc_unix_listeners) } }
 };
 /* </settings checks> */
 
index 195910fb68a7fecd70affc35da3e0ae1d4676bd3..71e6a5758ea2b96e33b705293c1ae93db5fd47cd 100644 (file)
@@ -6,18 +6,22 @@
 #include "buffer.h"
 
 struct real_buffer {
-       /* public: */
-       const void *r_buffer;
-       size_t used;
-
-       /* private: */
-       unsigned char *w_buffer;
-       size_t dirty, alloc, max_size;
-
-       pool_t pool;
-
-       bool alloced:1;
-       bool dynamic:1;
+       union {
+               struct buffer buf;
+               struct {
+                       /* public: */
+                       const void *r_buffer;
+                       size_t used;
+                       /* private: */
+                       unsigned char *w_buffer;
+                       size_t dirty, alloc, max_size;
+
+                       pool_t pool;
+
+                       bool alloced:1;
+                       bool dynamic:1;
+               };
+       };
 };
 typedef int buffer_check_sizes[COMPILE_ERROR_IF_TRUE(sizeof(struct real_buffer) > sizeof(buffer_t)) ?1:1];
 
index f28969d276a3ec632d8d7f9661857822f2629679..6472183ee2db8c1aceb78f5f661de1b4c408e285 100644 (file)
@@ -2,9 +2,13 @@
 #define BUFFER_H
 
 struct buffer {
-       const void *data;
-       const size_t used;
-       void *priv[6];
+       union {
+               struct {
+                       const void *data;
+                       const size_t used;
+               };
+               void *priv[8];
+       };
 };
 
 /* WARNING: Be careful with functions that return pointers to data.
index 0574cef1a4b62d0b902fd36997ab768c78a3863e..50a2e92da5a1ca11f742d54a02e413ecc2de4975 100644 (file)
@@ -235,52 +235,52 @@ static void test_buffer_truncate_bits(void)
                size_t bits;
                buffer_t output;
        } test_cases[] = {
-                { { "\xff\xff\xff", 3, {0} },  0, { "",  0, {0} } },
-                { { "\xff\xff\xff", 3, {0} },  1, { "\x01", 1, {0} } },
-                { { "\xff\xff\xff", 3, {0} },  2, { "\x03", 1, {0} } },
-                { { "\xff\xff\xff", 3, {0} },  3, { "\x07", 1, {0} } },
-                { { "\xff\xff\xff", 3, {0} },  4, { "\x0f", 1, {0} } },
-                { { "\xff\xff\xff", 3, {0} },  5, { "\x1f", 1, {0} } },
-                { { "\xff\xff\xff", 3, {0} },  6, { "\x3f", 1, {0} } },
-                { { "\xff\xff\xff", 3, {0} },  7, { "\x7f", 1, {0} } },
-                { { "\xff\xff\xff", 3, {0} },  8, { "\xff", 1, {0} } },
-                { { "\xff\xff\xff", 3, {0} },  9, { "\x01\xff", 2, {0} } },
-                { { "\xff\xff\xff", 3, {0} }, 10, { "\x03\xff", 2, {0} } },
-                { { "\xff\xff\xff", 3, {0} }, 11, { "\x07\xff", 2, {0} } },
-                { { "\xff\xff\xff", 3, {0} }, 12, { "\x0f\xff", 2, {0} } },
-                { { "\xff\xff\xff", 3, {0} }, 13, { "\x1f\xff", 2, {0} } },
-                { { "\xff\xff\xff", 3, {0} }, 14, { "\x3f\xff", 2, {0} } },
-                { { "\xff\xff\xff", 3, {0} }, 15, { "\x7f\xff", 2, {0} } },
-                { { "0123456789", 10, {0} }, 16, { "01",  2, {0} } },
-                { { "0123456789", 10, {0} }, 24, { "012",  3, {0} } },
-                { { "0123456789", 10, {0} }, 32, { "0123",  4, {0} } },
-                { { "0123456789", 10, {0} }, 40, { "01234",  5, {0} } },
-                { { "0123456789", 10, {0} }, 48, { "012345",  6, {0} } },
-                { { "0123456789", 10, {0} }, 56, { "0123456",  7, {0} } },
-                { { "0123456789", 10, {0} }, 64, { "01234567",  8, {0} } },
-                { { "0123456789", 10, {0} }, 72, { "012345678",  9, {0} } },
-               { { "0123456789", 10, {0} }, 80, { "0123456789", 10, {0} } },
-
-               { { "\x58\x11\xed\x02\x4d\x87\x4a\xe2\x5c\xb2\xfa\x69\xf0\xa9\x46\x2e\x04\xca\x5d\x82", 20, {0} },
+               { { { { "\xff\xff\xff", 3 } } },  0, { { { "",  0 } } } },
+                { { { { "\xff\xff\xff", 3 } } },  1, { { { "\x01", 1 } } } },
+                { { { { "\xff\xff\xff", 3 } } },  2, { { { "\x03", 1 } } } },
+                { { { { "\xff\xff\xff", 3 } } },  3, { { { "\x07", 1 } } } },
+                { { { { "\xff\xff\xff", 3 } } },  4, { { { "\x0f", 1 } } } },
+                { { { { "\xff\xff\xff", 3 } } },  5, { { { "\x1f", 1 } } } },
+                { { { { "\xff\xff\xff", 3 } } },  6, { { { "\x3f", 1 } } } },
+                { { { { "\xff\xff\xff", 3 } } },  7, { { { "\x7f", 1 } } } },
+                { { { { "\xff\xff\xff", 3 } } },  8, { { { "\xff", 1 } } } },
+                { { { { "\xff\xff\xff", 3 } } },  9, { { { "\x01\xff", 2 } } } },
+                { { { { "\xff\xff\xff", 3 } } }, 10, { { { "\x03\xff", 2 } } } },
+                { { { { "\xff\xff\xff", 3 } } }, 11, { { { "\x07\xff", 2 } } } },
+                { { { { "\xff\xff\xff", 3 } } }, 12, { { { "\x0f\xff", 2 } } } },
+                { { { { "\xff\xff\xff", 3 } } }, 13, { { { "\x1f\xff", 2 } } } },
+                { { { { "\xff\xff\xff", 3 } } }, 14, { { { "\x3f\xff", 2 } } } },
+                { { { { "\xff\xff\xff", 3 } } }, 15, { { { "\x7f\xff", 2 } } } },
+                { { { { "0123456789", 10 } } }, 16, { { { "01",  2 } } } },
+                { { { { "0123456789", 10 } } }, 24, { { { "012",  3 } } } },
+                { { { { "0123456789", 10 } } }, 32, { { { "0123",  4 } } } },
+                { { { { "0123456789", 10 } } }, 40, { { { "01234",  5 } } } },
+                { { { { "0123456789", 10 } } }, 48, { { { "012345",  6 } } } },
+                { { { { "0123456789", 10 } } }, 56, { { { "0123456",  7 } } } },
+                { { { { "0123456789", 10 } } }, 64, { { { "01234567",  8 } } } },
+                { { { { "0123456789", 10 } } }, 72, { { { "012345678",  9 } } } },
+               { { { { "0123456789", 10 } } }, 80, { { { "0123456789", 10 } } } },
+
+               { { { { "\x58\x11\xed\x02\x4d\x87\x4a\xe2\x5c\xb2\xfa\x69\xf0\xa9\x46\x2e\x04\xca\x5d\x82", 20 } } },
                  13,
-                 { "\x0b\x02", 2, {0} }
+                 { { { "\x0b\x02", 2 } } }
                },
 
                /* special test cases for auth policy */
 
-               { { "\x34\x40\xc8\xc9\x3a\xb6\xe7\xc4\x3f\xc1\xc3\x4d\xd5\x56\xa3\xea\xfb\x5a\x33\x57\xac\x11\x39\x2c\x71\xcb\xee\xbb\xc8\x66\x2f\x64", 32, {0} },
+               { { { { "\x34\x40\xc8\xc9\x3a\xb6\xe7\xc4\x3f\xc1\xc3\x4d\xd5\x56\xa3\xea\xfb\x5a\x33\x57\xac\x11\x39\x2c\x71\xcb\xee\xbb\xc8\x66\x2f\x64", 32 } } },
                  12,
-                 { "\x03\x44", 2, {0} }
+                 { { { "\x03\x44", 2 } } }
                },
 
-               { { "\x49\xe5\x8a\x88\x76\xd3\x25\x68\xc9\x89\x4a\xe0\x64\xe4\x04\xf4\xf9\x13\xec\x88\x97\x47\x30\x7f\x3f\xcd\x8f\x74\x4f\x40\xd1\x25", 32, {0} },
+               { { { { "\x49\xe5\x8a\x88\x76\xd3\x25\x68\xc9\x89\x4a\xe0\x64\xe4\x04\xf4\xf9\x13\xec\x88\x97\x47\x30\x7f\x3f\xcd\x8f\x74\x4f\x40\xd1\x25", 32 } } },
                   12,
-                  { "\x04\x9e", 2, {0} }
+                 { { { "\x04\x9e", 2 } } }
                 },
 
-               { { "\x08\x3c\xdc\x14\x61\x80\x1c\xe8\x43\x81\x98\xfa\xc0\x64\x04\x7a\xa2\x73\x25\x6e\xe6\x4b\x85\x42\xd0\xe2\x78\xd7\x91\xb4\x89\x3f", 32, {0} },
+               { { { { "\x08\x3c\xdc\x14\x61\x80\x1c\xe8\x43\x81\x98\xfa\xc0\x64\x04\x7a\xa2\x73\x25\x6e\xe6\x4b\x85\x42\xd0\xe2\x78\xd7\x91\xb4\x89\x3f", 32 } } },
                   12,
-                  { "\x00\x83", 2, {0} }
+                 { { { "\x00\x83", 2 } } }
                 },
 
        };
index d5322ea3e5053cbfa7d87f7a22aed39fd6baa883..5cec2bea5ad0202745f166470c51b19b3327cf24 100644 (file)
@@ -24,7 +24,7 @@ static struct file_listener_settings *lmtp_unix_listeners[] = {
        &lmtp_unix_listeners_array[0]
 };
 static buffer_t lmtp_unix_listeners_buf = {
-       lmtp_unix_listeners, sizeof(lmtp_unix_listeners), { NULL, }
+       { { lmtp_unix_listeners, sizeof(lmtp_unix_listeners) } }
 };
 /* </settings checks> */
 
index c4fc978c04d64d5ede6c49cec509dce8ebac53fe..7c55544f457d5a3b3eaac5a4a100420b2e85ea00 100644 (file)
@@ -15,8 +15,7 @@ static struct file_listener_settings *log_unix_listeners[] = {
        &log_unix_listeners_array[0]
 };
 static buffer_t log_unix_listeners_buf = {
-       log_unix_listeners,
-       sizeof(log_unix_listeners), { NULL, }
+       { { log_unix_listeners, sizeof(log_unix_listeners) } }
 };
 /* </settings checks> */
 
index 72c61f6febc9eb6fd7d19faefb030833c8e3898e..3aa65af0c59571d8d8a0671aaf9805ca66034030 100644 (file)
@@ -14,7 +14,7 @@ static struct file_listener_settings *old_stats_unix_listeners[] = {
        &old_stats_unix_listeners_array[0]
 };
 static buffer_t old_stats_unix_listeners_buf = {
-       old_stats_unix_listeners, sizeof(old_stats_unix_listeners), { NULL, }
+       { { old_stats_unix_listeners, sizeof(old_stats_unix_listeners) } }
 };
 static struct file_listener_settings old_stats_fifo_listeners_array[] = {
        { "old-stats-mail", 0600, "", "" },
@@ -25,8 +25,7 @@ static struct file_listener_settings *old_stats_fifo_listeners[] = {
        &old_stats_fifo_listeners_array[1]
 };
 static buffer_t old_stats_fifo_listeners_buf = {
-       old_stats_fifo_listeners,
-       sizeof(old_stats_fifo_listeners), { NULL, }
+       { { old_stats_fifo_listeners, sizeof(old_stats_fifo_listeners) } }
 };
 /* </settings checks> */
 
index ca7f06bbc1f93d9c28af2661a00fc9d9f45c96e3..43b54e36e9fadae1a140e43f6bb28778d0c3ed28 100644 (file)
@@ -116,7 +116,7 @@ CL_NS_DEF2(analysis,snowball)
        unsigned char utf8text[LUCENE_MAX_WORD_LEN*5+1];
        unsigned int len = I_MIN(LUCENE_MAX_WORD_LEN, token->termLength());
 
-       buffer_t buf = { 0, 0, { 0, 0, 0, 0, 0 } };
+       buffer_t buf = { { 0, 0 } };
        i_assert(sizeof(wchar_t) == sizeof(unichar_t));
        buffer_create_from_data(&buf, utf8text, sizeof(utf8text));
        uni_ucs4_to_utf8((const unichar_t *)token->termBuffer(), len, &buf);
index 4e12a4402eb22b69271af516322fd34e43e8379d..744669386b7b208fbbfabc9fda9d3c1fe7415500 100644 (file)
@@ -215,7 +215,7 @@ void lucene_utf8_n_to_tchar(const unsigned char *src, size_t srcsize,
                            wchar_t *dest, size_t destsize)
 {
        ARRAY_TYPE(unichars) dest_arr;
-       buffer_t buf = { 0, 0, { 0, 0, 0, 0, 0 } };
+       buffer_t buf = { { 0, 0 } };
 
        i_assert(sizeof(wchar_t) == sizeof(unichar_t));
 
@@ -656,7 +656,7 @@ int lucene_index_build_deinit(struct lucene_index *index)
 static int
 wcharguid_to_guid(guid_128_t dest, const wchar_t *src)
 {
-       buffer_t buf = { 0, 0, { 0, 0, 0, 0, 0 } };
+       buffer_t buf = { { 0, 0 } };
        char src_chars[GUID_128_SIZE*2 + 1];
        unsigned int i;
 
@@ -926,7 +926,7 @@ int lucene_index_rescan(struct lucene_index *index)
 static void guid128_to_wguid(const guid_128_t guid,
                             wchar_t wguid_hex[MAILBOX_GUID_HEX_LENGTH + 1])
 {
-       buffer_t buf = { 0, 0, { 0, 0, 0, 0, 0 } };
+       buffer_t buf = { { 0, 0 } };
        unsigned char guid_hex[MAILBOX_GUID_HEX_LENGTH];
        unsigned int i;
 
index 7852ec605d1df85b076e980e9de9d0c9123cf3fe..747e51e508044ecff48d90aba6043e57d6bdac5f 100644 (file)
@@ -19,7 +19,7 @@ static struct inet_listener_settings *pop3_login_inet_listeners[] = {
        &pop3_login_inet_listeners_array[1]
 };
 static buffer_t pop3_login_inet_listeners_buf = {
-       pop3_login_inet_listeners, sizeof(pop3_login_inet_listeners), { NULL, }
+       { { pop3_login_inet_listeners, sizeof(pop3_login_inet_listeners) } }
 };
 
 /* </settings checks> */
index efc6bfd6a878b81c33698d91d300fba2618db8cd..0606dc8059f61d819221dc2458c4e9834060ff26 100644 (file)
@@ -21,7 +21,7 @@ static struct file_listener_settings *pop3_unix_listeners[] = {
        &pop3_unix_listeners_array[0]
 };
 static buffer_t pop3_unix_listeners_buf = {
-       pop3_unix_listeners, sizeof(pop3_unix_listeners), { NULL, }
+       { { pop3_unix_listeners, sizeof(pop3_unix_listeners) } }
 };
 /* </settings checks> */
 
index a0c1be3028ee0b20a192eedcb74c5517b44cb551..98597bde151df4698c14116f69b4a010a059bea6 100644 (file)
@@ -14,7 +14,7 @@ static struct file_listener_settings *aggregator_unix_listeners[] = {
        &aggregator_unix_listeners_array[0]
 };
 static buffer_t aggregator_unix_listeners_buf = {
-       aggregator_unix_listeners, sizeof(aggregator_unix_listeners), { NULL, }
+       { { aggregator_unix_listeners, sizeof(aggregator_unix_listeners) } }
 };
 
 static struct file_listener_settings aggregator_fifo_listeners_array[] = {
@@ -24,7 +24,7 @@ static struct file_listener_settings *aggregator_fifo_listeners[] = {
        &aggregator_fifo_listeners_array[0]
 };
 static buffer_t aggregator_fifo_listeners_buf = {
-       aggregator_fifo_listeners, sizeof(aggregator_fifo_listeners), { NULL, }
+       { { aggregator_fifo_listeners, sizeof(aggregator_fifo_listeners) } }
 };
 /* </settings checks> */
 
index 4696f44793070d50349b7001656e233dec15a3a0..3965100d6b434bf951cfb4cebb5f5041dc690ce9 100644 (file)
@@ -16,7 +16,7 @@ static struct file_listener_settings *replicator_unix_listeners[] = {
        &replicator_unix_listeners_array[1]
 };
 static buffer_t replicator_unix_listeners_buf = {
-       replicator_unix_listeners, sizeof(replicator_unix_listeners), { NULL, }
+       { { replicator_unix_listeners, sizeof(replicator_unix_listeners) } }
 };
 /* </settings checks> */
 
index 50020df678c7f2772f00b27dd0c42b9b944e5c2a..c7e631eeb16397d7a588bc7ed64df80788696470 100644 (file)
@@ -26,7 +26,7 @@ static struct file_listener_settings *stats_unix_listeners[] = {
        &stats_unix_listeners_array[1],
 };
 static buffer_t stats_unix_listeners_buf = {
-       stats_unix_listeners, sizeof(stats_unix_listeners), { NULL, }
+       { { stats_unix_listeners, sizeof(stats_unix_listeners) } }
 };
 /* </settings checks> */
 
index c4a7e8be121a82dc156ce7eddee66645d944cb1f..4a6f211820628394668b624e3aa176924d09395f 100644 (file)
@@ -22,7 +22,8 @@ static struct inet_listener_settings *submission_login_inet_listeners[] = {
        &submission_login_inet_listeners_array[0]
 };
 static buffer_t submission_login_inet_listeners_buf = {
-       submission_login_inet_listeners, sizeof(submission_login_inet_listeners), { 0, }
+       { { submission_login_inet_listeners,
+           sizeof(submission_login_inet_listeners) } }
 };
 
 /* </settings checks> */
index 034ec619fd5d4899051b135982d28f133cc54199..c4dd3dbbff9a937884495331781821f673fe8fbb 100644 (file)
@@ -22,7 +22,7 @@ static struct file_listener_settings *submission_unix_listeners[] = {
        &submission_unix_listeners_array[0]
 };
 static buffer_t submission_unix_listeners_buf = {
-       submission_unix_listeners, sizeof(submission_unix_listeners), { 0, }
+       { { submission_unix_listeners, sizeof(submission_unix_listeners) } }
 };
 /* </settings checks> */