dovecot-2.2: treewide sparse cleanup - make single-unit-only dat...

dovecot at dovecot.org dovecot at dovecot.org
Thu May 8 11:12:24 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/7f6c5e27b908
changeset: 17351:7f6c5e27b908
user:      Phil Carmody <phil at dovecot.fi>
date:      Tue May 06 18:10:55 2014 +0300
description:
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').

diffstat:

 src/lib-index/mail-index-strmap.c              |  2 +-
 src/lib-lda/mail-send.c                        |  2 --
 src/lib-storage/mail-search-register-imap.c    |  2 +-
 src/lib/child-wait.c                           |  2 +-
 src/lib/hash-method.c                          |  2 +-
 src/login-common/client-common.c               |  3 ++-
 src/plugins/fts-lucene/doveadm-fts-lucene.c    |  2 +-
 src/plugins/fts/doveadm-dump-fts-expunge-log.c |  2 +-
 src/plugins/fts/fts-parser-html.c              |  2 +-
 src/plugins/fts/fts-parser.c                   |  2 +-
 10 files changed, 10 insertions(+), 11 deletions(-)

diffs (121 lines):

diff -r b9d91c59bc5b -r 7f6c5e27b908 src/lib-index/mail-index-strmap.c
--- 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
 };
diff -r b9d91c59bc5b -r 7f6c5e27b908 src/lib-lda/mail-send.c
--- 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)
diff -r b9d91c59bc5b -r 7f6c5e27b908 src/lib-storage/mail-search-register-imap.c
--- 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 },
diff -r b9d91c59bc5b -r 7f6c5e27b908 src/lib/child-wait.c
--- 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 *
diff -r b9d91c59bc5b -r 7f6c5e27b908 src/lib/hash-method.c
--- 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),
diff -r b9d91c59bc5b -r 7f6c5e27b908 src/login-common/client-common.c
--- 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)
diff -r b9d91c59bc5b -r 7f6c5e27b908 src/plugins/fts-lucene/doveadm-fts-lucene.c
--- 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
diff -r b9d91c59bc5b -r 7f6c5e27b908 src/plugins/fts/doveadm-dump-fts-expunge-log.c
--- 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
diff -r b9d91c59bc5b -r 7f6c5e27b908 src/plugins/fts/fts-parser-html.c
--- 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[] = {
diff -r b9d91c59bc5b -r 7f6c5e27b908 src/plugins/fts/fts-parser.c
--- 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


More information about the dovecot-cvs mailing list