You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bo...@apache.org on 2006/06/07 13:34:48 UTC

svn commit: r412372 - /apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c

Author: bojan
Date: Wed Jun  7 04:34:48 2006
New Revision: 412372

URL: http://svn.apache.org/viewvc?rev=412372&view=rev
Log:
Don't cast cleanup function, provide wrappers instead.

Modified:
    apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c

Modified: apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c?rev=412372&r1=412371&r2=412372&view=diff
==============================================================================
--- apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c (original)
+++ apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c Wed Jun  7 04:34:48 2006
@@ -67,6 +67,11 @@
 		} \
 	} while(0);
 
+static apr_status_t free_table(void *data)
+{
+    sqlite_free_table(data); 
+    return APR_SUCCESS;
+}
 
 static int dbd_sqlite_select(apr_pool_t * pool, apr_dbd_t * sql,
                              apr_dbd_results_t ** results, const char *query,
@@ -97,7 +102,7 @@
         (*results)->random = seek;
 
         if (tuples > 0)
-            apr_pool_cleanup_register(pool, result, (void *) sqlite_free_table,
+            apr_pool_cleanup_register(pool, result, free_table,
                                       apr_pool_cleanup_null);
 
         ret = 0;
@@ -216,11 +221,17 @@
     return ret;
 }
 
+static apr_status_t free_mem(void *data)
+{
+    sqlite_freemem(data);
+    return APR_SUCCESS
+}
+
 static const char *dbd_sqlite_escape(apr_pool_t * pool, const char *arg,
                                      apr_dbd_t * sql)
 {
     char *ret = sqlite_mprintf("%q", arg);
-    apr_pool_cleanup_register(pool, ret, (void *) sqlite_freemem,
+    apr_pool_cleanup_register(pool, ret, free_mem,
                               apr_pool_cleanup_null);
     return ret;
 }



Re: svn commit: r412372 - /apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c

Posted by Bojan Smojver <bo...@rexursive.com>.
On Wed, 2006-06-07 at 11:34 +0000, bojan@apache.org wrote:

> Don't cast cleanup function, provide wrappers instead.

I'll audit other DBD drivers too.

-- 
Bojan