diff --git a/.clang-format b/.clang-format index 3ce5fb1..66ca46b 100644 --- a/.clang-format +++ b/.clang-format @@ -6,19 +6,12 @@ AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false AllowShortIfStatementsOnASingleLine: Never AlwaysBreakTemplateDeclarations: Yes -BraceWrapping: - AfterCaseLabel: false - AfterClass: false - AfterControlStatement: Never - AfterEnum: false - AfterFunction: false - AfterStruct: false - AfterUnion: false - BeforeElse: false +BreakBeforeBraces: Attach BreakBeforeTernaryOperators: true BreakConstructorInitializers: BeforeComma ColumnLimit: 0 ContinuationIndentWidth: 4 +Cpp11BracedListStyle: false DeriveLineEnding: false DerivePointerAlignment: false IncludeBlocks: Merge @@ -50,5 +43,6 @@ SpacesInCStyleCastParentheses: false SpacesInConditionalStatement: false Standard: c++11 TabWidth: 4 +TypenameMacros: ['STORM_EXPLICIT_LIST', 'STORM_LIST'] UseCRLF: false UseTab: Never diff --git a/storm/array/TSBaseArray.hpp b/storm/array/TSBaseArray.hpp index 1eddb20..67efd09 100644 --- a/storm/array/TSBaseArray.hpp +++ b/storm/array/TSBaseArray.hpp @@ -3,7 +3,7 @@ #include -template +template class TSBaseArray { public: uint32_t m_alloc = 0; @@ -15,17 +15,17 @@ class TSBaseArray { void Clear(void); }; -template +template T& TSBaseArray::operator[](uint32_t i) { return this->m_data[i]; } -template +template uint32_t TSBaseArray::Count() { return this->m_count; } -template +template void TSBaseArray::Clear() { delete[] this->m_data; TSBaseArray(); diff --git a/storm/array/TSFixedArray.hpp b/storm/array/TSFixedArray.hpp index e29a22d..0782322 100644 --- a/storm/array/TSFixedArray.hpp +++ b/storm/array/TSFixedArray.hpp @@ -1,18 +1,18 @@ #ifndef STORM_ARRAY_TS_FIXED_ARRAY_HPP #define STORM_ARRAY_TS_FIXED_ARRAY_HPP -#include "storm/array/TSBaseArray.hpp" #include "storm/Memory.hpp" +#include "storm/array/TSBaseArray.hpp" #include -template +template class TSFixedArray : public TSBaseArray { public: void ReallocData(uint32_t count); void SetCount(uint32_t count); }; -template +template void TSFixedArray::ReallocData(uint32_t count) { T* oldData = this->m_data; @@ -47,7 +47,7 @@ void TSFixedArray::ReallocData(uint32_t count) { } } -template +template void TSFixedArray::SetCount(uint32_t count) { if (count != this->m_count) { if (count) { diff --git a/storm/array/TSGrowableArray.hpp b/storm/array/TSGrowableArray.hpp index cbae6e2..be2af83 100644 --- a/storm/array/TSGrowableArray.hpp +++ b/storm/array/TSGrowableArray.hpp @@ -7,7 +7,7 @@ #include #include -template +template class TSGrowableArray : public TSFixedArray { public: uint32_t m_chunk = 0; @@ -22,7 +22,7 @@ class TSGrowableArray : public TSFixedArray { void SetCount(uint32_t count); }; -template +template uint32_t TSGrowableArray::Add(uint32_t count, const T* data) { this->Reserve(count, 1); @@ -35,7 +35,7 @@ uint32_t TSGrowableArray::Add(uint32_t count, const T* data) { return this->m_count - count; } -template +template uint32_t TSGrowableArray::Add(uint32_t count, uint32_t incr, const T* data) { this->Reserve(count, 1); @@ -51,7 +51,7 @@ uint32_t TSGrowableArray::Add(uint32_t count, uint32_t incr, const T* data) { return this->m_count - count; } -template +template uint32_t TSGrowableArray::CalcChunkSize(uint32_t count) { uint32_t maxChunk = std::max(static_cast(256 / sizeof(T)), 8); @@ -73,7 +73,7 @@ uint32_t TSGrowableArray::CalcChunkSize(uint32_t count) { return result; } -template +template void TSGrowableArray::GrowToFit(uint32_t index, int32_t zero) { uint32_t count = this->m_count; @@ -88,14 +88,14 @@ void TSGrowableArray::GrowToFit(uint32_t index, int32_t zero) { } } -template +template T* TSGrowableArray::New() { this->Reserve(1, 1); void* element = &this->m_data[this->m_count++]; return new (element) T(); } -template +template void TSGrowableArray::Reserve(uint32_t count, int32_t round) { if (count + this->m_count > this->m_alloc) { if (round) { @@ -112,7 +112,7 @@ void TSGrowableArray::Reserve(uint32_t count, int32_t round) { } } -template +template uint32_t TSGrowableArray::RoundToChunk(uint32_t count, uint32_t chunk) { if (count % chunk) { return chunk - count % chunk + count; @@ -121,7 +121,7 @@ uint32_t TSGrowableArray::RoundToChunk(uint32_t count, uint32_t chunk) { } } -template +template void TSGrowableArray::SetCount(uint32_t count) { if (count > this->m_count) { // Expand size