From 90835da72ffb18043abb809db31339bfbc643065 Mon Sep 17 00:00:00 2001 From: "sca+openldap@andreasschulze.de" Date: Fri, 1 Sep 2017 16:31:52 -0700 Subject: [PATCH] ITS#8578 - remove unused-variables in RE24 testing call (2.4.45) --- libraries/libldap/add.c | 2 +- libraries/libldap/extended.c | 1 - libraries/libldap/modify.c | 2 +- libraries/libldap/os-local.c | 2 +- servers/slapd/back-ldap/distproc.c | 3 +++ servers/slapd/back-ldif/ldif.c | 1 - servers/slapd/back-mdb/id2entry.c | 6 +----- servers/slapd/back-mdb/index.c | 2 +- servers/slapd/back-mdb/init.c | 1 - servers/slapd/back-mdb/monitor.c | 4 +++- servers/slapd/back-mdb/search.c | 2 -- servers/slapd/back-mdb/tools.c | 2 -- servers/slapd/overlays/syncprov.c | 3 +-- servers/slapd/syncrepl.c | 5 +---- tests/progs/slapd-mtread.c | 4 ++-- 15 files changed, 15 insertions(+), 25 deletions(-) diff --git a/libraries/libldap/add.c b/libraries/libldap/add.c index bba85be474..cf5ffa1b98 100644 --- a/libraries/libldap/add.c +++ b/libraries/libldap/add.c @@ -207,7 +207,7 @@ ldap_add_ext( int *msgidp ) { BerElement *ber; - int i, rc; + int rc; ber_int_t id; Debug( LDAP_DEBUG_TRACE, "ldap_add_ext\n", 0, 0, 0 ); diff --git a/libraries/libldap/extended.c b/libraries/libldap/extended.c index 1a745515a5..05084b0ae8 100644 --- a/libraries/libldap/extended.c +++ b/libraries/libldap/extended.c @@ -103,7 +103,6 @@ ldap_extended_operation( int *msgidp ) { BerElement *ber; - int rc; ber_int_t id; Debug( LDAP_DEBUG_TRACE, "ldap_extended_operation\n", 0, 0, 0 ); diff --git a/libraries/libldap/modify.c b/libraries/libldap/modify.c index 8e189b0b3c..e5ea2197a1 100644 --- a/libraries/libldap/modify.c +++ b/libraries/libldap/modify.c @@ -152,7 +152,7 @@ ldap_modify_ext( LDAP *ld, int *msgidp ) { BerElement *ber; - int i, rc; + int rc; ber_int_t id; Debug( LDAP_DEBUG_TRACE, "ldap_modify_ext\n", 0, 0, 0 ); diff --git a/libraries/libldap/os-local.c b/libraries/libldap/os-local.c index e6db521046..36d3e97e4e 100644 --- a/libraries/libldap/os-local.c +++ b/libraries/libldap/os-local.c @@ -359,5 +359,5 @@ ldap_connect_to_path(LDAP *ld, Sockbuf *sb, LDAPURLDesc *srv, int async) return rc; } #else -static int dummy; +static int dummy; /* generate also a warning: 'dummy' defined but not used (at least here) */ #endif /* LDAP_PF_LOCAL */ diff --git a/servers/slapd/back-ldap/distproc.c b/servers/slapd/back-ldap/distproc.c index e0d525842b..c5946ce521 100644 --- a/servers/slapd/back-ldap/distproc.c +++ b/servers/slapd/back-ldap/distproc.c @@ -211,7 +211,10 @@ static int sc_returnContRef; #define get_returnContRef(op) ((op)->o_returnContRef & SLAP_CONTROL_MASK) static struct berval slap_EXOP_CHAINEDREQUEST = BER_BVC( LDAP_EXOP_X_CHAINEDREQUEST ); +#ifdef LDAP_DEVEL static struct berval slap_FEATURE_CANCHAINOPS = BER_BVC( LDAP_FEATURE_X_CANCHAINOPS ); +#endif + static BackendInfo *lback; diff --git a/servers/slapd/back-ldif/ldif.c b/servers/slapd/back-ldif/ldif.c index d667521b56..6e4c205b8b 100644 --- a/servers/slapd/back-ldif/ldif.c +++ b/servers/slapd/back-ldif/ldif.c @@ -395,7 +395,6 @@ crc32(const void *vbuf, int len) { const unsigned char *buf = vbuf; ber_uint_t crc = 0xffffffff; - int i; while (len > 7) { CRC8; diff --git a/servers/slapd/back-mdb/id2entry.c b/servers/slapd/back-mdb/id2entry.c index 2171dcd2f2..6244dd77ca 100644 --- a/servers/slapd/back-mdb/id2entry.c +++ b/servers/slapd/back-mdb/id2entry.c @@ -384,7 +384,6 @@ int mdb_id2entry( ID id, Entry **e ) { - struct mdb_info *mdb = (struct mdb_info *) op->o_bd->be_private; MDB_val key, data; int rc = 0; @@ -534,7 +533,6 @@ int mdb_entry_release( { struct mdb_info *mdb = (struct mdb_info *) op->o_bd->be_private; struct mdb_op_info *moi = NULL; - int rc; /* slapMode : SLAP_SERVER_MODE, SLAP_TOOL_MODE, SLAP_TRUNCATE_MODE, SLAP_UNDEFINED_MODE */ @@ -924,8 +922,7 @@ static int mdb_entry_partsize(struct mdb_info *mdb, MDB_txn *txn, Entry *e, static int mdb_entry_encode(Operation *op, Entry *e, MDB_val *data, Ecount *eh) { struct mdb_info *mdb = (struct mdb_info *) op->o_bd->be_private; - ber_len_t len, i; - int rc; + ber_len_t i; Attribute *a; unsigned char *ptr; unsigned int *lp, l; @@ -1004,7 +1001,6 @@ int mdb_entry_decode(Operation *op, MDB_txn *txn, MDB_val *data, ID id, Entry ** Attribute *a; Entry *x; const char *text; - AttributeDescription *ad; unsigned int *lp = (unsigned int *)data->mv_data; unsigned char *ptr; BerVarray bptr; diff --git a/servers/slapd/back-mdb/index.c b/servers/slapd/back-mdb/index.c index 7ec483eda2..18ddaa5849 100644 --- a/servers/slapd/back-mdb/index.c +++ b/servers/slapd/back-mdb/index.c @@ -172,7 +172,7 @@ static int indexer( int opid, slap_mask_t mask ) { - int rc, i; + int rc; struct berval *keys; MDB_cursor *mc = ai->ai_cursor; mdb_idl_keyfunc *keyfunc; diff --git a/servers/slapd/back-mdb/init.c b/servers/slapd/back-mdb/init.c index 60b3c3f405..1faae86a51 100644 --- a/servers/slapd/back-mdb/init.c +++ b/servers/slapd/back-mdb/init.c @@ -235,7 +235,6 @@ mdb_db_open( BackendDB *be, ConfigReply *cr ) } else if ( i == MDB_DN2ID ) { MDB_cursor *mc; MDB_val key, data; - ID id; mdb_set_dupsort( txn, mdb->mi_dbis[i], mdb_dup_compare ); /* check for old dn2id format */ rc = mdb_cursor_open( txn, mdb->mi_dbis[i], &mc ); diff --git a/servers/slapd/back-mdb/monitor.c b/servers/slapd/back-mdb/monitor.c index 34e1822992..f7f15ad5d8 100644 --- a/servers/slapd/back-mdb/monitor.c +++ b/servers/slapd/back-mdb/monitor.c @@ -118,9 +118,9 @@ mdb_monitor_update( Entry *e, void *priv ) { +#ifdef MDB_MONITOR_IDX struct mdb_info *mdb = (struct mdb_info *) priv; -#ifdef MDB_MONITOR_IDX mdb_monitor_idx_entry_add( mdb, e ); #endif /* MDB_MONITOR_IDX */ @@ -259,7 +259,9 @@ mdb_monitor_initialize( void ) int mdb_monitor_db_init( BackendDB *be ) { +#ifdef MDB_MONITOR_IDX struct mdb_info *mdb = (struct mdb_info *) be->be_private; +#endif /* MDB_MONITOR_IDX */ if ( mdb_monitor_initialize() == LDAP_SUCCESS ) { /* monitoring in back-mdb is on by default */ diff --git a/servers/slapd/back-mdb/search.c b/servers/slapd/back-mdb/search.c index 036d21b2b0..28dc262dee 100644 --- a/servers/slapd/back-mdb/search.c +++ b/servers/slapd/back-mdb/search.c @@ -292,7 +292,6 @@ static void scope_chunk_free( void *key, void *data ) static ID2 *scope_chunk_get( Operation *op ) { - struct mdb_info *mdb = (struct mdb_info *) op->o_bd->be_private; ID2 *ret = NULL; ldap_pvt_thread_pool_getkey( op->o_threadctx, (void *)scope_chunk_get, @@ -309,7 +308,6 @@ static ID2 *scope_chunk_get( Operation *op ) static void scope_chunk_ret( Operation *op, ID2 *scopes ) { - struct mdb_info *mdb = (struct mdb_info *) op->o_bd->be_private; void *ret = NULL; ldap_pvt_thread_pool_getkey( op->o_threadctx, (void *)scope_chunk_get, diff --git a/servers/slapd/back-mdb/tools.c b/servers/slapd/back-mdb/tools.c index d898c9d293..7cbea62395 100644 --- a/servers/slapd/back-mdb/tools.c +++ b/servers/slapd/back-mdb/tools.c @@ -453,7 +453,6 @@ static int mdb_tool_next_id( struct berval *text, int hole ) { - struct mdb_info *mdb = (struct mdb_info *) op->o_bd->be_private; struct berval dn = e->e_name; struct berval ndn = e->e_nname; struct berval pdn, npdn, nmatched; @@ -1517,7 +1516,6 @@ mdb_dn2id_upgrade( BackendDB *be ) { MDB_txn *mt; MDB_cursor *mc = NULL; MDB_val key, data; - char *ptr; int rc, writes=0, depth=0; int enable_meter = 0; ID id = 0, *num, count = 0; diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index d1252182a1..18c2c6cf3c 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -917,7 +917,6 @@ syncprov_qstart( syncops *so ); static int syncprov_qplay( Operation *op, syncops *so ) { - slap_overinst *on = LDAP_SLIST_FIRST(&so->s_op->o_extra)->oe_key; syncres *sr; int rc = 0; @@ -1597,7 +1596,7 @@ syncprov_add_slog( Operation *op ) } sl->sl_num++; while ( sl->sl_num > sl->sl_size ) { - int i, j; + int i; se = sl->sl_head; sl->sl_head = se->se_next; for ( i=0; isl_numcsns; i++ ) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 4025498179..26485da411 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -2188,11 +2188,8 @@ syncrepl_op_modify( Operation *op, SlapReply *rs ) if ( match < 0 ) { Operation op2 = *op; AttributeName an[2]; - const char *text; struct berval bv; - char *ptr; - Modifications *ml; - int size, rc; + int size; SlapReply rs1 = {0}; resolve_ctxt rx; slap_callback cb = { NULL, syncrepl_resolve_cb, NULL, NULL }; diff --git a/tests/progs/slapd-mtread.c b/tests/progs/slapd-mtread.c index c9c872918c..571487173c 100644 --- a/tests/progs/slapd-mtread.c +++ b/tests/progs/slapd-mtread.c @@ -576,7 +576,7 @@ do_conn( char *uri, char *manager, struct berval *passwd, { LDAP *ld = NULL; int version = LDAP_VERSION3; - int i = 0, do_retry = maxretries; + int do_retry = maxretries; int rc = LDAP_SUCCESS; char thrstr[BUFSIZ]; @@ -712,7 +712,7 @@ do_random2( LDAP *ld, int rc = LDAP_SUCCESS; int lo, hi, range; int flen; - LDAPMessage *res = NULL, *e = NULL; + LDAPMessage *res = NULL; char *ptr, *ftail; char thrstr[BUFSIZ]; char fbuf[BUFSIZ]; -- 2.39.5