]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: drop unnecessary parens in &(foo)
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Tue, 12 Dec 2017 16:18:10 +0000 (11:18 -0500)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 13 Dec 2017 10:32:08 +0000 (12:32 +0200)
This makes the code more consistent since most of the repo uses the
no-parens style.  These inconsistencies were found using
`git grep '(&([^*]'` and any use of the parens in macros was ignored for
safety reasons.

src/auth/auth-policy.c
src/doveadm/doveadm-cmd.c
src/lib-dcrypt/dcrypt-gnutls.c
src/lib-dcrypt/dcrypt-openssl.c
src/lib-dcrypt/istream-decrypt.c
src/lib-dcrypt/ostream-encrypt.c
src/lib-dict-backend/dict-ldap.c
src/lib-ldap/ldap-connection.c
src/lib-ldap/ldap-entry.c
src/lib-ldap/ldap-iterator.c
src/lib-ldap/ldap-search.c

index 43c50201c099e2e92946ce6fd522d00dcc8d10ca..412333df09414d128e085e115f1c94b5e38c4e26 100755 (executable)
@@ -234,10 +234,10 @@ void auth_policy_finish(struct policy_lookup_ctx *context)
 {
        if (context->parser != NULL) {
                const char *error ATTR_UNUSED;
-               (void)json_parser_deinit(&(context->parser), &error);
+               (void)json_parser_deinit(&context->parser, &error);
        }
        if (context->http_request != NULL)
-               http_client_request_abort(&(context->http_request));
+               http_client_request_abort(&context->http_request);
        if (context->request != NULL)
                auth_request_unref(&context->request);
 }
@@ -260,7 +260,7 @@ void auth_policy_parse_response(struct policy_lookup_ctx *context)
                        else
                                continue;
                } else if (context->parse_state == POLICY_RESULT_VALUE_STATUS) {
-                       if (type != JSON_TYPE_NUMBER || str_to_int(value, &(context->result)) != 0)
+                       if (type != JSON_TYPE_NUMBER || str_to_int(value, &context->result) != 0)
                                break;
                        context->parse_state = POLICY_RESULT;
                } else if (context->parse_state == POLICY_RESULT_VALUE_MESSAGE) {
@@ -279,7 +279,7 @@ void auth_policy_parse_response(struct policy_lookup_ctx *context)
 
        context->parse_error = TRUE;
 
-       io_remove(&(context->io));
+       io_remove(&context->io);
 
        if (context->payload->stream_errno != 0) {
                auth_request_log_error(context->request, "policy",
@@ -293,13 +293,13 @@ void auth_policy_parse_response(struct policy_lookup_ctx *context)
                        "Policy server response was malformed");
        } else {
                const char *error = "unknown";
-               if (json_parser_deinit(&(context->parser), &error) != 0)
+               if (json_parser_deinit(&context->parser, &error) != 0)
                        auth_request_log_error(context->request, "policy",
                                "Policy server response JSON parse error: %s", error);
                else if (context->parse_state == POLICY_RESULT)
                        context->parse_error = FALSE;
        }
-       i_stream_unref(&(context->payload));
+       i_stream_unref(&context->payload);
 
        if (context->parse_error) {
                context->result = (context->set->policy_reject_on_fail ? -1 : 0);
index c26a0d2e7349b6a614da843a29cfebf611d6c60c..5ca1742e617dacc9f78f3a5781bdc7a0c92a037d 100644 (file)
@@ -233,7 +233,7 @@ doveadm_cmd_param_get(const struct doveadm_cmd_context *cctx,
        i_assert(cctx->argv != NULL);
        for(int i = 0; i < cctx->argc; i++) {
                if (strcmp(cctx->argv[i].name, name) == 0 && cctx->argv[i].value_set)
-                       return &(cctx->argv[i]);
+                       return &cctx->argv[i];
        }
        return NULL;
 }
@@ -327,7 +327,7 @@ void doveadm_cmd_params_clean(ARRAY_TYPE(doveadm_cmd_param_arr_t) *pargv)
        array_foreach_modifiable(pargv, param) {
                if (param->type == CMD_PARAM_ISTREAM &&
                    param->value.v_istream != NULL)
-                       i_stream_destroy(&(param->value.v_istream));
+                       i_stream_destroy(&param->value.v_istream);
        }
        array_clear(pargv);
 }
@@ -516,7 +516,7 @@ int doveadm_cmd_run_ver2(int argc, const char *const argv[],
 
        for(pargc=0;cctx->cmd->parameters[pargc].name != NULL;pargc++) {
                param = array_append_space(&pargv);
-               memcpy(param, &(cctx->cmd->parameters[pargc]), sizeof(struct doveadm_cmd_param));
+               memcpy(param, &cctx->cmd->parameters[pargc], sizeof(struct doveadm_cmd_param));
                param->value_set = FALSE;
        }
        i_assert(pargc == array_count(&opts)-1); /* opts is NULL-terminated */
index 968407ad6c317b58281e115e4d4eea25f88ed681..e6ddc22cb9da234399f5749bbe55296a0b1bbf5f 100644 (file)
@@ -147,7 +147,7 @@ static
 int dcrypt_gnutls_ctx_sym_init(struct dcrypt_context_symmetric *ctx, const char **error_r)
 {
        int ec;
-       ec = gnutls_cipher_init(&(ctx->ctx), ctx->cipher, &ctx->key, &ctx->iv);
+       ec = gnutls_cipher_init(&ctx->ctx, ctx->cipher, &ctx->key, &ctx->iv);
        if(ec < 0) return dcrypt_gnutls_error(ec, error_r);
        return 0;
 }
@@ -216,7 +216,7 @@ static
 int dcrypt_gnutls_ctx_hmac_init(struct dcrypt_context_hmac *ctx, const char **error_r)
 {
        int ec;
-       ec = gnutls_hmac_init(&(ctx->ctx), ctx->md, ctx->key.data, ctx->key.size);
+       ec = gnutls_hmac_init(&ctx->ctx, ctx->md, ctx->key.data, ctx->key.size);
        if (ec < 0) return dcrypt_gnutls_error(ec, error_r);
        return 0;
 }
@@ -307,7 +307,7 @@ int dcrypt_gnutls_generate_keypair(struct dcrypt_keypair *pair_r, enum dcrypt_ke
 
        pair_r->priv = (struct dcrypt_private_key*)priv;
 
-       return dcrypt_gnutls_private_to_public_key(pair_r->priv, &(pair_r->pub), error_r);
+       return dcrypt_gnutls_private_to_public_key(pair_r->priv, &pair_r->pub, error_r);
 } 
 
 static
@@ -407,8 +407,8 @@ void dcrypt_gnutls_free_private_key(struct dcrypt_private_key **key)
 static
 void dcrypt_gnutls_free_keypair(struct dcrypt_keypair *keypair)
 {
-       dcrypt_gnutls_free_public_key(&(keypair->pub));
-       dcrypt_gnutls_free_private_key(&(keypair->priv));
+       dcrypt_gnutls_free_public_key(&keypair->pub);
+       dcrypt_gnutls_free_private_key(&keypair->priv);
 }
 
 static
index 6eca440a295a0b481cb60ae3399d87931ef56203..b20d56f1a41eb5ba4e550cbb14e27e61567b2987 100644 (file)
@@ -743,7 +743,7 @@ bool dcrypt_openssl_generate_keypair(struct dcrypt_keypair *pair_r, enum dcrypt_
                        pair_r->priv->key = pkey;
                        pair_r->priv->ref++;
                        pair_r->pub = NULL;
-                       dcrypt_openssl_private_to_public_key(pair_r->priv, &(pair_r->pub));
+                       dcrypt_openssl_private_to_public_key(pair_r->priv, &pair_r->pub);
                        return TRUE;
                } else return dcrypt_openssl_error(error_r);
        } else if (kind == DCRYPT_KEY_EC) {
@@ -758,7 +758,7 @@ bool dcrypt_openssl_generate_keypair(struct dcrypt_keypair *pair_r, enum dcrypt_
                        pair_r->priv->key = pkey;
                        pair_r->priv->ref++;
                        pair_r->pub = NULL;
-                       dcrypt_openssl_private_to_public_key(pair_r->priv, &(pair_r->pub));
+                       dcrypt_openssl_private_to_public_key(pair_r->priv, &pair_r->pub);
                        return TRUE;
                } else return dcrypt_openssl_error(error_r);
        }
@@ -1983,8 +1983,8 @@ static
 void dcrypt_openssl_unref_keypair(struct dcrypt_keypair *keypair)
 {
        i_assert(keypair != NULL);
-       dcrypt_openssl_unref_public_key(&(keypair->pub));
-       dcrypt_openssl_unref_private_key(&(keypair->priv));
+       dcrypt_openssl_unref_public_key(&keypair->pub);
+       dcrypt_openssl_unref_private_key(&keypair->priv);
 }
 
 static
index 937ac619375afdf4ab5b3e87ef2914faeaccf16c..f6d5ee0919bb8e27346af3b83b92089ca62b4e30 100644 (file)
@@ -129,7 +129,7 @@ ssize_t i_stream_decrypt_read_header_v1(struct decrypt_istream *stream,
                /* see if we can get one */
                if (stream->key_callback != NULL) {
                        const char *key_id = binary_to_hex(digest_pos, digest_len);
-                       int ret = stream->key_callback(key_id, &(stream->priv_key), &error, stream->key_context);
+                       int ret = stream->key_callback(key_id, &stream->priv_key, &error, stream->key_context);
                        if (ret < 0) {
                                io_stream_set_error(&stream->istream.iostream, "Private key not available: %s", error);
                                return -1;
@@ -213,7 +213,7 @@ ssize_t i_stream_decrypt_read_header_v1(struct decrypt_istream *stream,
        }
 
        /* prime context with key */
-       if (!dcrypt_ctx_sym_create("aes-256-ctr", DCRYPT_MODE_DECRYPT, &(stream->ctx_sym), &error)) {
+       if (!dcrypt_ctx_sym_create("aes-256-ctr", DCRYPT_MODE_DECRYPT, &stream->ctx_sym, &error)) {
                io_stream_set_error(&stream->istream.iostream, "Decryption context create error: %s", error);
                return -1;
        }
@@ -313,7 +313,7 @@ ssize_t i_stream_decrypt_key(struct decrypt_istream *stream, const char *malg, u
                if (stream->key_callback != NULL) {
                        const char *hexdgst = binary_to_hex(data, sizeof(dgst)); /* digest length */
                        /* hope you going to give us right key.. */
-                       int ret = stream->key_callback(hexdgst, &(stream->priv_key), &error, stream->key_context);
+                       int ret = stream->key_callback(hexdgst, &stream->priv_key, &error, stream->key_context);
                        if (ret < 0) {
                                io_stream_set_error(&stream->istream.iostream, "Private key not available: %s", error);
                                return -1;
@@ -477,7 +477,7 @@ int i_stream_decrypt_header_contents(struct decrypt_istream *stream,
        const char *calg;
        if (!i_stream_decrypt_der(&data, end, &calg))
                return 0;
-       if (calg == NULL || !dcrypt_ctx_sym_create(calg, DCRYPT_MODE_DECRYPT, &(stream->ctx_sym), NULL)) {
+       if (calg == NULL || !dcrypt_ctx_sym_create(calg, DCRYPT_MODE_DECRYPT, &stream->ctx_sym, NULL)) {
                io_stream_set_error(&stream->istream.iostream, "Decryption error: unsupported/invalid cipher: %s", calg);
                return -1;
        }
@@ -486,7 +486,7 @@ int i_stream_decrypt_header_contents(struct decrypt_istream *stream,
        const char *malg;
        if (!i_stream_decrypt_der(&data, end, &malg))
                return 0;
-       if (malg == NULL || !dcrypt_ctx_hmac_create(malg, &(stream->ctx_mac), NULL)) {
+       if (malg == NULL || !dcrypt_ctx_hmac_create(malg, &stream->ctx_mac, NULL)) {
                io_stream_set_error(&stream->istream.iostream, "Decryption error: unsupported/invalid MAC algorithm: %s", malg);
                return -1;
        }
@@ -840,13 +840,13 @@ void i_stream_decrypt_destroy(struct iostream_private *stream)
        if (dstream->iv != NULL)
                i_free_and_null(dstream->iv);
        if (dstream->ctx_sym != NULL)
-               dcrypt_ctx_sym_destroy(&(dstream->ctx_sym));
+               dcrypt_ctx_sym_destroy(&dstream->ctx_sym);
        if (dstream->ctx_mac != NULL)
-               dcrypt_ctx_hmac_destroy(&(dstream->ctx_mac));
+               dcrypt_ctx_hmac_destroy(&dstream->ctx_mac);
        if (dstream->priv_key != NULL)
-               dcrypt_key_unref_private(&(dstream->priv_key));
+               dcrypt_key_unref_private(&dstream->priv_key);
 
-       i_stream_unref(&(dstream->istream.parent));
+       i_stream_unref(&dstream->istream.parent);
 }
 
 static
index 002c374aa99c452f07d2c11786b4a7c7f04b4dce..6c085e6fe7c440ca9dd20d08a1fe80471582c8bd 100644 (file)
@@ -568,12 +568,12 @@ void o_stream_encrypt_destroy(struct iostream_private *stream)
 {
        struct encrypt_ostream *estream = (struct encrypt_ostream *)stream;
        /* release resources */
-       if (estream->ctx_sym != NULL) dcrypt_ctx_sym_destroy(&(estream->ctx_sym));
-       if (estream->ctx_mac != NULL) dcrypt_ctx_hmac_destroy(&(estream->ctx_mac));
+       if (estream->ctx_sym != NULL) dcrypt_ctx_sym_destroy(&estream->ctx_sym);
+       if (estream->ctx_mac != NULL) dcrypt_ctx_hmac_destroy(&estream->ctx_mac);
        if (estream->key_data != NULL) i_free(estream->key_data);
-       if (estream->cipher_oid != NULL) buffer_free(&(estream->cipher_oid));
-       if (estream->mac_oid != NULL) buffer_free(&(estream->mac_oid));
-       if (estream->pub != NULL) dcrypt_key_unref_public(&(estream->pub));
+       if (estream->cipher_oid != NULL) buffer_free(&estream->cipher_oid);
+       if (estream->mac_oid != NULL) buffer_free(&estream->mac_oid);
+       if (estream->pub != NULL) dcrypt_key_unref_public(&estream->pub);
        o_stream_unref(&estream->ostream.parent);
 }
 
@@ -584,7 +584,7 @@ int o_stream_encrypt_init(struct encrypt_ostream *estream, const char *algorithm
        char *calg, *malg;
 
        if ((estream->flags & IO_STREAM_ENC_VERSION_1) == IO_STREAM_ENC_VERSION_1) {
-               if (!dcrypt_ctx_sym_create("AES-256-CTR", DCRYPT_MODE_ENCRYPT, &(estream->ctx_sym), &error)) {
+               if (!dcrypt_ctx_sym_create("AES-256-CTR", DCRYPT_MODE_ENCRYPT, &estream->ctx_sym, &error)) {
                        io_stream_set_error(&estream->ostream.iostream, "Cannot create ostream-encrypt: %s", error);
                        return -1;
                }
@@ -601,7 +601,7 @@ int o_stream_encrypt_init(struct encrypt_ostream *estream, const char *algorithm
                }
                (*malg++) = '\0';
 
-               if (!dcrypt_ctx_sym_create(calg, DCRYPT_MODE_ENCRYPT, &(estream->ctx_sym), &error)) {
+               if (!dcrypt_ctx_sym_create(calg, DCRYPT_MODE_ENCRYPT, &estream->ctx_sym, &error)) {
                        io_stream_set_error(&estream->ostream.iostream, "Cannot create ostream-encrypt: %s", error);
                        return -1;
                }
@@ -616,7 +616,7 @@ int o_stream_encrypt_init(struct encrypt_ostream *estream, const char *algorithm
 
                /* mac context is optional */
                if ((estream->flags & IO_STREAM_ENC_INTEGRITY_HMAC) == IO_STREAM_ENC_INTEGRITY_HMAC) {
-                       if (!dcrypt_ctx_hmac_create(malg, &(estream->ctx_mac), &error)) {
+                       if (!dcrypt_ctx_hmac_create(malg, &estream->ctx_mac, &error)) {
                                io_stream_set_error(&estream->ostream.iostream, "Cannot create ostream-encrypt: %s", error);
                                return -1;
                        }
index 098297494ae0cf2a57ddace5f0f93ff749631486..826aecce46b93c48098fff3ddd9f8481c1abb4c3 100644 (file)
@@ -210,10 +210,10 @@ ldap_dict_build_query(struct ldap_dict *dict, const struct dict_ldap_map *map,
                template = map->filter;
        }
 
-       for(size_t i = 0; i < array_count(values) && i < array_count(&(map->ldap_attributes)); i++) {
+       for(size_t i = 0; i < array_count(values) && i < array_count(&map->ldap_attributes); i++) {
                struct var_expand_table entry;
                const char *const *valuep = array_idx(values, i);
-               const char *const *long_keyp = array_idx(&(map->ldap_attributes), i);
+               const char *const *long_keyp = array_idx(&map->ldap_attributes, i);
 
                entry.value = ldap_escape(*valuep);
                entry.long_key = *long_keyp;
@@ -342,7 +342,7 @@ ldap_dict_lookup_callback(struct ldap_result *result, struct dict_ldap_op *op)
                }
                ldap_search_iterator_deinit(&iter);
        }
-       op->callback(&(op->res), op->callback_ctx);
+       op->callback(&op->res, op->callback_ctx);
        pool_unref(&pool);
 }
 
@@ -441,7 +441,7 @@ void ldap_dict_lookup_async(struct dict *dict, const char *key,
                input.scope = map->scope_val;
                if (!ldap_dict_build_query(ctx, map, &values, strncmp(key, DICT_PATH_PRIVATE, strlen(DICT_PATH_PRIVATE))==0, query, &error)) {
                        op->res.error = error;
-                       callback(&(op->res), context);
+                       callback(&op->res, context);
                        pool_unref(&oppool);
                }
                input.filter = str_c(query);
@@ -451,7 +451,7 @@ void ldap_dict_lookup_async(struct dict *dict, const char *key,
                ldap_search_start(ctx->client, &input, ldap_dict_lookup_callback, op);
        } else {
                op->res.error = "no such key";
-               callback(&(op->res), context);
+               callback(&op->res, context);
                pool_unref(&oppool);
        }
 }
index 6ac4c616737563bbf444d51d88455db9f2553445..554c76c8568807302912ecc262252b1b56e23a68 100644 (file)
@@ -30,7 +30,7 @@ void ldap_connection_deinit(struct ldap_connection **_conn)
        unsigned int n = aqueue_count(conn->request_queue);
        for (unsigned int i = 0; i < n; i++) {
                struct ldap_op_queue_entry *const *reqp =
-                       array_idx(&(conn->request_array),
+                       array_idx(&conn->request_array,
                                  aqueue_idx(conn->request_queue, i));
                timeout_remove(&(*reqp)->to_abort);
        }
@@ -42,7 +42,7 @@ int ldap_connection_setup(struct ldap_connection *conn, const char **error_r)
 {
        int ret, opt;
 
-       ret = ldap_initialize(&(conn->conn), conn->set.uri);
+       ret = ldap_initialize(&conn->conn, conn->set.uri);
        if (ret != LDAP_SUCCESS) {
                *error_r = t_strdup_printf("ldap_initialize(uri=%s) failed: %s",
                                           conn->set.uri, ldap_err2string(ret));
@@ -155,7 +155,7 @@ int ldap_connection_init(struct ldap_client *client,
        conn->set.bind_dn = p_strdup(pool, set->bind_dn);
        if (set->password != NULL) {
                conn->set.password = p_strdup(pool, set->password);
-               ber_str2bv(conn->set.password, strlen(conn->set.password), 0, &(conn->cred));
+               ber_str2bv(conn->set.password, strlen(conn->set.password), 0, &conn->cred);
        }
        /* cannot use these */
        conn->ssl_set.ca = NULL;
@@ -179,8 +179,8 @@ int ldap_connection_init(struct ldap_client *client,
                return -1;
        }
 
-       p_array_init(&(conn->request_array), conn->pool, 10);
-       conn->request_queue = aqueue_init(&(conn->request_array.arr));
+       p_array_init(&conn->request_array, conn->pool, 10);
+       conn->request_queue = aqueue_init(&conn->request_array.arr);
 
        *conn_r = conn;
        return 0;
@@ -198,10 +198,10 @@ void ldap_connection_switch_ioloop(struct ldap_connection *conn)
 
        for (unsigned int i = 0; i < n; i++) {
                struct ldap_op_queue_entry *const *reqp =
-                       array_idx(&(conn->request_array),
+                       array_idx(&conn->request_array,
                                  aqueue_idx(conn->request_queue, i));
                if ((*reqp)->to_abort != NULL)
-                       (*reqp)->to_abort = io_loop_move_timeout(&((*reqp)->to_abort));
+                       (*reqp)->to_abort = io_loop_move_timeout(&(*reqp)->to_abort);
        }
 }
 
@@ -240,7 +240,7 @@ void ldap_connection_send_next(struct ldap_connection *conn)
        unsigned int i = 0, n;
        struct ldap_op_queue_entry *req;
 
-       timeout_remove(&(conn->to_reconnect));
+       timeout_remove(&conn->to_reconnect);
 
        if (conn->state == LDAP_STATE_DISCONNECT) {
                if (ldap_connection_connect(conn) == -1)
@@ -260,7 +260,7 @@ void ldap_connection_send_next(struct ldap_connection *conn)
 
        for(i=0; i < n; i++) {
                struct ldap_op_queue_entry *const *reqp =
-                       array_idx(&(conn->request_array),
+                       array_idx(&conn->request_array,
                                  aqueue_idx(conn->request_queue, i));
                if ((*reqp)->msgid > -1)
                        break;
@@ -389,7 +389,7 @@ ldap_connection_connect_parse(struct ldap_connection *conn,
                        return result_err;
                }
                if (msgtype != LDAP_RES_BIND) return 0;
-               ret = ldap_parse_sasl_bind_result(conn->conn, message, &(conn->scred), 0);
+               ret = ldap_parse_sasl_bind_result(conn->conn, message, &conn->scred, 0);
                if (ret != LDAP_SUCCESS) {
                        const char *error = t_strdup_printf(
                                "Cannot bind with server: %s", ldap_err2string(ret));
@@ -423,7 +423,7 @@ void ldap_connection_abort_request(struct ldap_op_queue_entry *req)
        unsigned int n = aqueue_count(req->conn->request_queue);
        for (unsigned int i = 0; i < n; i++) {
                struct ldap_op_queue_entry *const *reqp =
-                       array_idx(&(req->conn->request_array),
+                       array_idx(&req->conn->request_array,
                                  aqueue_idx(req->conn->request_queue, i));
                if (req == *reqp) {
                        aqueue_delete(req->conn->request_queue, i);
@@ -445,7 +445,7 @@ void ldap_connection_abort_all_requests(struct ldap_connection *conn)
        unsigned int n = aqueue_count(conn->request_queue);
        for (unsigned int i = 0; i < n; i++) {
                struct ldap_op_queue_entry **reqp =
-                       array_idx_modifiable(&(conn->request_array),
+                       array_idx_modifiable(&conn->request_array,
                aqueue_idx(conn->request_queue, i));
                timeout_remove(&(*reqp)->to_abort);
                if ((*reqp)->result_callback != NULL)
@@ -467,7 +467,7 @@ ldap_connect_next_message(struct ldap_connection *conn,
        case LDAP_STATE_DISCONNECT:
                /* if we should not disable SSL, and the URI is not ldaps:// */
                if (!conn->set.start_tls || strstr(conn->set.uri, "ldaps://") == NULL) {
-                       ret = ldap_start_tls(conn->conn, NULL, NULL, &(req->msgid));
+                       ret = ldap_start_tls(conn->conn, NULL, NULL, &req->msgid);
                        if (ret != LDAP_SUCCESS) {
                                ldap_connection_result_failure(conn, req, ret, t_strdup_printf(
                                        "ldap_start_tls(uri=%s) failed: %s",
@@ -483,10 +483,10 @@ ldap_connect_next_message(struct ldap_connection *conn,
                ret = ldap_sasl_bind(conn->conn,
                        conn->set.bind_dn,
                        LDAP_SASL_SIMPLE,
-                       &(conn->cred),
+                       &conn->cred,
                        NULL,
                        NULL,
-                       &(req->msgid));
+                       &req->msgid);
                if (ret != LDAP_SUCCESS) {
                        ldap_connection_result_failure(conn, req, ret, t_strdup_printf(
                                "ldap_sasl_bind(uri=%s, dn=%s) failed: %s",
@@ -548,15 +548,15 @@ int ldap_connection_connect(struct ldap_connection *conn)
 
 void ldap_connection_kill(struct ldap_connection *conn)
 {
-       io_remove_closed(&(conn->io));
-       timeout_remove(&(conn->to_disconnect));
-       timeout_remove(&(conn->to_reconnect));
+       io_remove_closed(&conn->io);
+       timeout_remove(&conn->to_disconnect);
+       timeout_remove(&conn->to_reconnect);
        if (conn->request_queue != NULL) {
                unsigned int n = aqueue_count(conn->request_queue);
 
                for (unsigned int i = 0; i < n; i++) {
                        struct ldap_op_queue_entry *const *reqp =
-                               array_idx(&(conn->request_array),
+                               array_idx(&conn->request_array,
                                          aqueue_idx(conn->request_queue, i));
                        if ((*reqp)->msgid > -1)
                                ldap_abandon_ext(conn->conn, (*reqp)->msgid, NULL, NULL);
@@ -585,7 +585,7 @@ ldap_connection_find_req_by_msgid(struct ldap_connection *conn, int msgid,
        unsigned int i, n = aqueue_count(conn->request_queue);
        for (i = 0; i < n; i++) {
                struct ldap_op_queue_entry *const *reqp =
-                       array_idx(&(conn->request_array),
+                       array_idx(&conn->request_array,
                                  aqueue_idx(conn->request_queue, i));
                if ((*reqp)->msgid == msgid) {
                        *idx_r = i;
index 35e98e9f1d1c6d114c7be9d0c9d311fccb382318..db331aaafc5c1dcb8edf16b8fd9dd9abb94ff6b8 100644 (file)
@@ -20,25 +20,25 @@ int ldap_entry_init(struct ldap_entry *obj, struct ldap_result *result,
        tmp = ldap_first_attribute(result->conn->conn, message, &bptr);
 
        p_array_init(&attr_names, result->pool, 8);
-       p_array_init(&(obj->attributes), result->pool, 8);
+       p_array_init(&obj->attributes, result->pool, 8);
 
        while(tmp != NULL) {
                struct ldap_attribute *attr = p_new(result->pool, struct ldap_attribute, 1);
                attr->name = p_strdup(result->pool, tmp);
-               array_append(&attr_names, &(attr->name), 1);
+               array_append(&attr_names, &attr->name, 1);
                values = ldap_get_values_len(result->conn->conn, message, tmp);
                if (values != NULL) {
                        count = ldap_count_values_len(values);
-                       p_array_init(&(attr->values), result->pool, count);
+                       p_array_init(&attr->values, result->pool, count);
                        for(int i = 0; i < count; i++) {
                                const char *ptr = p_strndup(result->pool, values[i]->bv_val, values[i]->bv_len);
-                               array_append(&(attr->values), &ptr, 1);
+                               array_append(&attr->values, &ptr, 1);
                        }
                        ldap_value_free_len(values);
                }
-               array_append_zero(&(attr->values));
+               array_append_zero(&attr->values);
                ldap_memfree(tmp);
-               array_append(&(obj->attributes), attr, 1);
+               array_append(&obj->attributes, attr, 1);
                tmp = ldap_next_attribute(result->conn->conn, message, bptr);
        }
 
@@ -63,9 +63,9 @@ const char *const *ldap_entry_get_attributes(const struct ldap_entry *entry)
 const char *const *ldap_entry_get_attribute(const struct ldap_entry *entry, const char *attribute)
 {
        const struct ldap_attribute *attr;
-       array_foreach(&(entry->attributes), attr) {
+       array_foreach(&entry->attributes, attr) {
                if (strcasecmp(attr->name, attribute) == 0) {
-                       return array_idx(&(attr->values), 0);
+                       return array_idx(&attr->values, 0);
                }
        }
        return NULL;
index 8c38ff0efbf6e1661c8d28200ed9081a6ce5b40f..79147f053b8124205af792e43b1d49c8167104ad 100644 (file)
@@ -18,9 +18,9 @@ struct ldap_search_iterator* ldap_search_iterator_init(struct ldap_result *resul
 
 const struct ldap_entry *ldap_search_iterator_next(struct ldap_search_iterator *iter)
 {
-       if (iter->idx >= array_count(&(iter->result->entries)))
+       if (iter->idx >= array_count(&iter->result->entries))
                return NULL;
-       return array_idx(&(iter->result->entries), iter->idx++);
+       return array_idx(&iter->result->entries, iter->idx++);
 }
 
 void ldap_search_iterator_deinit(struct ldap_search_iterator **iter)
index b386871c2aea055d1137c29d1171b70fbb24af8e..6a10da6522929233a12b4c22b3afe9f3c75c3887 100644 (file)
@@ -19,14 +19,14 @@ ldap_search_result_failure(struct ldap_op_queue_entry *req,
        struct ldap_search_ctx *sctx = req->ctx;
        sctx->res.openldap_ret = ret;
        sctx->res.error_string = error;
-       req->result_callback(&(sctx->res), req->result_callback_ctx);
+       req->result_callback(&sctx->res, req->result_callback_ctx);
 }
 
 static void ldap_search_result_success(struct ldap_op_queue_entry *req)
 {
        struct ldap_search_ctx *sctx = req->ctx;
        sctx->res.openldap_ret = LDAP_SUCCESS;
-       req->result_callback(&(sctx->res), req->result_callback_ctx);
+       req->result_callback(&sctx->res, req->result_callback_ctx);
 }
 
 static int
@@ -69,8 +69,8 @@ ldap_search_callback(struct ldap_connection *conn,
 
        while(res != NULL) {
                struct ldap_entry *obj = p_new(req->pool, struct ldap_entry, 1);
-               ldap_entry_init(obj, &(sctx->res), message);
-               array_append(&(sctx->res.entries), obj, 1);
+               ldap_entry_init(obj, &sctx->res, message);
+               array_append(&sctx->res.entries, obj, 1);
                res = ldap_next_entry(conn->conn, res);
        }
 
@@ -112,7 +112,7 @@ ldap_search_send(struct ldap_connection *conn, struct ldap_op_queue_entry *req,
                NULL,
                &tv,
                input->size_limit,
-               &(req->msgid));
+               &req->msgid);
 
        if (ret != LDAP_SUCCESS) {
                *error_r = t_strdup_printf(
@@ -137,7 +137,7 @@ void ldap_connection_search_start(struct ldap_connection *conn,
        sctx->res.conn = conn;
        sctx->res.pool = pool;
 
-       p_array_init(&(sctx->res.entries), req->pool, 8);
+       p_array_init(&sctx->res.entries, req->pool, 8);
 
        req->internal_response_cb = ldap_search_callback;