From 107572262a1362e2cd4d19ba2828ac404875839f Mon Sep 17 00:00:00 2001 From: frosch Date: Thu, 17 Apr 2025 13:02:45 +0200 Subject: [PATCH] Codechange: Expand the single usage of the macro CLRBITS. --- src/core/bitmath_func.hpp | 12 ------------ src/road_cmd.cpp | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/core/bitmath_func.hpp b/src/core/bitmath_func.hpp index 01822301e7..4e9a2cd933 100644 --- a/src/core/bitmath_func.hpp +++ b/src/core/bitmath_func.hpp @@ -141,18 +141,6 @@ constexpr T ClrBit(T &x, const uint8_t y) return x = (T)(x & ~((T)1U << y)); } -/** - * Clears several bits in a variable. - * - * This macro clears several bits in a variable. The bits to clear are - * provided by a value. The new value is also returned. - * - * @param x The variable to clear some bits - * @param y The value with set bits for clearing them in the variable - * @return The new value of x - */ -#define CLRBITS(x, y) ((x) &= ~(y)) - /** * Toggles a bit in a variable. * diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 2d9a6d2de5..35cd09a614 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -540,7 +540,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlags flags, RoadBits pie static CommandCost CheckRoadSlope(Slope tileh, RoadBits *pieces, RoadBits existing, RoadBits other) { /* Remove already build pieces */ - CLRBITS(*pieces, existing); + *pieces &= ~existing; /* If we can't build anything stop here */ if (*pieces == ROAD_NONE) return CMD_ERROR;