* Add warning if -c option and something conflicting with it are both given

* Fixes for mingw32 compile
* Fix a couple of compiler warnings
This commit is contained in:
Chris Cannam
2008-07-07 18:54:18 +00:00
parent 167760625a
commit d6d4af1539
7 changed files with 38 additions and 36 deletions

View File

@@ -22,7 +22,7 @@
#include <cstring>
#include "sysutils.h"
#ifdef _WIN32
#ifdef __MSVC__
#include "bsd-3rdparty/getopt/getopt.h"
#else
#include <getopt.h>
@@ -78,6 +78,7 @@ int main(int argc, char **argv)
bool hqpitch = false;
bool softening = true;
bool formant = false;
bool crispchanged = false;
int crispness = -1;
bool help = false;
bool version = false;
@@ -138,11 +139,11 @@ int main(int argc, char **argv)
case 'F': formant = true; break;
case '0': threading = 1; break;
case '@': threading = 2; break;
case '1': transients = NoTransients; break;
case '2': peaklock = false; break;
case '3': longwin = true; break;
case '4': shortwin = true; break;
case '8': transients = BandLimitedTransients; break;
case '1': transients = NoTransients; crispchanged = true; break;
case '2': peaklock = false; crispchanged = true; break;
case '3': longwin = true; crispchanged = true; break;
case '4': shortwin = true; crispchanged = true; break;
case '8': transients = BandLimitedTransients; crispchanged = true; break;
case '9': softening = false; break;
case '%': hqpitch = true; break;
case 'c': crispness = atoi(optarg); break;
@@ -215,6 +216,11 @@ int main(int argc, char **argv)
return 2;
}
if (crispness >= 0 && crispchanged) {
cerr << "WARNING: Both crispness option and transients, peaklock or window options" << endl;
cerr << " provided -- crispness will override these other options" << endl;
}
switch (crispness) {
case -1: crispness = 4; break;
case 0: transients = NoTransients; peaklock = false; longwin = true; shortwin = false; break;