From b6f83f1a25c82fe397ae1c483b76341325e05fea Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Mon, 13 Oct 2008 09:17:36 +0000 Subject: [PATCH] Warning cleanup: signed meets unsigned. ber_flatten2() returns -1 on error, not LBER_DEFAULT. --- servers/slapd/overlays/accesslog.c | 12 ++++++------ servers/slapd/overlays/dynlist.c | 2 +- servers/slapd/overlays/ppolicy.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c index 866afd7937..0be32e9bfa 100644 --- a/servers/slapd/overlays/accesslog.c +++ b/servers/slapd/overlays/accesslog.c @@ -534,17 +534,17 @@ log_age_unparse( int age, struct berval *agebv, size_t size ) if ( dd ) { len = snprintf( ptr, size, "%d+", dd ); - assert( len >= 0 && len < size ); + assert( len >= 0 && (unsigned) len < size ); size -= len; ptr += len; } len = snprintf( ptr, size, "%02d:%02d", hh, mm ); - assert( len >= 0 && len < size ); + assert( len >= 0 && (unsigned) len < size ); size -= len; ptr += len; if ( ss ) { len = snprintf( ptr, size, ":%02d", ss ); - assert( len >= 0 && len < size ); + assert( len >= 0 && (unsigned) len < size ); size -= len; ptr += len; } @@ -580,7 +580,7 @@ log_old_lookup( Operation *op, SlapReply *rs ) a = attr_find( rs->sr_entry->e_attrs, slap_schema.si_ad_entryCSN ); if ( a ) { - int len = a->a_vals[0].bv_len; + ber_len_t len = a->a_vals[0].bv_len; if ( len > pd->csn.bv_len ) len = pd->csn.bv_len; if ( memcmp( a->a_vals[0].bv_val, pd->csn.bv_val, len ) > 0 ) { @@ -933,7 +933,7 @@ logSchemaControlValidate( struct berval *valp ) { struct berval val, bv; - int i; + ber_len_t i; int rc = LDAP_SUCCESS; assert( valp != NULL ); @@ -1155,7 +1155,7 @@ accesslog_ctrls( } if ( !BER_BVISNULL( &ctrls[ i ]->ldctl_value ) ) { - int j; + ber_len_t j; ptr = lutil_strcopy( ptr, " controlValue \"" ); for ( j = 0; j < ctrls[ i ]->ldctl_value.bv_len; j++ ) diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c index 5a5eb09f39..b7f38aa01d 100644 --- a/servers/slapd/overlays/dynlist.c +++ b/servers/slapd/overlays/dynlist.c @@ -877,7 +877,7 @@ dynlist_build_def_filter( dynlist_info_t *dli ) ptr = lutil_strcopy( ptr, dli->dli_oc->soc_cname.bv_val ); ptr = lutil_strcopy( ptr, "))" ); - assert( dli->dli_default_filter.bv_len == ptr - dli->dli_default_filter.bv_val ); + assert( ptr == &dli->dli_default_filter.bv_val[dli->dli_default_filter.bv_len] ); return 0; } diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c index 99db2bd5b1..ca0cb29b14 100644 --- a/servers/slapd/overlays/ppolicy.c +++ b/servers/slapd/overlays/ppolicy.c @@ -395,7 +395,7 @@ create_passcontrol( Operation *op, int exptime, int grace, LDAPPasswordPolicyErr } ber_printf( ber, /*{*/ "N}" ); - if (ber_flatten2( ber, &(c.ldctl_value), 1 ) == LBER_DEFAULT) { + if (ber_flatten2( ber, &(c.ldctl_value), 1 ) == -1) { return NULL; } (void)ber_free_buf(ber); @@ -679,7 +679,7 @@ parse_pwdhistory( struct berval *bv, char **oid, time_t *oldtime, struct berval { char *ptr; struct berval nv, npw; - int i, j; + ber_len_t i, j; assert (bv && (bv->bv_len > 0) && (bv->bv_val) && oldtime && oldpw ); -- 2.39.5