From a9031b6bae742b333b1b390192fa590f2ecb07ea Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Mon, 5 Oct 2020 11:27:14 +0100 Subject: Fix cmake not adding Werror on clang, and _lots_ of warnings (#4963) * Fix cmake not adding Werror on clang, and _lots_ of warnings * WIP: Build fixes * Cannot make intermediate blockhandler instance * Tiger's changes * Fix BitIndex check * Handle invalid NextState values in cMultiVersionProtocol Co-authored-by: Tiger Wang --- .../IncrementalRedstoneSimulator/RedstoneWireHandler.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h') diff --git a/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h b/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h index 0bf3d58f3..c97f37aa5 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h +++ b/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h @@ -109,7 +109,7 @@ namespace RedstoneWireHandler const bool IsYPTerracingBlocked = cBlockInfo::IsSolid(YPTerraceBlock) && !cBlockInfo::IsTransparent(YPTerraceBlock); // Loop through laterals, discovering terracing connections: - for (const auto Offset : RelativeLaterals) + for (const auto & Offset : RelativeLaterals) { auto Adjacent = Position + Offset; auto NeighbourChunk = Chunk.GetRelNeighborChunkAdjustCoords(Adjacent); @@ -268,7 +268,7 @@ namespace RedstoneWireHandler a_Chunk.SetMeta(a_Position, Power); // Notify all positions, sans YP, to update: - for (const auto Offset : RelativeAdjacents) + for (const auto & Offset : RelativeAdjacents) { if (Offset == OffsetYP) { @@ -291,7 +291,7 @@ namespace RedstoneWireHandler const auto Block = Data.WireStates.find(a_Position)->second; // Figure out, based on our pre-computed block, where we connect to: - for (const auto Offset : RelativeLaterals) + for (const auto & Offset : RelativeLaterals) { const auto Relative = a_Position + Offset; Callback(Relative); @@ -311,10 +311,10 @@ namespace RedstoneWireHandler const auto YMDiagonalPosition = Relative + OffsetYM; if ( - BLOCKTYPE Block; + BLOCKTYPE QueryBlock; cChunkDef::IsValidHeight(YMDiagonalPosition.y) && - a_Chunk.UnboundedRelGetBlockType(YMDiagonalPosition, Block) && - (Block == E_BLOCK_REDSTONE_WIRE) + a_Chunk.UnboundedRelGetBlockType(YMDiagonalPosition, QueryBlock) && + (QueryBlock == E_BLOCK_REDSTONE_WIRE) ) { Callback(YMDiagonalPosition); -- cgit v1.2.3