From da0c0360e4930142dc6c2c0b0512721af065f78a Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sun, 2 Apr 2006 19:54:24 +0000 Subject: [PATCH] Warnings: Unused vars. funcptr=0, not =NULL. if(b=...) -> if((b=...) != NULL). --- libraries/libldap_r/tpool.c | 1 - servers/slapd/back-bdb/init.c | 2 +- servers/slapd/back-monitor/conn.c | 1 - servers/slapd/back-monitor/operation.c | 1 - servers/slapd/back-monitor/rww.c | 1 - servers/slapd/back-monitor/sent.c | 1 - servers/slapd/back-monitor/time.c | 1 - servers/slapd/back-perl/search.c | 2 -- servers/slapd/backglue.c | 2 +- servers/slapd/connection.c | 2 -- servers/slapd/init.c | 4 ---- servers/slapd/overlays/auditlog.c | 7 ++++--- servers/slapd/overlays/pcache.c | 7 +------ servers/slapd/syncrepl.c | 2 -- 14 files changed, 7 insertions(+), 27 deletions(-) diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index a9ec8f4795..31d27b7d36 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -482,7 +482,6 @@ int ldap_pvt_thread_pool_destroy ( ldap_pvt_thread_pool_t *tpool, int run_pending ) { struct ldap_int_thread_pool_s *pool, *pptr; - long waiting; ldap_int_thread_ctx_t *ctx; if (tpool == NULL) diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index b766f6b1c6..6fe2a30609 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -95,7 +95,7 @@ bdb_db_open( BackendDB *be ) u_int32_t flags; char path[MAXPATHLEN]; char *dbhome; - int do_recover = 0, do_alock_recover = 0, open_env = 1; + int do_recover = 0, do_alock_recover = 0; int alockt, quick = 0; if ( be->be_suffix == NULL ) { diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index f34f215b9a..21f0a1d34d 100644 --- a/servers/slapd/back-monitor/conn.c +++ b/servers/slapd/back-monitor/conn.c @@ -54,7 +54,6 @@ monitor_subsys_conn_init( monitor_info_t *mi; Entry *e, **ep, *e_conn; monitor_entry_t *mp; - char buf[ BACKMONITOR_BUFSIZE ]; struct berval bv; assert( be != NULL ); diff --git a/servers/slapd/back-monitor/operation.c b/servers/slapd/back-monitor/operation.c index c9dbf3b627..c84088dcb8 100644 --- a/servers/slapd/back-monitor/operation.c +++ b/servers/slapd/back-monitor/operation.c @@ -65,7 +65,6 @@ monitor_subsys_ops_init( Entry *e_op, **ep; monitor_entry_t *mp; - char buf[ BACKMONITOR_BUFSIZE ]; int i; struct berval bv_zero = BER_BVC( "0" ); diff --git a/servers/slapd/back-monitor/rww.c b/servers/slapd/back-monitor/rww.c index e8ae7bf617..76cb031603 100644 --- a/servers/slapd/back-monitor/rww.c +++ b/servers/slapd/back-monitor/rww.c @@ -86,7 +86,6 @@ monitor_subsys_rww_init( ep = &mp->mp_children; for ( i = 0; i < MONITOR_RWW_LAST; i++ ) { - char buf[ BACKMONITOR_BUFSIZE ]; struct berval nrdn, bv; Entry *e; diff --git a/servers/slapd/back-monitor/sent.c b/servers/slapd/back-monitor/sent.c index 23ed6419ca..caa6beab52 100644 --- a/servers/slapd/back-monitor/sent.c +++ b/servers/slapd/back-monitor/sent.c @@ -89,7 +89,6 @@ monitor_subsys_sent_init( ep = &mp->mp_children; for ( i = 0; i < MONITOR_SENT_LAST; i++ ) { - char buf[ BACKMONITOR_BUFSIZE ]; struct berval nrdn, bv; Entry *e; diff --git a/servers/slapd/back-monitor/time.c b/servers/slapd/back-monitor/time.c index c8588e8048..ac2f61543e 100644 --- a/servers/slapd/back-monitor/time.c +++ b/servers/slapd/back-monitor/time.c @@ -46,7 +46,6 @@ monitor_subsys_time_init( Entry *e, **ep, *e_time; monitor_entry_t *mp; - char buf[ BACKMONITOR_BUFSIZE ]; struct berval bv; assert( be != NULL ); diff --git a/servers/slapd/back-perl/search.c b/servers/slapd/back-perl/search.c index 1524900eb3..d249825a4b 100644 --- a/servers/slapd/back-perl/search.c +++ b/servers/slapd/back-perl/search.c @@ -84,8 +84,6 @@ perl_back_search( send_entry = 1; if (send_entry) { - int rc; - rs->sr_entry = e; rs->sr_attrs = op->ors_attrs; rs->sr_flags = REP_ENTRY_MODIFIABLE; diff --git a/servers/slapd/backglue.c b/servers/slapd/backglue.c index e2fa8a2ff8..5cd6c42f80 100644 --- a/servers/slapd/backglue.c +++ b/servers/slapd/backglue.c @@ -766,7 +766,7 @@ glue_db_close( { slap_overinst *on = (slap_overinst *)be->bd_info; - on->on_info->oi_bi.bi_db_close = NULL; + on->on_info->oi_bi.bi_db_close = 0; return 0; } diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index cf43c239c1..0c788c7b1a 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -2051,8 +2051,6 @@ static int connection_bind_cleanup_cb( Operation *op, SlapReply *rs ) static int connection_bind_cb( Operation *op, SlapReply *rs ) { - slap_callback *cb = op->o_callback; - ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex ); op->o_conn->c_conn_state = SLAP_C_ACTIVE; op->o_conn->c_sasl_bind_in_progress = diff --git a/servers/slapd/init.c b/servers/slapd/init.c index 5ee2f1d934..ac710dfcbc 100644 --- a/servers/slapd/init.c +++ b/servers/slapd/init.c @@ -236,8 +236,6 @@ slap_init( int mode, const char *name ) int slap_startup( Backend *be ) { - int rc; - Debug( LDAP_DEBUG_TRACE, "%s startup: initiated.\n", slap_name, 0, 0 ); @@ -248,8 +246,6 @@ int slap_startup( Backend *be ) int slap_shutdown( Backend *be ) { - int rc; - Debug( LDAP_DEBUG_TRACE, "%s shutdown: initiated\n", slap_name, 0, 0 ); diff --git a/servers/slapd/overlays/auditlog.c b/servers/slapd/overlays/auditlog.c index dd338bbfa7..6a2e5b4c77 100644 --- a/servers/slapd/overlays/auditlog.c +++ b/servers/slapd/overlays/auditlog.c @@ -52,7 +52,7 @@ static int auditlog_response(Operation *op, SlapReply *rs) { Attribute *a; Modifications *m; struct berval *b; - char *what, *subop, *suffix, *who = NULL; + char *what, *suffix, *who = NULL; long stamp = slap_get_time(); int i; @@ -111,7 +111,7 @@ static int auditlog_response(Operation *op, SlapReply *rs) { switch(op->o_tag) { case LDAP_REQ_ADD: for(a = op->ora_e->e_attrs; a; a = a->a_next) - if(b = a->a_vals) + if((b = a->a_vals) != NULL) for(i = 0; b[i].bv_val; i++) fprint_ldif(f, a->a_desc->ad_cname.bv_val, b[i].bv_val, b[i].bv_len); break; @@ -128,7 +128,8 @@ static int auditlog_response(Operation *op, SlapReply *rs) { continue; } fprintf(f, "%s: %s\n", what, m->sml_desc->ad_cname.bv_val); - if(b = m->sml_values) for(i = 0; b[i].bv_val; i++) + if((b = m->sml_values) != NULL) + for(i = 0; b[i].bv_val; i++) fprint_ldif(f, m->sml_desc->ad_cname.bv_val, b[i].bv_val, b[i].bv_len); fprintf(f, "-\n"); } diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 7eef3c5d2a..d6b44f082d 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -417,7 +417,6 @@ strings_containment(struct berval* stored, struct berval* incoming) static int substr_containment_substr(Operation *op, Filter* stored, Filter* incoming) { - int i; int rc = 0; struct berval init_incoming; @@ -608,7 +607,6 @@ static void free_query (CachedQuery* qc) { Query* q = (Query*)qc; - int i; free(qc->q_uuid.bv_val); filter_free(q->filter); @@ -1205,8 +1203,6 @@ pcache_op_search( cache_manager *cm = on->on_bi.bi_private; query_manager* qm = cm->qm; - int count; - int i = -1; AttributeName *filter_attrs = NULL; @@ -1219,7 +1215,6 @@ pcache_op_search( int cacheable = 0; int fattr_cnt=0; int fattr_got_oc = 0; - int oc_attr_absent = 1; struct berval tempstr; @@ -2014,7 +2009,7 @@ pcache_db_close( slap_overinst *on = (slap_overinst *)be->bd_info; cache_manager *cm = on->on_bi.bi_private; query_manager *qm = cm->qm; - int i, j, rc = 0; + int i, rc = 0; /* cleanup stuff inherited from the original database... */ cm->db.be_limits = NULL; diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index c8dc5281e8..3cac0d0a96 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -3406,8 +3406,6 @@ syncrepl_config( ConfigArgs *c ) } return 1; } else if ( c->op == LDAP_MOD_DELETE ) { - struct re_s *re; - if ( c->be->be_syncinfo ) { syncinfo_free( c->be->be_syncinfo ); c->be->be_syncinfo = NULL; -- 2.39.5