1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-19 12:23:49 +03:00

r26451: 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.
This commit is contained in:
Kai Blin
2007-12-14 10:38:26 +01:00
committed by Stefan Metzmacher
parent 5300bc175e
commit 46dfa63d4f
10 changed files with 18 additions and 20 deletions

View File

@@ -272,7 +272,7 @@ static WERROR reg_dir_get_value(TALLOC_CTX *mem_ctx,
} }
static WERROR reg_dir_enum_value(TALLOC_CTX *mem_ctx, 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, const char **name,
uint32_t *type, DATA_BLOB *data) uint32_t *type, DATA_BLOB *data)
{ {

View File

@@ -82,7 +82,7 @@ struct hive_operations {
* Retrieve a registry value with a specific index. * Retrieve a registry value with a specific index.
*/ */
WERROR (*enum_value) (TALLOC_CTX *mem_ctx, 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, const char **name, uint32_t *type,
DATA_BLOB *data); DATA_BLOB *data);

View File

@@ -74,7 +74,7 @@ _PUBLIC_ WERROR reg_get_predefined_key_by_name(struct registry_context *ctx,
} }
/** Get predefined key by id. */ /** 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) uint32_t hkey, struct registry_key **key)
{ {
return ctx->ops->get_predefined_key(ctx, hkey, key); return ctx->ops->get_predefined_key(ctx, hkey, key);

View File

@@ -249,7 +249,7 @@ static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx,
return WERR_OK; 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, int idx, const char **name,
uint32_t *data_type, DATA_BLOB *data) uint32_t *data_type, DATA_BLOB *data)
{ {

View File

@@ -126,7 +126,7 @@ static WERROR local_open_key(TALLOC_CTX *mem_ctx,
return WERR_OK; 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) uint32_t key_id, struct registry_key **key)
{ {
struct registry_local *rctx = talloc_get_type(ctx, struct registry_local *rctx = talloc_get_type(ctx,
@@ -168,7 +168,7 @@ static WERROR local_create_key(TALLOC_CTX *mem_ctx,
struct security_descriptor *security, struct security_descriptor *security,
struct registry_key **key) struct registry_key **key)
{ {
const struct local_key *local_parent; struct local_key *local_parent;
struct hive_key *hivekey; struct hive_key *hivekey;
const char **elements; const char **elements;
int i; int i;
@@ -177,11 +177,11 @@ static WERROR local_create_key(TALLOC_CTX *mem_ctx,
last_part = strrchr(name, '\\'); last_part = strrchr(name, '\\');
if (last_part == NULL) { if (last_part == NULL) {
last_part = name; last_part = name;
local_parent = (const struct local_key *)parent_key; local_parent = (struct local_key *)parent_key;
} else { } else {
W_ERROR_NOT_OK_RETURN(reg_open_key(mem_ctx, parent_key, W_ERROR_NOT_OK_RETURN(reg_open_key(mem_ctx, parent_key,
talloc_strndup(mem_ctx, name, last_part-name), talloc_strndup(mem_ctx, name, last_part-name),
&local_parent)); (struct registry_key **)&local_parent));
last_part++; last_part++;
} }

View File

@@ -488,7 +488,7 @@ static struct regf_key_data *regf_get_key(TALLOC_CTX *ctx,
} }
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, int idx, const char **name,
uint32_t *data_type, DATA_BLOB *data) uint32_t *data_type, DATA_BLOB *data)
{ {
@@ -1529,8 +1529,7 @@ static WERROR regf_sl_del_entry(struct regf_data *regf, uint32_t list_offset,
static WERROR regf_del_value (struct hive_key *key, const char *name) static WERROR regf_del_value (struct hive_key *key, const char *name)
{ {
const struct regf_key_data *private_data = struct regf_key_data *private_data = (struct regf_key_data *)key;
(const struct regf_key_data *)key;
struct regf_data *regf = private_data->hive; struct regf_data *regf = private_data->hive;
struct nk_block *nk = private_data->nk; struct nk_block *nk = private_data->nk;
struct vk_block vk; struct vk_block vk;
@@ -1703,8 +1702,7 @@ static WERROR regf_add_key(TALLOC_CTX *ctx, const struct hive_key *parent,
static WERROR regf_set_value(struct hive_key *key, const char *name, static WERROR regf_set_value(struct hive_key *key, const char *name,
uint32_t type, const DATA_BLOB data) uint32_t type, const DATA_BLOB data)
{ {
const struct regf_key_data *private_data = struct regf_key_data *private_data = (struct regf_key_data *)key;
(const struct regf_key_data *)key;
struct regf_data *regf = private_data->hive; struct regf_data *regf = private_data->hive;
struct nk_block *nk = private_data->nk; struct nk_block *nk = private_data->nk;
struct vk_block vk; struct vk_block vk;

View File

@@ -94,7 +94,7 @@ struct registry_operations {
WERROR (*flush_key) (struct registry_key *key); 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, uint32_t key_id,
struct registry_key **key); struct registry_key **key);
@@ -195,7 +195,7 @@ const char *reg_get_predef_name(uint32_t hkey);
WERROR reg_get_predefined_key_by_name(struct registry_context *ctx, WERROR reg_get_predefined_key_by_name(struct registry_context *ctx,
const char *name, const char *name,
struct registry_key **key); 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, uint32_t hkey,
struct registry_key **key); struct registry_key **key);

View File

@@ -91,7 +91,7 @@ static struct {
static WERROR rpc_query_key(const struct registry_key *k); 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, uint32_t hkey_type,
struct registry_key **k) struct registry_key **k)
{ {

View File

@@ -290,7 +290,7 @@ static bool hive_setup_dir(struct torture_context *tctx, void **data)
{ {
struct hive_key *key; struct hive_key *key;
WERROR error; WERROR error;
const char *dirname; char *dirname;
NTSTATUS status; NTSTATUS status;
status = torture_temp_dir(tctx, "hive-dir", &dirname); status = torture_temp_dir(tctx, "hive-dir", &dirname);
@@ -314,7 +314,7 @@ static bool hive_setup_ldb(struct torture_context *tctx, void **data)
{ {
struct hive_key *key; struct hive_key *key;
WERROR error; WERROR error;
const char *dirname; char *dirname;
NTSTATUS status; NTSTATUS status;
status = torture_temp_dir(tctx, "hive-ldb", &dirname); status = torture_temp_dir(tctx, "hive-ldb", &dirname);
@@ -338,7 +338,7 @@ static bool hive_setup_regf(struct torture_context *tctx, void **data)
{ {
struct hive_key *key; struct hive_key *key;
WERROR error; WERROR error;
const char *dirname; char *dirname;
NTSTATUS status; NTSTATUS status;
status = torture_temp_dir(tctx, "hive-dir", &dirname); status = torture_temp_dir(tctx, "hive-dir", &dirname);

View File

@@ -535,7 +535,7 @@ static bool setup_local_registry(struct torture_context *tctx, void **data)
{ {
struct registry_context *rctx; struct registry_context *rctx;
WERROR error; WERROR error;
const char *tempdir; char *tempdir;
NTSTATUS status; NTSTATUS status;
struct hive_key *hive_key; struct hive_key *hive_key;
const char *filename; const char *filename;