&& ( option == LBER_OPT_MEMORY_FNS )
&& ( invalue != NULL ))
{
- BerMemoryFunctions *f = (BerMemoryFunctions *) invalue;
+ const BerMemoryFunctions *f =
+ (const BerMemoryFunctions *) invalue;
/* make sure all functions are provided */
if(!( f->bmf_malloc && f->bmf_calloc
if(item == NULL) {
if(option == LBER_OPT_BER_DEBUG) {
- ber_int_debug = * (int *) invalue;
+ ber_int_debug = * (const int *) invalue;
return LBER_OPT_SUCCESS;
} else if(option == LBER_OPT_LOG_PRINT_FN) {
switch(option) {
case LBER_OPT_BER_OPTIONS:
assert( BER_VALID( ber ) );
- ber->ber_options = * (int *) invalue;
+ ber->ber_options = * (const int *) invalue;
return LBER_OPT_SUCCESS;
case LBER_OPT_BER_DEBUG:
assert( BER_VALID( ber ) );
- ber->ber_debug = * (int *) invalue;
+ ber->ber_debug = * (const int *) invalue;
return LBER_OPT_SUCCESS;
default:
break;
case LDAP_OPT_DEREF:
- lo->ldo_deref = * (int *) invalue;
+ lo->ldo_deref = * (const int *) invalue;
return LDAP_OPT_SUCCESS;
case LDAP_OPT_SIZELIMIT:
- lo->ldo_sizelimit = * (int *) invalue;
+ lo->ldo_sizelimit = * (const int *) invalue;
return LDAP_OPT_SUCCESS;
case LDAP_OPT_TIMELIMIT:
- lo->ldo_timelimit = * (int *) invalue;
+ lo->ldo_timelimit = * (const int *) invalue;
return LDAP_OPT_SUCCESS;
case LDAP_OPT_PROTOCOL_VERSION: {
- int vers = * (int *) invalue;
+ int vers = * (const int *) invalue;
if (vers < LDAP_VERSION_MIN || vers > LDAP_VERSION_MAX) {
/* not supported */
break;
} return LDAP_OPT_SUCCESS;
case LDAP_OPT_SERVER_CONTROLS: {
- LDAPControl **controls = (LDAPControl **) invalue;
+ LDAPControl *const *controls =
+ (LDAPControl *const *) invalue;
ldap_controls_free( lo->ldo_sctrls );
return LDAP_OPT_SUCCESS;
}
- lo->ldo_sctrls =
- ldap_controls_dup( (LDAPControl **) invalue );
+ lo->ldo_sctrls = ldap_controls_dup( controls );
if(lo->ldo_sctrls == NULL) {
/* memory allocation error ? */
} return LDAP_OPT_SUCCESS;
case LDAP_OPT_CLIENT_CONTROLS: {
- LDAPControl **controls = (LDAPControl **) invalue;
+ LDAPControl *const *controls =
+ (LDAPControl *const *) invalue;
ldap_controls_free( lo->ldo_cctrls );
return LDAP_OPT_SUCCESS;
}
- lo->ldo_cctrls =
- ldap_controls_dup( (LDAPControl **) invalue );
+ lo->ldo_cctrls = ldap_controls_dup( controls );
if(lo->ldo_cctrls == NULL) {
/* memory allocation error ? */
} return LDAP_OPT_SUCCESS;
case LDAP_OPT_HOST_NAME: {
- char* host = (char *) invalue;
+ const char *host = (const char *) invalue;
if(lo->ldo_defhost != NULL) {
LDAP_FREE(lo->ldo_defhost);
} return LDAP_OPT_SUCCESS;
case LDAP_OPT_ERROR_NUMBER: {
- int err = * (int *) invalue;
+ int err = * (const int *) invalue;
if(ld == NULL) {
/* need a struct ldap */
} return LDAP_OPT_SUCCESS;
case LDAP_OPT_ERROR_STRING: {
- char* err = (char *) invalue;
+ const char *err = (const char *) invalue;
if(ld == NULL) {
/* need a struct ldap */
} return LDAP_OPT_SUCCESS;
case LDAP_OPT_MATCHED_DN: {
- char* err = (char *) invalue;
+ const char *err = (const char *) invalue;
if(ld == NULL) {
/* need a struct ldap */
break;
case LDAP_OPT_DEBUG_LEVEL:
- lo->ldo_debug = * (int *) invalue;
+ lo->ldo_debug = * (const int *) invalue;
return LDAP_OPT_SUCCESS;
default: