diff options
author | peterbell10 <peterbell10@live.co.uk> | 2020-10-05 12:27:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-05 12:27:14 +0200 |
commit | a9031b6bae742b333b1b390192fa590f2ecb07ea (patch) | |
tree | b2802c81d24d339c201a0747d66ba44e9ea8b1b0 /src/Simulator/IncrementalRedstoneSimulator/RedstoneDataHelper.h | |
parent | Fixed current end generator (#4968) (diff) | |
download | cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.tar cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.tar.gz cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.tar.bz2 cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.tar.lz cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.tar.xz cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.tar.zst cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.zip |
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/RedstoneDataHelper.h')
-rw-r--r-- | src/Simulator/IncrementalRedstoneSimulator/RedstoneDataHelper.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/RedstoneDataHelper.h b/src/Simulator/IncrementalRedstoneSimulator/RedstoneDataHelper.h index 16d6924b1..2f827206f 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/RedstoneDataHelper.h +++ b/src/Simulator/IncrementalRedstoneSimulator/RedstoneDataHelper.h @@ -12,7 +12,7 @@ inline void UpdateAdjustedRelative(const cChunk & From, const cChunk & To, const { DataForChunk(To).WakeUp(cIncrementalRedstoneSimulatorChunkData::RebaseRelativePosition(From, To, Position + Offset)); - for (const auto LinkedOffset : cSimulator::GetLinkedOffsets(Offset)) + for (const auto & LinkedOffset : cSimulator::GetLinkedOffsets(Offset)) { DataForChunk(To).WakeUp(cIncrementalRedstoneSimulatorChunkData::RebaseRelativePosition(From, To, Position + LinkedOffset)); } @@ -21,7 +21,7 @@ inline void UpdateAdjustedRelative(const cChunk & From, const cChunk & To, const template <typename ArrayType> inline void UpdateAdjustedRelatives(const cChunk & From, const cChunk & To, const Vector3i Position, const ArrayType & Relative) { - for (const auto Offset : Relative) + for (const auto & Offset : Relative) { UpdateAdjustedRelative(From, To, Position, Offset); } @@ -30,12 +30,18 @@ inline void UpdateAdjustedRelatives(const cChunk & From, const cChunk & To, cons template <typename ArrayType> inline void InvokeForAdjustedRelatives(ForEachSourceCallback & Callback, const Vector3i Position, const ArrayType & Relative) { - for (const auto Offset : Relative) + for (const auto & Offset : Relative) { Callback(Position + Offset); } } +// Warning shouldn't trigger for inline variables, this is fixed in clang 7 +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-variable-declarations" +#endif + inline constexpr Vector3i OffsetYP{ 0, 1, 0 }; inline constexpr Vector3i OffsetYM{ 0, -1, 0 }; @@ -61,3 +67,7 @@ inline constexpr std::array<Vector3i, 4> RelativeLaterals { 0, 0, -1 }, } }; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif |