jorton 2003/06/08 06:36:32
Modified: locks/unix thread_mutex.c
Log:
Code style cleanups: remove unnecessary casts to and from void *;
don't check for allocation failure.
Revision Changes Path
1.17 +3 -8 apr/locks/unix/thread_mutex.c
Index: thread_mutex.c
===================================================================
RCS file: /home/cvs/apr/locks/unix/thread_mutex.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -u -r1.16 -r1.17
--- thread_mutex.c 8 Jun 2003 13:29:22 -0000 1.16
+++ thread_mutex.c 8 Jun 2003 13:36:32 -0000 1.17
@@ -60,7 +60,7 @@
static apr_status_t thread_mutex_cleanup(void *data)
{
- apr_thread_mutex_t *mutex = (apr_thread_mutex_t *)data;
+ apr_thread_mutex_t *mutex = data;
apr_status_t rv;
rv = pthread_mutex_destroy(&mutex->mutex);
@@ -79,12 +79,7 @@
apr_thread_mutex_t *new_mutex;
apr_status_t rv;
- new_mutex = (apr_thread_mutex_t *)apr_pcalloc(pool,
-
sizeof(apr_thread_mutex_t));
-
- if (new_mutex == NULL) {
- return APR_ENOMEM;
- }
+ new_mutex = apr_pcalloc(pool, sizeof(apr_thread_mutex_t));
new_mutex->pool = pool;
@@ -102,7 +97,7 @@
}
apr_pool_cleanup_register(new_mutex->pool,
- (void *)new_mutex, thread_mutex_cleanup,
+ new_mutex, thread_mutex_cleanup,
apr_pool_cleanup_null);
*mutex = new_mutex;