From c91d4e573760b6650cd7239c9e234478ca8c2d50 Mon Sep 17 00:00:00 2001 From: Andrew Gresyk Date: Fri, 14 Feb 2020 10:23:11 +0100 Subject: [PATCH] * fixed ORTHO_UNIT for FSMs with multiple orthogonal regions --- CMakeLists.txt | 2 +- include/hfsm2/detail/state_registry.hpp | 4 ++-- include/hfsm2/detail/structure/orthogonal.hpp | 2 +- include/hfsm2/machine.hpp | 6 +++--- projects/visual-studio/hfsm2-16-vs.sln | 1 + test/deprecated_test.hpp | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8e85c1..5ef6fb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ set(SANITIZE_CXX_FLAGS "") #set(SANITIZE_CXX_FLAGS "-fsanitize=memory -g -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls") #set(SANITIZE_CXX_FLAGS "-fsanitize=undefined") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZE_CXX_FLAGS} -Wall -Werror") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZE_CXX_FLAGS} -pedantic -Werror") project(hfsm2_test) diff --git a/include/hfsm2/detail/state_registry.hpp b/include/hfsm2/detail/state_registry.hpp index c610516..ad1f7a1 100644 --- a/include/hfsm2/detail/state_registry.hpp +++ b/include/hfsm2/detail/state_registry.hpp @@ -95,7 +95,7 @@ struct AllForksT { static constexpr ShortIndex ORTHO_UNITS = NOrthoUnits; using Compo = StaticArray; - using Ortho = BitArray; + using Ortho = BitArray ; Compo compo{INVALID_SHORT_INDEX}; Ortho ortho; @@ -155,7 +155,7 @@ struct StateRegistryT; using OrthoParents = StaticArray; - using OrthoUnits = StaticArray; + using OrthoUnits = StaticArray; using CompoForks = StaticArray; using AllForks = AllForksT; diff --git a/include/hfsm2/detail/structure/orthogonal.hpp b/include/hfsm2/detail/structure/orthogonal.hpp index 1bf8d22..07cdbfa 100644 --- a/include/hfsm2/detail/structure/orthogonal.hpp +++ b/include/hfsm2/detail/structure/orthogonal.hpp @@ -56,7 +56,7 @@ struct O_ final { using SubStates = OS_, + ORTHO_UNIT + (WIDTH + 7) / 8>, Args, 0, TSubStates...>; diff --git a/include/hfsm2/machine.hpp b/include/hfsm2/machine.hpp index 9a0cee6..9bd961b 100644 --- a/include/hfsm2/machine.hpp +++ b/include/hfsm2/machine.hpp @@ -2844,7 +2844,7 @@ struct AllForksT { static constexpr ShortIndex ORTHO_UNITS = NOrthoUnits; using Compo = StaticArray; - using Ortho = BitArray; + using Ortho = BitArray ; Compo compo{INVALID_SHORT_INDEX}; Ortho ortho; @@ -2904,7 +2904,7 @@ struct StateRegistryT; using OrthoParents = StaticArray; - using OrthoUnits = StaticArray; + using OrthoUnits = StaticArray; using CompoForks = StaticArray; using AllForks = AllForksT; @@ -8492,7 +8492,7 @@ struct O_ final { using SubStates = OS_, + ORTHO_UNIT + (WIDTH + 7) / 8>, Args, 0, TSubStates...>; diff --git a/projects/visual-studio/hfsm2-16-vs.sln b/projects/visual-studio/hfsm2-16-vs.sln index 61e3377..c0f607b 100644 --- a/projects/visual-studio/hfsm2-16-vs.sln +++ b/projects/visual-studio/hfsm2-16-vs.sln @@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{ED EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{58AC2401-48A7-4AFA-A6F4-5F00DFAF260A}" ProjectSection(SolutionItems) = preProject + catch2.runsettings = catch2.runsettings ..\..\test\CMakeLists.txt = ..\..\test\CMakeLists.txt ..\..\hfsm.natvis = ..\..\hfsm.natvis EndProjectSection diff --git a/test/deprecated_test.hpp b/test/deprecated_test.hpp index b48710c..eb581fd 100644 --- a/test/deprecated_test.hpp +++ b/test/deprecated_test.hpp @@ -22,7 +22,7 @@ namespace Event { COUNT }; -}; +} //------------------------------------------------------------------------------