From 3935ba39d30666dd7d4a831155631847c77b70c4 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Wed, 2 Aug 2017 08:46:58 +0000 Subject: Massive patch using LLVM coding style. It was generated with: clang-format -style=LLVM -i *.cpp *.h Please set your editor to replace tabs with spaces and use indentation of 2 spaces. --- src/main.cpp | 104 ++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 57 insertions(+), 47 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index c7f0573..833136c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,57 +16,67 @@ along with this program. If not, see . */ -#include +#include "gemma.h" #include +#include #include #include #include -#include "gemma.h" using namespace std; -int main(int argc, char * argv[]) { - GEMMA cGemma; - PARAM cPar; - - if (argc <= 1) { - cGemma.PrintHeader(); - return EXIT_SUCCESS; - } - if (argc==2 && argv[1][0] == '-' && argv[1][1] == 'h') { - cGemma.PrintHelp(0); - return EXIT_SUCCESS; - } - if (argc==3 && argv[1][0] == '-' && argv[1][1] == 'h') { - string str; - str.assign(argv[2]); - cGemma.PrintHelp(atoi(str.c_str())); - return EXIT_SUCCESS; - } - if (argc==2 && argv[1][0] == '-' && argv[1][1] == 'l') { - cGemma.PrintLicense(); - return EXIT_SUCCESS; - } - - cGemma.Assign(argc, argv, cPar); - - ifstream check_dir((cPar.path_out).c_str()); - if (!check_dir) { - mkdir((cPar.path_out).c_str(), S_IRWXU|S_IRGRP|S_IROTH); - } - - if (cPar.error==true) {return EXIT_FAILURE;} - - if (cPar.mode_silence) {stringstream ss; cout.rdbuf (ss.rdbuf());} - - cPar.CheckParam(); - - if (cPar.error==true) {return EXIT_FAILURE;} - - cGemma.BatchRun(cPar); - - if (cPar.error==true) {return EXIT_FAILURE;} - - cGemma.WriteLog(argc, argv, cPar); - - return EXIT_SUCCESS; } +int main(int argc, char *argv[]) { + GEMMA cGemma; + PARAM cPar; + + if (argc <= 1) { + cGemma.PrintHeader(); + return EXIT_SUCCESS; + } + if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'h') { + cGemma.PrintHelp(0); + return EXIT_SUCCESS; + } + if (argc == 3 && argv[1][0] == '-' && argv[1][1] == 'h') { + string str; + str.assign(argv[2]); + cGemma.PrintHelp(atoi(str.c_str())); + return EXIT_SUCCESS; + } + if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'l') { + cGemma.PrintLicense(); + return EXIT_SUCCESS; + } + + cGemma.Assign(argc, argv, cPar); + + ifstream check_dir((cPar.path_out).c_str()); + if (!check_dir) { + mkdir((cPar.path_out).c_str(), S_IRWXU | S_IRGRP | S_IROTH); + } + + if (cPar.error == true) { + return EXIT_FAILURE; + } + + if (cPar.mode_silence) { + stringstream ss; + cout.rdbuf(ss.rdbuf()); + } + + cPar.CheckParam(); + + if (cPar.error == true) { + return EXIT_FAILURE; + } + + cGemma.BatchRun(cPar); + + if (cPar.error == true) { + return EXIT_FAILURE; + } + + cGemma.WriteLog(argc, argv, cPar); + + return EXIT_SUCCESS; +} -- cgit v1.2.3