summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Davis <cd.rattan@gmail.com>2014-08-04 21:48:04 -0700
committerMichael Adam <obnox@samba.org>2014-10-01 14:32:08 +0200
commit7e7c649376bd17c7ac9908bbd0ffc235e7cd18f7 (patch)
treed1ac7e044c5dc9a580607be6e6941fbd48fa36e8
parent0fbce1457dadbd5ae1307989f2699196161a37df (diff)
downloadsamba-7e7c649376bd17c7ac9908bbd0ffc235e7cd18f7.tar.gz
samba-7e7c649376bd17c7ac9908bbd0ffc235e7cd18f7.tar.xz
samba-7e7c649376bd17c7ac9908bbd0ffc235e7cd18f7.zip
regedit: silence some warnings
Signed-off-by: Chris Davis <cd.rattan@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--source3/utils/regedit.c4
-rw-r--r--source3/utils/regedit.h3
-rw-r--r--source3/utils/regedit_samba3.c4
3 files changed, 6 insertions, 5 deletions
diff --git a/source3/utils/regedit.c b/source3/utils/regedit.c
index 21fd257e41..a1118d5633 100644
--- a/source3/utils/regedit.c
+++ b/source3/utils/regedit.c
@@ -197,7 +197,7 @@ static void load_values(struct regedit *regedit)
static void add_reg_key(struct regedit *regedit, struct tree_node *node,
bool subkey)
{
- char *name;
+ const char *name;
const char *msg;
if (!subkey && !node->parent) {
@@ -244,7 +244,7 @@ static void add_reg_key(struct regedit *regedit, struct tree_node *node,
dialog_notice(regedit, DIA_ALERT, "New Key",
"Failed to create key.");
}
- talloc_free(name);
+ talloc_free(discard_const(name));
}
}
diff --git a/source3/utils/regedit.h b/source3/utils/regedit.h
index fb9ad6100d..2ab40f9d69 100644
--- a/source3/utils/regedit.h
+++ b/source3/utils/regedit.h
@@ -33,7 +33,8 @@ WERROR reg_openhive_wrap(TALLOC_CTX *ctx, const char *hive,
WERROR reg_openkey_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *parent,
const char *name, struct samba3_registry_key *key);
WERROR reg_enumvalue_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *key,
- uint32 idx, char **name, uint32_t *type, DATA_BLOB *data);
+ uint32 idx, char **name, uint32_t *type,
+ DATA_BLOB *data);
WERROR reg_queryvalue_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *key,
const char *name, uint32_t *type, DATA_BLOB *data);
WERROR reg_enumkey_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *key,
diff --git a/source3/utils/regedit_samba3.c b/source3/utils/regedit_samba3.c
index 39b06bca1c..4e22be8fde 100644
--- a/source3/utils/regedit_samba3.c
+++ b/source3/utils/regedit_samba3.c
@@ -107,7 +107,7 @@ static WERROR samba3_get_value_by_index(TALLOC_CTX *mem_ctx,
mykeydata = talloc_get_type(parent, struct samba3_key);
return reg_enumvalue_wrap(mem_ctx, &mykeydata->s3key, n,
- value_name, type, data);
+ discard_const(value_name), type, data);
}
static WERROR samba3_get_value_by_name(TALLOC_CTX *mem_ctx,
@@ -138,7 +138,7 @@ static WERROR samba3_get_subkey_by_index(TALLOC_CTX *mem_ctx,
*keyclass = NULL;
return reg_enumkey_wrap(mem_ctx, &mykeydata->s3key, n,
- name, last_changed_time);
+ discard_const(name), last_changed_time);
}
static WERROR samba3_add_key(TALLOC_CTX *mem_ctx,