>From 480e254da6b1af3e55e72aee0853719a15927591 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Fri, 17 May 2013 04:48:13 -0700 Subject: [PATCH] ldb: Fix warnings using discard_const Signed-off-by: Matthieu Patou --- lib/ldb/ldb_map/ldb_map.c | 4 ++-- lib/ldb/tests/sample_module.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ldb/ldb_map/ldb_map.c b/lib/ldb/ldb_map/ldb_map.c index d35e5c6..6c53d06 100644 --- a/lib/ldb/ldb_map/ldb_map.c +++ b/lib/ldb/ldb_map/ldb_map.c @@ -871,7 +871,7 @@ static int map_objectclass_convert_operator(struct ldb_module *module, void *mem /* Build a request to search a record by its DN. */ struct ldb_request *map_search_base_req(struct map_context *ac, struct ldb_dn *dn, const char * const *attrs, const struct ldb_parse_tree *tree, void *context, ldb_map_callback_t callback) { - const struct ldb_parse_tree *search_tree; + struct ldb_parse_tree *search_tree; struct ldb_context *ldb; struct ldb_request *req; int ret; @@ -879,7 +879,7 @@ struct ldb_request *map_search_base_req(struct map_context *ac, struct ldb_dn *d ldb = ldb_module_get_ctx(ac->module); if (tree) { - search_tree = tree; + search_tree = discard_const_p(struct ldb_parse_tree, tree); } else { search_tree = ldb_parse_tree(ac, NULL); if (search_tree == NULL) { diff --git a/lib/ldb/tests/sample_module.c b/lib/ldb/tests/sample_module.c index bee40a5..6c0ed8b 100644 --- a/lib/ldb/tests/sample_module.c +++ b/lib/ldb/tests/sample_module.c @@ -30,7 +30,7 @@ static int sample_add(struct ldb_module *mod, struct ldb_request *req) { struct ldb_control *control; - ldb_msg_add_fmt(req->op.add.message, "touchedBy", "sample"); + ldb_msg_add_fmt(discard_const(req->op.add.message), "touchedBy", "sample"); /* check if there's a relax control */ control = ldb_request_get_control(req, LDB_CONTROL_RELAX_OID); -- 1.8.1.2