Use "const char *" instead of "char *" where needed.

Fix compiler warnings:
compat_getopt_main.c: In function ‘main’:
compat_getopt_main.c:145: warning: initialization discards qualifiers from pointer target type
compat_getopt_main.c:288: warning: assignment discards qualifiers from pointer target type
compat_getopt_main.c:336: warning: assignment discards qualifiers from pointer target type
compat_getopt_main.c:366: warning: passing argument 3 of ‘handle’ discards qualifiers from pointer target type
compat_getopt_main.c:76: note: expected ‘char *’ but argument is of type ‘const char *’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4743 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
ludovic.rousseau 2010-09-21 09:48:57 +00:00
parent 96a2568ee0
commit 2085126d39
1 changed files with 5 additions and 5 deletions

View File

@ -74,8 +74,8 @@ usage(char *progname)
/* input file handler -- returns nonzero or exit()s on failure */
static int
handle(char *progname,
FILE *infile, char *infilename,
FILE *outfile, char *outfilename,
FILE *infile, const char *infilename,
FILE *outfile, const char *outfilename,
int rotate)
{
int c;
@ -133,7 +133,7 @@ main(int argc, char * argv[])
/* during argument parsing, opt contains the return value from getopt() */
int opt;
/* the output filename is initially 0 (a.k.a. stdout) */
char *outfilename = 0;
const char *outfilename = 0;
/* the default return value is initially 0 (success) */
int retval = 0;
/* initially we truncate */
@ -142,7 +142,7 @@ main(int argc, char * argv[])
int rotate = 0;
/* short options string */
char *shortopts = "Vho:r::v::";
const char *shortopts = "Vho:r::v::";
/* long options list */
struct option longopts[] =
{
@ -326,7 +326,7 @@ main(int argc, char * argv[])
for (argindex = optind; argindex < argc; argindex ++)
{
char *infilename = argv[argindex];
const char *infilename = argv[argindex];
FILE *infile;
/* we allow "-" as a synonym for stdin here */