1
0
Fork 0

Codechange: Expand the single usage of the macro CLRBITS.

pull/14031/head
frosch 2025-04-17 13:02:45 +02:00 committed by frosch
parent d97936e77a
commit 7cbf4f5560
2 changed files with 1 additions and 13 deletions

View File

@ -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.
*

View File

@ -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;