From: Hallvard Furuseth Date: Thu, 14 Jul 2005 19:52:08 +0000 (+0000) Subject: Silence "unused " warnings X-Git-Tag: OPENLDAP_AC_BP~402 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d6cc947561d7bb757225dc7dc7ce9106f31bf048;p=openldap Silence "unused " warnings --- diff --git a/servers/slapd/abandon.c b/servers/slapd/abandon.c index 95df80c2a5..df2f937f49 100644 --- a/servers/slapd/abandon.c +++ b/servers/slapd/abandon.c @@ -36,7 +36,6 @@ do_abandon( Operation *op, SlapReply *rs ) { ber_int_t id; Operation *o; - int i; Debug( LDAP_DEBUG_TRACE, "do_abandon\n", 0, 0, 0 ); diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 613ed8a658..c690d2efdb 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -990,8 +990,6 @@ file2anlist( AttributeName *an, const char *fname, const char *brkstr ) } while ( fgets( lcur, LBUFSIZ, fp ) != NULL ) { - char *str, *s, *next; - const char *delimstr = brkstr; if ( ( c = strchr( lcur, '\n' ) ) ) { if ( c == line ) { *c = '\0'; diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index d203586cc3..5ef52a46c3 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -884,9 +884,11 @@ bdb_cache_add( u_int32_t locker ) { EntryInfo *new, ei; - struct berval rdn = e->e_name; DB_LOCK lock; int rc; +#ifdef BDB_HIER + struct berval rdn = e->e_name; +#endif ei.bei_id = e->e_id; ei.bei_parent = eip; @@ -981,8 +983,10 @@ bdb_cache_modrdn( DB_LOCK *lock ) { EntryInfo *ei = BEI(e), *pei; - struct berval rdn; int rc; +#ifdef BDB_HIER + struct berval rdn; +#endif /* Get write lock on data */ rc = bdb_cache_entry_db_relock( bdb->bi_dbenv, locker, ei, 1, 0, lock ); diff --git a/servers/slapd/back-bdb/config.c b/servers/slapd/back-bdb/config.c index 1c01c2296f..9ac83de447 100644 --- a/servers/slapd/back-bdb/config.c +++ b/servers/slapd/back-bdb/config.c @@ -263,7 +263,7 @@ bdb_online_index( void *ctx, void *arg ) id++; getnext = 1; } -out: + ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex ); ldap_pvt_runqueue_stoptask( &slapd_rq, rtask ); bdb->bi_index_task = NULL; diff --git a/servers/slapd/back-bdb/dn2id.c b/servers/slapd/back-bdb/dn2id.c index 89bfae0ebf..3352278c06 100644 --- a/servers/slapd/back-bdb/dn2id.c +++ b/servers/slapd/back-bdb/dn2id.c @@ -555,7 +555,7 @@ hdb_dn2id_delete( DBT key, data; DBC *cursor; diskNode *d; - int rc, nrlen; + int rc; ID nid; unsigned char dlen[2]; @@ -705,7 +705,6 @@ hdb_dn2id_parent( int rc = 0; diskNode *d; char *ptr; - unsigned char *pt2; ID nid; DBTzero(&key); diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index c00ba93235..5c5e0ef304 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -1212,8 +1212,6 @@ ID bdb_idl_next( ID *ids, ID *cursor ) */ int bdb_idl_append_one( ID *ids, ID id ) { - unsigned x; - if (BDB_IDL_IS_RANGE( ids )) { /* if already in range, treat as a dup */ if (id >= BDB_IDL_FIRST(ids) && id <= BDB_IDL_LAST(ids)) diff --git a/servers/slapd/back-bdb/index.c b/servers/slapd/back-bdb/index.c index 91c5a74626..e994e28ec1 100644 --- a/servers/slapd/back-bdb/index.c +++ b/servers/slapd/back-bdb/index.c @@ -389,7 +389,7 @@ bdb_index_entry( #ifdef LDAP_COMP_MATCH ComponentReference *cr_list = NULL; ComponentReference *cr = NULL, *dupped_cr = NULL; - void* decoded_comp, *extracted_comp; + void* decoded_comp; ComponentSyntaxInfo* csi_attr; Syntax* syn; AttributeType* at; diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index bfd5296266..37ca981c3a 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -246,7 +246,6 @@ bdb_db_recover( BackendDB *be ) return bdb_do_recovery( be ); } -re_exit: Debug( LDAP_DEBUG_ANY, "bdb_db_recover: Database cannot be recovered. "\ "Restore from backup!\n", 0, 0, 0); diff --git a/servers/slapd/back-ldbm/close.c b/servers/slapd/back-ldbm/close.c index 167f78d0fd..2e2090e286 100644 --- a/servers/slapd/back-ldbm/close.c +++ b/servers/slapd/back-ldbm/close.c @@ -26,8 +26,6 @@ int ldbm_back_db_close( Backend *be ) { - struct ldbminfo *li = (struct ldbminfo *) be->be_private; - Debug( LDAP_DEBUG_TRACE, "ldbm backend syncing\n", 0, 0, 0 ); ldbm_cache_flush_all( be ); diff --git a/servers/slapd/back-meta/candidates.c b/servers/slapd/back-meta/candidates.c index 76023a8837..a59606ff70 100644 --- a/servers/slapd/back-meta/candidates.c +++ b/servers/slapd/back-meta/candidates.c @@ -50,10 +50,6 @@ * A possible extension will include the handling of multiple suffixes */ -static int -meta_back_is_candidate_unique( - metainfo_t *mi, - struct berval *ndn ); /* * returns 1 if suffix is candidate for dn, otherwise 0 @@ -80,6 +76,7 @@ meta_back_is_candidate( return META_NOT_CANDIDATE; } +#if 0 /* * meta_back_is_candidate_unique * @@ -99,6 +96,7 @@ meta_back_is_candidate_unique( return 1; } +#endif /* 0 */ /* * meta_back_select_unique_candidate diff --git a/servers/slapd/back-meta/compare.c b/servers/slapd/back-meta/compare.c index 42a99e59b7..9fd06be3e0 100644 --- a/servers/slapd/back-meta/compare.c +++ b/servers/slapd/back-meta/compare.c @@ -71,7 +71,6 @@ meta_back_compare( Operation *op, SlapReply *rs ) dc.ctx = "compareDN"; for ( i = 0; i < mi->mi_ntargets; i++ ) { - metasingleconn_t *msc = &mc->mc_conns[ i ]; struct berval mdn = BER_BVNULL; struct berval mapped_attr = op->orc_ava->aa_desc->ad_cname; struct berval mapped_value = op->orc_ava->aa_value; diff --git a/servers/slapd/back-meta/conn.c b/servers/slapd/back-meta/conn.c index 1379d8c3a1..36fdc72a46 100644 --- a/servers/slapd/back-meta/conn.c +++ b/servers/slapd/back-meta/conn.c @@ -570,7 +570,6 @@ meta_back_candidates_get( Operation *op ) { metainfo_t *mi = ( metainfo_t * )op->o_bd->be_private; metacandidates_t *mc; - SlapReply *rs; if ( op->o_threadctx ) { void *data = NULL; diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index 90c395a40f..6294d0c636 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -74,7 +74,6 @@ over_db_config( BackendInfo *bi_orig = be->bd_info; struct ConfigOCs *be_cf_ocs = be->be_cf_ocs; ConfigArgs ca = {0}; - ConfigTable *ct; int rc = 0; if ( oi->oi_orig->bi_db_config ) { diff --git a/servers/slapd/component.c b/servers/slapd/component.c index 7633af36de..36651ae756 100644 --- a/servers/slapd/component.c +++ b/servers/slapd/component.c @@ -99,7 +99,7 @@ componentFilterMatch ( { ComponentSyntaxInfo *csi_attr = (ComponentSyntaxInfo*)value; MatchingRuleAssertion * ma = (MatchingRuleAssertion*)assertedValue; - int num_attr, rc, i; + int rc; if ( !mr || !ma->ma_cf ) return LDAP_INAPPROPRIATE_MATCHING; @@ -154,8 +154,6 @@ allComponentsMatch( static int slapd_ber2cav( struct berval* bv, ComponentAssertionValue* cav ) { - int len; - cav->cav_ptr = cav->cav_buf = bv->bv_val; cav->cav_end = bv->bv_val + bv->bv_len; @@ -165,11 +163,9 @@ slapd_ber2cav( struct berval* bv, ComponentAssertionValue* cav ) ComponentReference* dup_comp_ref ( Operation* op, ComponentReference* cr ) { - int rc, count = 0; ComponentReference* dup_cr; ComponentId* ci_curr; ComponentId** ci_temp; - ber_int_t type; dup_cr = op->o_tmpalloc( sizeof( ComponentReference ), op->o_tmpmemctx ); @@ -234,7 +230,6 @@ dup_comp_filter_item ( ComponentAssertion* in_ca, ComponentAssertion** out_ca ) { - ComponentAssertion* ca; int len; if ( !in_ca->ca_comp_ref ) return SLAPD_DISCONNECT; @@ -301,9 +296,7 @@ dup_comp_filter ( int get_aliased_filter_aa ( Operation* op, AttributeAssertion* a_assert, AttributeAliasing* aa, const char** text ) { - int rc; struct berval assert_bv; - ComponentAssertion* ca; Debug( LDAP_DEBUG_FILTER, "get_aliased_filter\n", 0, 0, 0 ); @@ -324,9 +317,7 @@ get_aliased_filter( Operation* op, MatchingRuleAssertion* ma, AttributeAliasing* aa, const char** text ) { - int rc; struct berval assert_bv; - ComponentAssertion* ca; Debug( LDAP_DEBUG_FILTER, "get_aliased_filter\n", 0, 0, 0 ); @@ -956,7 +947,6 @@ get_item( Operation *op, ComponentAssertionValue* cav, ComponentAssertion** ca, { int rc; ComponentAssertion* _ca; - struct berval t_bv; struct berval value; MatchingRule* mr; @@ -1268,7 +1258,7 @@ test_comp_filter_item( ComponentSyntaxInfo *csi_attr, ComponentAssertion *ca ) { - int rc, len; + int rc; void *attr_nm, *assert_nm; if ( strcmp(ca->ca_ma_rule->smr_mrule.mr_oid, diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 5b81cfa083..7f14f1fd62 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -32,7 +32,9 @@ static SLAP_CTRL_PARSE_FN parseProxyAuthz; static SLAP_CTRL_PARSE_FN parseManageDIT; #endif static SLAP_CTRL_PARSE_FN parseManageDSAit; +#ifdef LDAP_CONTROL_MODIFY_INCREMENT static SLAP_CTRL_PARSE_FN parseModifyIncrement; +#endif static SLAP_CTRL_PARSE_FN parseNoOp; static SLAP_CTRL_PARSE_FN parsePagedResults; #ifdef LDAP_DEVEL @@ -672,7 +674,6 @@ int get_ctrls( rs->sr_text = "critical extension is not recognized"; goto return_results; } -next_ctrl:; } return_results: @@ -693,6 +694,7 @@ return_results: return rs->sr_err; } +#ifdef LDAP_CONTROL_MODIFY_INCREMENT static int parseModifyIncrement ( Operation *op, SlapReply *rs, @@ -718,6 +720,7 @@ static int parseModifyIncrement ( return LDAP_SUCCESS; } +#endif #ifdef LDAP_DEVEL static int parseManageDIT ( diff --git a/servers/slapd/ldapsync.c b/servers/slapd/ldapsync.c index 5ecf2590f7..4e96b22539 100644 --- a/servers/slapd/ldapsync.c +++ b/servers/slapd/ldapsync.c @@ -176,9 +176,7 @@ slap_dup_sync_cookie( struct sync_cookie *src ) { - int i; struct sync_cookie *new; - struct berval tmp_bv; if ( src == NULL ) return NULL; diff --git a/servers/slapd/oc.c b/servers/slapd/oc.c index cd381f1bf3..33a7421d34 100644 --- a/servers/slapd/oc.c +++ b/servers/slapd/oc.c @@ -604,7 +604,7 @@ oc_unparse( BerVarray *res, ObjectClass *start, ObjectClass *end, int sys ) ObjectClass *oc; int i, num; struct berval bv, *bva = NULL, idx; - char ibuf[32], *ptr; + char ibuf[32]; if ( !start ) start = LDAP_STAILQ_FIRST( &oc_list ); diff --git a/servers/slapd/oidm.c b/servers/slapd/oidm.c index 25407644a4..32b4a47e74 100644 --- a/servers/slapd/oidm.c +++ b/servers/slapd/oidm.c @@ -156,7 +156,7 @@ void oidm_unparse( BerVarray *res, OidMacro *start, OidMacro *end, int sys ) { OidMacro *om; int i, j, num; - struct berval bv, *bva = NULL, idx; + struct berval *bva = NULL, idx; char ibuf[32], *ptr; if ( !start ) diff --git a/servers/slapd/phonetic.c b/servers/slapd/phonetic.c index ae35892417..4b52ad9378 100644 --- a/servers/slapd/phonetic.c +++ b/servers/slapd/phonetic.c @@ -43,6 +43,7 @@ ispunct((unsigned char) (x)) || \ isdigit((unsigned char) (x)) || (x) == '\0') +#if 0 static char * first_word( char *s ) { @@ -98,6 +99,7 @@ word_dup( char *w ) return( ret ); } +#endif /* 0 */ #ifndef MAXPHONEMELEN #define MAXPHONEMELEN 4 diff --git a/servers/slapd/root_dse.c b/servers/slapd/root_dse.c index 64389ccd17..50c326b10e 100644 --- a/servers/slapd/root_dse.c +++ b/servers/slapd/root_dse.c @@ -53,7 +53,6 @@ root_dse_info( { Entry *e; struct berval val, *bv; - struct berval nval; int i, j; char ** supportedSASLMechanisms; BackendDB *be; diff --git a/servers/slapd/saslauthz.c b/servers/slapd/saslauthz.c index 001c0ecdb0..bb4abc1822 100644 --- a/servers/slapd/saslauthz.c +++ b/servers/slapd/saslauthz.c @@ -494,6 +494,7 @@ done: return( rc ); } +#ifndef SLAP_AUTH_REWRITE static int slap_sasl_rx_off(char *rep, int *off) { const char *c; @@ -527,6 +528,7 @@ static int slap_sasl_rx_off(char *rep, int *off) off[n] = -1; return( LDAP_SUCCESS ); } +#endif /* ! SLAP_AUTH_REWRITE */ #ifdef SLAP_AUTH_REWRITE int slap_sasl_rewrite_config( @@ -644,7 +646,6 @@ int slap_sasl_regexp_config( const char *match, const char *replace ) void slap_sasl_regexp_unparse( BerVarray *out ) { int i; - struct berval bv; BerVarray bva = NULL; char ibuf[32], *ptr; struct berval idx; @@ -670,6 +671,7 @@ void slap_sasl_regexp_unparse( BerVarray *out ) *out = bva; } +#ifndef SLAP_AUTH_REWRITE /* Perform replacement on regexp matches */ static void slap_sasl_rx_exp( const char *rep, @@ -721,6 +723,7 @@ static void slap_sasl_rx_exp( out->bv_val[insert] = '\0'; } +#endif /* ! SLAP_AUTH_REWRITE */ /* Take the passed in SASL name and attempt to convert it into an LDAP URI to find the matching LDAP entry, using the pattern matching @@ -1102,7 +1105,7 @@ slap_sasl_check_authz( Operation *op, AttributeDescription *ad, struct berval *authc ) { - int i, rc; + int rc; BerVarray vals = NULL; Debug( LDAP_DEBUG_TRACE, diff --git a/servers/slapd/slapadd.c b/servers/slapd/slapadd.c index fec476894d..9ff3e86990 100644 --- a/servers/slapd/slapadd.c +++ b/servers/slapd/slapadd.c @@ -63,8 +63,7 @@ slapadd( int argc, char **argv ) ID ctxcsn_id, id; int ret; struct berval bvtext; - int i, checkvals; - struct berval mc; + int checkvals; slap_tool_init( progname, SLAPADD, argc, argv ); if( !be->be_entry_open || @@ -314,7 +313,6 @@ slapadd( int argc, char **argv ) } } -done:; entry_free( e ); } diff --git a/servers/slapd/str2filter.c b/servers/slapd/str2filter.c index b6aa778c6b..374ec60b2f 100644 --- a/servers/slapd/str2filter.c +++ b/servers/slapd/str2filter.c @@ -34,12 +34,6 @@ #include "slap.h" -#if 0 /* unused */ -static char *find_matching_paren( const char *s ); -#endif /* unused */ -static Filter *str2list( const char *str, long unsigned int ftype); -static Filter *str2simple( const char *str); -static int str2subvals( const char *val, Filter *f); Filter * str2filter_x( Operation *op, const char *str ) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index f7efaf86fc..f2f56a5e85 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -2659,7 +2659,7 @@ syncrepl_unparse( syncinfo_t *si, struct berval *bv ) { struct berval bc; char buf[BUFSIZ*2], *ptr; - int i, len; + int i; bindconf_unparse( &si->si_bindconf, &bc ); ptr = buf; diff --git a/servers/slapd/value.c b/servers/slapd/value.c index ef5c8b571d..174a30579d 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -312,7 +312,6 @@ ordered_value_sort( Attribute *a, int do_renumber ) int i, vals; int index = 0, noindex = 0, renumber = 0, gotnvals = 0; struct berval tmp; - char *ptr; if ( a->a_nvals && a->a_nvals != a->a_vals ) gotnvals = 1;