fix const warnings

In particular, in passing argv around as a "const char * const *"
instead of a "const char *".
This commit is contained in:
Jordan Lee 2015-12-06 22:39:14 +00:00
parent 3d76f23b2b
commit 3ea43ba778
7 changed files with 15 additions and 15 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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,

View File

@ -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;

View File

@ -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;

View File

@ -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;