From df3d8f3e30d896499540a49c9b662155909c3aaf Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 20 Feb 2005 04:59:29 +0000 Subject: [PATCH] Cleanup unused variables --- servers/slapd/back-bdb/add.c | 10 ---------- servers/slapd/back-bdb/attr.c | 2 +- servers/slapd/back-bdb/cache.c | 4 +--- servers/slapd/back-bdb/delete.c | 4 ---- servers/slapd/back-bdb/filterindex.c | 2 -- servers/slapd/back-bdb/id2entry.c | 2 +- servers/slapd/back-bdb/idl.c | 2 +- servers/slapd/back-bdb/index.c | 7 ++----- servers/slapd/back-bdb/init.c | 3 --- servers/slapd/back-bdb/modify.c | 5 ----- servers/slapd/back-bdb/modrdn.c | 7 ------- servers/slapd/back-bdb/nextid.c | 2 +- servers/slapd/back-bdb/search.c | 21 --------------------- servers/slapd/back-bdb/tools.c | 1 - 14 files changed, 7 insertions(+), 65 deletions(-) diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 3a1f6942f4..f94448412c 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -42,12 +42,6 @@ bdb_add(Operation *op, SlapReply *rs ) int num_retries = 0; - Operation* ps_list; - int rc; - EntryInfo *suffix_ei = NULL; - Entry *ctxcsn_e; - int ctxcsn_added = 0; - LDAPControl **postread_ctrl = NULL; LDAPControl *ctrls[SLAP_MAX_RESPONSE_CONTROLS]; int num_ctrls = 0; @@ -404,10 +398,6 @@ retry: /* transaction retry */ bdb_cache_add( bdb, ei, e, &nrdn, locker ); - if ( suffix_ei == NULL ) { - suffix_ei = BEI(e); - } - if(( rs->sr_err=TXN_COMMIT( ltid, 0 )) != 0 ) { rs->sr_text = "txn_commit failed"; } else { diff --git a/servers/slapd/back-bdb/attr.c b/servers/slapd/back-bdb/attr.c index 70a20ea9c1..157383ab32 100644 --- a/servers/slapd/back-bdb/attr.c +++ b/servers/slapd/back-bdb/attr.c @@ -81,7 +81,7 @@ bdb_attr_mask_cr( *indexmask = a->ai_indexmask; *cr = a->ai_cr; } else { - *indexmask = NULL; + *indexmask = 0; *cr = NULL; } } diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index 76d6e28c5e..7965cf8e69 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -373,8 +373,6 @@ hdb_cache_find_parent( { struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private; EntryInfo ei, eip, *ei2 = NULL, *ein = NULL, *eir = NULL; - char ndn[SLAP_LDAPDN_MAXLEN]; - ID parent; int rc; int addlru = 1; @@ -1236,7 +1234,7 @@ bdb_txn_free( void *key, void *data ) static int bdb_txn_get( Operation *op, DB_ENV *env, DB_TXN **txn, int reset ) { - int i, rc, lockid; + int i, rc; void *ctx, *data = NULL; /* If no op was provided, try to find the ctx anyway... */ diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index f7b3ff494f..142e698781 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -42,11 +42,7 @@ bdb_delete( Operation *op, SlapReply *rs ) int num_retries = 0; - Operation* ps_list; int rc; - EntryInfo *suffix_ei; - Entry *ctxcsn_e; - int ctxcsn_added = 0; LDAPControl **preread_ctrl = NULL; LDAPControl *ctrls[SLAP_MAX_RESPONSE_CONTROLS]; diff --git a/servers/slapd/back-bdb/filterindex.c b/servers/slapd/back-bdb/filterindex.c index 4d9cb47f12..ea997d1b35 100644 --- a/servers/slapd/back-bdb/filterindex.c +++ b/servers/slapd/back-bdb/filterindex.c @@ -224,7 +224,6 @@ comp_list_candidates( ID *tmp, ID *save ) { - struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private; int rc = 0; ComponentFilter *f; @@ -485,7 +484,6 @@ list_candidates( ID *tmp, ID *save ) { - struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private; int rc = 0; Filter *f; diff --git a/servers/slapd/back-bdb/id2entry.c b/servers/slapd/back-bdb/id2entry.c index b8d9028964..cfd60ad3a8 100644 --- a/servers/slapd/back-bdb/id2entry.c +++ b/servers/slapd/back-bdb/id2entry.c @@ -99,7 +99,7 @@ int bdb_id2entry( DB *db = bdb->bi_id2entry->bdi_db; DBT key, data; struct berval bv; - int rc = 0, ret = 0; + int rc = 0; ID nid; *e = NULL; diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index 32a78a93c6..b6d0208fad 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -611,7 +611,7 @@ bdb_idl_insert_key( int rc; DBT data; DBC *cursor; - ID lo, hi, tmp, nlo, nhi, nid; + ID lo, hi, nlo, nhi, nid; char *err; { diff --git a/servers/slapd/back-bdb/index.c b/servers/slapd/back-bdb/index.c index 3e725c8800..4db3c6794a 100644 --- a/servers/slapd/back-bdb/index.c +++ b/servers/slapd/back-bdb/index.c @@ -166,7 +166,6 @@ static int indexer( slap_mask_t mask ) { int rc, i; - const char *text; DB *db; struct berval *keys; @@ -269,10 +268,6 @@ static int index_at_values( { int rc; slap_mask_t mask = 0; -#ifdef LDAP_COMP_MATCH - ComponentReference* cr_list, *cr; - AttributeDescription *comp_ad; -#endif if( type->sat_sup ) { /* recurse */ @@ -287,6 +282,8 @@ static int index_at_values( if( type->sat_ad ) { #ifdef LDAP_COMP_MATCH /* component indexing */ + ComponentReference* cr_list, *cr; + bdb_attr_mask_cr( op->o_bd->be_private, type->sat_ad, &mask, &cr_list ); if ( cr_list ) { for( cr = cr_list ; cr ; cr = cr->cr_next ) { diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 39e9239092..5492bd226d 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -416,9 +416,6 @@ bdb_db_destroy( BackendDB *be ) { int rc; struct bdb_info *bdb = (struct bdb_info *) be->be_private; - Operation *ps = NULL; - Operation *psn = NULL; - void *saved_tmpmemctx = NULL; /* close db environment */ if( bdb->bi_dbenv ) { diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index db166d0c37..6ca4e3208a 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -282,12 +282,7 @@ bdb_modify( Operation *op, SlapReply *rs ) LDAPControl *ctrls[SLAP_MAX_RESPONSE_CONTROLS]; int num_ctrls = 0; - Operation* ps_list; - struct psid_entry *pm_list, *pm_prev; int rc; - EntryInfo *suffix_ei; - Entry *ctxcsn_e; - int ctxcsn_added = 0; Debug( LDAP_DEBUG_ARGS, LDAP_XSTRING(bdb_modify) ": %s\n", op->o_req_dn.bv_val, 0, 0 ); diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 333be33ee7..4385e8e92c 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -42,8 +42,6 @@ bdb_modrdn( Operation *op, SlapReply *rs ) struct bdb_op_info opinfo = {0}; Entry dummy = {0}; - ID id; - Entry *np = NULL; /* newSuperior Entry */ struct berval *np_dn = NULL; /* newSuperior dn */ struct berval *np_ndn = NULL; /* newSuperior ndn */ @@ -64,12 +62,7 @@ bdb_modrdn( Operation *op, SlapReply *rs ) LDAPControl *ctrls[SLAP_MAX_RESPONSE_CONTROLS]; int num_ctrls = 0; - Operation *ps_list; - struct psid_entry *pm_list, *pm_prev; int rc; - EntryInfo *suffix_ei; - Entry *ctxcsn_e; - int ctxcsn_added = 0; int parent_is_glue = 0; int parent_is_leaf = 0; diff --git a/servers/slapd/back-bdb/nextid.c b/servers/slapd/back-bdb/nextid.c index 15483a75b1..d149ec77e1 100644 --- a/servers/slapd/back-bdb/nextid.c +++ b/servers/slapd/back-bdb/nextid.c @@ -35,7 +35,7 @@ int bdb_next_id( BackendDB *be, DB_TXN *tid, ID *out ) int bdb_last_id( BackendDB *be, DB_TXN *tid ) { struct bdb_info *bdb = (struct bdb_info *) be->be_private; - int i, rc; + int rc; ID id = 0; unsigned char idbuf[sizeof(ID)]; DBT key, data; diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 297e179e6a..b2f34ed8b7 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -43,9 +43,6 @@ static void send_paged_response( ID *lastid, int tentries ); -static int bdb_pfid_cmp( const void *v_id1, const void *v_id2 ); -static ID* bdb_id_dup( Operation *op, ID *id ); - /* Dereference aliases for a single alias entry. Return the final * dereferenced entry on success, NULL on any failure. */ @@ -637,13 +634,10 @@ dn2entry_retry: goto loop_begin; } -loop_start: - for ( id = bdb_idl_first( candidates, &cursor ); id != NOID ; id = bdb_idl_next( candidates, &cursor ) ) { int scopeok = 0; - ID* idhole = NULL; loop_begin: @@ -1276,18 +1270,3 @@ done: (void) ber_free_buf( ber ); } -static int -bdb_pfid_cmp( const void *v_id1, const void *v_id2 ) -{ - const ID *p1 = v_id1, *p2 = v_id2; - return *p1 - *p2; -} - -static ID* -bdb_id_dup( Operation *op, ID *id ) -{ - ID *new; - new = ch_malloc( sizeof(ID) ); - *new = *id; - return new; -} diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index ec38daa6cd..a702106f35 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -212,7 +212,6 @@ static int bdb_tool_next_id( struct berval *text, int hole ) { - struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private; struct berval dn = e->e_name; struct berval ndn = e->e_nname; struct berval pdn, npdn; -- 2.39.5