svn commit: samba r19935 - in branches/SAMBA_3_0/source/lib/ldb:
common include ldb_ildap ldb_ldap modules
metze at samba.org
metze at samba.org
Tue Nov 28 17:47:42 GMT 2006
Author: metze
Date: 2006-11-28 17:47:41 +0000 (Tue, 28 Nov 2006)
New Revision: 19935
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19935
Log:
always use discard_const_p() in lib/ldb/
metze
Modified:
branches/SAMBA_3_0/source/lib/ldb/common/attrib_handlers.c
branches/SAMBA_3_0/source/lib/ldb/include/includes.h
branches/SAMBA_3_0/source/lib/ldb/ldb_ildap/ldb_ildap.c
branches/SAMBA_3_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
branches/SAMBA_3_0/source/lib/ldb/modules/operational.c
Changeset:
Modified: branches/SAMBA_3_0/source/lib/ldb/common/attrib_handlers.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/common/attrib_handlers.c 2006-11-28 17:30:43 UTC (rev 19934)
+++ branches/SAMBA_3_0/source/lib/ldb/common/attrib_handlers.c 2006-11-28 17:47:41 UTC (rev 19935)
@@ -296,7 +296,7 @@
}
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;
Modified: branches/SAMBA_3_0/source/lib/ldb/include/includes.h
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/include/includes.h 2006-11-28 17:30:43 UTC (rev 19934)
+++ branches/SAMBA_3_0/source/lib/ldb/include/includes.h 2006-11-28 17:47:41 UTC (rev 19935)
@@ -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"
Modified: branches/SAMBA_3_0/source/lib/ldb/ldb_ildap/ldb_ildap.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/ldb_ildap/ldb_ildap.c 2006-11-28 17:30:43 UTC (rev 19934)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_ildap/ldb_ildap.c 2006-11-28 17:47:41 UTC (rev 19935)
@@ -470,11 +470,12 @@
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));
Modified: branches/SAMBA_3_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/ldb_ldap/ldb_ldap.c 2006-11-28 17:30:43 UTC (rev 19934)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_ldap/ldb_ldap.c 2006-11-28 17:47:41 UTC (rev 19935)
@@ -274,7 +274,7 @@
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;
}
Modified: branches/SAMBA_3_0/source/lib/ldb/modules/operational.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/modules/operational.c 2006-11-28 17:30:43 UTC (rev 19934)
+++ branches/SAMBA_3_0/source/lib/ldb/modules/operational.c 2006-11-28 17:47:41 UTC (rev 19935)
@@ -244,7 +244,7 @@
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);
}
More information about the samba-cvs
mailing list