From 97a7fcc110f3cbb2b304952c80047e4eaef059e1 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 17 Oct 2022 13:58:22 +0200 Subject: [PATCH] Consistently use literal suffix in upper-case --- .../engines/opengl/OpenGLDrawingEngine.cpp | 2 +- src/openrct2/Game.h | 2 +- src/openrct2/core/BitSet.hpp | 16 ++--- src/openrct2/drawing/Drawing.String.cpp | 2 +- src/openrct2/drawing/Drawing.h | 2 +- src/openrct2/entity/Guest.cpp | 2 +- src/openrct2/entity/Peep.h | 2 +- src/openrct2/entity/Staff.cpp | 2 +- src/openrct2/interface/Widget.h | 2 +- src/openrct2/localisation/Formatting.h | 2 +- src/openrct2/management/Award.cpp | 2 +- src/openrct2/object/WallObject.cpp | 2 +- .../paint/tile_element/Paint.TileElement.h | 4 +- src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/ride/Ride.cpp | 2 +- src/openrct2/ride/TrackDesign.h | 4 +- src/openrct2/ride/Vehicle.cpp | 4 +- src/openrct2/ride/VehicleEntry.h | 2 +- src/openrct2/util/Util.cpp | 4 +- src/openrct2/world/Park.cpp | 2 +- src/openrct2/world/Park.h | 2 +- test/tests/BitSetTests.cpp | 62 +++++++++---------- test/tests/Pathfinding.cpp | 4 +- 23 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index e2880c11d8..e0826ed368 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -804,7 +804,7 @@ void OpenGLDrawingContext::DrawSpriteSolid(rct_drawpixelinfo* dpi, const ImageId { CalculcateClipping(dpi); - assert((colour & 0xFF) > 0u); + assert((colour & 0xFF) > 0U); auto g1Element = gfx_get_g1_element(image); if (g1Element == nullptr) diff --git a/src/openrct2/Game.h b/src/openrct2/Game.h index 3634a63a53..c82a90f36e 100644 --- a/src/openrct2/Game.h +++ b/src/openrct2/Game.h @@ -116,7 +116,7 @@ enum : uint32_t GAME_COMMAND_FLAG_NO_SPEND = (1 << 5), // Game command is not networked GAME_COMMAND_FLAG_GHOST = (1 << 6), // Game command is not networked GAME_COMMAND_FLAG_TRACK_DESIGN = (1 << 7), - GAME_COMMAND_FLAG_NETWORKED = (1u << 31) // Game command is coming from network + GAME_COMMAND_FLAG_NETWORKED = (1U << 31) // Game command is coming from network }; enum diff --git a/src/openrct2/core/BitSet.hpp b/src/openrct2/core/BitSet.hpp index 3c6df5c753..3f8b11f971 100644 --- a/src/openrct2/core/BitSet.hpp +++ b/src/openrct2/core/BitSet.hpp @@ -27,7 +27,7 @@ namespace OpenRCT2 template static constexpr size_t ByteAlignBits() { const auto reminder = TNumBits % BitsPerByte; - if constexpr (reminder == 0u) + if constexpr (reminder == 0U) { return TNumBits; } @@ -57,10 +57,10 @@ namespace OpenRCT2 else { const auto numBytes = numBits / BitsPerByte; - auto mask = 1u; + auto mask = 1U; while (mask < numBytes) { - mask <<= 1u; + mask <<= 1U; } return mask; } @@ -93,11 +93,11 @@ namespace OpenRCT2 { size_t res = 0; auto x = static_cast>(val); - while (x > 0u) + while (x > 0U) { - if (x & 1u) + if (x & 1U) res++; - x >>= 1u; + x >>= 1U; } return res; } @@ -142,8 +142,8 @@ namespace OpenRCT2 static constexpr size_t BlockCount = Detail::BitSet::ComputeBlockCount(); static constexpr size_t CapacityBits = BlockCount * BlockBitSize; - static constexpr StorageBlockType BlockValueZero = StorageBlockType{ 0u }; - static constexpr StorageBlockType BlockValueOne = StorageBlockType{ 1u }; + static constexpr StorageBlockType BlockValueZero = StorageBlockType{ 0U }; + static constexpr StorageBlockType BlockValueOne = StorageBlockType{ 1U }; static constexpr StorageBlockType BlockValueMask = static_cast(~BlockValueZero); static constexpr bool RequiresTrim = TBitSize != CapacityBits; diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index cd23bdf4c3..8116ac0c66 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -37,7 +37,7 @@ enum : uint32_t TEXT_DRAW_FLAG_NO_FORMATTING = 1 << 28, TEXT_DRAW_FLAG_Y_OFFSET_EFFECT = 1 << 29, TEXT_DRAW_FLAG_TTF = 1 << 30, - TEXT_DRAW_FLAG_NO_DRAW = 1u << 31 + TEXT_DRAW_FLAG_NO_DRAW = 1U << 31 }; static int32_t ttf_get_string_width(std::string_view text, FontStyle fontStyle, bool noFormatting); diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 40e97a5633..9385a28265 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -159,7 +159,7 @@ enum : uint32_t IMAGE_TYPE_DEFAULT = 0, IMAGE_TYPE_REMAP = (1 << 29), IMAGE_TYPE_TRANSPARENT = (1 << 30), - IMAGE_TYPE_REMAP_2_PLUS = (1u << 31) + IMAGE_TYPE_REMAP_2_PLUS = (1U << 31) // REMAP_2_PLUS + REMAP = REMAP 2 // REMAP_2_PLUS = REMAP 3 }; diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 3524229d64..1881389f6d 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -2839,7 +2839,7 @@ static void peep_update_ride_nausea_growth(Guest* peep, Ride* ride) uint32_t nauseaGrowthRateChange = (ride->nausea * nauseaMultiplier) / 512; nauseaGrowthRateChange *= std::max(static_cast(128), peep->Hunger) / 64; nauseaGrowthRateChange >>= (EnumValue(peep->NauseaTolerance) & 3); - peep->NauseaTarget = static_cast(std::min(peep->NauseaTarget + nauseaGrowthRateChange, 255u)); + peep->NauseaTarget = static_cast(std::min(peep->NauseaTarget + nauseaGrowthRateChange, 255U)); } static bool peep_should_go_on_ride_again(Guest* peep, Ride* ride) diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index 82ce44c184..7cb514dfe9 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -228,7 +228,7 @@ enum PeepFlags : uint32_t PEEP_FLAGS_INTAMIN_DEPRECATED = (1 << 27), // Used to make the peep think "I'm so excited - It's an Intamin ride!" while // riding on a Intamin ride. PEEP_FLAGS_HERE_WE_ARE = (1 << 28), // Makes the peep think "...and here we are on X!" while riding a ride - PEEP_FLAGS_TWITCH_DEPRECATED = (1u << 31), // Formerly used for twitch integration + PEEP_FLAGS_TWITCH_DEPRECATED = (1U << 31), // Formerly used for twitch integration }; enum PeepNextFlags diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index f42827ba58..d24da82ca7 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -154,7 +154,7 @@ bool Staff::CanIgnoreWideFlag(const CoordsXYZ& staffPos, TileElement* path) cons total++; /* Check if path has an edge in adjac_dir */ - if (!(path->AsPath()->GetEdges() & (1u << adjac_dir))) + if (!(path->AsPath()->GetEdges() & (1U << adjac_dir))) { continue; } diff --git a/src/openrct2/interface/Widget.h b/src/openrct2/interface/Widget.h index d75b5e96ef..b44b89f67e 100644 --- a/src/openrct2/interface/Widget.h +++ b/src/openrct2/interface/Widget.h @@ -41,7 +41,7 @@ enum class WindowWidgetType : uint8_t }; constexpr const auto WIDGETS_END = rct_widget{ WindowWidgetType::Last, 0, 0, 0, 0, 0, 0, 0 }; -#define BAR_BLINK (1u << 31) +#define BAR_BLINK (1U << 31) enum { diff --git a/src/openrct2/localisation/Formatting.h b/src/openrct2/localisation/Formatting.h index 4f986fd9ea..bea625562d 100644 --- a/src/openrct2/localisation/Formatting.h +++ b/src/openrct2/localisation/Formatting.h @@ -33,7 +33,7 @@ namespace OpenRCT2 uint32_t _capacity; TTraits _traits; - static constexpr uint32_t FlagLocalStorage = (1u << 31); + static constexpr uint32_t FlagLocalStorage = (1U << 31); public: explicit FormatBufferBase() diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index 1c4e694aca..0631bfd5b9 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -630,7 +630,7 @@ void award_update_all() if (award_is_deserved(awardType, activeAwardTypes)) { // Add award - _currentAwards.push_back(Award{ 5u, awardType }); + _currentAwards.push_back(Award{ 5U, awardType }); if (gConfigNotifications.ParkAward) { News::AddItemToQueue(News::ItemType::Award, AwardNewsStrings[EnumValue(awardType)], 0, {}); diff --git a/src/openrct2/object/WallObject.cpp b/src/openrct2/object/WallObject.cpp index 7e5310aaec..8016fbfd3e 100644 --- a/src/openrct2/object/WallObject.cpp +++ b/src/openrct2/object/WallObject.cpp @@ -48,7 +48,7 @@ void WallObject::ReadLegacy(IReadObjectContext* context, OpenRCT2::IStream* stre if (identifier == "XXWLBR03") { _legacyType.flags2 &= ~WALL_SCENERY_2_DOOR_SOUND_MASK; - _legacyType.flags2 |= (1u << WALL_SCENERY_2_DOOR_SOUND_SHIFT) & WALL_SCENERY_2_DOOR_SOUND_MASK; + _legacyType.flags2 |= (1U << WALL_SCENERY_2_DOOR_SOUND_SHIFT) & WALL_SCENERY_2_DOOR_SOUND_MASK; } } diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.h b/src/openrct2/paint/tile_element/Paint.TileElement.h index 74be5ecbe0..9fd99f05ff 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.h +++ b/src/openrct2/paint/tile_element/Paint.TileElement.h @@ -73,8 +73,8 @@ enum namespace PaintSessionFlags { - constexpr uint8_t PassedSurface = 1u << 0; - constexpr uint8_t IsTrackPiecePreview = 1u << 1; + constexpr uint8_t PassedSurface = 1U << 0; + constexpr uint8_t IsTrackPiecePreview = 1U << 1; } // namespace PaintSessionFlags extern const int32_t SEGMENTS_ALL; diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index de777a633e..2c3ba1fe38 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -2277,7 +2277,7 @@ enum : uint32_t { S6_SAVE_FLAG_EXPORT = 1 << 0, S6_SAVE_FLAG_SCENARIO = 1 << 1, - S6_SAVE_FLAG_AUTOMATIC = 1u << 31, + S6_SAVE_FLAG_AUTOMATIC = 1U << 31, }; int32_t scenario_save(u8string_view path, int32_t flags) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 9edb0875a2..dcc9b5de8f 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -136,7 +136,7 @@ size_t RideManager::size() const RideManager::Iterator RideManager::begin() { const auto endIndex = static_cast(_rides.size()); - return RideManager::Iterator(*this, 0u, endIndex); + return RideManager::Iterator(*this, 0U, endIndex); } RideManager::Iterator RideManager::end() diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index 416f935a66..379a7b077d 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -169,13 +169,13 @@ enum : uint32_t TRACK_FLAGS_CONTAINS_WATER_SPLASH = (1 << 27), TRACK_FLAGS_CONTAINS_BARREL_ROLL = (1 << 29), TRACK_FLAGS_CONTAINS_POWERED_LIFT = (1 << 30), - TRACK_FLAGS_CONTAINS_LARGE_HALF_LOOP = (1u << 31), + TRACK_FLAGS_CONTAINS_LARGE_HALF_LOOP = (1U << 31), }; enum : uint32_t { TRACK_FLAGS2_CONTAINS_LOG_FLUME_REVERSER = (1 << 1), - TRACK_FLAGS2_SIX_FLAGS_RIDE_DEPRECATED = (1u << 31) // Not used anymore. + TRACK_FLAGS2_SIX_FLAGS_RIDE_DEPRECATED = (1U << 31) // Not used anymore. }; enum diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 94612068d6..af4ddc5744 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -2959,7 +2959,7 @@ static void test_finish(Ride& ride) totalTime += rideStations[i].SegmentTime; } - totalTime = std::max(totalTime, 1u); + totalTime = std::max(totalTime, 1U); ride.average_speed = ride.average_speed / totalTime; window_invalidate_by_number(WindowClass::Ride, ride.id.ToUnderlying()); } @@ -6800,7 +6800,7 @@ void Vehicle::UpdateAdditionalAnimation() UpdateAnimationAnimalFlying(); // makes animation play faster with vehicle speed targetFrame = abs(_vehicleVelocityF64E08) >> 24; - animationState = std::max(animationState - targetFrame, 0u); + animationState = std::max(animationState - targetFrame, 0U); break; } } diff --git a/src/openrct2/ride/VehicleEntry.h b/src/openrct2/ride/VehicleEntry.h index 678df1d7ac..993574d8df 100644 --- a/src/openrct2/ride/VehicleEntry.h +++ b/src/openrct2/ride/VehicleEntry.h @@ -70,7 +70,7 @@ enum : uint32_t CAR_ENTRY_FLAG_CHAIRLIFT = 1 << 28, CAR_ENTRY_FLAG_WATER_RIDE = 1 << 29, // Set on rides where water would provide continuous propulsion. CAR_ENTRY_FLAG_GO_KART = 1 << 30, - CAR_ENTRY_FLAG_DODGEM_CAR_PLACEMENT = 1u << 31, + CAR_ENTRY_FLAG_DODGEM_CAR_PLACEMENT = 1U << 31, }; enum : uint32_t diff --git a/src/openrct2/util/Util.cpp b/src/openrct2/util/Util.cpp index 9cd38de948..26d6af80c8 100644 --- a/src/openrct2/util/Util.cpp +++ b/src/openrct2/util/Util.cpp @@ -66,7 +66,7 @@ int32_t bitscanforward(int32_t source) // any intrinsic. // cf. https://github.com/OpenRCT2/OpenRCT2/pull/2093 for (int32_t i = 0; i < 32; i++) - if (source & (1u << i)) + if (source & (1U << i)) return i; return -1; @@ -88,7 +88,7 @@ int32_t bitscanforward(int64_t source) // any intrinsic. // cf. https://github.com/OpenRCT2/OpenRCT2/pull/2093 for (int32_t i = 0; i < 64; i++) - if (source & (1ull << i)) + if (source & (1ULL << i)) return i; return -1; diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 21a919e9ce..9f6157a6c2 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -403,7 +403,7 @@ int32_t Park::CalculateParkRating() const result -= 500; if (gNumGuestsInPark > 0) { - result += 2 * std::min(250u, (happyGuestCount * 300) / gNumGuestsInPark); + result += 2 * std::min(250U, (happyGuestCount * 300) / gNumGuestsInPark); } // Up to 25 guests can be lost without affecting the park rating. diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index b1cf23dd24..fe7761c3d9 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -40,7 +40,7 @@ enum : uint32_t PARK_FLAGS_NO_MONEY_SCENARIO = (1 << 17), // Deprecated, originally used in scenario editor PARK_FLAGS_SPRITES_INITIALISED = (1 << 18), // After a scenario is loaded this prevents edits in the scenario editor PARK_FLAGS_SIX_FLAGS_DEPRECATED = (1 << 19), // Not used anymore - PARK_FLAGS_UNLOCK_ALL_PRICES = (1u << 31), // OpenRCT2 only! + PARK_FLAGS_UNLOCK_ALL_PRICES = (1U << 31), // OpenRCT2 only! }; struct Guest; diff --git a/test/tests/BitSetTests.cpp b/test/tests/BitSetTests.cpp index 157c422914..c6dc4cabcb 100644 --- a/test/tests/BitSetTests.cpp +++ b/test/tests/BitSetTests.cpp @@ -14,14 +14,14 @@ using namespace OpenRCT2; TEST(BitTest, test_index_construction) { - BitSet<64u> bits({ 0u, 2u, 4u, 6u, 8u, 10u }); + BitSet<64U> bits({ 0U, 2U, 4U, 6U, 8U, 10U }); #if defined(_M_X64) || defined(_M_ARM64) static_assert(std::is_same_v); #else static_assert(std::is_same_v); #endif constexpr auto size = sizeof(bits); - static_assert(size == 8u); + static_assert(size == 8U); ASSERT_EQ(bits.data()[0], 0b10101010101U); ASSERT_EQ(bits.to_string(), std::string("0000000000000000000000000000000000000000000000000000010101010101")); @@ -29,7 +29,7 @@ TEST(BitTest, test_index_construction) TEST(BitTest, test_basic) { - BitSet<8u> bits; + BitSet<8U> bits; static_assert(std::is_same_v); constexpr auto size = sizeof(bits); static_assert(size == sizeof(uint8_t)); @@ -42,26 +42,26 @@ TEST(BitTest, test_basic) ASSERT_EQ(bits[0], false); bits[0] = bits[6]; ASSERT_EQ(bits[0], true); - ASSERT_EQ(bits.data()[0u], 0b01000001U); + ASSERT_EQ(bits.data()[0U], 0b01000001U); ASSERT_EQ(bits.to_string(), std::string("01000001")); } TEST(BitTest, test_flip) { - BitSet<8u> bits; + BitSet<8U> bits; static_assert(std::is_same_v); constexpr auto size = sizeof(bits); static_assert(size == sizeof(uint8_t)); bits.flip(); - ASSERT_EQ(bits.data()[0u], 0xFFu); + ASSERT_EQ(bits.data()[0U], 0xFFu); bits.flip(); - ASSERT_EQ(bits.data()[0u], 0x00u); + ASSERT_EQ(bits.data()[0U], 0x00u); } TEST(BitTest, test_trim8) { - BitSet<5u> bits; + BitSet<5U> bits; static_assert(std::is_same_v); constexpr auto size = sizeof(bits); static_assert(size == sizeof(uint8_t)); @@ -70,12 +70,12 @@ TEST(BitTest, test_trim8) ASSERT_EQ(bits[5], false); ASSERT_EQ(bits[6], false); ASSERT_EQ(bits[7], false); - ASSERT_EQ(bits.data()[0u], 0b00011111u); + ASSERT_EQ(bits.data()[0U], 0b00011111u); } TEST(BitTest, test_trim16) { - BitSet<14u> bits; + BitSet<14U> bits; static_assert(std::is_same_v); constexpr auto size = sizeof(bits); static_assert(size == sizeof(uint16_t)); @@ -83,15 +83,15 @@ TEST(BitTest, test_trim16) bits.flip(); ASSERT_EQ(bits[14], false); ASSERT_EQ(bits[15], false); - ASSERT_EQ(bits.data()[0u], 0b0011111111111111u); + ASSERT_EQ(bits.data()[0U], 0b0011111111111111u); ASSERT_EQ(bits.to_string(), std::string("11111111111111")); } TEST(BitTest, test_big) { - BitSet<256u> bits; + BitSet<256U> bits; constexpr auto size = sizeof(bits); - static_assert(size == 32u); + static_assert(size == 32U); bits.flip(); #if defined(_M_X64) || defined(_M_ARM64) @@ -117,8 +117,8 @@ TEST(BitTest, test_big) TEST(BitTest, test_xor5) { - BitSet<5u> bits1({ 0u, 2u, 4u }); - BitSet<5u> bits2({ 0u, 1u, 3u }); + BitSet<5U> bits1({ 0U, 2U, 4U }); + BitSet<5U> bits2({ 0U, 1U, 3U }); auto res = bits1 ^ bits2; ASSERT_EQ(res.data()[0], 0b11110u); @@ -127,8 +127,8 @@ TEST(BitTest, test_xor5) TEST(BitTest, test_xor15) { - BitSet<15u> bits1({ 0u, 2u, 4u }); - BitSet<15u> bits2({ 0u, 1u, 3u, 14u }); + BitSet<15U> bits1({ 0U, 2U, 4U }); + BitSet<15U> bits2({ 0U, 1U, 3U, 14U }); auto res = bits1 ^ bits2; ASSERT_EQ(res.data()[0], 0b0100000000011110u); @@ -137,8 +137,8 @@ TEST(BitTest, test_xor15) TEST(BitTest, test_or5) { - BitSet<5u> bits1({ 0u, 2u, 4u }); - BitSet<5u> bits2({ 0u, 1u, 3u }); + BitSet<5U> bits1({ 0U, 2U, 4U }); + BitSet<5U> bits2({ 0U, 1U, 3U }); auto res = bits1 | bits2; ASSERT_EQ(res.data()[0], 0b11111); @@ -147,8 +147,8 @@ TEST(BitTest, test_or5) TEST(BitTest, test_or15) { - BitSet<15u> bits1({ 0u, 2u, 4u }); - BitSet<15u> bits2({ 0u, 1u, 3u, 14u }); + BitSet<15U> bits1({ 0U, 2U, 4U }); + BitSet<15U> bits2({ 0U, 1U, 3U, 14U }); auto res = bits1 | bits2; ASSERT_EQ(res.data()[0], 0b0100000000011111u); @@ -157,8 +157,8 @@ TEST(BitTest, test_or15) TEST(BitTest, test_and5) { - BitSet<5u> bits1({ 0u, 2u, 4u }); - BitSet<5u> bits2({ 0u, 1u, 3u }); + BitSet<5U> bits1({ 0U, 2U, 4U }); + BitSet<5U> bits2({ 0U, 1U, 3U }); auto res = bits1 & bits2; ASSERT_EQ(res.data()[0], 0b1); @@ -167,8 +167,8 @@ TEST(BitTest, test_and5) TEST(BitTest, test_and15) { - BitSet<15u> bits1({ 0u, 2u, 4u }); - BitSet<15u> bits2({ 0u, 1u, 3u, 14u }); + BitSet<15U> bits1({ 0U, 2U, 4U }); + BitSet<15U> bits2({ 0U, 1U, 3U, 14U }); auto res = bits1 & bits2; ASSERT_EQ(res.data()[0], 0b1); @@ -177,7 +177,7 @@ TEST(BitTest, test_and15) TEST(BitTest, test_neg5) { - BitSet<5u> bits1({ 0u, 2u, 4u }); + BitSet<5U> bits1({ 0U, 2U, 4U }); auto res = ~bits1; ASSERT_EQ(res.data()[0], 0b01010u); @@ -186,7 +186,7 @@ TEST(BitTest, test_neg5) TEST(BitTest, test_neg15) { - BitSet<15u> bits1({ 0u, 2u, 4u }); + BitSet<15U> bits1({ 0U, 2U, 4U }); auto res = ~bits1; ASSERT_EQ(res.data()[0], 0b111111111101010u); @@ -195,13 +195,13 @@ TEST(BitTest, test_neg15) TEST(BitTest, test_count) { - BitSet<31u> bits1({ 0u, 2u, 4u, 7u, 9u, 12u, 16u, 19u, 22u, 29u }); - ASSERT_EQ(bits1.count(), 10u); + BitSet<31U> bits1({ 0U, 2U, 4U, 7U, 9U, 12U, 16U, 19U, 22U, 29U }); + ASSERT_EQ(bits1.count(), 10U); } TEST(BitTest, test_iterator) { - BitSet<31u> bits1({ 0u, 2u, 4u, 7u, 9u, 12u, 16u, 19u, 22u, 29u }); + BitSet<31U> bits1({ 0U, 2U, 4U, 7U, 9U, 12U, 16U, 19U, 22U, 29U }); int totalBits = 0; for (auto v : bits1) @@ -214,7 +214,7 @@ TEST(BitTest, test_iterator) TEST(BitTest, test_iterator_const) { - BitSet<31u> bits1({ 0u, 2u, 4u, 7u, 9u, 12u, 16u, 19u, 22u, 29u }); + BitSet<31U> bits1({ 0U, 2U, 4U, 7U, 9U, 12U, 16U, 19U, 22U, 29U }); int totalBits = 0; auto test = [&](const auto& b) { diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index 814589626f..fa0ed10c1c 100644 --- a/test/tests/Pathfinding.cpp +++ b/test/tests/Pathfinding.cpp @@ -136,7 +136,7 @@ protected: static ::testing::AssertionResult AssertIsStartPosition(const char*, const TileCoordsXYZ& location) { - const uint32_t expectedSurfaceStyle = 11u; + const uint32_t expectedSurfaceStyle = 11U; const uint32_t style = MapGetSurfaceElementAt(location.ToCoordsXYZ())->GetSurfaceStyle(); if (style != expectedSurfaceStyle) @@ -150,7 +150,7 @@ protected: static ::testing::AssertionResult AssertIsNotForbiddenPosition(const char*, const TileCoordsXYZ& location) { - const uint32_t forbiddenSurfaceStyle = 8u; + const uint32_t forbiddenSurfaceStyle = 8U; const uint32_t style = MapGetSurfaceElementAt(location.ToCoordsXYZ())->GetSurfaceStyle();