Mercurial > dovecot > core-2.2
changeset 17351:7f6c5e27b908
treewide sparse cleanup - make single-unit-only data static
Helps keep the global namespace clean. Not all the things suggested by
sparse have been moved. All DOVECOT_ABI_VERSION strings, and anything
replicated in all-settings.c by src/config/settings-get.pl has been
left untouched. Some of the latter could be moved, but the script would
need to be modified to replicate the 'static' (it outputs 'extern').
author | Phil Carmody <phil@dovecot.fi> |
---|---|
date | Tue, 06 May 2014 18:10:55 +0300 |
parents | b9d91c59bc5b |
children | d7a66090b7c7 |
files | src/lib-index/mail-index-strmap.c src/lib-lda/mail-send.c src/lib-storage/mail-search-register-imap.c src/lib/child-wait.c src/lib/hash-method.c src/login-common/client-common.c src/plugins/fts-lucene/doveadm-fts-lucene.c src/plugins/fts/doveadm-dump-fts-expunge-log.c src/plugins/fts/fts-parser-html.c src/plugins/fts/fts-parser.c |
diffstat | 10 files changed, 10 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-index-strmap.c Thu May 08 13:45:37 2014 +0300 +++ b/src/lib-index/mail-index-strmap.c Tue May 06 18:10:55 2014 +0300 @@ -89,7 +89,7 @@ #define MAIL_INDEX_STRMAP_TIMEOUT_SECS 10 -const struct dotlock_settings default_dotlock_settings = { +static const struct dotlock_settings default_dotlock_settings = { .timeout = MAIL_INDEX_STRMAP_TIMEOUT_SECS, .stale_timeout = 30 };
--- a/src/lib-lda/mail-send.c Thu May 08 13:45:37 2014 +0300 +++ b/src/lib-lda/mail-send.c Tue May 06 18:10:55 2014 +0300 @@ -21,8 +21,6 @@ #include <stdlib.h> #include <sys/wait.h> -int global_outgoing_count = 0; - static const struct var_expand_table * get_var_expand_table(struct mail *mail, const char *reason, const char *recipient)
--- a/src/lib-storage/mail-search-register-imap.c Thu May 08 13:45:37 2014 +0300 +++ b/src/lib-storage/mail-search-register-imap.c Tue May 06 18:10:55 2014 +0300 @@ -501,7 +501,7 @@ return sarg; } -const struct mail_search_register_arg imap_register_args[] = { +static const struct mail_search_register_arg imap_register_args[] = { /* argument set operations */ { "NOT", imap_search_not }, { "OR", imap_search_or },
--- a/src/lib/child-wait.c Thu May 08 13:45:37 2014 +0300 +++ b/src/lib/child-wait.c Tue May 06 18:10:55 2014 +0300 @@ -15,7 +15,7 @@ }; /* pid_t => wait */ -HASH_TABLE(void *, struct child_wait *) child_pids; +static HASH_TABLE(void *, struct child_wait *) child_pids; #undef child_wait_new_with_pid struct child_wait *
--- a/src/lib/hash-method.c Thu May 08 13:45:37 2014 +0300 +++ b/src/lib/hash-method.c Tue May 06 18:10:55 2014 +0300 @@ -47,7 +47,7 @@ result_r[7] = (*ctx & 0x00000000000000ffULL); } -const struct hash_method hash_method_size = { +static const struct hash_method hash_method_size = { "size", sizeof(uint64_t), sizeof(uint64_t),
--- a/src/login-common/client-common.c Thu May 08 13:45:37 2014 +0300 +++ b/src/login-common/client-common.c Tue May 06 18:10:55 2014 +0300 @@ -25,7 +25,8 @@ #include <stdlib.h> -struct client *clients = NULL, *last_client = NULL; +struct client *clients = NULL; +static struct client *last_client = NULL; static unsigned int clients_count = 0; static void client_idle_disconnect_timeout(struct client *client)
--- a/src/plugins/fts-lucene/doveadm-fts-lucene.c Thu May 08 13:45:37 2014 +0300 +++ b/src/plugins/fts-lucene/doveadm-fts-lucene.c Tue May 06 18:10:55 2014 +0300 @@ -53,7 +53,7 @@ return stat(path, &st) == 0; } -struct doveadm_cmd_dump doveadm_cmd_dump_fts_lucene = { +static const struct doveadm_cmd_dump doveadm_cmd_dump_fts_lucene = { "fts-lucene", test_dump_fts_lucene, cmd_dump_fts_lucene
--- a/src/plugins/fts/doveadm-dump-fts-expunge-log.c Thu May 08 13:45:37 2014 +0300 +++ b/src/plugins/fts/doveadm-dump-fts-expunge-log.c Tue May 06 18:10:55 2014 +0300 @@ -97,7 +97,7 @@ return strcmp(p, "dovecot-expunges.log") == 0; } -struct doveadm_cmd_dump doveadm_cmd_dump_fts_expunge_log = { +static const struct doveadm_cmd_dump doveadm_cmd_dump_fts_expunge_log = { "fts-expunge-log", test_dump_fts_expunge_log, cmd_dump_fts_expunge_log
--- a/src/plugins/fts/fts-parser-html.c Thu May 08 13:45:37 2014 +0300 +++ b/src/plugins/fts/fts-parser-html.c Tue May 06 18:10:55 2014 +0300 @@ -36,7 +36,7 @@ bool ignore_next_text; }; -struct { +static struct { const char *name; unichar_t chr; } html_entities[] = {
--- a/src/plugins/fts/fts-parser.c Thu May 08 13:45:37 2014 +0300 +++ b/src/plugins/fts/fts-parser.c Tue May 06 18:10:55 2014 +0300 @@ -6,7 +6,7 @@ #include "message-parser.h" #include "fts-parser.h" -const struct fts_parser_vfuncs *parsers[] = { +static const struct fts_parser_vfuncs *parsers[] = { &fts_parser_html, &fts_parser_script, &fts_parser_tika