]> git.sur5r.net Git - openldap/commitdiff
minor cleanup
authorPierangelo Masarati <ando@openldap.org>
Sun, 11 Jul 2004 22:55:57 +0000 (22:55 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 11 Jul 2004 22:55:57 +0000 (22:55 +0000)
servers/slapd/back-bdb/search.c

index a63a4bae9985462a57387cc4cd85a5138bd35fc8..4219a8c1936f7040f303182b8bdd15baf1fc877a 100644 (file)
@@ -149,7 +149,7 @@ static int search_aliases(
        ID cursora, ida, cursoro, ido, *subscop2;
        Entry *matched, *a;
        EntryInfo *ei;
-       struct berval bv_alias = { sizeof("alias")-1, "alias" };
+       struct berval bv_alias = BER_BVC( "alias" );
        AttributeAssertion aa_alias;
        Filter  af;
        DB_LOCK locka, lockr;
@@ -504,8 +504,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
        null_attr.an_desc = NULL;
        null_attr.an_oc = NULL;
        null_attr.an_oc_exclude = 0;
-       null_attr.an_name.bv_len = 0;
-       null_attr.an_name.bv_val = NULL;
+       BER_BVZERO( &null_attr.an_name );
 
        for( num_ctrls = 0; num_ctrls < SLAP_MAX_RESPONSE_CONTROLS; num_ctrls++ ) {
                ctrls[num_ctrls] = NULL;
@@ -517,8 +516,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
                attrs[0].an_desc = NULL;
                attrs[0].an_oc = NULL;
                attrs[0].an_oc_exclude = 0;
-               attrs[0].an_name.bv_len = 0;
-               attrs[0].an_name.bv_val = NULL;
+               BER_BVZERO( &attrs[0].an_name );
        }
 
        manageDSAit = get_manageDSAit( sop );
@@ -555,8 +553,8 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
                ei_root.bei_parent = &ei_root;
                e_root.e_private = &ei_root;
                e_root.e_id = 0;
-               e_root.e_nname.bv_val="";
-               e_root.e_name.bv_val="";
+               BER_BVSTR( &e_root.e_nname, "" );
+               BER_BVSTR( &e_root.e_name, "" );
                ei = &ei_root;
                rs->sr_err = LDAP_SUCCESS;
        } else {
@@ -1654,7 +1652,7 @@ static int search_candidates(
        {
                if( !get_manageDSAit(op) && !get_domainScope(op) ) {
                        /* match referral objects */
-                       struct berval bv_ref = { sizeof("referral")-1, "referral" };
+                       struct berval bv_ref = BER_BVC( "referral" );
                        rf.f_choice = LDAP_FILTER_EQUALITY;
                        rf.f_ava = &aa_ref;
                        rf.f_av_desc = slap_schema.si_ad_objectClass;
@@ -1678,7 +1676,7 @@ static int search_candidates(
 
 #ifdef BDB_SUBENTRIES
        if( get_subentries_visibility( op ) ) {
-               struct berval bv_subentry = { sizeof("SUBENTRY")-1, "SUBENTRY" };
+               struct berval bv_subentry = BER_BVC( "SUBENTRY" );
                sf.f_choice = LDAP_FILTER_EQUALITY;
                sf.f_ava = &aa_subentry;
                sf.f_av_desc = slap_schema.si_ad_objectClass;
@@ -1761,7 +1759,7 @@ send_paged_response(
                lastid ? *lastid : 0, rs->sr_nentries, NULL );
 #endif
 
-       ctrl.ldctl_value.bv_val = NULL;
+       BER_BVZERO( &ctrl.ldctl_value );
        ctrls[0] = &ctrl;
        ctrls[1] = NULL;
 
@@ -1774,8 +1772,7 @@ send_paged_response(
 
        } else {
                respcookie = ( PagedResultsCookie )0;
-               cookie.bv_val = "";
-               cookie.bv_len = 0;
+               BER_BVSTR( &cookie, "" );
        }
 
        op->o_conn->c_pagedresults_state.ps_cookie = respcookie;