Commit 5d2ba11a authored by Howard Chu's avatar Howard Chu
Browse files

ITS#3847 silence warnings

parent 6754d025
......@@ -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;
......
......@@ -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 );
......
......@@ -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 */
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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", &quote_ptr);
......
......@@ -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";
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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 ))) {
......
......@@ -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;
......
......@@ -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 */
......
......@@ -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);
......
......@@ -25,7 +25,6 @@
int
starttls_extop ( Operation *op, SlapReply *rs )
{
void *ctx;
int rc;
if ( op->ore_reqdata != NULL ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment