# HG changeset patch # User Benjamin Golinvaux # Date 1587998943 -7200 # Node ID 4ebf246f391984aadf24bbf9808bb02717ef425e # Parent dfb48f0794b1e102fa4049c6c2fec4859b12e73c Fixed big mistake (factoring the option parsing, which only adds noise to the people reading the code) diff -r dfb48f0794b1 -r 4ebf246f3919 Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp --- a/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp Mon Apr 27 16:48:19 2020 +0200 +++ b/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp Mon Apr 27 16:49:03 2020 +0200 @@ -1,13 +1,7 @@ #include "SdlSimpleViewerApplication.h" - -#include - -#include - -#include - -#include +#include "../SdlHelpers.h" +#include "../../Common/SampleHelpers.h" #include #include @@ -15,20 +9,26 @@ #include #include -#include "../SdlHelpers.h" -#include "../../Common/SampleHelpers.h" +#include + +#include +#include + +#include + std::string orthancUrl; std::string instanceId; int frameIndex = 0; + static void ProcessOptions(int argc, char* argv[]) { namespace po = boost::program_options; po::options_description desc("Usage:"); desc.add_options() - ("log_level", po::value()->default_value("WARNING"), + ("loglevel", po::value()->default_value("WARNING"), "You can choose WARNING, INFO or TRACE for the logging level: Errors and warnings will always be displayed. (default: WARNING)") ("orthanc", po::value()->default_value("http://localhost:8042"), @@ -52,9 +52,9 @@ std::cerr << "Please check your command line options! (\"" << e.what() << "\")" << std::endl; } - if (vm.count("log_level") > 0) + if (vm.count("loglevel") > 0) { - std::string logLevel = vm["log_level"].as(); + std::string logLevel = vm["loglevel"].as(); OrthancStoneHelpers::SetLogLevel(logLevel); } @@ -76,11 +76,6 @@ } -extern void f() -{ - std::cout << "f()" << std::endl; -} - /** * IMPORTANT: The full arguments to "main()" are needed for SDL on * Windows. Otherwise, one gets the linking error "undefined reference @@ -88,8 +83,6 @@ **/ int main(int argc, char* argv[]) { - f(); - try { OrthancStone::StoneInitialize();