diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-02-27 09:49:47 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-11-25 07:25:45 +0100 |
commit | dac1590379dff09ba39654daee15afae9c52c92e (patch) | |
tree | ea992fe9abf99e087e308e2ca378f02df3ab43db /source4 | |
parent | 8fd59a828e2c57517da2416ef52742a83bdcb969 (diff) | |
download | samba-dac1590379dff09ba39654daee15afae9c52c92e.tar.gz |
s4:lib/registry: avoid some const warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/registry/tools/regpatch.c | 4 | ||||
-rw-r--r-- | source4/lib/registry/tools/regshell.c | 42 | ||||
-rw-r--r-- | source4/lib/registry/tools/regtree.c | 4 |
3 files changed, 25 insertions, 25 deletions
diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c index a8c18431165..34cbd1c5aaa 100644 --- a/source4/lib/registry/tools/regpatch.c +++ b/source4/lib/registry/tools/regpatch.c @@ -26,7 +26,7 @@ #include "param/param.h" #include "events/events.h" -int main(int argc, char **argv) +int main(int argc, const char **argv) { int opt; poptContext pc; @@ -44,7 +44,7 @@ int main(int argc, char **argv) { NULL } }; - pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0); + pc = poptGetContext(argv[0], argc, argv, long_options,0); while((opt = poptGetNextOpt(pc)) != -1) { } diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index dd154f78c94..448f9576e0a 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -37,9 +37,9 @@ struct regshell_context { struct registry_key *root; }; -static WERROR get_full_path(struct regshell_context *ctx, char *path, char **ret_path) +static WERROR get_full_path(struct regshell_context *ctx, const char *path, char **ret_path) { - char *dir; + const char *dir; char *tmp; char *new_path; @@ -49,7 +49,7 @@ static WERROR get_full_path(struct regshell_context *ctx, char *path, char **ret new_path = talloc_strdup(ctx, ctx->path); } - dir = strtok(path, "\\"); + dir = strtok(discard_const_p(char, path), "\\"); if (dir == NULL) { *ret_path = new_path; return WERR_OK; @@ -98,7 +98,7 @@ static WERROR get_full_path(struct regshell_context *ctx, char *path, char **ret * exit */ -static WERROR cmd_info(struct regshell_context *ctx, int argc, char **argv) +static WERROR cmd_info(struct regshell_context *ctx, int argc, const char **argv) { struct security_descriptor *sec_desc = NULL; time_t last_mod; @@ -150,7 +150,7 @@ static WERROR cmd_info(struct regshell_context *ctx, int argc, char **argv) return WERR_OK; } -static WERROR cmd_predef(struct regshell_context *ctx, int argc, char **argv) +static WERROR cmd_predef(struct regshell_context *ctx, int argc, const char **argv) { struct registry_key *ret = NULL; if (argc < 2) { @@ -176,7 +176,7 @@ static WERROR cmd_predef(struct regshell_context *ctx, int argc, char **argv) } static WERROR cmd_pwd(struct regshell_context *ctx, - int argc, char **argv) + int argc, const char **argv) { if (ctx->predef) { printf("%s\\", ctx->predef); @@ -185,7 +185,7 @@ static WERROR cmd_pwd(struct regshell_context *ctx, return WERR_OK; } -static WERROR cmd_set(struct regshell_context *ctx, int argc, char **argv) +static WERROR cmd_set(struct regshell_context *ctx, int argc, const char **argv) { struct registry_value val; WERROR error; @@ -209,7 +209,7 @@ static WERROR cmd_set(struct regshell_context *ctx, int argc, char **argv) return WERR_OK; } -static WERROR cmd_ck(struct regshell_context *ctx, int argc, char **argv) +static WERROR cmd_ck(struct regshell_context *ctx, int argc, const char **argv) { struct registry_key *nkey = NULL; char *full_path; @@ -238,7 +238,7 @@ static WERROR cmd_ck(struct regshell_context *ctx, int argc, char **argv) return WERR_OK; } -static WERROR cmd_print(struct regshell_context *ctx, int argc, char **argv) +static WERROR cmd_print(struct regshell_context *ctx, int argc, const char **argv) { uint32_t value_type; DATA_BLOB value_data; @@ -262,7 +262,7 @@ static WERROR cmd_print(struct regshell_context *ctx, int argc, char **argv) return WERR_OK; } -static WERROR cmd_ls(struct regshell_context *ctx, int argc, char **argv) +static WERROR cmd_ls(struct regshell_context *ctx, int argc, const char **argv) { unsigned int i; WERROR error; @@ -292,7 +292,7 @@ static WERROR cmd_ls(struct regshell_context *ctx, int argc, char **argv) return WERR_OK; } -static WERROR cmd_mkkey(struct regshell_context *ctx, int argc, char **argv) +static WERROR cmd_mkkey(struct regshell_context *ctx, int argc, const char **argv) { struct registry_key *tmp; WERROR error; @@ -314,7 +314,7 @@ static WERROR cmd_mkkey(struct regshell_context *ctx, int argc, char **argv) } static WERROR cmd_rmkey(struct regshell_context *ctx, - int argc, char **argv) + int argc, const char **argv) { WERROR error; @@ -334,7 +334,7 @@ static WERROR cmd_rmkey(struct regshell_context *ctx, return WERR_OK; } -static WERROR cmd_rmval(struct regshell_context *ctx, int argc, char **argv) +static WERROR cmd_rmval(struct regshell_context *ctx, int argc, const char **argv) { WERROR error; @@ -355,18 +355,18 @@ static WERROR cmd_rmval(struct regshell_context *ctx, int argc, char **argv) } _NORETURN_ static WERROR cmd_exit(struct regshell_context *ctx, - int argc, char **argv) + int argc, const char **argv) { exit(0); } -static WERROR cmd_help(struct regshell_context *ctx, int, char **); +static WERROR cmd_help(struct regshell_context *ctx, int, const char **); static struct { const char *name; const char *alias; const char *help; - WERROR (*handle)(struct regshell_context *ctx, int argc, char **argv); + WERROR (*handle)(struct regshell_context *ctx, int argc, const char **argv); } regshell_cmds[] = { {"ck", "cd", "Change current key", cmd_ck }, {"info", "i", "Show detailed information of a key", cmd_info }, @@ -384,7 +384,7 @@ static struct { }; static WERROR cmd_help(struct regshell_context *ctx, - int argc, char **argv) + int argc, const char **argv) { unsigned int i; printf("Available commands:\n"); @@ -399,10 +399,10 @@ static WERROR process_cmd(struct regshell_context *ctx, char *line) { int argc; - char **argv = NULL; + const char **argv = NULL; int ret, i; - if ((ret = poptParseArgvString(line, &argc, (const char ***) &argv)) != 0) { + if ((ret = poptParseArgvString(line, &argc, &argv)) != 0) { fprintf(stderr, "regshell: %s\n", poptStrerror(ret)); return WERR_INVALID_PARAM; } @@ -551,7 +551,7 @@ static char **reg_completion(const char *text, int start, int end) } } -int main(int argc, char **argv) +int main(int argc, const char **argv) { int opt; const char *file = NULL; @@ -570,7 +570,7 @@ int main(int argc, char **argv) { NULL } }; - pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0); + pc = poptGetContext(argv[0], argc, argv, long_options,0); while((opt = poptGetNextOpt(pc)) != -1) { } diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index 40570dd778a..6df8e5067ec 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -98,7 +98,7 @@ static void print_tree(unsigned int level, struct registry_key *p, talloc_free(mem_ctx); } -int main(int argc, char **argv) +int main(int argc, const char **argv) { int opt; unsigned int i; @@ -122,7 +122,7 @@ int main(int argc, char **argv) { NULL } }; - pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0); + pc = poptGetContext(argv[0], argc, argv, long_options,0); while((opt = poptGetNextOpt(pc)) != -1) { } |