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

40cd75
From 43c73ca572af6a4bdc9b5994a9640f4d4e713cc2 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
40cd75
index ae0a13fdc..8730d9f56 100644
40cd75
--- a/ldap/servers/slapd/valueset.c
40cd75
+++ b/ldap/servers/slapd/valueset.c
40cd75
@@ -744,7 +744,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++)
40cd75
@@ -814,7 +814,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 */
40cd75
@@ -868,7 +868,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