This is an automated email from the git hooks/post-receive script.
firstyear pushed a commit to branch master
in repository 389-ds-base.
commit 683737b52e116435b9cde2e2727b018b17cdb433
Author: William Brown <firstyear(a)redhat.com>
Date: Wed May 3 12:12:21 2017 +1000
Ticket 49240 - ci compiler warns
Bug Description: Fix compiler warnings found in fedora jenkins.
Fix Description: Fix cast from calloc in pblock, fix unsigned
constants, ifdef out some tests, change pointer type to avl
tree.
https://pagure.io/389-ds-base/issue/49240
Author: wibrown
Review by: mreynolds (Thanks!)
---
ldap/servers/slapd/pblock.c | 14 +++++++-------
src/libsds/test/benchmark.c | 4 ++--
src/libsds/test/test_sds_bpt.c | 6 ++++--
src/libsds/test/test_sds_csiphash.c | 4 ++--
4 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
index b1e36a3..4fb16df 100644
--- a/ldap/servers/slapd/pblock.c
+++ b/ldap/servers/slapd/pblock.c
@@ -217,49 +217,49 @@ void slapi_pblock_destroy(Slapi_PBlock *pb) {
static inline void __attribute__((always_inline))
_pblock_assert_pb_dse(Slapi_PBlock *pblock) {
if (pblock->pb_dse == NULL) {
- pblock->pb_dse = slapi_ch_calloc(1, sizeof(slapi_pblock_dse));
+ pblock->pb_dse = (slapi_pblock_dse *)slapi_ch_calloc(1,
sizeof(slapi_pblock_dse));
}
}
static inline void __attribute__((always_inline))
_pblock_assert_pb_task(Slapi_PBlock *pblock) {
if (pblock->pb_task == NULL) {
- pblock->pb_task = slapi_ch_calloc(1, sizeof(slapi_pblock_task));
+ pblock->pb_task = (slapi_pblock_task *)slapi_ch_calloc(1,
sizeof(slapi_pblock_task));
}
}
static inline void __attribute__((always_inline))
_pblock_assert_pb_mr(Slapi_PBlock *pblock) {
if (pblock->pb_mr == NULL) {
- pblock->pb_mr = slapi_ch_calloc(1, sizeof(slapi_pblock_matching_rule));
+ pblock->pb_mr = (slapi_pblock_matching_rule *)slapi_ch_calloc(1,
sizeof(slapi_pblock_matching_rule));
}
}
static inline void __attribute__((always_inline))
_pblock_assert_pb_misc(Slapi_PBlock *pblock) {
if (pblock->pb_misc == NULL) {
- pblock->pb_misc = slapi_ch_calloc(1, sizeof(slapi_pblock_misc));
+ pblock->pb_misc = (slapi_pblock_misc *)slapi_ch_calloc(1,
sizeof(slapi_pblock_misc));
}
}
static inline void __attribute__((always_inline))
_pblock_assert_pb_intop(Slapi_PBlock *pblock) {
if (pblock->pb_intop == NULL) {
- pblock->pb_intop = slapi_ch_calloc(1, sizeof(slapi_pblock_intop));
+ pblock->pb_intop = (slapi_pblock_intop *)slapi_ch_calloc(1,
sizeof(slapi_pblock_intop));
}
}
static inline void __attribute__((always_inline))
_pblock_assert_pb_intplugin(Slapi_PBlock *pblock) {
if (pblock->pb_intplugin == NULL) {
- pblock->pb_intplugin = slapi_ch_calloc(1, sizeof(slapi_pblock_intplugin));
+ pblock->pb_intplugin = (slapi_pblock_intplugin *)slapi_ch_calloc(1,
sizeof(slapi_pblock_intplugin));
}
}
static inline void __attribute__((always_inline))
_pblock_assert_pb_deprecated(Slapi_PBlock *pblock) {
if (pblock->pb_deprecated == NULL) {
- pblock->pb_deprecated = slapi_ch_calloc(1, sizeof(slapi_pblock_deprecated));
+ pblock->pb_deprecated = (slapi_pblock_deprecated *)slapi_ch_calloc(1,
sizeof(slapi_pblock_deprecated));
}
}
diff --git a/src/libsds/test/benchmark.c b/src/libsds/test/benchmark.c
index 83c4d89..46a1e1d 100644
--- a/src/libsds/test/benchmark.c
+++ b/src/libsds/test/benchmark.c
@@ -72,7 +72,7 @@ avl_delete_wrapper(void **inst, uint64_t *key) {
int64_t
avl_destroy_wrapper(void **inst) {
Avlnode **tree = (Avlnode **)inst;
- ( void ) avl_free( *tree, free );
+ ( void ) avl_free( *tree, (IFP)free );
return 0;
}
@@ -284,7 +284,7 @@ int64_t ht_init_wrapper(void **inst) {
int64_t ht_add_wrapper(void** inst, uint64_t *key, void *value) {
sds_ht_instance **ht = (sds_ht_instance **)inst;
- sds_ht_insert(*ht, key, NULL);
+ sds_ht_insert(*ht, key, value);
return 0;
}
diff --git a/src/libsds/test/test_sds_bpt.c b/src/libsds/test/test_sds_bpt.c
index f53c618..3b477e1 100644
--- a/src/libsds/test/test_sds_bpt.c
+++ b/src/libsds/test/test_sds_bpt.c
@@ -9,6 +9,7 @@
#include "test_sds.h"
+#ifdef DEBUG_TEST_ASAN
static void
test_asan_overflow(void)
{
@@ -24,6 +25,7 @@ test_asan_leak(void)
// Just malloc this, it should fail in the end.
char *test = sds_malloc(4 * sizeof(char));
}
+#endif
static void
test_1_invalid_binst_ptr(void **state __attribute__((unused)))
@@ -877,14 +879,14 @@ run_bpt_tests (void) {
#ifdef DEBUG
cmocka_unit_test(test_10_tamper_with_inst),
cmocka_unit_test(test_11_tamper_with_node),
- /*
+#endif
+#ifdef DEBUG_TEST_ASAN
cmocka_unit_test_setup_teardown(test_17_insert_and_tamper,
bptree_test_setup,
bptree_test_teardown),
cmocka_unit_test_setup_teardown(test_5_single_null_mismatch_size_insert_fn,
bptree_test_setup,
bptree_test_teardown),
- */
#endif
cmocka_unit_test_setup_teardown(test_3_single_insert,
bptree_test_setup,
diff --git a/src/libsds/test/test_sds_csiphash.c b/src/libsds/test/test_sds_csiphash.c
index c4cc12c..2973504 100644
--- a/src/libsds/test/test_sds_csiphash.c
+++ b/src/libsds/test/test_sds_csiphash.c
@@ -22,8 +22,8 @@ test_siphash(void **state __attribute__((unused))) {
uint64_t hashout = 0;
char key[16] = {0};
- uint64_t test_a = 15794382300316794652;
- uint64_t test_b = 13042610424265326907;
+ uint64_t test_a = 15794382300316794652U;
+ uint64_t test_b = 13042610424265326907U;
// Initial simple test
value = 5;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.