From 546262acb88f5b23030fc20e257cc3809fe3b8e3 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 20 Aug 1999 19:50:11 +0000 Subject: [PATCH] complete this round of constification --- servers/slapd/attr.c | 2 +- servers/slapd/back-shell/config.c | 18 +++++++++--------- servers/slapd/charray.c | 8 ++++---- servers/slapd/proto-slap.h | 8 ++++---- servers/slapd/result.c | 12 +++++++----- 5 files changed, 25 insertions(+), 23 deletions(-) diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index bfdbc3c4ed..2aadf7056c 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -321,7 +321,7 @@ attr_syntax_config( save = argv[lasti]; argv[lasti] = NULL; - at->at_names = charray_dup( (const char **) argv ); + at->at_names = charray_dup( argv ); argv[lasti] = save; code = at_add( at, &err ); diff --git a/servers/slapd/back-shell/config.c b/servers/slapd/back-shell/config.c index d7442b1d8e..2c79d6dcd5 100644 --- a/servers/slapd/back-shell/config.c +++ b/servers/slapd/back-shell/config.c @@ -35,7 +35,7 @@ shell_back_db_config( fname, lineno ); return( 1 ); } - si->si_bind = charray_dup( (const char**) &argv[1] ); + si->si_bind = charray_dup( &argv[1] ); /* command + args to exec for unbinds */ } else if ( strcasecmp( argv[0], "unbind" ) == 0 ) { @@ -45,7 +45,7 @@ shell_back_db_config( fname, lineno ); return( 1 ); } - si->si_unbind = charray_dup( (const char**) &argv[1] ); + si->si_unbind = charray_dup( &argv[1] ); /* command + args to exec for searches */ } else if ( strcasecmp( argv[0], "search" ) == 0 ) { @@ -55,7 +55,7 @@ shell_back_db_config( fname, lineno ); return( 1 ); } - si->si_search = charray_dup( (const char**) &argv[1] ); + si->si_search = charray_dup( &argv[1] ); /* command + args to exec for compares */ } else if ( strcasecmp( argv[0], "compare" ) == 0 ) { @@ -65,7 +65,7 @@ shell_back_db_config( fname, lineno ); return( 1 ); } - si->si_compare = charray_dup( (const char**) &argv[1] ); + si->si_compare = charray_dup( &argv[1] ); /* command + args to exec for modifies */ } else if ( strcasecmp( argv[0], "modify" ) == 0 ) { @@ -75,7 +75,7 @@ shell_back_db_config( fname, lineno ); return( 1 ); } - si->si_modify = charray_dup( (const char**) &argv[1] ); + si->si_modify = charray_dup( &argv[1] ); /* command + args to exec for modrdn */ } else if ( strcasecmp( argv[0], "modrdn" ) == 0 ) { @@ -85,7 +85,7 @@ shell_back_db_config( fname, lineno ); return( 1 ); } - si->si_modrdn = charray_dup( (const char**) &argv[1] ); + si->si_modrdn = charray_dup( &argv[1] ); /* command + args to exec for add */ } else if ( strcasecmp( argv[0], "add" ) == 0 ) { @@ -95,7 +95,7 @@ shell_back_db_config( fname, lineno ); return( 1 ); } - si->si_add = charray_dup( (const char**) &argv[1] ); + si->si_add = charray_dup( &argv[1] ); /* command + args to exec for delete */ } else if ( strcasecmp( argv[0], "delete" ) == 0 ) { @@ -105,7 +105,7 @@ shell_back_db_config( fname, lineno ); return( 1 ); } - si->si_delete = charray_dup( (const char**) &argv[1] ); + si->si_delete = charray_dup( &argv[1] ); /* command + args to exec for abandon */ } else if ( strcasecmp( argv[0], "abandon" ) == 0 ) { @@ -115,7 +115,7 @@ shell_back_db_config( fname, lineno ); return( 1 ); } - si->si_abandon = charray_dup( (const char**) &argv[1] ); + si->si_abandon = charray_dup( &argv[1] ); /* anything else */ } else { diff --git a/servers/slapd/charray.c b/servers/slapd/charray.c index 8c27f1fbd0..bd79537de0 100644 --- a/servers/slapd/charray.c +++ b/servers/slapd/charray.c @@ -40,7 +40,7 @@ charray_add( void charray_merge( char ***a, - const char **s + char **s ) { int i, n, nn; @@ -79,7 +79,7 @@ charray_free( char **array ) int charray_inlist( - const char **a, + char **a, const char *s ) { @@ -95,7 +95,7 @@ charray_inlist( } char ** -charray_dup( const char **a ) +charray_dup( char **a ) { int i; char **new; @@ -115,7 +115,7 @@ charray_dup( const char **a ) char * -charray2str( const char **a ) +charray2str( char **a ) { char *s; int i; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index fe20446761..f8bb6c44c5 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -148,12 +148,12 @@ void ch_free LDAP_P(( void * )); */ void charray_add LDAP_P(( char ***a, const char *s )); -void charray_merge LDAP_P(( char ***a, const char **s )); +void charray_merge LDAP_P(( char ***a, char **s )); void charray_free LDAP_P(( char **array )); -int charray_inlist LDAP_P(( const char **a, const char *s )); -char ** charray_dup LDAP_P(( const char **a )); +int charray_inlist LDAP_P(( char **a, const char *s )); +char ** charray_dup LDAP_P(( char **a )); char ** str2charray LDAP_P(( const char *str, const char *brkstr )); -char * charray2str LDAP_P(( const char **a )); +char * charray2str LDAP_P(( char **a )); /* * controls.c diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 309350f646..1ed5717d7b 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -217,10 +217,10 @@ send_ldap_response( ber_tag_t tag, ber_int_t msgid, ber_int_t err, - char *matched, - char *text, + const char *matched, + const char *text, struct berval **ref, - char *resoid, + const char *resoid, struct berval *resdata, LDAPControl **ctrls ) @@ -381,7 +381,8 @@ send_ldap_result( err = LDAP_NO_SUCH_OBJECT; } else if ( op->o_protocol < LDAP_VERSION3 ) { err = LDAP_PARTIAL_RESULTS; - tmp = text = v2ref( ref ); + tmp = v2ref( ref ); + text = tmp; ref = NULL; } } @@ -445,7 +446,8 @@ send_search_result( err = LDAP_PARTIAL_RESULTS; } - tmp = text = v2ref( refs ); + tmp = v2ref( refs ); + text = tmp; refs = NULL; } else { -- 2.39.5