From 1c2aef605004892dcc695e580271a5b65070f54e Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 8 Sep 2005 20:18:43 +0000 Subject: [PATCH] fix format and signedness issues --- servers/slapd/back-sql/add.c | 6 +++--- servers/slapd/back-sql/entry-id.c | 16 ++++++++-------- servers/slapd/back-sql/util.c | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/servers/slapd/back-sql/add.c b/servers/slapd/back-sql/add.c index d8f3842366..548bfd835e 100644 --- a/servers/slapd/back-sql/add.c +++ b/servers/slapd/back-sql/add.c @@ -819,7 +819,7 @@ backsql_add_attr( if ( rc != SQL_SUCCESS ) { Debug( LDAP_DEBUG_TRACE, " backsql_add_attr(): " - "error binding output parameter for %s[%d]\n", + "error binding output parameter for %s[%lu]\n", at_rec->bam_ad->ad_cname.bv_val, i, 0 ); backsql_PrintErrors( bi->sql_db_env, dbh, sth, rc ); @@ -840,7 +840,7 @@ backsql_add_attr( if ( rc != SQL_SUCCESS ) { Debug( LDAP_DEBUG_TRACE, " backsql_add_attr(): " - "error binding keyval parameter for %s[%d]\n", + "error binding keyval parameter for %s[%lu]\n", at_rec->bam_ad->ad_cname.bv_val, i, 0 ); backsql_PrintErrors( bi->sql_db_env, dbh, sth, rc ); @@ -861,7 +861,7 @@ backsql_add_attr( if ( rc != SQL_SUCCESS ) { Debug( LDAP_DEBUG_TRACE, " backsql_add_attr(): " - "error binding value parameter for %s[%d]\n", + "error binding value parameter for %s[%lu]\n", at_rec->bam_ad->ad_cname.bv_val, i, 0 ); backsql_PrintErrors( bi->sql_db_env, dbh, sth, rc ); diff --git a/servers/slapd/back-sql/entry-id.c b/servers/slapd/back-sql/entry-id.c index 9690774a09..74035025d0 100644 --- a/servers/slapd/back-sql/entry-id.c +++ b/servers/slapd/back-sql/entry-id.c @@ -550,7 +550,7 @@ backsql_get_attr_vals( void *v_at, void *v_bsi ) } Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): " - "number of values in query: %d\n", count, 0, 0 ); + "number of values in query: %lu\n", count, 0, 0 ); SQLFreeStmt( sth, SQL_DROP ); if ( count == 0 ) { return 1; @@ -662,7 +662,7 @@ backsql_get_attr_vals( void *v_at, void *v_bsi ) BACKSQL_SUCCESS( rc ); rc = SQLFetch( sth ), k++ ) { - for ( i = 0; i < row.ncols; i++ ) { + for ( i = 0; i < (unsigned long)row.ncols; i++ ) { if ( row.value_len[ i ] > 0 ) { struct berval bv; @@ -722,11 +722,11 @@ backsql_get_attr_vals( void *v_at, void *v_bsi ) * but we're accepting the attributes; * should we fail at all? */ snprintf( buf, sizeof( buf ), - "unable to %s value #%d " + "unable to %s value #%lu " "of AttributeDescription %s", pretty ? "prettify" : "validate", - at->bam_ad->ad_cname.bv_val, - k - oldcount ); + k - oldcount, + at->bam_ad->ad_cname.bv_val ); Debug( LDAP_DEBUG_TRACE, "==>backsql_get_attr_vals(\"%s\"): " "%s (%d)\n", @@ -757,10 +757,10 @@ backsql_get_attr_vals( void *v_at, void *v_bsi ) * but we're accepting the attributes; * should we fail at all? */ snprintf( buf, sizeof( buf ), - "unable to normalize value #%d " + "unable to normalize value #%lu " "of AttributeDescription %s", - at->bam_ad->ad_cname.bv_val, - k - oldcount ); + k - oldcount, + at->bam_ad->ad_cname.bv_val ); Debug( LDAP_DEBUG_TRACE, "==>backsql_get_attr_vals(\"%s\"): " "%s (%d)\n", diff --git a/servers/slapd/back-sql/util.c b/servers/slapd/back-sql/util.c index 4bb276f0f2..eee55942e5 100644 --- a/servers/slapd/back-sql/util.c +++ b/servers/slapd/back-sql/util.c @@ -522,9 +522,9 @@ backsql_entryUUID( /* note: works only with 32 bit architectures... */ snprintf( uuidbuf, sizeof( uuidbuf ), "%08x-%04x-%04x-0000-000000000000", - ( id->eid_oc_id & 0xFFFFFFFF ), - ( ( id->eid_keyval & 0xFFFF0000 ) >> 020 /* 16 */ ), - ( id->eid_keyval & 0xFFFF ) ); + ( (unsigned)id->eid_oc_id & 0xFFFFFFFF ), + ( ( (unsigned)id->eid_keyval & 0xFFFF0000 ) >> 020 /* 16 */ ), + ( (unsigned)id->eid_keyval & 0xFFFF ) ); #endif /* ! BACKSQL_ARBITRARY_KEY */ uuid.bv_val = uuidbuf; -- 2.39.5