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,
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.
} else if (( cn->data[0] == '*' ) && ( cn->data[1] == '.' )) {
char *domain = strchr(name, '.');
if( domain ) {
- size_t dlen;
+ int dlen;
dlen = nlen - (domain-name);
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;
}
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 );
utf8char[len++] = 0x80 | ( wchar & 0x3f );
}
- } else
+#if SIZEOF_WCHAR_T > 4
+ } else {
len = -1;
+#endif /* SIZEOF_WCHAR_T > 4 */
+ }
return len;
return n;
}
-#endif
+#endif /* SIZEOF_WCHAR_T >= 4 */
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;
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;
c->log, c->argv[1] );
return 1;
}
- bdb->bi_lock_detect = rc;
+ bdb->bi_lock_detect = (u_int32_t)rc;
break;
case BDB_SSTACK:
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;
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];