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

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