]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
extern/static fixes (from a sparse check by Diego Liziero)
authorTimo Sirainen <tss@iki.fi>
Sun, 20 Jul 2008 18:00:33 +0000 (21:00 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 20 Jul 2008 18:00:33 +0000 (21:00 +0300)
--HG--
branch : HEAD

16 files changed:
src/auth/db-ldap.c
src/auth/db-sql.c
src/dict/main.c
src/imap/cmd-fetch.c
src/imap/commands.c
src/imap/imap-fetch.c
src/imap/main.c
src/lib-index/mail-index-transaction.c
src/lib-index/mailbox-list-index.c
src/lib-otp/otp-parity.h
src/lib-sql/driver-sqlite.c
src/lib-storage/index/mbox/mbox-lock.c
src/login-common/client-common.c
src/plugins/convert/convert-storage.c
src/plugins/quota/quota-maildir.c
src/pop3/main.c

index 12325333bc761f310dc41dc9c99c41f89363a491..34cbc4887b8146a549a22be3ada913db2ed124bd 100644 (file)
@@ -109,7 +109,7 @@ static struct setting_def setting_defs[] = {
        { 0, NULL, 0 }
 };
 
-struct ldap_settings default_ldap_settings = {
+static struct ldap_settings default_ldap_settings = {
        MEMBER(hosts) NULL,
        MEMBER(uris) NULL,
        MEMBER(dn) NULL,
index 72b45689bcf2869a23db1af5a8a4b57e9f11bfac..b1b5f6bb0c52526bc198527d3edab2cee5afd02a 100644 (file)
@@ -26,7 +26,7 @@ static struct setting_def setting_defs[] = {
        { 0, NULL, 0 }
 };
 
-struct sql_settings default_sql_settings = {
+static struct sql_settings default_sql_settings = {
        MEMBER(driver) NULL,
        MEMBER(connect) NULL,
        MEMBER(password_query) "SELECT username, domain, password FROM users WHERE username = '%n' AND domain = '%d'",
index d7f5b66d6ab20df1e6ed4773966e35ab9b8fb78a..716be34fe46882043abd5b9959ef1b6c2af2ed9e 100644 (file)
@@ -18,8 +18,7 @@
 
 #define DICT_MASTER_LISTENER_FD 3
 
-struct ioloop *ioloop;
-
+static struct ioloop *ioloop;
 static struct io *log_io;
 static struct module *modules;
 static struct dict_server *dict_server;
index fbbb74fa6b8bc4c8f2755c4222cb907cd2442a89..0e50fd876d8353bdee62a325a0c6cdf41443688d 100644 (file)
@@ -9,13 +9,13 @@
 
 #include <stdlib.h>
 
-const char *all_macro[] = {
+static const char *all_macro[] = {
        "FLAGS", "INTERNALDATE", "RFC822.SIZE", "ENVELOPE", NULL
 };
-const char *fast_macro[] = {
+static const char *fast_macro[] = {
        "FLAGS", "INTERNALDATE", "RFC822.SIZE", NULL
 };
-const char *full_macro[] = {
+static const char *full_macro[] = {
        "FLAGS", "INTERNALDATE", "RFC822.SIZE", "ENVELOPE", "BODY", NULL
 };
 
index 3856f8f4158777893ec678c9eeb202164d3fc308..2ed3e336ec293a2ac5a120ca8b3dfdde5fbe6e85 100644 (file)
@@ -7,7 +7,7 @@
 
 #include <stdlib.h>
 
-const struct command imap4rev1_commands[] = {
+static const struct command imap4rev1_commands[] = {
        { "CAPABILITY",         cmd_capability,  0 },
        { "LOGOUT",             cmd_logout,      COMMAND_FLAG_BREAKS_MAILBOX },
        { "NOOP",               cmd_noop,        COMMAND_FLAG_BREAKS_SEQS },
@@ -40,7 +40,7 @@ const struct command imap4rev1_commands[] = {
 };
 #define IMAP4REV1_COMMANDS_COUNT N_ELEMENTS(imap4rev1_commands)
 
-const struct command imap_ext_commands[] = {
+static const struct command imap_ext_commands[] = {
        { "CANCELUPDATE",       cmd_cancelupdate,0 },
        { "ENABLE",             cmd_enable,      0 },
        { "ID",                 cmd_id,          0 },
index 1efb0a671357a5ebf575119eb354f58d07eec340..c3975de39f8c2bf6e244deb5de325eaf991d2804 100644 (file)
@@ -23,7 +23,8 @@
        "(NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL)"
 
 #define IMAP_FETCH_HANDLER_COUNT 9
-const struct imap_fetch_handler default_handlers[IMAP_FETCH_HANDLER_COUNT];
+extern const struct imap_fetch_handler
+       imap_fetch_default_handlers[IMAP_FETCH_HANDLER_COUNT];
 static buffer_t *fetch_handlers = NULL;
 
 static int imap_fetch_handler_cmp(const void *p1, const void *p2)
@@ -91,8 +92,8 @@ imap_fetch_init(struct client_command_context *cmd, struct mailbox *box)
        struct imap_fetch_context *ctx;
 
        if (fetch_handlers == NULL) {
-               imap_fetch_handlers_register(default_handlers,
-                                            N_ELEMENTS(default_handlers));
+               imap_fetch_handlers_register(imap_fetch_default_handlers,
+                       N_ELEMENTS(imap_fetch_default_handlers));
        }
 
        ctx = p_new(cmd->pool, struct imap_fetch_context, 1);
@@ -800,7 +801,8 @@ fetch_x_mailbox_init(struct imap_fetch_context *ctx ATTR_UNUSED,
        return TRUE;
 }
 
-const struct imap_fetch_handler default_handlers[IMAP_FETCH_HANDLER_COUNT] = {
+const struct imap_fetch_handler
+imap_fetch_default_handlers[IMAP_FETCH_HANDLER_COUNT] = {
        { "BODY", fetch_body_init },
        { "BODYSTRUCTURE", fetch_bodystructure_init },
        { "ENVELOPE", fetch_envelope_init },
index b3a4599136292966b3f34f2f4b3985a2b40215e6..12a577a6924190c4380123214f5c90b3d34b62c1 100644 (file)
@@ -30,7 +30,7 @@ struct client_workaround_list {
        enum client_workarounds num;
 };
 
-struct client_workaround_list client_workaround_list[] = {
+static struct client_workaround_list client_workaround_list[] = {
        { "delay-newmail", WORKAROUND_DELAY_NEWMAIL },
        { "outlook-idle", 0 }, /* only for backwards compatibility */
        { "netscape-eoh", WORKAROUND_NETSCAPE_EOH },
index c11acc3b2debc830cc706b3679cbfe6b625f05fb..e0f117a4eaf1e87eaebfcdfd1090bd27091035c3 100644 (file)
@@ -1613,7 +1613,7 @@ void mail_index_transaction_check_conflicts(struct mail_index_transaction *t)
        t->log_updates = mail_index_transaction_has_changes(t);
 }
 
-struct mail_index_transaction_vfuncs trans_vfuncs = {
+static struct mail_index_transaction_vfuncs trans_vfuncs = {
        mail_index_transaction_commit_v,
        mail_index_transaction_rollback_v
 };
index 4c23497eb940ba5cb639748161477b99f610d23b..050db47f872bfb7536e96693c7ab9bb11913e961 100644 (file)
@@ -41,7 +41,7 @@ struct mailbox_list_iter_ctx {
        unsigned int failed:1;
 };
 
-const struct dotlock_settings default_dotlock_set = {
+static const struct dotlock_settings default_dotlock_set = {
        MEMBER(temp_prefix) NULL,
        MEMBER(lock_suffix) NULL,
 
index 74ad18ec50e0f6e88b0a91534e577e54751af1c7..86ea18fef940440fe80e0975c6d20dd004c3cd33 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef OTP_PARITY_H
 #define OTP_PARITY_H
 
-const unsigned char parity_table[256];
+extern const unsigned char parity_table[256];
 
 static inline unsigned int otp_parity(unsigned char *data)
 {
index a319cd210c4a4a8be780173dd7595f2a1f169d7e..bcc46e8663ccafa1a74cbace219ec77ecb5dcdbd 100644 (file)
@@ -9,7 +9,7 @@
 #include <sqlite3.h>
 
 /* retry time if db is busy (in ms) */
-const int sqlite_busy_timeout = 1000;
+static const int sqlite_busy_timeout = 1000;
 
 struct sqlite_db {
        struct sql_db api;
index f74f02ee470d6dbac874172f54345cbbc95a2490..8748755a528eca48f79feb798ceab2d1785b58c7 100644 (file)
@@ -82,7 +82,7 @@ static int mbox_lock_lockf(struct mbox_lock_context *ctx, int lock_type,
 #  define mbox_lock_lockf NULL
 #endif
 
-struct mbox_lock_data lock_data[] = {
+static struct mbox_lock_data lock_data[] = {
        { MBOX_LOCK_DOTLOCK, "dotlock", mbox_lock_dotlock },
        { MBOX_LOCK_DOTLOCK_TRY, "dotlock_try", mbox_lock_dotlock_try },
        { MBOX_LOCK_FCNTL, "fcntl", mbox_lock_fcntl },
index 3c70772bc9ee308332efba2b89f032b8ebf0973b..2e476cec9403419b0cc7349d92ccd11b516db33b 100644 (file)
@@ -12,7 +12,7 @@
 #include <stdlib.h>
 
 struct client *clients = NULL;
-unsigned int clients_count = 0;
+static unsigned int clients_count = 0;
 
 void client_link(struct client *client)
 {
index 55233e98fd24564047e5f556ef85eb28e8ff4020..d4447bae8b83d05948cf2d9ce16cfbd2932687e4 100644 (file)
@@ -14,7 +14,7 @@
 
 #define CONVERT_LOCK_FILENAME ".dovecot.convert"
 
-struct dotlock_settings dotlock_settings = {
+static struct dotlock_settings dotlock_settings = {
        MEMBER(temp_prefix) NULL,
        MEMBER(lock_suffix) NULL,
 
index 053ddca876f3f9ffe0edf178bec67e870a99f756..0a787588266b807e3b8c90e262aff6557d7d14c6 100644 (file)
@@ -46,7 +46,7 @@ struct maildir_list_context {
 
 extern struct quota_backend quota_backend_maildir;
 
-struct dotlock_settings dotlock_settings = {
+static struct dotlock_settings dotlock_settings = {
        MEMBER(temp_prefix) NULL,
        MEMBER(lock_suffix) NULL,
 
index 3f50a0bc8a986be43983a71501849c4f03861a09..227d4aec06c88f5496c6444d7a1cc89bd43a6426 100644 (file)
@@ -30,7 +30,7 @@ struct client_workaround_list {
        enum client_workarounds num;
 };
 
-struct client_workaround_list client_workaround_list[] = {
+static struct client_workaround_list client_workaround_list[] = {
        { "outlook-no-nuls", WORKAROUND_OUTLOOK_NO_NULS },
        { "oe-ns-eoh", WORKAROUND_OE_NS_EOH },
        { NULL, 0 }