mirror of
https://github.com/samba-team/samba.git
synced 2024-12-28 07:21:54 +03:00
r19935: always use discard_const_p() in lib/ldb/
metze
This commit is contained in:
parent
be3c444c37
commit
4a5da57306
@ -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;
|
||||
|
@ -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"
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user