ldap/servers/slapd/entry.c | 23 +----------------------
ldap/servers/slapd/slapi-plugin.h | 2 +-
ldap/servers/slapd/valueset.c | 6 +++---
3 files changed, 5 insertions(+), 26 deletions(-)
New commits:
commit 708df4b77abaf8260f717f3d8e3a0bd6b47bd36c
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Thu Jul 18 15:32:05 2013 +0200
fix compiler warnings
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
index ee7c18f..4006d53 100644
--- a/ldap/servers/slapd/entry.c
+++ b/ldap/servers/slapd/entry.c
@@ -746,12 +746,11 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int
read_stateinfo )
char *type;
struct berval bvtype;
str2entry_attr *sa;
- int i, j;
+ int i;
char *next=NULL;
char *valuecharptr=NULL;
struct berval bvvalue;
int rc;
- int fast_dup_check = 0;
entry_attrs *ea = NULL;
int tree_attr_checking = 0;
int big_entry_attr_presence_check = 0;
@@ -991,7 +990,6 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int
read_stateinfo )
if ( prev_attr==NULL )
{
/* Haven't seen this type yet */
- fast_dup_check = 1;
if ( nattrs == maxattrs )
{
/* Out of space - reallocate */
@@ -1023,15 +1021,6 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int
read_stateinfo )
/* Get the comparison function for later use */
attr_get_value_cmp_fn( &attrs[nattrs].sa_attr,
&(attrs[nattrs].sa_comparefn));
/*
- * If the compare function wasn't available,
- * we have to revert to AVL-tree-based dup checking,
- * which uses index keys for comparisons
- */
- if (NULL == attrs[nattrs].sa_comparefn)
- {
- fast_dup_check = 0;
- }
- /*
* If we are maintaining the attribute tree,
* then add the new attribute to the tree.
*/
@@ -1043,16 +1032,6 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int
read_stateinfo )
prev_attr = &attrs[nattrs];
nattrs++;
} else { /* prev_attr != NULL */
- if ( check_for_duplicate_values ) {
- /*
- * If the compare function wasn't available,
- * we have to revert to AVL-tree-based dup checking,
- * which uses index keys for comparisons
- */
- if (NULL == prev_attr->sa_comparefn) {
- fast_dup_check = 0;
- }
- }
}
sa = prev_attr; /* For readability */
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index d171f99..d548baf 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -4752,7 +4752,7 @@ void slapi_valueset_add_value(Slapi_ValueSet *vs, const Slapi_Value
*addval);
* \see slapi_valueset_first_value()
* \see slapi_valueset_next_value()
*/
-void slapi_valueset_add_value_ext(Slapi_ValueSet *vs, Slapi_Value *addval, unsigned long
flags);
+void slapi_valueset_add_value_ext(Slapi_ValueSet *vs, const Slapi_Value *addval, unsigned
long flags);
int slapi_valueset_add_attr_value_ext(const Slapi_Attr *a, Slapi_ValueSet *vs,
Slapi_Value *addval, unsigned long flags);
/**
diff --git a/ldap/servers/slapd/valueset.c b/ldap/servers/slapd/valueset.c
index 76d03e1..416a838 100644
--- a/ldap/servers/slapd/valueset.c
+++ b/ldap/servers/slapd/valueset.c
@@ -870,7 +870,7 @@ slapi_valueset_add_value(Slapi_ValueSet *vs, const Slapi_Value
*addval)
}
void
-slapi_valueset_add_value_ext(Slapi_ValueSet *vs, Slapi_Value *addval, unsigned long
flags)
+slapi_valueset_add_value_ext(Slapi_ValueSet *vs, const Slapi_Value *addval, unsigned long
flags)
{
Slapi_Value *oneval[2];
oneval[0]= (Slapi_Value*)addval;
@@ -928,13 +928,13 @@ static int
valueset_value_cmp( const Slapi_Attr *a, const Slapi_Value *v1, const Slapi_Value *v2 )
{
- if ( a == NULL || slapi_attr_is_dn_syntax_attr(a)) {
+ if ( a == NULL || slapi_attr_is_dn_syntax_attr((Slapi_Attr *)a)) {
/* if no attr is provided just do a utf8compare */
/* for all the values the first step of normalization is done,
* case folding still needs to be done
*/
/* would this be enough ?: return (strcasecmp(v1->bv.bv_val, v2->bv.bv_val)); */
- return (slapi_utf8casecmp(v1->bv.bv_val, v2->bv.bv_val));
+ return (slapi_utf8casecmp((unsigned char*)v1->bv.bv_val, (unsigned
char*)v2->bv.bv_val));
} else {
/* slapi_value_compare doesn't work, it only returns 0 or -1
return (slapi_value_compare(a, v1, v2));