diff --git a/bin/test/data/SourceGroupTestSuite/cxx_cdb/expected_output/output.txt b/bin/test/data/SourceGroupTestSuite/cxx_cdb/expected_output/output.txt index ed2c7a65..544711b8 100644 --- a/bin/test/data/SourceGroupTestSuite/cxx_cdb/expected_output/output.txt +++ b/bin/test/data/SourceGroupTestSuite/cxx_cdb/expected_output/output.txt @@ -6,12 +6,12 @@ SourceFilePath: "src/Test.cpp" CompilerFlag: "-fms-compatibility" CompilerFlag: "-fms-compatibility-version=19" CompilerFlag: "-isystem" - CompilerFlag: "'/include/path/from/cdb'" + CompilerFlag: "/include/path/from/cdb" CompilerFlag: "-D" CompilerFlag: "DEFINE_FROM_CDB=some_value" CompilerFlag: "-std=c++14" CompilerFlag: "/FS" - CompilerFlag: "'./Test.cpp'" + CompilerFlag: "./Test.cpp" CompilerFlag: "-isystem" CompilerFlag: "header_search/local" CompilerFlag: "-isystem" diff --git a/bin/test/data/SourceGroupTestSuite/cxx_cdb/input/compile_commands.json b/bin/test/data/SourceGroupTestSuite/cxx_cdb/input/compile_commands.json index bf53a52c..3841ce72 100644 --- a/bin/test/data/SourceGroupTestSuite/cxx_cdb/input/compile_commands.json +++ b/bin/test/data/SourceGroupTestSuite/cxx_cdb/input/compile_commands.json @@ -1,7 +1,7 @@ [ { "directory": "src", - "command": "clang-tool -fms-extensions -fms-compatibility -fms-compatibility-version=19 -isystem '/include/path/from/cdb' -D DEFINE_FROM_CDB=\"some_value\" -std=c++14 /FS './Test.cpp'", + "command": "clang-tool -fms-extensions -fms-compatibility -fms-compatibility-version=19 -isystem /include/path/from/cdb -D DEFINE_FROM_CDB=\"some_value\" -std=c++14 /FS ./Test.cpp", "file": "./Test.cpp" } ] \ No newline at end of file diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 2ecd76c6..8776575f 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -425,7 +425,7 @@ add_files( utility/messaging/filter_types/MessageFilterSearchAutocomplete.h utility/messaging/type/activation/MessageActivateLegend.h - + utility/messaging/type/code/MessageCodeShowDefinition.h utility/messaging/type/error/MessageActivateErrors.h @@ -577,15 +577,6 @@ add_files( utility/sonargraph/utilitySonargraph.cpp utility/sonargraph/utilitySonargraph.h - utility/synchronization/ReaderWriterLock.cpp - utility/synchronization/ReaderWriterLock.h - utility/synchronization/ScopedReaderLock.cpp - utility/synchronization/ScopedReaderLock.h - utility/synchronization/ScopedWriterLock.cpp - utility/synchronization/ScopedWriterLock.h - utility/synchronization/Semaphore.cpp - utility/synchronization/Semaphore.h - utility/text/TextAccess.cpp utility/text/TextAccess.h diff --git a/src/lib/utility/synchronization/ReaderWriterLock.cpp b/src/lib/utility/synchronization/ReaderWriterLock.cpp deleted file mode 100644 index 517b0b82..00000000 --- a/src/lib/utility/synchronization/ReaderWriterLock.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "ReaderWriterLock.h" - -ReaderWriterLock::ReaderWriterLock() - : m_readerCount(0) - , m_allowedReaders(1) - , m_allowedWriters(1) -{ -} - -ReaderWriterLock::ReaderWriterLock(const ReaderWriterLock &lock) - : m_readerCount(0) - , m_allowedReaders(1) - , m_allowedWriters(1) -{ -} - -ReaderWriterLock::~ReaderWriterLock() -{ -} - -void ReaderWriterLock::readerLock() -{ - m_allowedReaders.wait(); - m_allowedReaders.post(); - - std::lock_guard lock(m_readerCountMutex); - m_readerCount++; - if (m_readerCount == 1) - { - m_allowedWriters.wait(); - } -} - -void ReaderWriterLock::readerUnlock() -{ - std::lock_guard lock(m_readerCountMutex); - m_readerCount--; - if (m_readerCount == 0) - { - m_allowedWriters.post(); - } -} - -void ReaderWriterLock::writerLock() -{ - m_allowedReaders.wait(); - m_allowedWriters.wait(); -} - -void ReaderWriterLock::writerUnlock() -{ - m_allowedWriters.post(); - m_allowedReaders.post(); -} diff --git a/src/lib/utility/synchronization/ReaderWriterLock.h b/src/lib/utility/synchronization/ReaderWriterLock.h deleted file mode 100644 index 369daeb5..00000000 --- a/src/lib/utility/synchronization/ReaderWriterLock.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef READER_WRITER_LOCK_H -#define READER_WRITER_LOCK_H - -#include -#include "Semaphore.h" - -class ReaderWriterLock -{ -public: - ReaderWriterLock(); - -private: - ReaderWriterLock(const ReaderWriterLock &lock); - -public: - ~ReaderWriterLock(); - - void readerLock(); - void readerUnlock(); - void writerLock(); - void writerUnlock(); - -private: - int m_readerCount; - std::mutex m_readerCountMutex; - Semaphore m_allowedReaders, m_allowedWriters; -}; - -#endif // READER_WRITER_LOCK_H - diff --git a/src/lib/utility/synchronization/ScopedReaderLock.cpp b/src/lib/utility/synchronization/ScopedReaderLock.cpp deleted file mode 100644 index 93faab55..00000000 --- a/src/lib/utility/synchronization/ScopedReaderLock.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "ScopedReaderLock.h" - -ScopedReaderLock::ScopedReaderLock(ReaderWriterLock& lock) - : m_lock(lock) -{ - m_lock.readerLock(); -} - -ScopedReaderLock::~ScopedReaderLock() -{ - m_lock.readerUnlock(); -} diff --git a/src/lib/utility/synchronization/ScopedReaderLock.h b/src/lib/utility/synchronization/ScopedReaderLock.h deleted file mode 100644 index ea94f610..00000000 --- a/src/lib/utility/synchronization/ScopedReaderLock.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef SCOPED_READER_LOCK_H -#define SCOPED_READER_LOCK_H - -#include "ReaderWriterLock.h" - -class ScopedReaderLock -{ -public: - ScopedReaderLock(ReaderWriterLock& lock); - ~ScopedReaderLock(); - -private: - ReaderWriterLock& m_lock; -}; - -#endif // SCOPED_READER_LOCK_H diff --git a/src/lib/utility/synchronization/ScopedWriterLock.cpp b/src/lib/utility/synchronization/ScopedWriterLock.cpp deleted file mode 100644 index c0e6fde6..00000000 --- a/src/lib/utility/synchronization/ScopedWriterLock.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "ScopedWriterLock.h" - -ScopedWriterLock::ScopedWriterLock(ReaderWriterLock& lock) - : m_lock(lock) -{ - m_lock.writerLock(); -} - -ScopedWriterLock::~ScopedWriterLock() -{ - m_lock.writerUnlock(); -} diff --git a/src/lib/utility/synchronization/ScopedWriterLock.h b/src/lib/utility/synchronization/ScopedWriterLock.h deleted file mode 100644 index e1c3f15d..00000000 --- a/src/lib/utility/synchronization/ScopedWriterLock.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef SCOPED_WRITER_LOCK_H -#define SCOPED_WRITER_LOCK_H - -#include "ReaderWriterLock.h" - -class ScopedWriterLock -{ -public: - ScopedWriterLock(ReaderWriterLock& lock); - ~ScopedWriterLock(); - -private: - ReaderWriterLock& m_lock; -}; - -#endif // SCOPED_WRITER_LOCK_H diff --git a/src/lib/utility/synchronization/Semaphore.cpp b/src/lib/utility/synchronization/Semaphore.cpp deleted file mode 100644 index 05d2a1eb..00000000 --- a/src/lib/utility/synchronization/Semaphore.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "Semaphore.h" - -Semaphore::Semaphore(unsigned int counter) - : m_counter(counter) -{ -} - -Semaphore::~Semaphore() -{ -} - -void Semaphore::wait() -{ - std::unique_lock lock(m_counterMutex); - while(m_counter == 0) - { - m_conditionVariable.wait(lock); - } - m_counter--; -} - -void Semaphore::post() -{ - std::unique_lock lock(m_counterMutex); - m_counter++; - m_conditionVariable.notify_one(); -} diff --git a/src/lib/utility/synchronization/Semaphore.h b/src/lib/utility/synchronization/Semaphore.h deleted file mode 100644 index e1701263..00000000 --- a/src/lib/utility/synchronization/Semaphore.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef SEMAPHORE_H -#define SEMAPHORE_H - -#include -#include - -class Semaphore -{ -public: - Semaphore(unsigned int counter); - ~Semaphore(); - - void wait(); - void post(); - -private: - unsigned int m_counter; - std::mutex m_counterMutex; - std::condition_variable m_conditionVariable; -}; - -#endif // SEMAPHORE_H diff --git a/src/lib_cxx/utility/codeblocks/CodeblocksProject.cpp b/src/lib_cxx/utility/codeblocks/CodeblocksProject.cpp index 7f9594ae..a4306377 100644 --- a/src/lib_cxx/utility/codeblocks/CodeblocksProject.cpp +++ b/src/lib_cxx/utility/codeblocks/CodeblocksProject.cpp @@ -275,7 +275,7 @@ namespace Codeblocks sourceGroupSettings->getCodeblocksProjectPathExpandedAndAbsolute().getParentDirectory(), utility::concat( optionsCache.getValue(targetName), - { IndexerCommandCxx::getCompilerFlagLanguageStandard(languageStandard), filePath.wstr() } + std::vector({ IndexerCommandCxx::getCompilerFlagLanguageStandard(languageStandard), filePath.wstr() }) ) )); } diff --git a/src/test/SourceGroupTestSuite.h b/src/test/SourceGroupTestSuite.h index 93a9a06f..d07ae62a 100644 --- a/src/test/SourceGroupTestSuite.h +++ b/src/test/SourceGroupTestSuite.h @@ -436,12 +436,12 @@ public: private: static FilePath getInputDirectoryPath(const std::wstring& projectName) { - return FilePath(L"data/SourceGroupTestSuite/" + projectName + L"/input").makeAbsolute(); + return FilePath(L"data/SourceGroupTestSuite/" + projectName + L"/input").makeAbsolute().makeCanonical(); } static FilePath getOutputDirectoryPath(const std::wstring& projectName) { - return FilePath(L"data/SourceGroupTestSuite/" + projectName + L"/expected_output").makeAbsolute(); + return FilePath(L"data/SourceGroupTestSuite/" + projectName + L"/expected_output").makeAbsolute().makeCanonical(); } std::string setupJavaEnvironmentFactory()