From 7aeac214402767b5368a566a891efc75e12d9ae0 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 23 Nov 2007 12:47:53 +0000 Subject: [PATCH] silence warnings --- libraries/liblutil/utils.c | 12 ++++++------ servers/slapd/attr.c | 3 +-- servers/slapd/back-bdb/dbcache.c | 2 +- servers/slapd/back-meta/config.c | 2 +- servers/slapd/back-meta/conn.c | 2 +- servers/slapd/back-sql/back-sql.h | 12 ++++++------ servers/slapd/back-sql/delete.c | 4 +--- servers/slapd/mods.c | 2 +- servers/slapd/overlays/auditlog.c | 2 ++ servers/slapd/overlays/pcache.c | 3 +++ servers/slapd/result.c | 5 +++-- servers/slapd/schema_init.c | 8 ++++---- servers/slapd/slapi/slapi_utils.c | 1 - 13 files changed, 30 insertions(+), 28 deletions(-) diff --git a/libraries/liblutil/utils.c b/libraries/liblutil/utils.c index 386657593f..f5727fa656 100644 --- a/libraries/liblutil/utils.c +++ b/libraries/liblutil/utils.c @@ -604,18 +604,18 @@ lutil_atoulx( unsigned long *v, const char *s, int x ) } /* Multiply an integer by 100000000 and add new */ -typedef struct _decnum { +typedef struct lutil_int_decnum { unsigned char *buf; int bufsiz; int beg; int len; -} _decnum; +} lutil_int_decnum; #define FACTOR1 (100000000&0xffff) #define FACTOR2 (100000000>>16) static void -scale( int new, _decnum *prev, unsigned char *tmp ) +scale( int new, lutil_int_decnum *prev, unsigned char *tmp ) { int i, j; unsigned char *in = prev->buf+prev->beg; @@ -726,12 +726,12 @@ lutil_str2bin( struct berval *in, struct berval *out ) } else { /* Decimal */ char tmpbuf[64], *tmp; - _decnum num; + lutil_int_decnum num; int neg = 0; len = in->bv_len; pin = in->bv_val; - num.buf = out->bv_val; + num.buf = (unsigned char *)out->bv_val; num.bufsiz = out->bv_len; num.beg = num.bufsiz-1; num.len = 0; @@ -762,7 +762,7 @@ lutil_str2bin( struct berval *in, struct berval *out ) rc = -1; goto decfail; } - scale( l, &num, tmp ); + scale( l, &num, (unsigned char *)tmp ); pin += chunk; len -= chunk; chunk = DECMAX; diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index e66b65a841..2702c9f1c9 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -318,9 +318,8 @@ attr_valfind( } if ( a->a_flags & SLAP_ATTR_SORTED_VALS ) { - /* Binary search */ + /* Binary search */ unsigned base = 0, n = a->a_numvals; - int val = 0; while ( 0 < n ) { unsigned pivot = n >> 1; diff --git a/servers/slapd/back-bdb/dbcache.c b/servers/slapd/back-bdb/dbcache.c index e08c2493cf..ba005476f2 100644 --- a/servers/slapd/back-bdb/dbcache.c +++ b/servers/slapd/back-bdb/dbcache.c @@ -139,7 +139,7 @@ bdb_db_cache( if( rc != 0 ) { Debug( LDAP_DEBUG_ANY, "bdb_db_cache: db_open(%s) failed: %s (%d)\n", - name, db_strerror(rc), rc ); + name->bv_val, db_strerror(rc), rc ); ldap_pvt_thread_mutex_unlock( &bdb->bi_database_mutex ); return rc; } diff --git a/servers/slapd/back-meta/config.c b/servers/slapd/back-meta/config.c index c29712e59c..3cebec281c 100644 --- a/servers/slapd/back-meta/config.c +++ b/servers/slapd/back-meta/config.c @@ -1325,7 +1325,7 @@ idassert-authzFrom "dn:" if ( BER_BVISNULL( &be->be_nsuffix[ c ] ) ) { Debug( LDAP_DEBUG_ANY, "%s: line %d: " - "%s: line %d: \"%s\" must be within the database naming context, in " + " \"%s\" must be within the database naming context, in " "\"suffixMassage \"\n", fname, lineno, pvnc.bv_val ); free( pvnc.bv_val ); diff --git a/servers/slapd/back-meta/conn.c b/servers/slapd/back-meta/conn.c index ec49010914..eba59e52bd 100644 --- a/servers/slapd/back-meta/conn.c +++ b/servers/slapd/back-meta/conn.c @@ -867,7 +867,7 @@ meta_back_get_candidate( op2.ors_slimit = 1; op2.ors_tlimit = SLAP_NO_LIMIT; - op2.ors_filter = slap_filter_objectClass_pres; + op2.ors_filter = (Filter *)slap_filter_objectClass_pres; op2.ors_filterstr = *slap_filterstr_objectClass_pres; op2.o_callback = &cb2; diff --git a/servers/slapd/back-sql/back-sql.h b/servers/slapd/back-sql/back-sql.h index 98d06bc5e6..b01b45b29e 100644 --- a/servers/slapd/back-sql/back-sql.h +++ b/servers/slapd/back-sql/back-sql.h @@ -266,12 +266,6 @@ typedef struct backsql_api { struct backsql_api *ba_next; } backsql_api; -#ifdef BACKSQL_ARBITRARY_KEY -#define BACKSQL_ENTRYID_INIT { BER_BVNULL, BER_BVNULL, 0, BER_BVNULL, BER_BVNULL, NULL } -#else /* ! BACKSQL_ARBITRARY_KEY */ -#define BACKSQL_ENTRYID_INIT { 0, 0, 0, BER_BVNULL, BER_BVNULL, NULL } -#endif /* BACKSQL_ARBITRARY_KEY */ - /* * "structural" objectClass mapping structure */ @@ -398,6 +392,12 @@ typedef struct backsql_entryID { struct backsql_entryID *eid_next; } backsql_entryID; +#ifdef BACKSQL_ARBITRARY_KEY +#define BACKSQL_ENTRYID_INIT { BER_BVNULL, BER_BVNULL, 0, NULL, BER_BVNULL, BER_BVNULL, NULL } +#else /* ! BACKSQL_ARBITRARY_KEY */ +#define BACKSQL_ENTRYID_INIT { 0, 0, 0, NULL, BER_BVNULL, BER_BVNULL, NULL } +#endif /* BACKSQL_ARBITRARY_KEY */ + /* the function must collect the entry associated to nbase */ #define BACKSQL_ISF_GET_ID 0x1U #define BACKSQL_ISF_GET_ENTRY ( 0x2U | BACKSQL_ISF_GET_ID ) diff --git a/servers/slapd/back-sql/delete.c b/servers/slapd/back-sql/delete.c index 15dd62a28a..ee819b0a77 100644 --- a/servers/slapd/back-sql/delete.c +++ b/servers/slapd/back-sql/delete.c @@ -293,7 +293,6 @@ static int backsql_tree_delete_search_cb( Operation *op, SlapReply *rs ) { if ( rs->sr_type == REP_SEARCH ) { - backsql_info *bi = (backsql_info*)op->o_bd->be_private; backsql_tree_delete_t *btd; backsql_entryID *eid; @@ -367,7 +366,7 @@ backsql_tree_delete( op2.ors_deref = LDAP_DEREF_NEVER; op2.ors_slimit = SLAP_NO_LIMIT; op2.ors_tlimit = SLAP_NO_LIMIT; - op2.ors_filter = slap_filter_objectClass_pres; + op2.ors_filter = (Filter *)slap_filter_objectClass_pres; op2.ors_filterstr = *slap_filterstr_objectClass_pres; op2.ors_attrs = slap_anlist_all_attributes; op2.ors_attrsonly = 0; @@ -403,7 +402,6 @@ clean:; int backsql_delete( Operation *op, SlapReply *rs ) { - backsql_info *bi = (backsql_info*)op->o_bd->be_private; SQLHDBC dbh = SQL_NULL_HDBC; SQLHSTMT sth = SQL_NULL_HSTMT; backsql_oc_map_rec *oc = NULL; diff --git a/servers/slapd/mods.c b/servers/slapd/mods.c index 2d0d01fc8b..55459eeaf1 100644 --- a/servers/slapd/mods.c +++ b/servers/slapd/mods.c @@ -69,7 +69,7 @@ modify_add_values( if ( a != NULL ) { MatchingRule *mr; struct berval *cvals; - int rc, i, j, p; + int rc, i, p; unsigned flags; mr = mod->sm_desc->ad_type->sat_equality; diff --git a/servers/slapd/overlays/auditlog.c b/servers/slapd/overlays/auditlog.c index 8879ee39f4..2744d18d4d 100644 --- a/servers/slapd/overlays/auditlog.c +++ b/servers/slapd/overlays/auditlog.c @@ -224,6 +224,7 @@ auditlog_db_destroy( return 0; } +#if 0 static int auditlog_config( BackendDB *be, @@ -249,6 +250,7 @@ auditlog_config( } return SLAP_CONF_UNKNOWN; } +#endif /* 0 */ int auditlog_initialize() { int rc; diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index ecdd2546ae..68560f1486 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -2015,6 +2015,9 @@ pcache_op_cleanup( Operation *op, SlapReply *rs ) { case PC_SIZELIMIT: qc->q_sizelimit = rs->sr_nentries; break; + default: + assert( 0 ); + break; } ldap_pvt_thread_rdwr_wunlock(&qc->rwlock); ldap_pvt_thread_mutex_lock(&cm->cache_mutex); diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 7be8d95249..eccc035832 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -742,9 +742,10 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) } /* Every 64 entries, check for thread pool pause */ - if (( rs->sr_nentries & 0x3f == 0x3f ) && + if ( ( ( rs->sr_nentries & 0x3f ) == 0x3f ) && ldap_pvt_thread_pool_query( &connection_pool, - LDAP_PVT_THREAD_POOL_PARAM_PAUSING, &i ) == 0 && i ) { + LDAP_PVT_THREAD_POOL_PARAM_PAUSING, &i ) == 0 && i ) + { return LDAP_BUSY; } diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 6bdd95cf75..c4ae8762d1 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -2208,7 +2208,7 @@ integerFilter( struct berval iv; BerVarray keys; struct berval *value; - int i, rc; + int rc; if ( !index_intlen ) { return octetStringFilter( use, flags, syntax, mr, @@ -3081,7 +3081,6 @@ serialNumberAndIssuerNormalize( char sbuf[64], *stmp = sbuf; int rc; ber_len_t n; - int is_hex = 0; assert( in != NULL ); assert( out != NULL ); @@ -3132,10 +3131,11 @@ serialNumberAndIssuerNormalize( AC_MEMCPY( &out->bv_val[n], sn.bv_val, sn.bv_len ); { int j; - unsigned char *v = sn2.bv_val; + unsigned char *v = (unsigned char *)sn2.bv_val; out->bv_val[n++] = '\''; for ( j = 0; j < sn2.bv_len; j++ ) { - sprintf( &out->bv_val[n], "%02X", v[j] ); + snprintf( &out->bv_val[n], out->bv_len - n + 1, + "%02X", v[j] ); n += 2; } out->bv_val[n++] = '\''; diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index 928a5e507b..fafcde1b2f 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -2153,7 +2153,6 @@ int slapi_attr_value_cmp( const Slapi_Attr *a, const struct berval *v1, const st int slapi_attr_value_find( const Slapi_Attr *a, struct berval *v ) { int rc; - int ret; if ( a ->a_vals == NULL ) { return -1; -- 2.39.5