From: Timo Sirainen Date: Sun, 20 Jul 2008 18:00:33 +0000 (+0300) Subject: extern/static fixes (from a sparse check by Diego Liziero) X-Git-Tag: 1.2.alpha1~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ab0d9eecd85f74acae18fe88529302e0776cc500;p=thirdparty%2Fdovecot%2Fcore.git extern/static fixes (from a sparse check by Diego Liziero) --HG-- branch : HEAD --- diff --git a/src/auth/db-ldap.c b/src/auth/db-ldap.c index 12325333bc..34cbc4887b 100644 --- a/src/auth/db-ldap.c +++ b/src/auth/db-ldap.c @@ -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, diff --git a/src/auth/db-sql.c b/src/auth/db-sql.c index 72b45689bc..b1b5f6bb0c 100644 --- a/src/auth/db-sql.c +++ b/src/auth/db-sql.c @@ -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'", diff --git a/src/dict/main.c b/src/dict/main.c index d7f5b66d6a..716be34fe4 100644 --- a/src/dict/main.c +++ b/src/dict/main.c @@ -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; diff --git a/src/imap/cmd-fetch.c b/src/imap/cmd-fetch.c index fbbb74fa6b..0e50fd876d 100644 --- a/src/imap/cmd-fetch.c +++ b/src/imap/cmd-fetch.c @@ -9,13 +9,13 @@ #include -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 }; diff --git a/src/imap/commands.c b/src/imap/commands.c index 3856f8f415..2ed3e336ec 100644 --- a/src/imap/commands.c +++ b/src/imap/commands.c @@ -7,7 +7,7 @@ #include -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 }, diff --git a/src/imap/imap-fetch.c b/src/imap/imap-fetch.c index 1efb0a6713..c3975de39f 100644 --- a/src/imap/imap-fetch.c +++ b/src/imap/imap-fetch.c @@ -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 }, diff --git a/src/imap/main.c b/src/imap/main.c index b3a4599136..12a577a692 100644 --- a/src/imap/main.c +++ b/src/imap/main.c @@ -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 }, diff --git a/src/lib-index/mail-index-transaction.c b/src/lib-index/mail-index-transaction.c index c11acc3b2d..e0f117a4ea 100644 --- a/src/lib-index/mail-index-transaction.c +++ b/src/lib-index/mail-index-transaction.c @@ -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 }; diff --git a/src/lib-index/mailbox-list-index.c b/src/lib-index/mailbox-list-index.c index 4c23497eb9..050db47f87 100644 --- a/src/lib-index/mailbox-list-index.c +++ b/src/lib-index/mailbox-list-index.c @@ -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, diff --git a/src/lib-otp/otp-parity.h b/src/lib-otp/otp-parity.h index 74ad18ec50..86ea18fef9 100644 --- a/src/lib-otp/otp-parity.h +++ b/src/lib-otp/otp-parity.h @@ -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) { diff --git a/src/lib-sql/driver-sqlite.c b/src/lib-sql/driver-sqlite.c index a319cd210c..bcc46e8663 100644 --- a/src/lib-sql/driver-sqlite.c +++ b/src/lib-sql/driver-sqlite.c @@ -9,7 +9,7 @@ #include /* 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; diff --git a/src/lib-storage/index/mbox/mbox-lock.c b/src/lib-storage/index/mbox/mbox-lock.c index f74f02ee47..8748755a52 100644 --- a/src/lib-storage/index/mbox/mbox-lock.c +++ b/src/lib-storage/index/mbox/mbox-lock.c @@ -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 }, diff --git a/src/login-common/client-common.c b/src/login-common/client-common.c index 3c70772bc9..2e476cec94 100644 --- a/src/login-common/client-common.c +++ b/src/login-common/client-common.c @@ -12,7 +12,7 @@ #include struct client *clients = NULL; -unsigned int clients_count = 0; +static unsigned int clients_count = 0; void client_link(struct client *client) { diff --git a/src/plugins/convert/convert-storage.c b/src/plugins/convert/convert-storage.c index 55233e98fd..d4447bae8b 100644 --- a/src/plugins/convert/convert-storage.c +++ b/src/plugins/convert/convert-storage.c @@ -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, diff --git a/src/plugins/quota/quota-maildir.c b/src/plugins/quota/quota-maildir.c index 053ddca876..0a78758826 100644 --- a/src/plugins/quota/quota-maildir.c +++ b/src/plugins/quota/quota-maildir.c @@ -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, diff --git a/src/pop3/main.c b/src/pop3/main.c index 3f50a0bc8a..227d4aec06 100644 --- a/src/pop3/main.c +++ b/src/pop3/main.c @@ -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 }