svn commit: samba r19899 - in branches/SAMBA_3_0/source/lib/ldb/ldb_tdb: .

vlendec at samba.org vlendec at samba.org
Sat Nov 25 17:11:30 GMT 2006


Author: vlendec
Date: 2006-11-25 17:11:29 +0000 (Sat, 25 Nov 2006)
New Revision: 19899

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19899

Log:
Fix some C++ warnings and klokwork ID 3147
Modified:
   branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_index.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_index.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_index.c	2006-11-25 17:07:49 UTC (rev 19898)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_index.c	2006-11-25 17:11:29 UTC (rev 19899)
@@ -47,7 +47,7 @@
 			 const void *base, size_t nmemb, size_t size, 
 			 comparison_fn_t comp_fn)
 {
-	const char *base_p = base;
+	const char *base_p = (const char *)base;
 	size_t min_i, max_i, test_i;
 
 	if (nmemb == 0) {
@@ -897,7 +897,8 @@
 static int ltdb_index_add0(struct ldb_module *module, const char *dn,
 			   struct ldb_message_element *elements, int num_el)
 {
-	struct ltdb_private *ltdb = module->private_data;
+	struct ltdb_private *ltdb =
+		(struct ltdb_private *)module->private_data;
 	int ret;
 	unsigned int i, j;
 
@@ -933,7 +934,8 @@
 */
 int ltdb_index_add(struct ldb_module *module, const struct ldb_message *msg)
 {
-	struct ltdb_private *ltdb = module->private_data;
+	struct ltdb_private *ltdb =
+		(struct ltdb_private *)module->private_data;
 	char *dn;
 	int ret;
 
@@ -1025,7 +1027,8 @@
 */
 int ltdb_index_del(struct ldb_module *module, const struct ldb_message *msg)
 {
-	struct ltdb_private *ltdb = module->private_data;
+	struct ltdb_private *ltdb =
+		(struct ltdb_private *)module->private_data;
 	int ret;
 	char *dn;
 	unsigned int i, j;
@@ -1082,7 +1085,7 @@
 */
 static int re_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *state)
 {
-	struct ldb_module *module = state;
+	struct ldb_module *module = (struct ldb_module *)state;
 	struct ldb_message *msg;
 	char *dn = NULL;
 	int ret;
@@ -1123,7 +1126,10 @@
 	if (msg->dn == NULL) {
 		dn = (char *)key.dptr + 3;
 	} else {
-		dn = ldb_dn_linearize(msg->dn, msg->dn);
+		if (!(dn = ldb_dn_linearize(msg->dn, msg->dn))) {
+			talloc_free(msg);
+			return -1;
+		}
 	}
 
 	ret = ltdb_index_add0(module, dn, msg->elements, msg->num_elements);
@@ -1138,7 +1144,8 @@
 */
 int ltdb_reindex(struct ldb_module *module)
 {
-	struct ltdb_private *ltdb = module->private_data;
+	struct ltdb_private *ltdb =
+		(struct ltdb_private *)module->private_data;
 	int ret;
 
 	if (ltdb_cache_reload(module) != 0) {



More information about the samba-cvs mailing list