فهرست منبع

fix compiler warnings

Ludwig Krispenz 12 سال پیش
والد
کامیت
708df4b77a
3فایلهای تغییر یافته به همراه5 افزوده شده و 26 حذف شده
  1. 1 22
      ldap/servers/slapd/entry.c
  2. 1 1
      ldap/servers/slapd/slapi-plugin.h
  3. 3 3
      ldap/servers/slapd/valueset.c

+ 1 - 22
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 */
@@ -1022,15 +1020,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 */

+ 1 - 1
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);
 
 /**

+ 3 - 3
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));