Blame SOURCES/0021-Ticket-49401-Fix-compiler-incompatible-pointer-types.patch

081b2d
From 308691e03cc6312bde3409b346df3156d34db0fe Mon Sep 17 00:00:00 2001
40cd75
From: Mohammad Nweider <nweiderm@amazon.com>
40cd75
Date: Wed, 25 Oct 2017 16:26:54 +0000
40cd75
Subject: [PATCH] Ticket 49401 - Fix compiler incompatible-pointer-types
40cd75
 warnings
40cd75
40cd75
Bug Description: vs->sorted was integer pointer in older versions,
40cd75
    but now it's size_t pointer, this is causing compiler warnings
40cd75
    during the build
40cd75
40cd75
Fix Description: use size_t pointers instead of integer pointers for vs->sorted and sorted2
40cd75
40cd75
Review By: mreynolds
40cd75
40cd75
Signed-off-by: Mark Reynolds <mreynolds@redhat.com>
40cd75
(cherry picked from commit 52ba2aba49935989152010aee0d40b01d7a78432)
40cd75
---
40cd75
 ldap/servers/slapd/valueset.c | 6 +++---
40cd75
 1 file changed, 3 insertions(+), 3 deletions(-)
40cd75
40cd75
diff --git a/ldap/servers/slapd/valueset.c b/ldap/servers/slapd/valueset.c
081b2d
index 1c1bc150a..dc0360738 100644
40cd75
--- a/ldap/servers/slapd/valueset.c
40cd75
+++ b/ldap/servers/slapd/valueset.c
081b2d
@@ -680,7 +680,7 @@ valueset_array_purge(const Slapi_Attr *a, Slapi_ValueSet *vs, const CSN *csn)
40cd75
     int nv = 0;
40cd75
     int numValues = 0;
40cd75
     Slapi_Value **va2 = NULL;
40cd75
-    int *sorted2 = NULL;
40cd75
+    size_t *sorted2 = NULL;
40cd75
 
40cd75
     /* Loop over all the values freeing the old ones. */
40cd75
     for(i = 0; i < vs->num; i++)
081b2d
@@ -750,7 +750,7 @@ valueset_array_purge(const Slapi_Attr *a, Slapi_ValueSet *vs, const CSN *csn)
40cd75
         if(vs->sorted) {
40cd75
             /* Let's allocate va2 and sorted2 */
40cd75
             va2 = (Slapi_Value **) slapi_ch_malloc( (numValues + 1) * sizeof(Slapi_Value *));
40cd75
-            sorted2 = (int *) slapi_ch_malloc( (numValues + 1)* sizeof(int));
40cd75
+            sorted2 = (size_t *) slapi_ch_malloc( (numValues + 1)* sizeof(size_t));
40cd75
         }
40cd75
 
40cd75
         /* I is the index for the *new* va2 array */
081b2d
@@ -804,7 +804,7 @@ valueset_array_purge(const Slapi_Attr *a, Slapi_ValueSet *vs, const CSN *csn)
40cd75
 
40cd75
     /* We still have values but not sorted array! rebuild it */
40cd75
     if(vs->num > VALUESET_ARRAY_SORT_THRESHOLD && vs->sorted == NULL) {
40cd75
-        vs->sorted = (int *) slapi_ch_malloc( vs->max* sizeof(int));
40cd75
+        vs->sorted = (size_t *) slapi_ch_malloc( vs->max* sizeof(size_t));
40cd75
         valueset_array_to_sorted(a, vs);
40cd75
     }
40cd75
 #ifdef DEBUG
40cd75
-- 
40cd75
2.13.6
40cd75