Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 48516 invoked from network); 1 Aug 2005 15:32:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Aug 2005 15:32:46 -0000 Received: (qmail 2712 invoked by uid 500); 1 Aug 2005 15:32:45 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 2529 invoked by uid 500); 1 Aug 2005 15:32:44 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 2516 invoked by uid 99); 1 Aug 2005 15:32:44 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 01 Aug 2005 08:32:33 -0700 Received: (qmail 48476 invoked by uid 65534); 1 Aug 2005 15:32:31 -0000 Message-ID: <20050801153231.48475.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r226820 - /httpd/httpd/trunk/modules/ldap/util_ldap_cache.c Date: Mon, 01 Aug 2005 15:32:30 -0000 To: cvs@httpd.apache.org From: jorton@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jorton Date: Mon Aug 1 08:32:28 2005 New Revision: 226820 URL: http://svn.apache.org/viewcvs?rev=226820&view=rev Log: * modules/ldap/util_ldap_cache.c: Remove various casts-from-void *, fix various minor style nits. No functional changes. Modified: httpd/httpd/trunk/modules/ldap/util_ldap_cache.c Modified: httpd/httpd/trunk/modules/ldap/util_ldap_cache.c URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/ldap/util_ldap_cache.c?rev=226820&r1=226819&r2=226820&view=diff ============================================================================== --- httpd/httpd/trunk/modules/ldap/util_ldap_cache.c (original) +++ httpd/httpd/trunk/modules/ldap/util_ldap_cache.c Mon Aug 1 08:32:28 2005 @@ -33,22 +33,22 @@ unsigned long util_ldap_url_node_hash(void *n) { - util_url_node_t *node = (util_url_node_t *)n; + util_url_node_t *node = n; return util_ald_hash_string(1, node->url); } int util_ldap_url_node_compare(void *a, void *b) { - util_url_node_t *na = (util_url_node_t *)a; - util_url_node_t *nb = (util_url_node_t *)b; + util_url_node_t *na = a; + util_url_node_t *nb = b; - return(strcmp(na->url, nb->url) == 0); + return (strcmp(na->url, nb->url) == 0); } void *util_ldap_url_node_copy(util_ald_cache_t *cache, void *c) { - util_url_node_t *n = (util_url_node_t *)c; - util_url_node_t *node = (util_url_node_t *)util_ald_alloc(cache, sizeof(util_url_node_t)); + util_url_node_t *n = c; + util_url_node_t *node = util_ald_alloc(cache, sizeof *node); if (node) { if (!(node->url = util_ald_strdup(cache, n->url))) { @@ -67,7 +67,7 @@ void util_ldap_url_node_free(util_ald_cache_t *cache, void *n) { - util_url_node_t *node = (util_url_node_t *)n; + util_url_node_t *node = n; util_ald_free(cache, node->url); util_ald_destroy_cache(node->search_cache); @@ -78,7 +78,7 @@ void util_ldap_url_node_display(request_rec *r, util_ald_cache_t *cache, void *n) { - util_url_node_t *node = (util_url_node_t *)n; + util_url_node_t *node = n; char date_str[APR_CTIME_LEN+1]; char *buf; const char *type_str; @@ -135,20 +135,22 @@ /* Cache functions for search nodes */ unsigned long util_ldap_search_node_hash(void *n) { - util_search_node_t *node = (util_search_node_t *)n; - return util_ald_hash_string(1, ((util_search_node_t *)(node))->username); + util_search_node_t *node = n; + return util_ald_hash_string(1, node->username); } int util_ldap_search_node_compare(void *a, void *b) { - return(strcmp(((util_search_node_t *)a)->username, - ((util_search_node_t *)b)->username) == 0); + util_search_node_t *na = a; + util_search_node_t *nb = b; + + return (strcmp(na->username, nb->username) == 0); } void *util_ldap_search_node_copy(util_ald_cache_t *cache, void *c) { - util_search_node_t *node = (util_search_node_t *)c; - util_search_node_t *newnode = util_ald_alloc(cache, sizeof(util_search_node_t)); + util_search_node_t *node = c; + util_search_node_t *newnode = util_ald_alloc(cache, sizeof *newnode); /* safety check */ if (newnode) { @@ -199,8 +201,9 @@ void util_ldap_search_node_free(util_ald_cache_t *cache, void *n) { int i = 0; - util_search_node_t *node = (util_search_node_t *)n; + util_search_node_t *node = n; int k = node->numvals; + if (node->vals) { for (;k;k--,i++) { if (node->vals[i]) { @@ -217,7 +220,7 @@ void util_ldap_search_node_display(request_rec *r, util_ald_cache_t *cache, void *n) { - util_search_node_t *node = (util_search_node_t *)n; + util_search_node_t *node = n; char date_str[APR_CTIME_LEN+1]; char *buf; @@ -240,14 +243,15 @@ unsigned long util_ldap_compare_node_hash(void *n) { - util_compare_node_t *node = (util_compare_node_t *)n; + util_compare_node_t *node = n; return util_ald_hash_string(3, node->dn, node->attrib, node->value); } int util_ldap_compare_node_compare(void *a, void *b) { - util_compare_node_t *na = (util_compare_node_t *)a; - util_compare_node_t *nb = (util_compare_node_t *)b; + util_compare_node_t *na = a; + util_compare_node_t *nb = b; + return (strcmp(na->dn, nb->dn) == 0 && strcmp(na->attrib, nb->attrib) == 0 && strcmp(na->value, nb->value) == 0); @@ -255,8 +259,8 @@ void *util_ldap_compare_node_copy(util_ald_cache_t *cache, void *c) { - util_compare_node_t *n = (util_compare_node_t *)c; - util_compare_node_t *node = (util_compare_node_t *)util_ald_alloc(cache, sizeof(util_compare_node_t)); + util_compare_node_t *n = c; + util_compare_node_t *node = util_ald_alloc(cache, sizeof *node); if (node) { if (!(node->dn = util_ald_strdup(cache, n->dn)) || @@ -276,7 +280,7 @@ void util_ldap_compare_node_free(util_ald_cache_t *cache, void *n) { - util_compare_node_t *node = (util_compare_node_t *)n; + util_compare_node_t *node = n; util_ald_free(cache, node->dn); util_ald_free(cache, node->attrib); util_ald_free(cache, node->value); @@ -285,7 +289,7 @@ void util_ldap_compare_node_display(request_rec *r, util_ald_cache_t *cache, void *n) { - util_compare_node_t *node = (util_compare_node_t *)n; + util_compare_node_t *node = n; char date_str[APR_CTIME_LEN+1]; char *buf, *cmp_result; @@ -322,19 +326,23 @@ unsigned long util_ldap_dn_compare_node_hash(void *n) { - return util_ald_hash_string(1, ((util_dn_compare_node_t *)n)->reqdn); + util_dn_compare_node_t *node = n; + return util_ald_hash_string(1, node->reqdn); } int util_ldap_dn_compare_node_compare(void *a, void *b) { - return (strcmp(((util_dn_compare_node_t *)a)->reqdn, - ((util_dn_compare_node_t *)b)->reqdn) == 0); + util_dn_compare_node_t *na = a; + util_dn_compare_node_t *nb = b; + + return (strcmp(na->reqdn, nb->reqdn) == 0); } void *util_ldap_dn_compare_node_copy(util_ald_cache_t *cache, void *c) { - util_dn_compare_node_t *n = (util_dn_compare_node_t *)c; - util_dn_compare_node_t *node = (util_dn_compare_node_t *)util_ald_alloc(cache, sizeof(util_dn_compare_node_t)); + util_dn_compare_node_t *n = c; + util_dn_compare_node_t *node = util_ald_alloc(cache, sizeof *node); + if (node) { if (!(node->reqdn = util_ald_strdup(cache, n->reqdn)) || !(node->dn = util_ald_strdup(cache, n->dn))) { @@ -350,7 +358,7 @@ void util_ldap_dn_compare_node_free(util_ald_cache_t *cache, void *n) { - util_dn_compare_node_t *node = (util_dn_compare_node_t *)n; + util_dn_compare_node_t *node = n; util_ald_free(cache, node->reqdn); util_ald_free(cache, node->dn); util_ald_free(cache, node); @@ -358,7 +366,7 @@ void util_ldap_dn_compare_node_display(request_rec *r, util_ald_cache_t *cache, void *n) { - util_dn_compare_node_t *node = (util_dn_compare_node_t *)n; + util_dn_compare_node_t *node = n; char *buf; buf = apr_psprintf(r->pool, @@ -376,7 +384,7 @@ /* ------------------------------------------------------------------ */ static apr_status_t util_ldap_cache_module_kill(void *data) { - util_ldap_state_t *st = (util_ldap_state_t *)data; + util_ldap_state_t *st = data; util_ald_destroy_cache(st->util_ldap_cache); #if APR_HAS_SHARED_MEMORY