Mercurial > hg > audiodb
diff audioDB.cpp @ 345:30384a82983a
Quieten newer compilers with MORE CONST CORRECTNESS.
(except, haha, gengetopt doesn't generate const-correct function
prototypes. Happy happy joy joy. Put in an explicit cast when calling
cmdline_parser().)
Adjust gengetopt.in and Makefile to support both old (2.19) and new
(2.22) versions of gengetopt. This only really means that we've lost -H
as a help switch; --help still works.
author | mas01cr |
---|---|
date | Wed, 08 Oct 2008 11:06:11 +0000 |
parents | da901c62e569 |
children | 94c18f128ce8 |
line wrap: on
line diff
--- a/audioDB.cpp Tue Oct 07 21:03:26 2008 +0000 +++ b/audioDB.cpp Wed Oct 08 11:06:11 2008 +0000 @@ -22,7 +22,7 @@ return ( (a.trackID==b.trackID) && (a.qpos==b.qpos) && (a.spos==b.spos) ); } -audioDB::audioDB(const unsigned argc, char* const argv[]): O2_AUDIODB_INITIALIZERS +audioDB::audioDB(const unsigned argc, const char *const argv[]): O2_AUDIODB_INITIALIZERS { if(processArgs(argc, argv)<0){ printf("No command found.\n"); @@ -97,7 +97,7 @@ error("Unrecognized command",command); } -audioDB::audioDB(const unsigned argc, char* const argv[], adb__queryResponse *adbQueryResponse): O2_AUDIODB_INITIALIZERS +audioDB::audioDB(const unsigned argc, const char *const argv[], adb__queryResponse *adbQueryResponse): O2_AUDIODB_INITIALIZERS { try { isServer = 1; // Set to make errors report over SOAP @@ -113,7 +113,7 @@ } } -audioDB::audioDB(const unsigned argc, char* const argv[], adb__statusResponse *adbStatusResponse): O2_AUDIODB_INITIALIZERS +audioDB::audioDB(const unsigned argc, const char* const argv[], adb__statusResponse *adbStatusResponse): O2_AUDIODB_INITIALIZERS { try { isServer = 1; // Set to make errors report over SOAP @@ -129,7 +129,7 @@ } } -audioDB::audioDB(const unsigned argc, char* const argv[], adb__lisztResponse *adbLisztResponse): O2_AUDIODB_INITIALIZERS +audioDB::audioDB(const unsigned argc, const char *const argv[], adb__lisztResponse *adbLisztResponse): O2_AUDIODB_INITIALIZERS { try { isServer = 1; // Set to make errors report over SOAP @@ -193,7 +193,7 @@ cleanup(); } -int audioDB::processArgs(const unsigned argc, char* const argv[]){ +int audioDB::processArgs(const unsigned argc, const char *const argv[]){ if(argc<2){ cmdline_parser_print_version (); @@ -206,7 +206,10 @@ exit(0); } - if (cmdline_parser (argc, argv, &args_info) != 0) + /* KLUDGE: gengetopt generates a function which is not completely + const-clean in its declaration. We cast argv here to keep the + compiler happy. -- CSR, 2008-10-08 */ + if (cmdline_parser (argc, (char *const *) argv, &args_info) != 0) error("Error parsing command line"); if(args_info.help_given){