From commits-return-7753-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Wed Jun 07 12:13:32 2006 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 20724 invoked from network); 7 Jun 2006 12:13:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Jun 2006 12:13:32 -0000 Received: (qmail 2791 invoked by uid 500); 7 Jun 2006 12:13:31 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 2689 invoked by uid 500); 7 Jun 2006 12:13:31 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 2678 invoked by uid 99); 7 Jun 2006 12:13:31 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jun 2006 05:13:31 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jun 2006 05:13:30 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 9E3791A983A; Wed, 7 Jun 2006 05:13:10 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r412385 - in /apr/apr-util/branches/1.2.x/dbd: apr_dbd_pgsql.c apr_dbd_sqlite3.c Date: Wed, 07 Jun 2006 12:13:10 -0000 To: commits@apr.apache.org From: bojan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060607121310.9E3791A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: bojan Date: Wed Jun 7 05:13:09 2006 New Revision: 412385 URL: http://svn.apache.org/viewvc?rev=412385&view=rev Log: Merge r412384 from trunk to 1.2.x branch Original message: Don't cast cleanup functions, provide wrappers instead (PgSQL, SQLite3). Modified: apr/apr-util/branches/1.2.x/dbd/apr_dbd_pgsql.c apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite3.c Modified: apr/apr-util/branches/1.2.x/dbd/apr_dbd_pgsql.c URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/dbd/apr_dbd_pgsql.c?rev=412385&r1=412384&r2=412385&view=diff ============================================================================== --- apr/apr-util/branches/1.2.x/dbd/apr_dbd_pgsql.c (original) +++ apr/apr-util/branches/1.2.x/dbd/apr_dbd_pgsql.c Wed Jun 7 05:13:09 2006 @@ -69,6 +69,12 @@ || ((x) == PGRES_COMMAND_OK) \ || ((x) == PGRES_TUPLES_OK)) +static apr_status_t clear_result(void *data) +{ + PQclear(data); + return APR_SUCCESS; +} + static int dbd_pgsql_select(apr_pool_t *pool, apr_dbd_t *sql, apr_dbd_results_t **results, const char *query, int seek) @@ -103,7 +109,7 @@ (*results)->ntuples = PQntuples(res); (*results)->sz = PQnfields(res); (*results)->random = seek; - apr_pool_cleanup_register(pool, res, (void*)PQclear, + apr_pool_cleanup_register(pool, res, clear_result, apr_pool_cleanup_null); } else { @@ -459,7 +465,7 @@ (*results)->ntuples = PQntuples(res); (*results)->sz = PQnfields(res); (*results)->random = seek; - apr_pool_cleanup_register(pool, res, (void*)PQclear, + apr_pool_cleanup_register(pool, res, clear_result, apr_pool_cleanup_null); } else { Modified: apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite3.c URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite3.c?rev=412385&r1=412384&r2=412385&view=diff ============================================================================== --- apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite3.c (original) +++ apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite3.c Wed Jun 7 05:13:09 2006 @@ -299,11 +299,17 @@ return ret; } +static apr_status_t free_mem(void *data) +{ + sqlite3_free(data); + return APR_SUCCESS; +} + static const char *dbd_sqlite3_escape(apr_pool_t *pool, const char *arg, apr_dbd_t *sql) { char *ret = sqlite3_mprintf("%q", arg); - apr_pool_cleanup_register(pool, ret, (void *) sqlite3_free, + apr_pool_cleanup_register(pool, ret, free_mem, apr_pool_cleanup_null); return ret; }