From: Pierangelo Masarati Date: Sat, 10 Sep 2005 18:59:35 +0000 (+0000) Subject: silence warnings X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~441 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9129a2f7eeb1d82b4d4de7fed0bf2b3472193879;p=openldap silence warnings --- diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index f5f7ce9b16..fc37f8dfb2 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -559,7 +559,7 @@ ber_get_next( /* Now look for the length */ if (*ber->ber_ptr & 0x80) { /* multi-byte */ - ber_len_t i; + int i; unsigned char *p = (unsigned char *)ber->ber_ptr; int llen = *p++ & 0x7f; if (llen > (int)sizeof(ber_len_t)) { diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index 7715044f14..02eb7828aa 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -209,7 +209,8 @@ ldap_pvt_connect(LDAP *ld, ber_socket_t s, int async) { int rc; - struct timeval tv, *opt_tv=NULL; + struct timeval tv = { 0 }, + *opt_tv = NULL; #ifdef LDAP_CONNECTIONLESS /* We could do a connect() but that would interfere with @@ -223,9 +224,9 @@ ldap_pvt_connect(LDAP *ld, ber_socket_t s, return ( 0 ); } #endif - if ( (opt_tv = ld->ld_options.ldo_tm_net) != NULL ) { - tv.tv_usec = opt_tv->tv_usec; - tv.tv_sec = opt_tv->tv_sec; + opt_tv = ld->ld_options.ldo_tm_net; + if ( opt_tv != NULL ) { + tv = *opt_tv; } osip_debug(ld, "ldap_connect_timeout: fd: %d tm: %ld async: %d\n", diff --git a/libraries/libldap/os-local.c b/libraries/libldap/os-local.c index 5c46e5c612..1079c50713 100644 --- a/libraries/libldap/os-local.c +++ b/libraries/libldap/os-local.c @@ -167,11 +167,12 @@ static int ldap_pvt_connect(LDAP *ld, ber_socket_t s, struct sockaddr_un *sa, int async) { int rc; - struct timeval tv, *opt_tv=NULL; + struct timeval tv = { 0 }, + *opt_tv = NULL; - if ( (opt_tv = ld->ld_options.ldo_tm_net) != NULL ) { - tv.tv_usec = opt_tv->tv_usec; - tv.tv_sec = opt_tv->tv_sec; + opt_tv = ld->ld_options.ldo_tm_net; + if ( opt_tv != NULL ) { + tv = *opt_tv; } oslocal_debug(ld, "ldap_connect_timeout: fd: %d tm: %ld async: %d\n", diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index a4f1093bbe..6891e6f915 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -251,7 +251,9 @@ wait4msg( LDAPMessage **result ) { int rc; - struct timeval tv, tv0, *tvp; + struct timeval tv = { 0 }, + tv0 = { 0 }, + *tvp; time_t start_time = 0; time_t tmp_time; LDAPConn *lc, *nextlc; @@ -281,9 +283,9 @@ wait4msg( rc = -2; while ( rc == -2 ) { #ifdef LDAP_DEBUG - Debug( LDAP_DEBUG_TRACE, "wait4msg continue, msgid %d, all %d\n", - msgid, all, 0 ); if ( ldap_debug & LDAP_DEBUG_TRACE ) { + Debug( LDAP_DEBUG_TRACE, "wait4msg continue, msgid %d, all %d\n", + msgid, all, 0 ); ldap_dump_connection( ld, ld->ld_conns, 1 ); ldap_dump_requests_and_responses( ld ); } @@ -360,7 +362,8 @@ wait4msg( if ( rc == -2 && tvp != NULL ) { tmp_time = time( NULL ); - if (( tv0.tv_sec -= ( tmp_time - start_time )) <= 0 ) { + tv0.tv_sec -= ( tmp_time - start_time ); + if ( tv0.tv_sec <= 0 ) { rc = 0; /* timed out */ ld->ld_errno = LDAP_TIMEOUT; break; @@ -1070,7 +1073,7 @@ int ldap_msgtype( LDAPMessage *lm ) { assert( lm != NULL ); - return ( lm != NULL ) ? lm->lm_msgtype : -1; + return ( lm != NULL ) ? (int)lm->lm_msgtype : -1; } diff --git a/libraries/liblutil/utils.c b/libraries/liblutil/utils.c index 692d2bebe6..4d179f7543 100644 --- a/libraries/liblutil/utils.c +++ b/libraries/liblutil/utils.c @@ -204,7 +204,7 @@ int lutil_parsetime( char *atm, struct lutil_tm *tm ) { while (atm && tm) { char *ptr = atm; - int i, fracs; + unsigned i, fracs; /* Is the stamp reasonably long? */ for (i=0; isdigit(atm[i]); i++); diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index 91c33e9c23..f224e68e8a 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -851,7 +851,8 @@ slap_acl_get( continue; } else if ( a->acl_dn_style == ACL_STYLE_ONE ) { - int rdnlen = -1, sep = 0; + ber_len_t rdnlen = 0; + int sep = 0; if ( dnlen <= patlen ) continue; @@ -942,7 +943,7 @@ slap_acl_get( continue; } else if ( a->acl_attrval_style == ACL_STYLE_ONE ) { - int rdnlen = -1; + ber_len_t rdnlen = 0; if ( !DN_SEPARATOR( val->bv_val[vdnlen - patlen - 1] ) ) continue; @@ -1186,7 +1187,7 @@ acl_mask_dn( } } else if ( b->a_style == ACL_STYLE_ONE ) { - int rdnlen = -1; + ber_len_t rdnlen = 0; if ( odnlen <= patlen ) { goto dn_match_cleanup; diff --git a/servers/slapd/aclparse.c b/servers/slapd/aclparse.c index 339bc6a582..ff6f70588f 100644 --- a/servers/slapd/aclparse.c +++ b/servers/slapd/aclparse.c @@ -267,7 +267,7 @@ regex_done:; sep = 1; } - rdnlen = (ber_len_t)dn_rdnlen( NULL, &dn ); + rdnlen = dn_rdnlen( NULL, &dn ); if ( rdnlen != dn.bv_len - patlen - sep ) return ACL_SCOPE_ERR; } diff --git a/servers/slapd/back-meta/init.c b/servers/slapd/back-meta/init.c index 3b50226603..fb2b0d50ce 100644 --- a/servers/slapd/back-meta/init.c +++ b/servers/slapd/back-meta/init.c @@ -30,7 +30,9 @@ int meta_back_open( BackendInfo *bi ) { + /* FIXME: need to remove the pagedResults, and likely more... */ bi->bi_controls = slap_known_controls; + return 0; } diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index 3326ba9309..05832ecd97 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -1207,7 +1207,7 @@ dnExtractRdn( /* * We can assume the input is a prettied or normalized DN */ -int +ber_len_t dn_rdnlen( Backend *be, struct berval *dn_in ) diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 1038da8cef..f901a6a379 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -783,7 +783,7 @@ LDAP_SLAPD_F (int) dnExtractRdn LDAP_P(( LDAP_SLAPD_F (int) rdn_validate LDAP_P(( struct berval * rdn )); -LDAP_SLAPD_F (int) dn_rdnlen LDAP_P(( Backend *be, struct berval *dn )); +LDAP_SLAPD_F (ber_len_t) dn_rdnlen LDAP_P(( Backend *be, struct berval *dn )); LDAP_SLAPD_F (void) build_new_dn LDAP_P(( struct berval * new_dn,