From: Hallvard Furuseth Date: Fri, 11 Jan 2008 06:07:43 +0000 (+0000) Subject: Warning cleanup: function ptr <=> void* at ldap_pvt_thread_pool_key() X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~220 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd63a0c43bfefbdd22e75e62e3dd5b5df79355f7;p=openldap Warning cleanup: function ptr <=> void* at ldap_pvt_thread_pool_key() --- diff --git a/contrib/slapd-modules/smbk5pwd/smbk5pwd.c b/contrib/slapd-modules/smbk5pwd/smbk5pwd.c index 545a00cc72..f6072ee14e 100644 --- a/contrib/slapd-modules/smbk5pwd/smbk5pwd.c +++ b/contrib/slapd-modules/smbk5pwd/smbk5pwd.c @@ -215,7 +215,7 @@ static int smbk5pwd_op_cleanup( /* clear out the current key */ ldap_pvt_thread_pool_setkey( op->o_threadctx, smbk5pwd_op_cleanup, - NULL, NULL, NULL, NULL ); + NULL, 0, NULL, NULL ); /* free the callback */ cb = op->o_callback; @@ -235,7 +235,7 @@ static int smbk5pwd_op_bind( if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE ) { slap_callback *cb; ldap_pvt_thread_pool_setkey( op->o_threadctx, - smbk5pwd_op_cleanup, op, NULL, NULL, NULL ); + smbk5pwd_op_cleanup, op, 0, NULL, NULL ); cb = op->o_tmpcalloc( 1, sizeof(slap_callback), op->o_tmpmemctx ); cb->sc_cleanup = smbk5pwd_op_cleanup; cb->sc_next = op->o_callback; diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index ded2d5a20f..0824a11ba5 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -790,7 +790,7 @@ int ldap_pvt_thread_pool_setkey( if ( found ) { *oldkfreep = ctx->ltu_key[i].ltk_free; } else { - *oldkfreep = NULL; + *oldkfreep = 0; } } diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index 70c1f8bf74..3156667d40 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -1449,7 +1449,7 @@ bdb_locker_flush( DB_ENV *env ) void *ctx = ldap_pvt_thread_pool_context(); if ( !ldap_pvt_thread_pool_getkey( ctx, env, &data, NULL ) ) { - ldap_pvt_thread_pool_setkey( ctx, env, NULL, NULL, NULL, NULL ); + ldap_pvt_thread_pool_setkey( ctx, env, NULL, 0, NULL, NULL ); bdb_locker_id_free( env, data ); } } diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index d768084474..abe130f550 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -998,7 +998,7 @@ static void *search_stack( Operation *op ) void *ret = NULL; if ( op->o_threadctx ) { - ldap_pvt_thread_pool_getkey( op->o_threadctx, search_stack, + ldap_pvt_thread_pool_getkey( op->o_threadctx, (void *)search_stack, &ret, NULL ); } else { ret = bdb->bi_search_stack; @@ -1008,7 +1008,7 @@ static void *search_stack( Operation *op ) ret = ch_malloc( bdb->bi_search_stack_depth * BDB_IDL_UM_SIZE * sizeof( ID ) ); if ( op->o_threadctx ) { - ldap_pvt_thread_pool_setkey( op->o_threadctx, search_stack, + ldap_pvt_thread_pool_setkey( op->o_threadctx, (void *)search_stack, ret, search_stack_free, NULL, NULL ); } else { bdb->bi_search_stack = ret; diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 55a2f32e1c..7d6884a848 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -822,15 +822,15 @@ be_rootdn_bind( Operation *op, SlapReply *rs ) } #ifdef SLAPD_SPASSWD - ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, - op->o_conn->c_sasl_authctx, NULL, &old_authctx, NULL ); + ldap_pvt_thread_pool_setkey( op->o_threadctx, (void *)slap_sasl_bind, + op->o_conn->c_sasl_authctx, 0, &old_authctx, NULL ); #endif rc = lutil_passwd( &op->o_bd->be_rootpw, &op->orb_cred, NULL, NULL ); #ifdef SLAPD_SPASSWD - ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, - old_authctx, NULL, NULL, NULL ); + ldap_pvt_thread_pool_setkey( op->o_threadctx, (void *)slap_sasl_bind, + old_authctx, 0, NULL, NULL ); #endif rc = ( rc == 0 ? LDAP_SUCCESS : LDAP_INVALID_CREDENTIALS ); diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index ab084319e4..a42e7ace3f 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -971,11 +971,12 @@ conn_counter_init( Operation *op, void *ctx ) slap_counters_t *sc; void *vsc = NULL; - if ( ldap_pvt_thread_pool_getkey( ctx, conn_counter_init, &vsc, NULL ) || !vsc ) { + if ( ldap_pvt_thread_pool_getkey( + ctx, (void *)conn_counter_init, &vsc, NULL ) || !vsc ) { vsc = ch_malloc( sizeof( slap_counters_t )); sc = vsc; slap_counters_init( sc ); - ldap_pvt_thread_pool_setkey( ctx, conn_counter_init, vsc, + ldap_pvt_thread_pool_setkey( ctx, (void*)conn_counter_init, vsc, conn_counter_destroy, NULL, NULL ); ldap_pvt_thread_mutex_lock( &slap_counters.sc_mutex ); @@ -1946,14 +1947,14 @@ connection_fake_init2( void *ebx = NULL; /* Use thread keys to make sure these eventually get cleaned up */ - if ( ldap_pvt_thread_pool_getkey( ctx, connection_fake_init, &ebx, - NULL )) { + if ( ldap_pvt_thread_pool_getkey( ctx, (void *)connection_fake_init, + &ebx, NULL )) { eb = ch_malloc( sizeof( *eb )); slapi_int_create_object_extensions( SLAPI_X_EXT_CONNECTION, conn ); slapi_int_create_object_extensions( SLAPI_X_EXT_OPERATION, op ); eb->eb_conn = conn->c_extensions; eb->eb_op = op->o_hdr->oh_extensions; - ldap_pvt_thread_pool_setkey( ctx, connection_fake_init, + ldap_pvt_thread_pool_setkey( ctx, (void *)connection_fake_init, eb, connection_fake_destroy, NULL, NULL ); } else { eb = ebx; diff --git a/servers/slapd/overlays/memberof.c b/servers/slapd/overlays/memberof.c index 8915661ef6..09edce82b7 100644 --- a/servers/slapd/overlays/memberof.c +++ b/servers/slapd/overlays/memberof.c @@ -205,7 +205,7 @@ memberof_saved_member_get( Operation *op, void *keyp ) } else { ldap_pvt_thread_pool_setkey( op->o_threadctx, - key, NULL, NULL, &vals, NULL ); + key, NULL, 0, &vals, NULL ); } return vals; diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index 8b1c299e3c..18d0bd2142 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -507,8 +507,8 @@ slap_passwd_check( #ifdef SLAPD_SPASSWD void *old_authctx = NULL; - ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, - op->o_conn->c_sasl_authctx, NULL, &old_authctx, NULL ); + ldap_pvt_thread_pool_setkey( op->o_threadctx, (void *)slap_sasl_bind, + op->o_conn->c_sasl_authctx, 0, &old_authctx, NULL ); #endif for ( bv = a->a_vals; bv->bv_val != NULL; bv++ ) { @@ -526,8 +526,8 @@ slap_passwd_check( } #ifdef SLAPD_SPASSWD - ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, - old_authctx, NULL, NULL, NULL ); + ldap_pvt_thread_pool_setkey( op->o_threadctx, (void *)slap_sasl_bind, + old_authctx, 0, NULL, NULL ); #endif return result; diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 95b2394ed4..f794a99f87 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -829,7 +829,7 @@ static int chk_sasl( rtn = LUTIL_PASSWD_ERR; ctx = ldap_pvt_thread_pool_context(); - ldap_pvt_thread_pool_getkey( ctx, slap_sasl_bind, &sconn, NULL ); + ldap_pvt_thread_pool_getkey( ctx, (void *)slap_sasl_bind, &sconn, NULL ); if( sconn != NULL ) { int sc; diff --git a/servers/slapd/sl_malloc.c b/servers/slapd/sl_malloc.c index 16d6d81192..74e24e21e8 100644 --- a/servers/slapd/sl_malloc.c +++ b/servers/slapd/sl_malloc.c @@ -246,7 +246,8 @@ slap_sl_mem_detach( slheap = NULL; #else /* separate from context */ - ldap_pvt_thread_pool_setkey( ctx, (void *)slap_sl_mem_init, NULL, NULL, NULL, NULL ); + ldap_pvt_thread_pool_setkey( ctx, (void *)slap_sl_mem_init, + NULL, 0, NULL, NULL ); #endif }