static struct auth_worker_connection *auth_worker_find_free(void)
{
- struct auth_worker_connection **conns;
+ struct auth_worker_connection *conn;
if (idle_count == 0)
return NULL;
- array_foreach_modifiable(&connections, conns) {
- struct auth_worker_connection *conn = *conns;
-
+ array_foreach_elem(&connections, conn) {
if (conn->request == NULL)
return conn;
}
{
struct master_service_settings_output set_output;
const struct auth_settings *service_set;
- struct auth *auth, *const *authp;
+ struct auth *auth;
unsigned int i;
const char *not_service = NULL;
bool check_default = TRUE;
if (not_service != NULL && str_array_find(services, not_service+1))
check_default = FALSE;
- array_foreach(&auths, authp) {
- if ((*authp)->service != NULL || check_default)
- auth_mech_list_verify_passdb(*authp);
+ array_foreach_elem(&auths, auth) {
+ if (auth->service != NULL || check_default)
+ auth_mech_list_verify_passdb(auth);
}
}
void auths_init(void)
{
- struct auth *const *auth;
+ struct auth *auth;
/* sanity checks */
i_assert(auth_request_var_expand_static_tab[AUTH_REQUEST_VAR_TAB_USER_IDX].key == 'u');
i_assert(auth_request_var_expand_static_tab[AUTH_REQUEST_VAR_TAB_COUNT-1].key != '\0' ||
auth_request_var_expand_static_tab[AUTH_REQUEST_VAR_TAB_COUNT-1].long_key != NULL);
- array_foreach(&auths, auth)
- auth_init(*auth);
+ array_foreach_elem(&auths, auth)
+ auth_init(auth);
}
void auths_deinit(void)
{
- struct auth *const *auth;
+ struct auth *auth;
- array_foreach(&auths, auth)
- auth_deinit(*auth);
+ array_foreach_elem(&auths, auth)
+ auth_deinit(auth);
event_unref(&auth_event);
}
{
const struct db_dict_field *field;
const struct db_dict_key *key;
- const struct db_dict_key *const *keyp;
const char *p, *name;
unsigned int idx, size;
string_t *str = t_str_new(128);
p += size;
}
}
- array_foreach(objects, keyp)
- str_printfa(str, "\t%s", (*keyp)->key);
+ array_foreach_elem(objects, key)
+ str_printfa(str, "\t%s", key->key);
return str_c(str);
}
static void db_dict_iter_find_used_objects(struct db_dict_value_iter *iter)
{
- const struct db_dict_key *const *keyp;
+ const struct db_dict_key *dict_key;
struct db_dict_iter_key *key;
- array_foreach(iter->objects, keyp) {
- key = db_dict_iter_find_key(iter, (*keyp)->name);
+ array_foreach_elem(iter->objects, dict_key) {
+ key = db_dict_iter_find_key(iter, dict_key->name);
i_assert(key != NULL); /* checked at init */
i_assert(key->key->parsed_format != DB_DICT_VALUE_FORMAT_VALUE);
key->used = TRUE;
static struct passdb_module_interface *passdb_interface_find(const char *name)
{
- struct passdb_module_interface *const *ifaces;
-
- array_foreach(&passdb_interfaces, ifaces) {
- struct passdb_module_interface *iface = *ifaces;
+ struct passdb_module_interface *iface;
+ array_foreach_elem(&passdb_interfaces, iface) {
if (strcmp(iface->name, name) == 0)
return iface;
}
static struct userdb_module_interface *userdb_interface_find(const char *name)
{
- struct userdb_module_interface *const *ifaces;
-
- array_foreach(&userdb_interfaces, ifaces) {
- struct userdb_module_interface *iface = *ifaces;
+ struct userdb_module_interface *iface;
+ array_foreach_elem(&userdb_interfaces, iface) {
if (strcmp(iface->name, name) == 0)
return iface;
}