svn commit: samba r26451 - in branches/SAMBA_4_0/source/lib/registry: . tests

kai at samba.org kai at samba.org
Fri Dec 14 10:38:28 GMT 2007


Author: kai
Date: 2007-12-14 10:38:26 +0000 (Fri, 14 Dec 2007)
New Revision: 26451

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

Log:
Janitorial: fix warnings in lib/registry/

This does not fix the discarded qualifier warnings in tests, as the test data
is currently passed as const. Jelmer wants to provide a test function that
passes non-const test data, thus allowing for a cleaner way to fix those
warnings.

Modified:
   branches/SAMBA_4_0/source/lib/registry/dir.c
   branches/SAMBA_4_0/source/lib/registry/hive.h
   branches/SAMBA_4_0/source/lib/registry/interface.c
   branches/SAMBA_4_0/source/lib/registry/ldb.c
   branches/SAMBA_4_0/source/lib/registry/local.c
   branches/SAMBA_4_0/source/lib/registry/regf.c
   branches/SAMBA_4_0/source/lib/registry/registry.h
   branches/SAMBA_4_0/source/lib/registry/rpc.c
   branches/SAMBA_4_0/source/lib/registry/tests/hive.c
   branches/SAMBA_4_0/source/lib/registry/tests/registry.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/registry/dir.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/dir.c	2007-12-14 01:53:54 UTC (rev 26450)
+++ branches/SAMBA_4_0/source/lib/registry/dir.c	2007-12-14 10:38:26 UTC (rev 26451)
@@ -272,7 +272,7 @@
 }
 
 static WERROR reg_dir_enum_value(TALLOC_CTX *mem_ctx,
-				 const struct hive_key *key, int idx,
+				 struct hive_key *key, int idx,
 				 const char **name,
 				 uint32_t *type, DATA_BLOB *data)
 {

Modified: branches/SAMBA_4_0/source/lib/registry/hive.h
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/hive.h	2007-12-14 01:53:54 UTC (rev 26450)
+++ branches/SAMBA_4_0/source/lib/registry/hive.h	2007-12-14 10:38:26 UTC (rev 26451)
@@ -82,7 +82,7 @@
 	 * Retrieve a registry value with a specific index.
 	 */
 	WERROR (*enum_value) (TALLOC_CTX *mem_ctx,
-			      const struct hive_key *key, int idx,
+			      struct hive_key *key, int idx,
 			      const char **name, uint32_t *type,
 			      DATA_BLOB *data);
 

Modified: branches/SAMBA_4_0/source/lib/registry/interface.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/interface.c	2007-12-14 01:53:54 UTC (rev 26450)
+++ branches/SAMBA_4_0/source/lib/registry/interface.c	2007-12-14 10:38:26 UTC (rev 26451)
@@ -74,7 +74,7 @@
 }
 
 /** Get predefined key by id. */
-_PUBLIC_ WERROR reg_get_predefined_key(const struct registry_context *ctx,
+_PUBLIC_ WERROR reg_get_predefined_key(struct registry_context *ctx,
 				       uint32_t hkey, struct registry_key **key)
 {
 	return ctx->ops->get_predefined_key(ctx, hkey, key);

Modified: branches/SAMBA_4_0/source/lib/registry/ldb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/ldb.c	2007-12-14 01:53:54 UTC (rev 26450)
+++ branches/SAMBA_4_0/source/lib/registry/ldb.c	2007-12-14 10:38:26 UTC (rev 26451)
@@ -249,7 +249,7 @@
 	return WERR_OK;
 }
 
-static WERROR ldb_get_value_by_id(TALLOC_CTX *mem_ctx, const struct hive_key *k,
+static WERROR ldb_get_value_by_id(TALLOC_CTX *mem_ctx, struct hive_key *k,
 				  int idx, const char **name,
 				  uint32_t *data_type, DATA_BLOB *data)
 {

Modified: branches/SAMBA_4_0/source/lib/registry/local.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/local.c	2007-12-14 01:53:54 UTC (rev 26450)
+++ branches/SAMBA_4_0/source/lib/registry/local.c	2007-12-14 10:38:26 UTC (rev 26451)
@@ -126,7 +126,7 @@
 	return WERR_OK;
 }
 
-WERROR local_get_predefined_key(const struct registry_context *ctx,
+WERROR local_get_predefined_key(struct registry_context *ctx,
 				uint32_t key_id, struct registry_key **key)
 {
 	struct registry_local *rctx = talloc_get_type(ctx,
@@ -168,7 +168,7 @@
 			       struct security_descriptor *security,
 			       struct registry_key **key)
 {
-	const struct local_key *local_parent;
+	struct local_key *local_parent;
 	struct hive_key *hivekey;
 	const char **elements;
 	int i;
@@ -177,11 +177,11 @@
 	last_part = strrchr(name, '\\');
 	if (last_part == NULL) {
 		last_part = name;
-		local_parent = (const struct local_key *)parent_key;
+		local_parent = (struct local_key *)parent_key;
 	} else {
 		W_ERROR_NOT_OK_RETURN(reg_open_key(mem_ctx, parent_key,
 						   talloc_strndup(mem_ctx, name, last_part-name),
-						   &local_parent));
+						   (struct registry_key **)&local_parent));
 		last_part++;
 	}
 

Modified: branches/SAMBA_4_0/source/lib/registry/regf.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/regf.c	2007-12-14 01:53:54 UTC (rev 26450)
+++ branches/SAMBA_4_0/source/lib/registry/regf.c	2007-12-14 10:38:26 UTC (rev 26451)
@@ -488,7 +488,7 @@
 }
 
 
-static WERROR regf_get_value(TALLOC_CTX *ctx, const struct hive_key *key,
+static WERROR regf_get_value(TALLOC_CTX *ctx, struct hive_key *key,
 			     int idx, const char **name,
 			     uint32_t *data_type, DATA_BLOB *data)
 {
@@ -1529,8 +1529,7 @@
 
 static WERROR regf_del_value (struct hive_key *key, const char *name)
 {
-	const struct regf_key_data *private_data =
-		(const struct regf_key_data *)key;
+	struct regf_key_data *private_data = (struct regf_key_data *)key;
 	struct regf_data *regf = private_data->hive;
 	struct nk_block *nk = private_data->nk;
 	struct vk_block vk;
@@ -1703,8 +1702,7 @@
 static WERROR regf_set_value(struct hive_key *key, const char *name,
 			     uint32_t type, const DATA_BLOB data)
 {
-	const struct regf_key_data *private_data =
-		(const struct regf_key_data *)key;
+	struct regf_key_data *private_data = (struct regf_key_data *)key;
 	struct regf_data *regf = private_data->hive;
 	struct nk_block *nk = private_data->nk;
 	struct vk_block vk;

Modified: branches/SAMBA_4_0/source/lib/registry/registry.h
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/registry.h	2007-12-14 01:53:54 UTC (rev 26450)
+++ branches/SAMBA_4_0/source/lib/registry/registry.h	2007-12-14 10:38:26 UTC (rev 26451)
@@ -94,7 +94,7 @@
 
 	WERROR (*flush_key) (struct registry_key *key);
 
-	WERROR (*get_predefined_key) (const struct registry_context *ctx,
+	WERROR (*get_predefined_key) (struct registry_context *ctx,
 				      uint32_t key_id,
 				      struct registry_key **key);
 
@@ -195,7 +195,7 @@
 WERROR reg_get_predefined_key_by_name(struct registry_context *ctx,
 				      const char *name,
 				      struct registry_key **key);
-WERROR reg_get_predefined_key(const struct registry_context *ctx,
+WERROR reg_get_predefined_key(struct registry_context *ctx,
 			      uint32_t hkey,
 			      struct registry_key **key);
 

Modified: branches/SAMBA_4_0/source/lib/registry/rpc.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/rpc.c	2007-12-14 01:53:54 UTC (rev 26450)
+++ branches/SAMBA_4_0/source/lib/registry/rpc.c	2007-12-14 10:38:26 UTC (rev 26451)
@@ -91,7 +91,7 @@
 
 static WERROR rpc_query_key(const struct registry_key *k);
 
-static WERROR rpc_get_predefined_key(const struct registry_context *ctx,
+static WERROR rpc_get_predefined_key(struct registry_context *ctx,
 				     uint32_t hkey_type,
 				     struct registry_key **k)
 {

Modified: branches/SAMBA_4_0/source/lib/registry/tests/hive.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/tests/hive.c	2007-12-14 01:53:54 UTC (rev 26450)
+++ branches/SAMBA_4_0/source/lib/registry/tests/hive.c	2007-12-14 10:38:26 UTC (rev 26451)
@@ -290,7 +290,7 @@
 {
 	struct hive_key *key;
 	WERROR error;
-	const char *dirname;
+	char *dirname;
 	NTSTATUS status;
 
 	status = torture_temp_dir(tctx, "hive-dir", &dirname);
@@ -314,7 +314,7 @@
 {
 	struct hive_key *key;
 	WERROR error;
-	const char *dirname;
+	char *dirname;
 	NTSTATUS status;
 
 	status = torture_temp_dir(tctx, "hive-ldb", &dirname);
@@ -338,7 +338,7 @@
 {
 	struct hive_key *key;
 	WERROR error;
-	const char *dirname;
+	char *dirname;
 	NTSTATUS status;
 
 	status = torture_temp_dir(tctx, "hive-dir", &dirname);

Modified: branches/SAMBA_4_0/source/lib/registry/tests/registry.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/tests/registry.c	2007-12-14 01:53:54 UTC (rev 26450)
+++ branches/SAMBA_4_0/source/lib/registry/tests/registry.c	2007-12-14 10:38:26 UTC (rev 26451)
@@ -535,7 +535,7 @@
 {
 	struct registry_context *rctx;
 	WERROR error;
-	const char *tempdir;
+	char *tempdir;
 	NTSTATUS status;
 	struct hive_key *hive_key;
 	const char *filename;



More information about the samba-cvs mailing list