Commits

rubenvb  committed 0dc6abb

Small fixes to default debug level and program flow.

  • Participants
  • Parent commits e9d612b

Comments (0)

Files changed (6)

File Ambrosia/Ambrosia.pro

 CONFIG -= qt
 DEFINES -= UNICODE QT_LARGEFILE_SUPPORT
 
-CONFIG += debug_and_release
-
 *g++*:QMAKE_CXXFLAGS += -std=c++0x -pedantic-errors -Wextra -Wconversion \
                         -Weffc++ -Wmissing-include-dirs -Wstrict-aliasing -Werror
 # Ambrosia Library

File Ambrosia/Source/commandline.cpp

 
     // Options to be filled in, with default values, if any
     string current;
-    bool m_first_dashless_argument;
+    bool m_first_dashless_argument = true;
     const auto end = arguments.end();
     for( auto it = arguments.begin(); it != end; ++it )
     {

File libAmbrosia/Include/Ambrosia/platform.h

  * Possible commonly implemented functions
  ******************************************/
 // PATH environment variable
-const std::vector<std::string> get_environment_PATH();
+const std::vector<std::string>& get_environment_PATH();
 // current working directory in string form.
 const std::string current_working_directory();
 // check if a file/directory exists/is accessible

File libAmbrosia/Source/Ambrosia/Platform/common.cpp

 /*
  * Common platform implementations
  **********************************/
-const vector<string> get_environment_PATH()
+const vector<string>& get_environment_PATH()
 {
+    static vector<string> result;
+    if( !result.empty() )
+        return result;
+
 #if _WIN32
     const std::string PATH = convert_to_utf8( _wgetenv(L"PATH") );
     const char delimiter = ';';
     if( PATH.empty() )
         throw runtime_error( "PATH should not be empty" );
 
-    vector<string> result;
     size_t previous = 0;
     size_t index = PATH.find( delimiter );
     while( index != string::npos )

File libAmbrosia/Source/Ambrosia/debug.cpp

 
 #ifdef AMBROSIA_DEBUG
 // static member initialization
-const debug::type s_max_debug_level = debug::type::commandline;
+const debug::type s_max_debug_level = debug::always;
 debug::type debug::s_level = s_max_debug_level;
+
 debug::debug( const type debug_level )
     :   m_output( debug_level & s_level )
 #else // AMBROSIA_DEBUG

File libAmbrosia/libAmbrosia.pro

 CONFIG -= qt
 DEFINES -= UNICODE QT_LARGEFILE_SUPPORT
 
-CONFIG += debug_and_release
-
 *g++*:QMAKE_CXXFLAGS += -std=c++0x -pedantic-errors -Wextra -Wall -Wconversion \
                         -Weffc++ -Wmissing-include-dirs -Wstrict-aliasing -Werror
 CONFIG( debug, debug|release ) {