X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=tools%2Fif1.cpp;h=413fb0f344276242a29a17a1b70f09664182ee38;hp=39158f8550dbf6e5dc9a37dbfa14b8ca8b6fda20;hb=1a050c98763fbbc0662731b0b76953acede6f5d7;hpb=c8b19dfaffba9f06d8b6c40cb1bb83a8964867f7 diff --git a/tools/if1.cpp b/tools/if1.cpp index 39158f8..413fb0f 100644 --- a/tools/if1.cpp +++ b/tools/if1.cpp @@ -48,7 +48,7 @@ static struct option my_options[] = static const char* g_szIdStr = "$Id$"; -void +void if1_usage (const char *program) { std::cout << "usage: " << fileBasename(program) << " infile outfile [OPTIONS]" << std::endl; @@ -64,7 +64,7 @@ if1_usage (const char *program) std::cout << " --help Print this help message" << std::endl; } -int +int if1_main (int argc, char *const argv[]) { char *in_file; @@ -79,45 +79,45 @@ if1_main (int argc, char *const argv[]) while (1) { int c = getopt_long (argc, argv, "", my_options, NULL); - + if (c == -1) - break; - + break; + switch (c) - { - case O_INVERT: - opt_invert = 1; - break; - case O_LOG: - opt_log = 1; - break; - case O_SQR: - opt_sqr = 1; - break; - case O_SQRT: - opt_sqrt = 1; - break; - case O_EXP: - opt_exp = 1; - break; - case O_VERBOSE: - opt_verbose = 1; - break; + { + case O_INVERT: + opt_invert = 1; + break; + case O_LOG: + opt_log = 1; + break; + case O_SQR: + opt_sqr = 1; + break; + case O_SQRT: + opt_sqrt = 1; + break; + case O_EXP: + opt_exp = 1; + break; + case O_VERBOSE: + opt_verbose = 1; + break; case O_VERSION: #ifdef VERSION - std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl; + std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl; #else std::cout << "Unknown version number" << std::endl; #endif - return (0); - case O_HELP: - case '?': - if1_usage(argv[0]); - return (0); - default: - if1_usage(argv[0]); - return (1); - } + return (0); + case O_HELP: + case '?': + if1_usage(argv[0]); + return (0); + default: + if1_usage(argv[0]); + return (1); + } } if (optind + 2 != argc) @@ -125,7 +125,7 @@ if1_main (int argc, char *const argv[]) if1_usage(argv[0]); return (1); } - + in_file = argv[optind]; out_file = argv[optind + 1]; @@ -168,7 +168,7 @@ if1_main (int argc, char *const argv[]) } #ifndef NO_MAIN -int +int main (int argc, char *const argv[]) { int retval = 1;