Skip to content

Commit 6169c23

Browse files
sirainencmouse
authored andcommitted
lib-storage: Remove "const" from settings parser contexts
1 parent f2823fc commit 6169c23

File tree

8 files changed

+16
-18
lines changed

8 files changed

+16
-18
lines changed

src/lib-storage/index/raw/raw-storage.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extern struct mail_storage raw_storage;
1313
extern struct mailbox raw_mailbox;
1414

1515
struct mail_user *
16-
raw_storage_create_from_set(const struct setting_parser_context *unexpanded_set_parser)
16+
raw_storage_create_from_set(struct setting_parser_context *unexpanded_set_parser)
1717
{
1818
struct mail_user *user;
1919
struct mail_namespace *ns;

src/lib-storage/index/raw/raw-storage.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct raw_mailbox {
3030
extern struct mail_vfuncs raw_mail_vfuncs;
3131

3232
struct mail_user *
33-
raw_storage_create_from_set(const struct setting_parser_context *unexpanded_set_parser);
33+
raw_storage_create_from_set(struct setting_parser_context *unexpanded_set_parser);
3434

3535
int raw_mailbox_alloc_stream(struct mail_user *user, struct istream *input,
3636
time_t received_time, const char *envelope_sender,

src/lib-storage/mail-storage-service.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ mail_storage_service_add_storage_set_roots(struct mail_storage_service_ctx *ctx)
10571057

10581058
int mail_storage_service_read_settings(struct mail_storage_service_ctx *ctx,
10591059
const struct mail_storage_service_input *input,
1060-
const struct setting_parser_context **parser_r,
1060+
struct setting_parser_context **parser_r,
10611061
const char **error_r)
10621062
{
10631063
struct master_service_settings_input set_input;
@@ -1106,15 +1106,13 @@ int mail_storage_service_read_settings(struct mail_storage_service_ctx *ctx,
11061106
if (null_strcmp(set_input.module, ctx->set_cache_module) == 0 &&
11071107
null_strcmp(set_input.service, ctx->set_cache_service) == 0 &&
11081108
ctx->set_cache != NULL) {
1109-
struct setting_parser_context *parser;
11101109
if (master_service_settings_cache_read(ctx->set_cache,
11111110
&set_input,
1112-
&parser, error_r) < 0) {
1111+
parser_r, error_r) < 0) {
11131112
*error_r = t_strdup_printf(
11141113
"Error reading configuration: %s", *error_r);
11151114
return -1;
11161115
}
1117-
*parser_r = parser;
11181116
} else {
11191117
if (master_service_settings_read(ctx->service, &set_input,
11201118
&set_output, error_r) < 0) {
@@ -1245,7 +1243,7 @@ mail_storage_service_lookup_real(struct mail_storage_service_ctx *ctx,
12451243
const struct mail_user_settings *user_set;
12461244
const char *const *userdb_fields, *error;
12471245
struct auth_user_reply reply;
1248-
const struct setting_parser_context *set_parser;
1246+
struct setting_parser_context *set_parser;
12491247
pool_t user_pool, temp_pool;
12501248
int ret = 1;
12511249

@@ -1683,7 +1681,7 @@ void mail_storage_service_init_settings(struct mail_storage_service_ctx *ctx,
16831681
const struct mail_storage_service_input *input)
16841682
{
16851683
const struct mail_user_settings *user_set;
1686-
const struct setting_parser_context *set_parser;
1684+
struct setting_parser_context *set_parser;
16871685
const char *error;
16881686

16891687
if (ctx->conn != NULL)

src/lib-storage/mail-storage-service.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void mail_storage_service_set_auth_conn(struct mail_storage_service_ctx *ctx,
8686
struct auth_master_connection *conn);
8787
int mail_storage_service_read_settings(struct mail_storage_service_ctx *ctx,
8888
const struct mail_storage_service_input *input,
89-
const struct setting_parser_context **parser_r,
89+
struct setting_parser_context **parser_r,
9090
const char **error_r) ATTR_NULL(2);
9191
/* Read settings and initialize context to use them. Do nothing if service is
9292
already initialized. This is mainly necessary when calling _get_auth_conn()

src/lib-storage/mail-user.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void mail_user_deinit_pre_base(struct mail_user *user ATTR_UNUSED)
5151
static struct mail_user *
5252
mail_user_alloc_int(struct event *parent_event,
5353
const char *username,
54-
const struct setting_parser_context *unexpanded_set_parser,
54+
struct setting_parser_context *unexpanded_set_parser,
5555
pool_t pool)
5656
{
5757
struct mail_user *user;
@@ -86,7 +86,7 @@ mail_user_alloc_int(struct event *parent_event,
8686
struct mail_user *
8787
mail_user_alloc_nodup_set(struct event *parent_event,
8888
const char *username,
89-
const struct setting_parser_context *unexpanded_set_parser)
89+
struct setting_parser_context *unexpanded_set_parser)
9090
{
9191
pool_t pool;
9292

@@ -97,7 +97,7 @@ mail_user_alloc_nodup_set(struct event *parent_event,
9797

9898
struct mail_user *mail_user_alloc(struct event *parent_event,
9999
const char *username,
100-
const struct setting_parser_context *unexpanded_set_parser)
100+
struct setting_parser_context *unexpanded_set_parser)
101101
{
102102
pool_t pool;
103103

src/lib-storage/mail-user.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ struct mail_user {
5858
This could be set by plugins that need to fail the initialization. */
5959
const char *error;
6060

61-
const struct setting_parser_context *unexpanded_set_parser;
62-
const struct setting_parser_context *set_parser;
61+
struct setting_parser_context *unexpanded_set_parser;
62+
struct setting_parser_context *set_parser;
6363
const struct mail_user_settings *unexpanded_set;
6464
struct mail_user_settings *set;
6565
struct mail_namespace *namespaces;
@@ -129,11 +129,11 @@ extern const struct var_expand_func_table *mail_user_var_expand_func_table;
129129

130130
struct mail_user *mail_user_alloc(struct event *parent_event,
131131
const char *username,
132-
const struct setting_parser_context *unexpanded_set_parser);
132+
struct setting_parser_context *unexpanded_set_parser);
133133
struct mail_user *
134134
mail_user_alloc_nodup_set(struct event *parent_event,
135135
const char *username,
136-
const struct setting_parser_context *set_parser);
136+
struct setting_parser_context *set_parser);
137137
/* Returns -1 if settings were invalid. */
138138
int mail_user_init(struct mail_user *user, const char **error_r);
139139

src/lmtp/lmtp-client.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static void client_load_modules(struct client *client)
100100
static void client_read_settings(struct client *client, bool ssl)
101101
{
102102
struct mail_storage_service_input input;
103-
const struct setting_parser_context *set_parser;
103+
struct setting_parser_context *set_parser;
104104
struct lmtp_settings *lmtp_set;
105105
struct lda_settings *lda_set;
106106
const char *error;

src/plugins/quota/quota-status.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ static void main_init(void)
280280
NULL
281281
};
282282
struct mail_storage_service_input input;
283-
const struct setting_parser_context *set_parser;
283+
struct setting_parser_context *set_parser;
284284
const struct mail_user_settings *user_set;
285285
const char *value, *error;
286286

0 commit comments

Comments
 (0)