Skip to content

Commit

Permalink
* fixed ORTHO_UNIT for FSMs with multiple orthogonal regions
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-gresyk committed Feb 14, 2020
1 parent 21aef92 commit c91d4e5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions include/hfsm2/detail/state_registry.hpp
Expand Up @@ -95,7 +95,7 @@ struct AllForksT {
static constexpr ShortIndex ORTHO_UNITS = NOrthoUnits;

using Compo = StaticArray<ShortIndex, COMPO_REGIONS>;
using Ortho = BitArray<ShortIndex, ORTHO_REGIONS>;
using Ortho = BitArray <ShortIndex, ORTHO_UNITS>;

Compo compo{INVALID_SHORT_INDEX};
Ortho ortho;
Expand Down Expand Up @@ -155,7 +155,7 @@ struct StateRegistryT<ArgsT<TContext,

using CompoParents = StaticArray<Parent, COMPO_REGIONS>;
using OrthoParents = StaticArray<Parent, ORTHO_REGIONS>;
using OrthoUnits = StaticArray<Units, ORTHO_REGIONS>;
using OrthoUnits = StaticArray<Units, ORTHO_UNITS>;

using CompoForks = StaticArray<ShortIndex, COMPO_REGIONS>;
using AllForks = AllForksT<COMPO_REGIONS, ORTHO_REGIONS, ORTHO_UNITS>;
Expand Down
2 changes: 1 addition & 1 deletion include/hfsm2/detail/structure/orthogonal.hpp
Expand Up @@ -56,7 +56,7 @@ struct O_ final {
using SubStates = OS_<I_<HEAD_ID + 1,
COMPO_INDEX,
ORTHO_INDEX + 1,
ORTHO_UNIT + ORTHO_UNITS>,
ORTHO_UNIT + (WIDTH + 7) / 8>,
Args,
0,
TSubStates...>;
Expand Down
6 changes: 3 additions & 3 deletions include/hfsm2/machine.hpp
Expand Up @@ -2844,7 +2844,7 @@ struct AllForksT {
static constexpr ShortIndex ORTHO_UNITS = NOrthoUnits;

using Compo = StaticArray<ShortIndex, COMPO_REGIONS>;
using Ortho = BitArray<ShortIndex, ORTHO_REGIONS>;
using Ortho = BitArray <ShortIndex, ORTHO_UNITS>;

Compo compo{INVALID_SHORT_INDEX};
Ortho ortho;
Expand Down Expand Up @@ -2904,7 +2904,7 @@ struct StateRegistryT<ArgsT<TContext,

using CompoParents = StaticArray<Parent, COMPO_REGIONS>;
using OrthoParents = StaticArray<Parent, ORTHO_REGIONS>;
using OrthoUnits = StaticArray<Units, ORTHO_REGIONS>;
using OrthoUnits = StaticArray<Units, ORTHO_UNITS>;

using CompoForks = StaticArray<ShortIndex, COMPO_REGIONS>;
using AllForks = AllForksT<COMPO_REGIONS, ORTHO_REGIONS, ORTHO_UNITS>;
Expand Down Expand Up @@ -8492,7 +8492,7 @@ struct O_ final {
using SubStates = OS_<I_<HEAD_ID + 1,
COMPO_INDEX,
ORTHO_INDEX + 1,
ORTHO_UNIT + ORTHO_UNITS>,
ORTHO_UNIT + (WIDTH + 7) / 8>,
Args,
0,
TSubStates...>;
Expand Down
1 change: 1 addition & 0 deletions projects/visual-studio/hfsm2-16-vs.sln
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/deprecated_test.hpp
Expand Up @@ -22,7 +22,7 @@ namespace Event {

COUNT
};
};
}

//------------------------------------------------------------------------------

Expand Down

0 comments on commit c91d4e5

Please sign in to comment.