summaryrefslogtreecommitdiff
path: root/source3/lib/ldb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-11-28 17:47:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:11 -0500
commit762b86ff0deb072871081f2684f63778e36ad3ce (patch)
tree329f0361e1284d16b4312a1de01cb487d1c46f79 /source3/lib/ldb
parent15974508e8916e325563202f5fa7fad4f8514340 (diff)
downloadsamba-762b86ff0deb072871081f2684f63778e36ad3ce.tar.gz
samba-762b86ff0deb072871081f2684f63778e36ad3ce.tar.bz2
samba-762b86ff0deb072871081f2684f63778e36ad3ce.zip
r19935: always use discard_const_p() in lib/ldb/
metze (This used to be commit 4a5da57306ad8cce5522ee72349cb85b447e295c)
Diffstat (limited to 'source3/lib/ldb')
-rw-r--r--source3/lib/ldb/common/attrib_handlers.c2
-rw-r--r--source3/lib/ldb/include/includes.h3
-rw-r--r--source3/lib/ldb/ldb_ildap/ldb_ildap.c5
-rw-r--r--source3/lib/ldb/ldb_ldap/ldb_ldap.c2
-rw-r--r--source3/lib/ldb/modules/operational.c2
5 files changed, 7 insertions, 7 deletions
diff --git a/source3/lib/ldb/common/attrib_handlers.c b/source3/lib/ldb/common/attrib_handlers.c
index a289f3c32a..2b699aeaa8 100644
--- a/source3/lib/ldb/common/attrib_handlers.c
+++ b/source3/lib/ldb/common/attrib_handlers.c
@@ -296,7 +296,7 @@ static int ldb_comparison_objectclass(struct ldb_context *ldb, void *mem_ctx,
}
for (i=0;subclasses[i];i++) {
struct ldb_val vs;
- vs.data = (uint8 *)discard_const(subclasses[i]);
+ vs.data = discard_const_p(uint8_t, subclasses[i]);
vs.length = strlen(subclasses[i]);
if (ldb_comparison_objectclass(ldb, mem_ctx, &vs, v2) == 0) {
return 0;
diff --git a/source3/lib/ldb/include/includes.h b/source3/lib/ldb/include/includes.h
index ce0d40e101..7a2e112241 100644
--- a/source3/lib/ldb/include/includes.h
+++ b/source3/lib/ldb/include/includes.h
@@ -18,8 +18,7 @@
-#define discard_const(ptr) ((void *)((intptr_t)(ptr)))
-#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
+#define discard_const_p(type, ptr) ((type *)((intptr_t)(ptr)))
#include "replace.h"
#include "system/filesys.h"
diff --git a/source3/lib/ldb/ldb_ildap/ldb_ildap.c b/source3/lib/ldb/ldb_ildap/ldb_ildap.c
index 51ae031cf9..87f38b5fc7 100644
--- a/source3/lib/ldb/ldb_ildap/ldb_ildap.c
+++ b/source3/lib/ldb/ldb_ildap/ldb_ildap.c
@@ -470,11 +470,12 @@ static int ildb_search(struct ldb_module *module, struct ldb_request *req)
msg->r.SearchRequest.timelimit = 0;
msg->r.SearchRequest.sizelimit = 0;
msg->r.SearchRequest.attributesonly = 0;
- msg->r.SearchRequest.tree = discard_const(req->op.search.tree);
+ msg->r.SearchRequest.tree = discard_const_p(struct ldb_parse_tree, req->op.search.tree);
for (n = 0; req->op.search.attrs && req->op.search.attrs[n]; n++) /* noop */ ;
msg->r.SearchRequest.num_attributes = n;
- msg->r.SearchRequest.attributes = discard_const(req->op.search.attrs);
+ msg->r.SearchRequest.attributes = discard_const_p(char *, req->op.search.attrs),
+
msg->controls = req->controls;
return ildb_request_send(module, msg, req->context, req->callback, req->timeout, &(req->handle));
diff --git a/source3/lib/ldb/ldb_ldap/ldb_ldap.c b/source3/lib/ldb/ldb_ldap/ldb_ldap.c
index 6dc52b2484..c45fa108f2 100644
--- a/source3/lib/ldb/ldb_ldap/ldb_ldap.c
+++ b/source3/lib/ldb/ldb_ldap/ldb_ldap.c
@@ -274,7 +274,7 @@ static int lldb_search(struct ldb_module *module, struct ldb_request *req)
expression = ldb_filter_from_tree(
lldb_ac,
- CONST_DISCARD(struct ldb_parse_tree *, req->op.search.tree));
+ discard_const_p(struct ldb_parse_tree, req->op.search.tree));
if (expression == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
diff --git a/source3/lib/ldb/modules/operational.c b/source3/lib/ldb/modules/operational.c
index 555ae5e9f6..953cbd593e 100644
--- a/source3/lib/ldb/modules/operational.c
+++ b/source3/lib/ldb/modules/operational.c
@@ -244,7 +244,7 @@ static int operational_search(struct ldb_module *module, struct ldb_request *req
searchable, but are stored using a different name in the
backend */
for (i=0;i<ARRAY_SIZE(parse_tree_sub);i++) {
- ldb_parse_tree_attr_replace(CONST_DISCARD(struct ldb_parse_tree *,req->op.search.tree),
+ ldb_parse_tree_attr_replace(discard_const_p(struct ldb_parse_tree, req->op.search.tree),
parse_tree_sub[i].attr,
parse_tree_sub[i].replace);
}