Commit 3a2e98e9 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

silence warnings

parent f31d40d6
......@@ -2012,22 +2012,15 @@ print_deref( LDAP *ld, LDAPControl *ctrl )
if ( dv->vals != NULL ) {
int j;
for ( j = 0; dv->vals[ j ].bv_val != NULL; j++ ) {
int k;
for ( k = 0; k < dv->vals[ j ].bv_len; k++ ) {
if ( !isprint( dv->vals[ j ].bv_val[k] ) ) {
k = -1;
break;
}
}
int k = ldif_is_not_printable( dv->vals[ j ].bv_val, dv->vals[ j ].bv_len );
*ptr++ = '<';
ptr = lutil_strcopy( ptr, dv->type );
if ( k == -1 ) {
if ( k ) {
*ptr++ = ':';
}
*ptr++ = '=';
if ( k == -1 ) {
if ( k ) {
k = lutil_b64_ntop(
(unsigned char *) dv->vals[ j ].bv_val,
dv->vals[ j ].bv_len,
......
......@@ -1297,7 +1297,7 @@ getNextPage:
if (( rc == LDAP_SUCCESS ) && vlv ) {
char buf[BUFSIZ];
int i, moreEntries, tmpSize;
int i, moreEntries;
/* Loop to get the next window when
* enter is pressed on the terminal.
......
......@@ -618,7 +618,7 @@ no_cn:
} else if (( cn->data[0] == '*' ) && ( cn->data[1] == '.' )) {
char *domain = strchr(name, '.');
if( domain ) {
size_t dlen;
int dlen;
dlen = nlen - (domain-name);
......
......@@ -191,7 +191,10 @@ ldap_x_wc_to_utf8 ( char *utf8char, wchar_t wchar, size_t count )
return 4;
if( wchar < 0x4000000 )
return 5;
if( wchar < 0x80000000 )
#if SIZEOF_WCHAR_T > 4
/* UL is not strictly needed by ANSI C */
if( wchar < (wchar_t)0x80000000UL )
#endif /* SIZEOF_WCHAR_T > 4 */
return 6;
return -1;
}
......@@ -235,7 +238,12 @@ ldap_x_wc_to_utf8 ( char *utf8char, wchar_t wchar, size_t count )
utf8char[len++] = 0x80 | ( wchar & 0x3f );
}
} else if( wchar < 0x80000000 ) {
} else
#if SIZEOF_WCHAR_T > 4
/* UL is not strictly needed by ANSI C */
if( wchar < (wchar_t)0x80000000UL )
#endif /* SIZEOF_WCHAR_T > 4 */
{
if (count >= 6) {
utf8char[len++] = 0xfc | ( wchar >> 30 );
utf8char[len++] = 0x80 | ( (wchar >> 24) & 0x3f );
......@@ -245,8 +253,11 @@ ldap_x_wc_to_utf8 ( char *utf8char, wchar_t wchar, size_t count )
utf8char[len++] = 0x80 | ( wchar & 0x3f );
}
} else
#if SIZEOF_WCHAR_T > 4
} else {
len = -1;
#endif /* SIZEOF_WCHAR_T > 4 */
}
return len;
......@@ -467,4 +478,4 @@ ldap_x_mbs_to_utf8s ( char *utf8str, const char *mbstr, size_t count,
return n;
}
#endif
#endif /* SIZEOF_WCHAR_T >= 4 */
......@@ -199,7 +199,7 @@ struct bdb_info {
struct re_s *bi_txn_cp_task;
struct re_s *bi_index_task;
int bi_lock_detect;
u_int32_t bi_lock_detect;
long bi_shm_key;
ID bi_lastid;
......
......@@ -487,7 +487,7 @@ bdb_cf_gen( ConfigArgs *c )
if ( bdb->bi_lock_detect != DB_LOCK_DEFAULT ) {
int i;
for (i=0; !BER_BVISNULL(&bdb_lockd[i].word); i++) {
if ( bdb->bi_lock_detect == bdb_lockd[i].mask ) {
if ( bdb->bi_lock_detect == (u_int32_t)bdb_lockd[i].mask ) {
value_add_one( &c->rvalue_vals, &bdb_lockd[i].word );
rc = 0;
break;
......@@ -890,7 +890,7 @@ bdb_cf_gen( ConfigArgs *c )
c->log, c->argv[1] );
return 1;
}
bdb->bi_lock_detect = rc;
bdb->bi_lock_detect = (u_int32_t)rc;
break;
case BDB_SSTACK:
......
......@@ -326,7 +326,8 @@ bdb_search( Operation *op, SlapReply *rs )
slap_mask_t mask;
time_t stoptime;
int manageDSAit;
int tentries = 0, nentries = 0;
int tentries = 0;
unsigned nentries = 0;
int idflag = 0;
DB_LOCK lock;
......
......@@ -832,7 +832,9 @@ ldap_build_entry(
LBER_FREE( attr->a_nvals[i].bv_val );
LBER_FREE( attr->a_vals[i].bv_val );
attr->a_numvals--;
if ( i < attr->a_numvals ) {
assert( i >= 0 );
if ( (unsigned)i < attr->a_numvals ) {
attr->a_vals[i] = attr->a_vals[attr->a_numvals];
if ( attr->a_nvals != attr->a_vals )
attr->a_nvals[i] = attr->a_nvals[attr->a_numvals];
......
Supports Markdown
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