Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 10515 invoked from network); 21 Sep 2005 14:30:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Sep 2005 14:30:22 -0000 Received: (qmail 1024 invoked by uid 500); 21 Sep 2005 14:30:21 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 985 invoked by uid 500); 21 Sep 2005 14:30:20 -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 963 invoked by uid 99); 21 Sep 2005 14:30:20 -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; Wed, 21 Sep 2005 07:30:20 -0700 Received: (qmail 10225 invoked by uid 65534); 21 Sep 2005 14:29:59 -0000 Message-ID: <20050921142959.10224.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r290711 - /httpd/httpd/trunk/modules/database/mod_dbd.c Date: Wed, 21 Sep 2005 14:29:59 -0000 To: cvs@httpd.apache.org From: niq@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: niq Date: Wed Sep 21 07:29:57 2005 New Revision: 290711 URL: http://svn.apache.org/viewcvs?rev=290711&view=rev Log: Eliminate possible compiler warnings pointed out by Joe. Modified: httpd/httpd/trunk/modules/database/mod_dbd.c Modified: httpd/httpd/trunk/modules/database/mod_dbd.c URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/database/mod_dbd.c?rev=290711&r1=290710&r2=290711&view=diff ============================================================================== --- httpd/httpd/trunk/modules/database/mod_dbd.c (original) +++ httpd/httpd/trunk/modules/database/mod_dbd.c Wed Sep 21 07:29:57 2005 @@ -27,9 +27,9 @@ #include "http_log.h" #include "apr_reslist.h" #include "apr_strings.h" - #include "apr_dbd.h" #include "mod_dbd.h" + extern module AP_MODULE_DECLARE_DATA dbd_module; /************ svr cfg: manage db connection pool ****************/ @@ -287,19 +287,19 @@ - open acquires a connection from the pool (opens one if necessary) - close releases it back in to the pool */ - +#define arec ((ap_dbd_t*)rec) #if APR_HAS_THREADS ap_dbd_t* ap_dbd_open(apr_pool_t *pool, server_rec *s) { - ap_dbd_t *rec = NULL; + void *rec = NULL; svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module); - apr_status_t rv; + apr_status_t rv = APR_SUCCESS; const char *errmsg; if (!svr->persist) { /* Return a once-only connection */ - rv = dbd_construct((void**)&rec, svr, pool); - return (rv == APR_SUCCESS) ? rec : NULL; + rv = dbd_construct(&rec, svr, pool); + return (rv == APR_SUCCESS) ? arec : NULL; } if (!svr->dbpool) { @@ -307,13 +307,13 @@ return NULL; } } - if (apr_reslist_acquire(svr->dbpool, (void**)&rec) != APR_SUCCESS) { + if (apr_reslist_acquire(svr->dbpool, &rec) != APR_SUCCESS) { ap_log_perror(APLOG_MARK, APLOG_ERR, 0, pool, "Failed to acquire DBD connection from pool!"); return NULL; } - if (apr_dbd_check_conn(rec->driver, pool, rec->handle) != APR_SUCCESS) { - errmsg = apr_dbd_error(rec->driver, rec->handle, rv); + if (apr_dbd_check_conn(arec->driver, pool, arec->handle) != APR_SUCCESS) { + errmsg = apr_dbd_error(arec->driver, arec->handle, rv); if (!errmsg) { errmsg = "(unknown)"; } @@ -322,27 +322,27 @@ apr_reslist_invalidate(svr->dbpool, rec); return NULL; } - return rec; + return arec; } #else ap_dbd_t* ap_dbd_open(apr_pool_t *pool, server_rec *s) { - apr_status_t rv; + apr_status_t rv = APR_SUCCESS; const char *errmsg; - ap_dbd_t *rec = NULL; + void *rec = NULL; svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module); if (!svr->persist) { /* Return a once-only connection */ - rv = dbd_construct((void**)&rec, svr, pool); - return (rv == APR_SUCCESS) ? rec : NULL; + rv = dbd_construct(&rec, svr, pool); + return (rv == APR_SUCCESS) ? arec : NULL; } /* since we're in nothread-land, we can mess with svr->conn with impunity */ /* If we have a persistent connection and it's good, we'll use it */ if (svr->conn) { if (apr_dbd_check_conn(svr->conn->driver, pool, svr->conn->handle) != 0){ - errmsg = apr_dbd_error(rec->driver, rec->handle, rv); + errmsg = apr_dbd_error(arec->driver, arec->handle, rv); if (!errmsg) { errmsg = "(unknown)"; } @@ -353,8 +353,8 @@ } /* We don't have a connection right now, so we'll open one */ if (!svr->conn) { - rv = dbd_construct((void**)&rec, svr, pool); - svr->conn = (rv == APR_SUCCESS) ? rec : NULL; + rv = dbd_construct(&rec, svr, pool); + svr->conn = (rv == APR_SUCCESS) ? arec : NULL; } return svr->conn; }