From: Howard Chu Date: Mon, 11 Jul 2005 12:11:15 +0000 (+0000) Subject: ITS#3847 silence warnings X-Git-Tag: OPENLDAP_AC_BP~422 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5d2ba11ad924cfe9be57d7d6a1e6a37e108bbe10;p=openldap ITS#3847 silence warnings --- diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 34f8cb4f20..613ed8a658 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -510,7 +510,6 @@ int ad_inlist( for( ; attrs->an_name.bv_val; attrs++ ) { AttributeType *a; ObjectClass *oc; - int rc; if ( attrs->an_desc ) { int lr; @@ -584,8 +583,6 @@ int ad_inlist( } if( oc != NULL ) { if ( attrs->an_oc_exclude ) { - int gotit = 0; - if ( oc == slap_schema.si_oc_extensibleObject ) { /* extensibleObject allows the return of anything */ return 0; diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 802319bbe0..b81d6a3853 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -646,7 +646,6 @@ bdb_db_close( BackendDB *be ) static int bdb_db_destroy( BackendDB *be ) { - int rc; struct bdb_info *bdb = (struct bdb_info *) be->be_private; if( bdb->bi_dbenv_home ) ch_free( bdb->bi_dbenv_home ); diff --git a/servers/slapd/back-ldbm/modrdn.c b/servers/slapd/back-ldbm/modrdn.c index c999b27b64..eb81387ba8 100644 --- a/servers/slapd/back-ldbm/modrdn.c +++ b/servers/slapd/back-ldbm/modrdn.c @@ -52,7 +52,6 @@ ldbm_back_modrdn( int isroot = -1; int rc_id = 0; ID id = NOID; - const char *text = NULL; char textbuf[SLAP_TEXT_BUFLEN]; size_t textlen = sizeof textbuf; /* Added to support newSuperior */ diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 4038ee5689..0352720f13 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -39,8 +39,7 @@ ldbm_back_search( SlapReply *rs ) { struct ldbminfo *li = (struct ldbminfo *) op->o_bd->be_private; - int rc, err; - const char *text = NULL; + int rc; time_t stoptime; ID_BLOCK *candidates; ID id, cursor; diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 9e352079cd..ed795dbf32 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -331,7 +331,6 @@ int backend_num( Backend *be ) int backend_shutdown( Backend *be ) { - int i; int rc = 0; BackendInfo *bi; @@ -433,7 +432,6 @@ void backend_destroy_one( BackendDB *bd ) int backend_destroy(void) { - int i; BackendDB *bd; BackendInfo *bi; @@ -540,7 +538,6 @@ void be_db_close( void ) { BackendDB *be; - int i; LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) { if ( be->bd_info->bi_db_close ) { @@ -560,7 +557,7 @@ select_backend( int manageDSAit, int noSubs ) { - int i, j; + int j; ber_len_t len, dnlen = dn->bv_len; Backend *be, *b2 = NULL; diff --git a/servers/slapd/cancel.c b/servers/slapd/cancel.c index 141229b874..c1b288c6d5 100644 --- a/servers/slapd/cancel.c +++ b/servers/slapd/cancel.c @@ -34,7 +34,6 @@ int cancel_extop( Operation *op, SlapReply *rs ) int rc; int opid; BerElement *ber; - int i; assert( ber_bvcmp( &slap_EXOP_CANCEL, &op->ore_reqoid ) == 0 ); diff --git a/servers/slapd/config.c b/servers/slapd/config.c index acf465c2fd..024e12d3bc 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -241,7 +241,7 @@ int config_check_vals(ConfigTable *Conf, ConfigArgs *c, int check_only ) { int config_set_vals(ConfigTable *Conf, ConfigArgs *c) { int rc, arg_type; - void *ptr; + void *ptr = NULL; arg_type = Conf->arg_type; if(arg_type & ARG_MAGIC) { @@ -1085,7 +1085,7 @@ fp_parse_line(ConfigArgs *c) char *token; char *hide[] = { "rootpw", "replica", "bindpw", "pseudorootpw", "dbpasswd", '\0' }; char *quote_ptr; - int i; + int i = -1; c->tline = ch_strdup(c->line); token = strtok_quote(c->tline, " \t", "e_ptr); diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index a3c686312c..5b81cfa083 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -253,7 +253,6 @@ int slap_controls_init( void ) { int i, rc; - struct slap_control *sc; rc = LDAP_SUCCESS; @@ -326,10 +325,9 @@ int get_supported_controls(char ***ctrloidsp, slap_mask_t **ctrlmasks) { - int i, n; + int n; char **oids; slap_mask_t *masks; - int rc; struct slap_control *sc; n = 0; @@ -1026,7 +1024,6 @@ static int parseAssert ( { BerElement *ber; struct berval fstr = BER_BVNULL; - const char *err_msg = ""; if ( op->o_assert != SLAP_CONTROL_NONE ) { rs->sr_text = "assert control specified multiple times"; @@ -1199,7 +1196,6 @@ int parseValuesReturnFilter ( { BerElement *ber; struct berval fstr = BER_BVNULL; - const char *err_msg = ""; if ( op->o_valuesreturnfilter != SLAP_CONTROL_NONE ) { rs->sr_text = "valuesReturnFilter control specified multiple times"; diff --git a/servers/slapd/cr.c b/servers/slapd/cr.c index a1c6005e93..0dcf1484a8 100644 --- a/servers/slapd/cr.c +++ b/servers/slapd/cr.c @@ -412,7 +412,7 @@ cr_unparse( BerVarray *res, ContentRule *start, ContentRule *end, int sys ) ContentRule *cr; int i, num; struct berval bv, *bva = NULL, idx; - char ibuf[32], *ptr; + char ibuf[32]; if ( !start ) start = LDAP_STAILQ_FIRST( &cr_list ); diff --git a/servers/slapd/ctxcsn.c b/servers/slapd/ctxcsn.c index 408ee66838..6d29007b58 100644 --- a/servers/slapd/ctxcsn.c +++ b/servers/slapd/ctxcsn.c @@ -37,7 +37,6 @@ slap_get_commit_csn( ) { struct slap_csn_entry *csne, *committed_csne = NULL; - int i = 0; if ( maxcsn ) { BER_BVZERO( maxcsn ); @@ -125,7 +124,6 @@ slap_create_context_csn_entry( struct berval *context_csn ) { Entry* e; - int rc; struct berval bv; diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index e83ed0000d..4f4634caf4 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -70,7 +70,6 @@ str2entry2( char *s, int checkvals ) { int rc; Entry *e; - struct berval *nvalsp; struct berval *type, *vals, *nvals; char *freeval; AttributeDescription *ad, *ad_prev; diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 89a7b4f8cd..cbe3c1b241 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -225,7 +225,6 @@ fe_op_modify( Operation *op, SlapReply *rs ) LDAPMod **modv = NULL; #endif int increment = op->orm_increment; - int rc = 0; BackendDB *op_be; char textbuf[ SLAP_TEXT_BUFLEN ]; size_t textlen = sizeof( textbuf ); diff --git a/servers/slapd/operation.c b/servers/slapd/operation.c index b6a4ae0e54..d2e9fd05f7 100644 --- a/servers/slapd/operation.c +++ b/servers/slapd/operation.c @@ -63,8 +63,6 @@ void slap_op_destroy(void) void slap_op_free( Operation *op ) { - struct berval slap_empty_bv_dup; - assert( LDAP_STAILQ_NEXT(op, o_next) == NULL ); if ( op->o_ber != NULL ) { @@ -124,7 +122,6 @@ slap_op_alloc( ) { Operation *op; - struct berval slap_empty_bv_dup; ldap_pvt_thread_mutex_lock( &slap_op_mutex ); if ((op = LDAP_STAILQ_FIRST( &slap_free_ops ))) { diff --git a/servers/slapd/repl.c b/servers/slapd/repl.c index 255607117e..f6f453997f 100644 --- a/servers/slapd/repl.c +++ b/servers/slapd/repl.c @@ -126,8 +126,6 @@ replog1( struct slap_replica_info *ri, Operation *op, FILE *fp, long now); void replog( Operation *op ) { - Modifications *ml = NULL; - Attribute *a = NULL; FILE *fp, *lfp; int i; /* undef NO_LOG_WHEN_NO_REPLICAS */ @@ -278,7 +276,7 @@ replog1( case LDAP_REQ_MODIFY: for ( ml = op->orm_modlist; ml != NULL; ml = ml->sml_next ) { - char *did, *type = ml->sml_desc->ad_cname.bv_val; + char *did = NULL, *type = ml->sml_desc->ad_cname.bv_val; switch ( ml->sml_op ) { case LDAP_MOD_ADD: did = "add"; break; diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 0ce73bb9b3..b64cd67b21 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -404,7 +404,7 @@ octetStringSubstringsIndexer( BerVarray *keysp, void *ctx ) { - ber_len_t i, j, len, nkeys; + ber_len_t i, nkeys; size_t slen, mlen; BerVarray keys; @@ -521,7 +521,7 @@ octetStringSubstringsFilter ( { SubstringsAssertion *sa; char pre; - ber_len_t len, max, nkeys = 0; + ber_len_t nkeys = 0; size_t slen, mlen, klen; BerVarray keys; HASH_CONTEXT HASHcontext; @@ -2362,7 +2362,6 @@ serialNumberAndIssuerValidate( struct berval *in ) { int rc; - int state; ber_len_t n; struct berval sn, i; if( in->bv_len < 3 ) return LDAP_INVALID_SYNTAX; @@ -2396,7 +2395,6 @@ serialNumberAndIssuerPretty( void *ctx ) { int rc; - int state; ber_len_t n; struct berval sn, i, newi; @@ -2471,7 +2469,6 @@ serialNumberAndIssuerNormalize( void *ctx ) { int rc; - int state; ber_len_t n; struct berval sn, i, newi; @@ -2900,7 +2897,6 @@ int generalizedTimeIndexer( void *ctx ) { int i, j; - size_t slen, mlen; BerVarray keys; char tmp[5]; BerValue bvtmp; /* 40 bit index */ diff --git a/servers/slapd/sl_malloc.c b/servers/slapd/sl_malloc.c index 1f6bd267f5..021bc830aa 100644 --- a/servers/slapd/sl_malloc.c +++ b/servers/slapd/sl_malloc.c @@ -99,7 +99,7 @@ slap_sl_mem_create( ber_len_t size_shift; int pad = 2*sizeof(int)-1, pad_shift; int order = -1, order_start = -1, order_end = -1; - int i, k; + int i; struct slab_object *so; #ifdef NO_THREADS @@ -247,7 +247,7 @@ slap_sl_malloc( struct slab_object *so_new, *so_left, *so_right; ber_len_t *ptr, *new; unsigned long diff; - int i, j, k; + int i, j; /* ber_set_option calls us like this */ if (!ctx) return ber_memalloc_x(size, NULL); @@ -347,12 +347,8 @@ void * slap_sl_realloc(void *ptr, ber_len_t size, void *ctx) { struct slab_heap *sh = ctx; - int size_shift; - int pad = 2*sizeof(int)-1, pad_shift; - int order_start = -1, order = -1; - struct slab_object *so; + int pad = 2*sizeof(int) -1; ber_len_t *p = (ber_len_t *)ptr, *new; - unsigned long diff; if (ptr == NULL) return slap_sl_malloc(size, ctx); @@ -420,7 +416,7 @@ slap_sl_free(void *ptr, void *ctx) int order_start = -1, order = -1; struct slab_object *so; unsigned long diff; - int i, k, inserted = 0; + int i, inserted = 0; if (!sh || ptr < sh->sh_base || ptr >= sh->sh_end) { ber_memfree_x(ptr, NULL); diff --git a/servers/slapd/starttls.c b/servers/slapd/starttls.c index e8170ad690..8864b03dd6 100644 --- a/servers/slapd/starttls.c +++ b/servers/slapd/starttls.c @@ -25,7 +25,6 @@ int starttls_extop ( Operation *op, SlapReply *rs ) { - void *ctx; int rc; if ( op->ore_reqdata != NULL ) {