From: Jordan Lee Date: Sun, 6 Dec 2015 22:39:14 +0000 (+0000) Subject: fix const warnings X-Git-Tag: 2.90~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ea43ba7788f3926c27f907a0b32494f6daabaf6;p=transmission fix const warnings In particular, in passing argv around as a "const char * const *" instead of a "const char *". --- diff --git a/daemon/daemon.c b/daemon/daemon.c index 0cd83025a..149668b8c 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -163,7 +163,7 @@ reopen_log_file (const char *filename) } static const char* -getConfigDir (int argc, const char ** argv) +getConfigDir (int argc, const char * const * argv) { int c; const char * configDir = NULL; diff --git a/daemon/remote.c b/daemon/remote.c index 6a11d13e7..5187ceafe 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -1834,7 +1834,7 @@ ensure_tset (tr_variant ** tset) } static int -processArgs (const char * rpcurl, int argc, const char ** argv) +processArgs (const char * rpcurl, int argc, const char * const * argv) { int c; int status = EXIT_SUCCESS; diff --git a/libtransmission/tr-getopt.c b/libtransmission/tr-getopt.c index c2048d072..a5c4d9f51 100644 --- a/libtransmission/tr-getopt.c +++ b/libtransmission/tr-getopt.c @@ -187,11 +187,11 @@ findOption (const tr_option * opts, } int -tr_getopt (const char * usage, - int argc, - const char ** argv, - const tr_option * opts, - const char ** setme_optarg) +tr_getopt (const char * usage, + int argc, + const char * const * argv, + const tr_option * opts, + const char ** setme_optarg) { int i; const char * arg = NULL; diff --git a/libtransmission/tr-getopt.h b/libtransmission/tr-getopt.h index 4171951cf..5a3e05b15 100644 --- a/libtransmission/tr-getopt.h +++ b/libtransmission/tr-getopt.h @@ -50,11 +50,11 @@ enum * @brief similar to getopt () * @return TR_GETOPT_DONE, TR_GETOPT_ERR, TR_GETOPT_UNK, or the matching tr_option's `val' field */ -int tr_getopt (const char * summary, - int argc, - const char ** argv, - const tr_option * opts, - const char ** setme_optarg); +int tr_getopt (const char * summary, + int argc, + const char * const * argv, + const tr_option * opts, + const char ** setme_optarg); /** @brief prints the `Usage' help section to stdout */ void tr_getopt_usage (const char * appName, diff --git a/utils/create.c b/utils/create.c index fc03f63ac..18d3a145a 100644 --- a/utils/create.c +++ b/utils/create.c @@ -51,7 +51,7 @@ getUsage (void) } static int -parseCommandLine (int argc, const char ** argv) +parseCommandLine (int argc, const char * const * argv) { int c; const char * optarg; diff --git a/utils/edit.c b/utils/edit.c index b096cc530..d7e7a70e6 100644 --- a/utils/edit.c +++ b/utils/edit.c @@ -45,7 +45,7 @@ getUsage (void) } static int -parseCommandLine (int argc, const char ** argv) +parseCommandLine (int argc, const char * const * argv) { int c; const char * optarg; diff --git a/utils/show.c b/utils/show.c index 77040952e..03d343291 100644 --- a/utils/show.c +++ b/utils/show.c @@ -49,7 +49,7 @@ static bool showVersion = false; const char * filename = NULL; static int -parseCommandLine (int argc, const char ** argv) +parseCommandLine (int argc, const char * const * argv) { int c; const char * optarg;