dovecot-2.2: auth: sparse static cleanup, and some const cleanup

dovecot at dovecot.org dovecot at dovecot.org
Tue May 27 18:19:15 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/c94d57a3aba3
changeset: 17403:c94d57a3aba3
user:      Phil Carmody <phil at dovecot.fi>
date:      Tue May 27 21:17:34 2014 +0300
description:
auth: sparse static cleanup, and some const cleanup
All the consts that are added to pointers represent deep const semantics.
There are other shallow consts that I've not added, as sometimes it's
better to not be const than have something you rely on change when you
think it won't.

Signed-off-by: Phil Carmody <phil at dovecot.fi>

diffstat:

 src/auth/auth.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (69 lines):

diff -r 48d651b2e82a -r c94d57a3aba3 src/auth/auth.c
--- a/src/auth/auth.c	Tue May 27 21:17:34 2014 +0300
+++ b/src/auth/auth.c	Tue May 27 21:17:34 2014 +0300
@@ -9,7 +9,7 @@
 #include "passdb.h"
 #include "auth.h"
 
-struct auth_userdb_settings userdb_dummy_set = {
+static const struct auth_userdb_settings userdb_dummy_set = {
 	.name = "",
 	.driver = "static",
 	.args = "",
@@ -110,9 +110,9 @@
 	auth_userdb->userdb = userdb_preinit(auth->pool, set);
 }
 
-static bool auth_passdb_list_have_verify_plain(struct auth *auth)
+static bool auth_passdb_list_have_verify_plain(const struct auth *auth)
 {
-	struct auth_passdb *passdb;
+	const struct auth_passdb *passdb;
 
 	for (passdb = auth->masterdbs; passdb != NULL; passdb = passdb->next) {
 		if (passdb->passdb->iface.verify_plain != NULL)
@@ -125,9 +125,9 @@
 	return FALSE;
 }
 
-static bool auth_passdb_list_have_lookup_credentials(struct auth *auth)
+static bool auth_passdb_list_have_lookup_credentials(const struct auth *auth)
 {
-	struct auth_passdb *passdb;
+	const struct auth_passdb *passdb;
 
 	for (passdb = auth->masterdbs; passdb != NULL; passdb = passdb->next) {
 		if (passdb->passdb->iface.lookup_credentials != NULL)
@@ -140,9 +140,9 @@
 	return FALSE;
 }
 
-static int auth_passdb_list_have_set_credentials(struct auth *auth)
+static int auth_passdb_list_have_set_credentials(const struct auth *auth)
 {
-	struct auth_passdb *passdb;
+	const struct auth_passdb *passdb;
 
 	for (passdb = auth->masterdbs; passdb != NULL; passdb = passdb->next) {
 		if (passdb->passdb->iface.set_credentials != NULL)
@@ -156,7 +156,7 @@
 }
 
 static bool
-auth_mech_verify_passdb(struct auth *auth, struct mech_module_list *list)
+auth_mech_verify_passdb(const struct auth *auth, const struct mech_module_list *list)
 {
 	switch (list->module.passdb_need) {
 	case MECH_PASSDB_NEED_NOTHING:
@@ -180,9 +180,9 @@
 	return TRUE;
 }
 
-static void auth_mech_list_verify_passdb(struct auth *auth)
+static void auth_mech_list_verify_passdb(const struct auth *auth)
 {
-	struct mech_module_list *list;
+	const struct mech_module_list *list;
 
 	for (list = auth->reg->modules; list != NULL; list = list->next) {
 		if (!auth_mech_verify_passdb(auth, list))


More information about the dovecot-cvs mailing list