]> git.sur5r.net Git - openldap/commitdiff
silence warnings
authorPierangelo Masarati <ando@openldap.org>
Sat, 10 Sep 2005 18:59:35 +0000 (18:59 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 10 Sep 2005 18:59:35 +0000 (18:59 +0000)
libraries/liblber/io.c
libraries/libldap/os-ip.c
libraries/libldap/os-local.c
libraries/libldap/result.c
libraries/liblutil/utils.c
servers/slapd/acl.c
servers/slapd/aclparse.c
servers/slapd/back-meta/init.c
servers/slapd/dn.c
servers/slapd/proto-slap.h

index f5f7ce9b166a6078c236985a56e0d6772896348e..fc37f8dfb20873880d04a4b2fb4bc26e03357595 100644 (file)
@@ -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)) {
index 7715044f14f3b87c618ca8d8658b32c9f94ded5a..02eb7828aa55cd73c98f109681fbe636a5268f37 100644 (file)
@@ -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",
index 5c46e5c6124099710214405798466b4c13d7d811..1079c5071363bc55423acb732f0abf2a8b16067d 100644 (file)
@@ -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",
index a4f1093bbe37b2e253cf690582a84e5edee6fa42..6891e6f9158ec68a083f4a82d9319c52d7d0220f 100644 (file)
@@ -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;
 }
 
 
index 692d2bebe6c9b311435c7c6dc751a7d9b2e72a15..4d179f7543a84d236c4dfa9c4269acebc4f45ff2 100644 (file)
@@ -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++);
index 91c33e9c2377e9f482128264555a99da7820ff99..f224e68e8a1b823178c7284c00ba9432fa80c11a 100644 (file)
@@ -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;
index 339bc6a5824272a0186fa10ee5eab4a583d81b17..ff6f70588f14992d0bf6aee99e42bdb8d2b8ee71 100644 (file)
@@ -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;
                        }
index 3b50226603d2826e39df0dd19bd13fc7f8571ddf..fb2b0d50ceb888241511c95a434b30397b052c47 100644 (file)
@@ -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;
 }
 
index 3326ba930936c13663d751e4940884675d6ed591..05832ecd97f1d3d4c83f6b5a6d7176cd0e05054f 100644 (file)
@@ -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 )
index 1038da8cef72f6bc79ac4bcb40c642d7578b9fe3..f901a6a379a3df4c5c3271defd7bf9ee2b328bac 100644 (file)
@@ -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,