From 090d8305e4e3c3ee085a897b72f2b4708e183eb8 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 5 Oct 2020 13:09:42 +0100 Subject: Warnings improvements * Turn off global-constructors warning. These are needed to implement cRoot signal handler functionality * Add Clang flags based on version lookup instead of a compile test. The CMake config process is single threaded and slow enough already * Reduced GetStackValue verbosity + Clarify EnchantmentLevel, StayCount, AlwaysTicked, ViewDistance signedness + Give SettingsRepositoryInterface a move constructor to simplify main.cpp code - Remove do {} while (false) construction in redstone handler --- .../IncrementalRedstoneSimulator/PressurePlateHandler.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Simulator/IncrementalRedstoneSimulator') diff --git a/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h b/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h index 46409b101..fb78b9b57 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h +++ b/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h @@ -12,7 +12,7 @@ namespace PressurePlateHandler { inline unsigned char GetPowerLevel(const cChunk & Chunk, const Vector3i Position, const BLOCKTYPE BlockType) { - Int64 NumberOfEntities = 0; + size_t NumberOfEntities = 0; bool FoundPlayer = false; Chunk.ForEachEntityInBox(cBoundingBox(Vector3d(0.5, 0, 0.5) + Position, 0.5, 0.5), [&](cEntity & Entity) @@ -24,7 +24,8 @@ namespace PressurePlateHandler if (Entity.IsPickup()) { - NumberOfEntities += static_cast(Entity).GetItem().m_ItemCount; + const auto & Pickup = static_cast(Entity); + NumberOfEntities += static_cast(Pickup.GetItem().m_ItemCount); return false; } NumberOfEntities++; @@ -35,11 +36,11 @@ namespace PressurePlateHandler { case E_BLOCK_STONE_PRESSURE_PLATE: { - return (FoundPlayer ? 15 : 0); + return FoundPlayer ? 15 : 0; } case E_BLOCK_WOODEN_PRESSURE_PLATE: { - return (NumberOfEntities > 0 ? 15 : 0); + return (NumberOfEntities != 0) ? 15 : 0; } case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE: { -- cgit v1.2.3