mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Expand the single usage of the macro CLRBITS.
parent
d97936e77a
commit
7cbf4f5560
|
@ -141,18 +141,6 @@ constexpr T ClrBit(T &x, const uint8_t y)
|
||||||
return x = (T)(x & ~((T)1U << 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.
|
* Toggles a bit in a variable.
|
||||||
*
|
*
|
||||||
|
|
|
@ -540,7 +540,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlags flags, RoadBits pie
|
||||||
static CommandCost CheckRoadSlope(Slope tileh, RoadBits *pieces, RoadBits existing, RoadBits other)
|
static CommandCost CheckRoadSlope(Slope tileh, RoadBits *pieces, RoadBits existing, RoadBits other)
|
||||||
{
|
{
|
||||||
/* Remove already build pieces */
|
/* Remove already build pieces */
|
||||||
CLRBITS(*pieces, existing);
|
*pieces &= ~existing;
|
||||||
|
|
||||||
/* If we can't build anything stop here */
|
/* If we can't build anything stop here */
|
||||||
if (*pieces == ROAD_NONE) return CMD_ERROR;
|
if (*pieces == ROAD_NONE) return CMD_ERROR;
|
||||||
|
|
Loading…
Reference in New Issue