mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3:utils: avoid argv related const warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
9e971068d0
commit
c2a26fe5e7
@ -295,7 +295,7 @@ static long read_log_data(FILE *in, unsigned char *buffer, long data_length)
|
||||
return data_length;
|
||||
}
|
||||
|
||||
int main (int argc, char **argv)
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
const char *infile, *outfile;
|
||||
FILE *out, *in;
|
||||
@ -312,7 +312,7 @@ int main (int argc, char **argv)
|
||||
POPT_TABLEEND
|
||||
};
|
||||
|
||||
pc = poptGetContext(NULL, argc, (const char **) argv, long_options,
|
||||
pc = poptGetContext(NULL, argc, argv, long_options,
|
||||
POPT_CONTEXT_KEEP_FIRST);
|
||||
poptSetOtherOptionHelp(pc, "[<infile> [<outfile>]]");
|
||||
|
||||
|
@ -767,13 +767,14 @@ static struct functable net_func[] = {
|
||||
/****************************************************************************
|
||||
main program
|
||||
****************************************************************************/
|
||||
int main(int argc, const char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int opt,i;
|
||||
char *p;
|
||||
int rc = 0;
|
||||
int argc_new = 0;
|
||||
const char ** argv_new;
|
||||
const char **argv_const = discard_const_p(const char *, argv);
|
||||
poptContext pc;
|
||||
TALLOC_CTX *frame = talloc_stackframe();
|
||||
struct net_context *c = talloc_zero(frame, struct net_context);
|
||||
@ -852,7 +853,7 @@ static struct functable net_func[] = {
|
||||
lp_set_cmdline("log level", "0");
|
||||
c->private_data = net_func;
|
||||
|
||||
pc = poptGetContext(NULL, argc, (const char **) argv, long_options,
|
||||
pc = poptGetContext(NULL, argc, argv_const, long_options,
|
||||
POPT_CONTEXT_KEEP_FIRST);
|
||||
|
||||
while((opt = poptGetNextOpt(pc)) != -1) {
|
||||
@ -883,7 +884,7 @@ static struct functable net_func[] = {
|
||||
default:
|
||||
d_fprintf(stderr, _("\nInvalid option %s: %s\n"),
|
||||
poptBadOption(pc, 0), poptStrerror(opt));
|
||||
net_help(c, argc, argv);
|
||||
net_help(c, argc, argv_const);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ static bool query_one(const char *lookup, unsigned int lookup_type)
|
||||
/****************************************************************************
|
||||
main program
|
||||
****************************************************************************/
|
||||
int main(int argc,char *argv[])
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
int opt;
|
||||
unsigned int lookup_type = 0x0;
|
||||
@ -246,7 +246,7 @@ int main(int argc,char *argv[])
|
||||
|
||||
setup_logging(argv[0], DEBUG_STDOUT);
|
||||
|
||||
pc = poptGetContext("nmblookup", argc, (const char **)argv,
|
||||
pc = poptGetContext("nmblookup", argc, argv,
|
||||
long_options, POPT_CONTEXT_KEEP_FIRST);
|
||||
|
||||
poptSetOtherOptionHelp(pc, "<NODE> ...");
|
||||
|
@ -983,7 +983,7 @@ static int delete_machine_entry(const char *machinename)
|
||||
Start here.
|
||||
**********************************************************/
|
||||
|
||||
int main (int argc, char **argv)
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
static int list_users = False;
|
||||
static int verbose = False;
|
||||
@ -1068,7 +1068,7 @@ int main (int argc, char **argv)
|
||||
|
||||
setup_logging("pdbedit", DEBUG_STDOUT);
|
||||
|
||||
pc = poptGetContext(NULL, argc, (const char **) argv, long_options,
|
||||
pc = poptGetContext(NULL, argc, argv, long_options,
|
||||
POPT_CONTEXT_KEEP_FIRST);
|
||||
|
||||
while((opt = poptGetNextOpt(pc)) != -1) {
|
||||
|
@ -194,7 +194,7 @@ static bool copy_registry_tree( REGF_FILE *infile, REGF_NK_REC *nk,
|
||||
/*********************************************************************
|
||||
*********************************************************************/
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
int main( int argc, const char *argv[] )
|
||||
{
|
||||
TALLOC_CTX *frame = talloc_stackframe();
|
||||
int opt;
|
||||
@ -218,7 +218,7 @@ int main( int argc, char *argv[] )
|
||||
|
||||
setup_logging( "profiles", DEBUG_STDERR);
|
||||
|
||||
pc = poptGetContext("profiles", argc, (const char **)argv, long_options,
|
||||
pc = poptGetContext("profiles", argc, argv, long_options,
|
||||
POPT_CONTEXT_KEEP_FIRST);
|
||||
|
||||
poptSetOtherOptionHelp(pc, "<profilefile>");
|
||||
|
@ -498,7 +498,7 @@ static void display_window(TALLOC_CTX *mem_ctx, struct registry_context *ctx)
|
||||
endwin();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
struct poptOption long_options[] = {
|
||||
POPT_AUTOHELP
|
||||
@ -526,7 +526,7 @@ int main(int argc, char **argv)
|
||||
exit(1);
|
||||
}
|
||||
popt_common_set_auth_info(auth_info);
|
||||
pc = poptGetContext("regedit", argc, (const char **)argv, long_options, 0);
|
||||
pc = poptGetContext("regedit", argc, argv, long_options, 0);
|
||||
|
||||
while ((opt = poptGetNextOpt(pc)) != -1) {
|
||||
/* TODO */
|
||||
|
@ -1355,8 +1355,9 @@ static struct cli_state *connect_one(struct user_auth_info *auth_info,
|
||||
/****************************************************************************
|
||||
main program
|
||||
****************************************************************************/
|
||||
int main(int argc, const char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char **argv_const = discard_const_p(const char *, argv);
|
||||
char *share;
|
||||
int opt;
|
||||
enum acl_mode mode = SMB_ACL_SET;
|
||||
@ -1415,7 +1416,7 @@ static struct cli_state *connect_one(struct user_auth_info *auth_info,
|
||||
}
|
||||
popt_common_set_auth_info(auth_info);
|
||||
|
||||
pc = poptGetContext("smbcacls", argc, argv, long_options, 0);
|
||||
pc = poptGetContext("smbcacls", argc, argv_const, long_options, 0);
|
||||
|
||||
poptSetOtherOptionHelp(pc, "//server1/share1 filename\nACLs look like: "
|
||||
"'ACL:user:[ALLOWED|DENIED]/flags/permissions'");
|
||||
|
@ -553,8 +553,9 @@ static struct cli_state *connect_one(const char *share)
|
||||
/****************************************************************************
|
||||
main program
|
||||
****************************************************************************/
|
||||
int main(int argc, const char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char **argv_const = discard_const_p(const char *, argv);
|
||||
char *share;
|
||||
int opt;
|
||||
int result;
|
||||
@ -609,7 +610,7 @@ FSQFLAGS:QUOTA_ENABLED/DENY_DISK/LOG_SOFTLIMIT/LOG_HARD_LIMIT", "SETSTRING" },
|
||||
}
|
||||
popt_common_set_auth_info(smbcquotas_auth_info);
|
||||
|
||||
pc = poptGetContext("smbcquotas", argc, argv, long_options, 0);
|
||||
pc = poptGetContext("smbcquotas", argc, argv_const, long_options, 0);
|
||||
|
||||
poptSetOtherOptionHelp(pc, "//server1/share1");
|
||||
|
||||
|
@ -288,6 +288,7 @@ static bool print_tree(struct user_auth_info *user_info)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
TALLOC_CTX *frame = talloc_stackframe();
|
||||
const char **argv_const = discard_const_p(const char *, argv);
|
||||
struct user_auth_info *auth_info;
|
||||
struct poptOption long_options[] = {
|
||||
POPT_AUTOHELP
|
||||
@ -313,7 +314,7 @@ static bool print_tree(struct user_auth_info *user_info)
|
||||
}
|
||||
popt_common_set_auth_info(auth_info);
|
||||
|
||||
pc = poptGetContext("smbtree", argc, (const char **)argv, long_options,
|
||||
pc = poptGetContext("smbtree", argc, argv_const, long_options,
|
||||
POPT_CONTEXT_KEEP_FIRST);
|
||||
while(poptGetNextOpt(pc) != -1);
|
||||
poptFreeContext(pc);
|
||||
|
@ -336,7 +336,7 @@ static void print_notify_recs(const char *path,
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
int c;
|
||||
int profile_only = 0;
|
||||
@ -375,7 +375,7 @@ static void print_notify_recs(const char *path,
|
||||
goto done;
|
||||
}
|
||||
|
||||
pc = poptGetContext(NULL, argc, (const char **) argv, long_options,
|
||||
pc = poptGetContext(NULL, argc, argv, long_options,
|
||||
POPT_CONTEXT_KEEP_FIRST);
|
||||
|
||||
while ((c = poptGetNextOpt(pc)) != -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user