1
0
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 used to be commit 4a5da57306)
This commit is contained in:
Stefan Metzmacher 2006-11-28 17:47:41 +00:00 committed by Gerald (Jerry) Carter
parent 15974508e8
commit 762b86ff0d
5 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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"

View File

@ -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));

View File

@ -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;
}

View File

@ -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);
}