Warning cleanup: function ptr <=> void* at ldap_pvt_thread_pool_<set/get>key()

This commit is contained in:
Hallvard Furuseth 2008-01-11 06:07:43 +00:00
parent 82719d5351
commit cd63a0c43b
10 changed files with 24 additions and 22 deletions

View File

@ -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;

View File

@ -790,7 +790,7 @@ int ldap_pvt_thread_pool_setkey(
if ( found ) {
*oldkfreep = ctx->ltu_key[i].ltk_free;
} else {
*oldkfreep = NULL;
*oldkfreep = 0;
}
}

View File

@ -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 );
}
}

View File

@ -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;

View File

@ -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 );

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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
}