(svn r11482) -Codechange: Remove the doubled function ClrBitT and rename the remaining to fit with the naming style

This commit is contained in:
skidd13 2007-11-19 21:32:20 +00:00
parent 71c4325c50
commit 5c31a973a1
32 changed files with 93 additions and 98 deletions

View File

@ -573,7 +573,7 @@ CommandCost CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uin
* Now we change the setting to apply the new one and let the vehicle head for the same hangar. * Now we change the setting to apply the new one and let the vehicle head for the same hangar.
* Note: the if is (true for requesting service == true for ordered to stop in hangar) */ * Note: the if is (true for requesting service == true for ordered to stop in hangar) */
if (flags & DC_EXEC) { if (flags & DC_EXEC) {
CLRBIT(v->current_order.flags, OFB_PART_OF_ORDERS); ClrBit(v->current_order.flags, OFB_PART_OF_ORDERS);
TOGGLEBIT(v->current_order.flags, OFB_HALT_IN_DEPOT); TOGGLEBIT(v->current_order.flags, OFB_HALT_IN_DEPOT);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR); InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
} }

View File

@ -184,7 +184,7 @@ uint GetBridgeHeight(TileIndex tile);
static inline void ClearSingleBridgeMiddle(TileIndex t, Axis a) static inline void ClearSingleBridgeMiddle(TileIndex t, Axis a)
{ {
assert(MayHaveBridgeAbove(t)); assert(MayHaveBridgeAbove(t));
CLRBIT(_m[t].m6, 6 + a); ClrBit(_m[t].m6, 6 + a);
} }

View File

@ -310,7 +310,7 @@ void IConsoleSwitch()
case ICONSOLE_OPENED: case ICONSOLE_FULL: case ICONSOLE_OPENED: case ICONSOLE_FULL:
DeleteWindowById(WC_CONSOLE, 0); DeleteWindowById(WC_CONSOLE, 0);
_iconsole_mode = ICONSOLE_CLOSED; _iconsole_mode = ICONSOLE_CLOSED;
CLRBIT(_no_scroll, SCROLL_CON); ClrBit(_no_scroll, SCROLL_CON);
break; break;
} }

View File

@ -341,7 +341,7 @@ void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player)
/* Reset the ratings for the old player */ /* Reset the ratings for the old player */
t->ratings[old_player] = 500; t->ratings[old_player] = 500;
CLRBIT(t->have_ratings, old_player); ClrBit(t->have_ratings, old_player);
} }
{ {
@ -1425,7 +1425,7 @@ void VehiclePayment(Vehicle *front_v)
_current_player = front_v->owner; _current_player = front_v->owner;
/* At this moment loading cannot be finished */ /* At this moment loading cannot be finished */
CLRBIT(front_v->vehicle_flags, VF_LOADING_FINISHED); ClrBit(front_v->vehicle_flags, VF_LOADING_FINISHED);
/* Start unloading in at the first possible moment */ /* Start unloading in at the first possible moment */
front_v->load_unload_time_rem = 1; front_v->load_unload_time_rem = 1;
@ -1576,7 +1576,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
} else { } else {
/* The order changed while unloading (unset unload/transfer) or the /* The order changed while unloading (unset unload/transfer) or the
* station does not accept goods anymore. */ * station does not accept goods anymore. */
CLRBIT(v->vehicle_flags, VF_CARGO_UNLOADING); ClrBit(v->vehicle_flags, VF_CARGO_UNLOADING);
continue; continue;
} }
@ -1590,7 +1590,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
completely_empty = false; completely_empty = false;
} else { } else {
/* We have finished unloading (cargo count == 0) */ /* We have finished unloading (cargo count == 0) */
CLRBIT(v->vehicle_flags, VF_CARGO_UNLOADING); ClrBit(v->vehicle_flags, VF_CARGO_UNLOADING);
} }
continue; continue;

View File

@ -307,7 +307,7 @@ static void DrawCatenaryRailway(const TileInfo *ti)
/* Level means that the slope is the same, or the track is flat */ /* Level means that the slope is the same, or the track is flat */
if (tileh[TS_HOME] == tileh[TS_NEIGHBOUR] || (isflat[TS_HOME] && isflat[TS_NEIGHBOUR])) { if (tileh[TS_HOME] == tileh[TS_NEIGHBOUR] || (isflat[TS_HOME] && isflat[TS_NEIGHBOUR])) {
for (k = 0; k < NUM_IGNORE_GROUPS; k++) for (k = 0; k < NUM_IGNORE_GROUPS; k++)
if (PPPpreferred[i] == IgnoredPCP[k][tlg][i]) CLRBIT(PCPstatus, i); if (PPPpreferred[i] == IgnoredPCP[k][tlg][i]) ClrBit(PCPstatus, i);
} }
/* Now decide where we draw our pylons. First try the preferred PPPs, but they may not exist. /* Now decide where we draw our pylons. First try the preferred PPPs, but they may not exist.

View File

@ -375,7 +375,7 @@ static void LoadSpriteTables()
GRFConfig *master = CallocT<GRFConfig>(1); GRFConfig *master = CallocT<GRFConfig>(1);
master->filename = strdup(files->openttd.filename); master->filename = strdup(files->openttd.filename);
FillGRFDetails(master, false); FillGRFDetails(master, false);
ClrBitT(master->flags, GCF_INIT_ONLY); ClrBit(master->flags, GCF_INIT_ONLY);
master->next = top; master->next = top;
_grfconfig = master; _grfconfig = master;

View File

@ -149,11 +149,6 @@ template <typename Tenum_t> struct TinyEnumT
} }
}; };
template <typename T> void ClrBitT(T &t, int bit_index)
{
t = (T)(t & ~((T)1 << bit_index));
}
template <typename T> void SetBitT(T &t, int bit_index) template <typename T> void SetBitT(T &t, int bit_index)
{ {
t = (T)(t | ((T)1 << bit_index)); t = (T)(t | ((T)1 << bit_index));

View File

@ -263,9 +263,9 @@ template<typename T> static inline T SETBIT(T& x, const uint8 y)
* @param y The bit position to clear * @param y The bit position to clear
* @return The new value of the old value with the bit cleared * @return The new value of the old value with the bit cleared
*/ */
template<typename T> static inline T CLRBIT(T& x, const uint8 y) template<typename T> static inline T ClrBit(T& x, const uint8 y)
{ {
return x &= ~((T)1U << y); return x = (T)(x & ~((T)1U << y));
} }
/** /**

View File

@ -822,7 +822,7 @@ static void ToolbarTrainClick(Window *w)
int dis = -1; int dis = -1;
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {
if (v->type == VEH_TRAIN && IsFrontEngine(v)) CLRBIT(dis, v->owner); if (v->type == VEH_TRAIN && IsFrontEngine(v)) ClrBit(dis, v->owner);
} }
PopupMainPlayerToolbMenu(w, 13, dis); PopupMainPlayerToolbMenu(w, 13, dis);
} }
@ -833,7 +833,7 @@ static void ToolbarRoadClick(Window *w)
int dis = -1; int dis = -1;
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {
if (v->type == VEH_ROAD && IsRoadVehFront(v)) CLRBIT(dis, v->owner); if (v->type == VEH_ROAD && IsRoadVehFront(v)) ClrBit(dis, v->owner);
} }
PopupMainPlayerToolbMenu(w, 14, dis); PopupMainPlayerToolbMenu(w, 14, dis);
} }
@ -844,7 +844,7 @@ static void ToolbarShipClick(Window *w)
int dis = -1; int dis = -1;
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {
if (v->type == VEH_SHIP) CLRBIT(dis, v->owner); if (v->type == VEH_SHIP) ClrBit(dis, v->owner);
} }
PopupMainPlayerToolbMenu(w, 15, dis); PopupMainPlayerToolbMenu(w, 15, dis);
} }
@ -855,7 +855,7 @@ static void ToolbarAirClick(Window *w)
int dis = -1; int dis = -1;
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {
if (v->type == VEH_AIRCRAFT) CLRBIT(dis, v->owner); if (v->type == VEH_AIRCRAFT) ClrBit(dis, v->owner);
} }
PopupMainPlayerToolbMenu(w, 16, dis); PopupMainPlayerToolbMenu(w, 16, dis);
} }

View File

@ -1162,7 +1162,7 @@ static void QueryStringWndProc(Window *w, WindowEvent *e)
e.event = WE_ON_EDIT_TEXT_CANCEL; e.event = WE_ON_EDIT_TEXT_CANCEL;
parent->wndproc(parent, &e); parent->wndproc(parent, &e);
} }
CLRBIT(_no_scroll, SCROLL_EDIT); ClrBit(_no_scroll, SCROLL_EDIT);
break; break;
} }
} }
@ -1624,7 +1624,7 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e)
DoCommandP(0, 0, 0, NULL, CMD_PAUSE); DoCommandP(0, 0, 0, NULL, CMD_PAUSE);
} }
FiosFreeSavegameList(); FiosFreeSavegameList();
CLRBIT(_no_scroll, SCROLL_SAVE); ClrBit(_no_scroll, SCROLL_SAVE);
break; break;
case WE_RESIZE: { case WE_RESIZE: {
/* Widget 2 and 3 have to go with halve speed, make it so obiwan */ /* Widget 2 and 3 have to go with halve speed, make it so obiwan */

View File

@ -1738,7 +1738,7 @@ static void ChatWindowWndProc(Window *w, WindowEvent *e)
case WE_DESTROY: case WE_DESTROY:
SendWindowMessage(WC_NEWS_WINDOW, 0, WE_DESTROY, 0, 0); SendWindowMessage(WC_NEWS_WINDOW, 0, WE_DESTROY, 0, 0);
CLRBIT(_no_scroll, SCROLL_CHAT); ClrBit(_no_scroll, SCROLL_CHAT);
break; break;
} }
} }

View File

@ -949,7 +949,7 @@ static bool StationChangeInfo(uint stid, int numinfo, int prop, byte **bufp, int
dts->ground_pal = grf_load_word(&buf); dts->ground_pal = grf_load_word(&buf);
if (dts->ground_sprite == 0) continue; if (dts->ground_sprite == 0) continue;
if (HasBit(dts->ground_pal, 15)) { if (HasBit(dts->ground_pal, 15)) {
CLRBIT(dts->ground_pal, 15); ClrBit(dts->ground_pal, 15);
SETBIT(dts->ground_sprite, SPRITE_MODIFIER_USE_OFFSET); SETBIT(dts->ground_sprite, SPRITE_MODIFIER_USE_OFFSET);
} }
@ -972,16 +972,16 @@ static bool StationChangeInfo(uint stid, int numinfo, int prop, byte **bufp, int
/* Remap flags as ours collide */ /* Remap flags as ours collide */
if (HasBit(dtss->pal, 15)) { if (HasBit(dtss->pal, 15)) {
CLRBIT(dtss->pal, 15); ClrBit(dtss->pal, 15);
SETBIT(dtss->image, SPRITE_MODIFIER_USE_OFFSET); SETBIT(dtss->image, SPRITE_MODIFIER_USE_OFFSET);
} }
if (HasBit(dtss->image, 15)) { if (HasBit(dtss->image, 15)) {
CLRBIT(dtss->image, 15); ClrBit(dtss->image, 15);
SETBIT(dtss->image, PALETTE_MODIFIER_COLOR); SETBIT(dtss->image, PALETTE_MODIFIER_COLOR);
} }
if (HasBit(dtss->image, 14)) { if (HasBit(dtss->image, 14)) {
CLRBIT(dtss->image, 14); ClrBit(dtss->image, 14);
SETBIT(dtss->image, PALETTE_MODIFIER_TRANSPARENT); SETBIT(dtss->image, PALETTE_MODIFIER_TRANSPARENT);
} }
} }
@ -1180,7 +1180,7 @@ static bool BridgeChangeInfo(uint brid, int numinfo, int prop, byte **bufp, int
} }
/* Clear old color modifer bit */ /* Clear old color modifer bit */
CLRBIT(image, 15); ClrBit(image, 15);
bridge->sprite_table[tableid][sprite].sprite = image; bridge->sprite_table[tableid][sprite].sprite = image;
bridge->sprite_table[tableid][sprite].pal = pal; bridge->sprite_table[tableid][sprite].pal = pal;
@ -1574,7 +1574,7 @@ static bool CargoChangeInfo(uint cid, int numinfo, int prop, byte **bufp, int le
cs->grfid = _cur_grffile->grfid; cs->grfid = _cur_grffile->grfid;
SETBIT(_cargo_mask, cid + i); SETBIT(_cargo_mask, cid + i);
} else { } else {
CLRBIT(_cargo_mask, cid + i); ClrBit(_cargo_mask, cid + i);
} }
break; break;
@ -2583,15 +2583,15 @@ static void NewSpriteGroup(byte *buf, int len)
group->g.layout.dts->ground_pal = grf_load_word(&buf); group->g.layout.dts->ground_pal = grf_load_word(&buf);
/* Remap transparent/colour modifier bits */ /* Remap transparent/colour modifier bits */
if (HasBit(group->g.layout.dts->ground_sprite, 14)) { if (HasBit(group->g.layout.dts->ground_sprite, 14)) {
CLRBIT(group->g.layout.dts->ground_sprite, 14); ClrBit(group->g.layout.dts->ground_sprite, 14);
SETBIT(group->g.layout.dts->ground_sprite, PALETTE_MODIFIER_TRANSPARENT); SETBIT(group->g.layout.dts->ground_sprite, PALETTE_MODIFIER_TRANSPARENT);
} }
if (HasBit(group->g.layout.dts->ground_sprite, 15)) { if (HasBit(group->g.layout.dts->ground_sprite, 15)) {
CLRBIT(group->g.layout.dts->ground_sprite, 15); ClrBit(group->g.layout.dts->ground_sprite, 15);
SETBIT(group->g.layout.dts->ground_sprite, PALETTE_MODIFIER_COLOR); SETBIT(group->g.layout.dts->ground_sprite, PALETTE_MODIFIER_COLOR);
} }
if (HasBit(group->g.layout.dts->ground_pal, 14)) { if (HasBit(group->g.layout.dts->ground_pal, 14)) {
CLRBIT(group->g.layout.dts->ground_pal, 14); ClrBit(group->g.layout.dts->ground_pal, 14);
SETBIT(group->g.layout.dts->ground_sprite, SPRITE_MODIFIER_OPAQUE); SETBIT(group->g.layout.dts->ground_sprite, SPRITE_MODIFIER_OPAQUE);
} }
if (HasBit(group->g.layout.dts->ground_pal, 15)) { if (HasBit(group->g.layout.dts->ground_pal, 15)) {
@ -2599,7 +2599,7 @@ static void NewSpriteGroup(byte *buf, int len)
* last spriteset defined. */ * last spriteset defined. */
SpriteID sprite = _cur_grffile->spriteset_start + GB(group->g.layout.dts->ground_sprite, 0, 14) * sprites; SpriteID sprite = _cur_grffile->spriteset_start + GB(group->g.layout.dts->ground_sprite, 0, 14) * sprites;
SB(group->g.layout.dts->ground_sprite, 0, SPRITE_WIDTH, sprite); SB(group->g.layout.dts->ground_sprite, 0, SPRITE_WIDTH, sprite);
CLRBIT(group->g.layout.dts->ground_pal, 15); ClrBit(group->g.layout.dts->ground_pal, 15);
} }
group->g.layout.dts->seq = CallocT<DrawTileSeqStruct>(num_sprites + 1); group->g.layout.dts->seq = CallocT<DrawTileSeqStruct>(num_sprites + 1);
@ -2613,15 +2613,15 @@ static void NewSpriteGroup(byte *buf, int len)
seq->delta_y = grf_load_byte(&buf); seq->delta_y = grf_load_byte(&buf);
if (HasBit(seq->image, 14)) { if (HasBit(seq->image, 14)) {
CLRBIT(seq->image, 14); ClrBit(seq->image, 14);
SETBIT(seq->image, PALETTE_MODIFIER_TRANSPARENT); SETBIT(seq->image, PALETTE_MODIFIER_TRANSPARENT);
} }
if (HasBit(seq->image, 15)) { if (HasBit(seq->image, 15)) {
CLRBIT(seq->image, 15); ClrBit(seq->image, 15);
SETBIT(seq->image, PALETTE_MODIFIER_COLOR); SETBIT(seq->image, PALETTE_MODIFIER_COLOR);
} }
if (HasBit(seq->pal, 14)) { if (HasBit(seq->pal, 14)) {
CLRBIT(seq->pal, 14); ClrBit(seq->pal, 14);
SETBIT(seq->image, SPRITE_MODIFIER_OPAQUE); SETBIT(seq->image, SPRITE_MODIFIER_OPAQUE);
} }
if (HasBit(seq->pal, 15)) { if (HasBit(seq->pal, 15)) {
@ -2629,7 +2629,7 @@ static void NewSpriteGroup(byte *buf, int len)
* last spriteset defined. */ * last spriteset defined. */
SpriteID sprite = _cur_grffile->spriteset_start + GB(seq->image, 0, 14) * sprites; SpriteID sprite = _cur_grffile->spriteset_start + GB(seq->image, 0, 14) * sprites;
SB(seq->image, 0, SPRITE_WIDTH, sprite); SB(seq->image, 0, SPRITE_WIDTH, sprite);
CLRBIT(seq->pal, 15); ClrBit(seq->pal, 15);
} }
if (type > 0) { if (type > 0) {
@ -3115,7 +3115,7 @@ static void FeatureNewName(byte *buf, int len)
bool generic = HasBit(lang, 7); bool generic = HasBit(lang, 7);
uint16 id = generic ? grf_load_word(&buf) : grf_load_byte(&buf); uint16 id = generic ? grf_load_word(&buf) : grf_load_byte(&buf);
CLRBIT(lang, 7); ClrBit(lang, 7);
if (feature <= GSF_AIRCRAFT && id < _vehcounts[feature]) { if (feature <= GSF_AIRCRAFT && id < _vehcounts[feature]) {
id += _vehshifts[feature]; id += _vehshifts[feature];
@ -3257,7 +3257,7 @@ static void GraphicsNew(byte *buf, int len)
uint16 num = grf_load_extended(&buf); uint16 num = grf_load_extended(&buf);
uint16 skip_num = 0; uint16 skip_num = 0;
uint16 offset = HasBit(type, 7) ? grf_load_extended(&buf) : 0; uint16 offset = HasBit(type, 7) ? grf_load_extended(&buf) : 0;
CLRBIT(type, 7); // Clear the high bit as that only indicates whether there is an offset. ClrBit(type, 7); // Clear the high bit as that only indicates whether there is an offset.
switch (type) { switch (type) {
case 0x04: // Signal graphics case 0x04: // Signal graphics
@ -3874,7 +3874,7 @@ static void GRFLoadError(byte *buf, int len)
grfmsg(7, "GRFLoadError: Skipping non-fatal GRFLoadError in stage %d", _cur_stage); grfmsg(7, "GRFLoadError: Skipping non-fatal GRFLoadError in stage %d", _cur_stage);
return; return;
} }
CLRBIT(severity, 7); ClrBit(severity, 7);
if (severity >= lengthof(sevstr)) { if (severity >= lengthof(sevstr)) {
grfmsg(7, "GRFLoadError: Invalid severity id %d. Setting to 2 (non-fatal error).", severity); grfmsg(7, "GRFLoadError: Invalid severity id %d. Setting to 2 (non-fatal error).", severity);
@ -4371,7 +4371,7 @@ static void FeatureTownName(byte *buf, int len)
if (HasBit(id, 7)) { if (HasBit(id, 7)) {
/* Final definition */ /* Final definition */
CLRBIT(id, 7); ClrBit(id, 7);
bool new_scheme = _cur_grffile->grf_version >= 7; bool new_scheme = _cur_grffile->grf_version >= 7;
if (!check_length(len, 1, "FeatureTownName: lang_id")) return; if (!check_length(len, 1, "FeatureTownName: lang_id")) return;
@ -4380,7 +4380,7 @@ static void FeatureTownName(byte *buf, int len)
byte nb_gen = townname->nb_gen; byte nb_gen = townname->nb_gen;
do { do {
CLRBIT(lang, 7); ClrBit(lang, 7);
if (!check_length(len, 1, "FeatureTownName: style name")) return; if (!check_length(len, 1, "FeatureTownName: style name")) return;
const char *name = grf_load_string(&buf, len); const char *name = grf_load_string(&buf, len);
@ -5607,7 +5607,7 @@ void LoadNewGRF(uint load_index, uint file_index)
if (stage == GLS_RESERVE) { if (stage == GLS_RESERVE) {
SETBIT(c->flags, GCF_RESERVED); SETBIT(c->flags, GCF_RESERVED);
} else if (stage == GLS_ACTIVATION) { } else if (stage == GLS_ACTIVATION) {
CLRBIT(c->flags, GCF_RESERVED); ClrBit(c->flags, GCF_RESERVED);
ClearTemporaryNewGRFData(); ClearTemporaryNewGRFData();
BuildCargoTranslationMap(); BuildCargoTranslationMap();
DEBUG(sprite, 2, "LoadNewGRF: Currently %i sprites are loaded", _cur_spriteid); DEBUG(sprite, 2, "LoadNewGRF: Currently %i sprites are loaded", _cur_spriteid);

View File

@ -136,7 +136,7 @@ GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src, bool init_o
if (src->error->custom_message != NULL) c->error->custom_message = strdup(src->error->custom_message); if (src->error->custom_message != NULL) c->error->custom_message = strdup(src->error->custom_message);
} }
CLRBIT(c->flags, GCF_INIT_ONLY); ClrBit(c->flags, GCF_INIT_ONLY);
if (init_only) SETBIT(c->flags, GCF_INIT_ONLY); if (init_only) SETBIT(c->flags, GCF_INIT_ONLY);
*dst = c; *dst = c;

View File

@ -123,7 +123,7 @@ static inline void NPFSetFlag(AyStarNode* node, NPFNodeFlag flag, bool value)
if (value) if (value)
SETBIT(node->user_data[NPF_NODE_FLAGS], flag); SETBIT(node->user_data[NPF_NODE_FLAGS], flag);
else else
CLRBIT(node->user_data[NPF_NODE_FLAGS], flag); ClrBit(node->user_data[NPF_NODE_FLAGS], flag);
} }
#endif /* NPF_H */ #endif /* NPF_H */

View File

@ -333,7 +333,7 @@ static void FixOldVehicles()
if (v->type == VEH_ROAD && if (v->type == VEH_ROAD &&
v->u.road.state != RVSB_IN_DEPOT && v->u.road.state != RVSB_IN_DEPOT &&
v->u.road.state != RVSB_WORMHOLE) { v->u.road.state != RVSB_WORMHOLE) {
CLRBIT(v->u.road.state, RVS_IS_STOPPING); ClrBit(v->u.road.state, RVS_IS_STOPPING);
} }
FOR_ALL_VEHICLES_FROM(u, v->index + 1) { FOR_ALL_VEHICLES_FROM(u, v->index + 1) {

View File

@ -1536,8 +1536,8 @@ bool AfterLoadGame()
SB(_m[t].m2, 0, 4, tmp); SB(_m[t].m2, 0, 4, tmp);
} else if (HasBit(_m[t].m5, 2)) { } else if (HasBit(_m[t].m5, 2)) {
/* Split waypoint and depot rail type and remove the subtype. */ /* Split waypoint and depot rail type and remove the subtype. */
CLRBIT(_m[t].m5, 2); ClrBit(_m[t].m5, 2);
CLRBIT(_m[t].m5, 6); ClrBit(_m[t].m5, 6);
} }
break; break;
@ -1776,23 +1776,23 @@ bool AfterLoadGame()
/* move the signal variant back */ /* move the signal variant back */
SetSignalVariant(t, TRACK_X, HasBit(_m[t].m2, 3) ? SIG_SEMAPHORE : SIG_ELECTRIC); SetSignalVariant(t, TRACK_X, HasBit(_m[t].m2, 3) ? SIG_SEMAPHORE : SIG_ELECTRIC);
CLRBIT(_m[t].m2, 3); ClrBit(_m[t].m2, 3);
} }
/* Clear PBS reservation on track */ /* Clear PBS reservation on track */
if (!IsTileDepotType(t, TRANSPORT_RAIL)) { if (!IsTileDepotType(t, TRANSPORT_RAIL)) {
SB(_m[t].m4, 4, 4, 0); SB(_m[t].m4, 4, 4, 0);
} else { } else {
CLRBIT(_m[t].m3, 6); ClrBit(_m[t].m3, 6);
} }
break; break;
case MP_ROAD: /* Clear PBS reservation on crossing */ case MP_ROAD: /* Clear PBS reservation on crossing */
if (IsLevelCrossing(t)) CLRBIT(_m[t].m5, 0); if (IsLevelCrossing(t)) ClrBit(_m[t].m5, 0);
break; break;
case MP_STATION: /* Clear PBS reservation on station */ case MP_STATION: /* Clear PBS reservation on station */
CLRBIT(_m[t].m3, 6); ClrBit(_m[t].m3, 6);
break; break;
default: break; default: break;
@ -1939,11 +1939,11 @@ bool AfterLoadGame()
/* The "lift has destination" bit has been moved from /* The "lift has destination" bit has been moved from
* m5[7] to m7[0]. */ * m5[7] to m7[0]. */
SB(_me[t].m7, 0, 1, HasBit(_m[t].m5, 7)); SB(_me[t].m7, 0, 1, HasBit(_m[t].m5, 7));
CLRBIT(_m[t].m5, 7); ClrBit(_m[t].m5, 7);
/* The "lift is moving" bit has been removed, as it does /* The "lift is moving" bit has been removed, as it does
* the same job as the "lift has destination" bit. */ * the same job as the "lift has destination" bit. */
CLRBIT(_m[t].m1, 7); ClrBit(_m[t].m1, 7);
/* The position of the lift goes from m1[7..0] to m6[7..2], /* The position of the lift goes from m1[7..0] to m6[7..2],
* making m1 totally free, now. The lift position does not * making m1 totally free, now. The lift position does not
@ -2039,7 +2039,7 @@ bool AfterLoadGame()
CargoPacket *cp = *it; CargoPacket *cp = *it;
cp->paid_for = HasBit(v->vehicle_flags, 2); cp->paid_for = HasBit(v->vehicle_flags, 2);
} }
CLRBIT(v->vehicle_flags, 2); ClrBit(v->vehicle_flags, 2);
v->cargo.InvalidateCache(); v->cargo.InvalidateCache();
} }
} }
@ -2101,7 +2101,7 @@ bool AfterLoadGame()
/* The loading finished flag is *only* set when actually completely /* The loading finished flag is *only* set when actually completely
* finished. Because the vehicle is loading, it is not finished. */ * finished. Because the vehicle is loading, it is not finished. */
CLRBIT(v->vehicle_flags, VF_LOADING_FINISHED); ClrBit(v->vehicle_flags, VF_LOADING_FINISHED);
} }
} }
} else if (CheckSavegameVersion(59)) { } else if (CheckSavegameVersion(59)) {
@ -2136,7 +2136,7 @@ bool AfterLoadGame()
SetSignalStates(t, GB(_m[t].m2, 4, 4)); SetSignalStates(t, GB(_m[t].m2, 4, 4));
SetSignalVariant(t, INVALID_TRACK, GetSignalVariant(t, TRACK_X)); SetSignalVariant(t, INVALID_TRACK, GetSignalVariant(t, TRACK_X));
SetSignalType(t, INVALID_TRACK, GetSignalType(t, TRACK_X)); SetSignalType(t, INVALID_TRACK, GetSignalType(t, TRACK_X));
CLRBIT(_m[t].m2, 7); ClrBit(_m[t].m2, 7);
} }
} }
} }

View File

@ -686,11 +686,11 @@ CommandCost CmdModifyOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
switch (p2) { switch (p2) {
case OFB_FULL_LOAD: case OFB_FULL_LOAD:
TOGGLEBIT(order->flags, OFB_FULL_LOAD); TOGGLEBIT(order->flags, OFB_FULL_LOAD);
if (order->type != OT_GOTO_DEPOT) CLRBIT(order->flags, OFB_UNLOAD); if (order->type != OT_GOTO_DEPOT) ClrBit(order->flags, OFB_UNLOAD);
break; break;
case OFB_UNLOAD: case OFB_UNLOAD:
TOGGLEBIT(order->flags, OFB_UNLOAD); TOGGLEBIT(order->flags, OFB_UNLOAD);
CLRBIT(order->flags, OFB_FULL_LOAD); ClrBit(order->flags, OFB_FULL_LOAD);
break; break;
case OFB_NON_STOP: case OFB_NON_STOP:
TOGGLEBIT(order->flags, OFB_NON_STOP); TOGGLEBIT(order->flags, OFB_NON_STOP);

View File

@ -312,7 +312,7 @@ static inline Track RemoveFirstTrack(TrackBits *tracks)
{ {
if (*tracks != TRACK_BIT_NONE && *tracks != INVALID_TRACK_BIT) { if (*tracks != TRACK_BIT_NONE && *tracks != INVALID_TRACK_BIT) {
Track first = (Track)FIND_FIRST_BIT(*tracks); Track first = (Track)FIND_FIRST_BIT(*tracks);
ClrBitT(*tracks, first); ClrBit(*tracks, first);
return first; return first;
} }
return INVALID_TRACK; return INVALID_TRACK;
@ -336,7 +336,7 @@ static inline Trackdir RemoveFirstTrackdir(TrackdirBits *trackdirs)
{ {
if (*trackdirs != TRACKDIR_BIT_NONE && *trackdirs != INVALID_TRACKDIR_BIT) { if (*trackdirs != TRACKDIR_BIT_NONE && *trackdirs != INVALID_TRACKDIR_BIT) {
Trackdir first = (Trackdir)FindFirstBit2x64(*trackdirs); Trackdir first = (Trackdir)FindFirstBit2x64(*trackdirs);
ClrBitT(*trackdirs, first); ClrBit(*trackdirs, first);
return first; return first;
} }
return INVALID_TRACKDIR; return INVALID_TRACKDIR;

View File

@ -685,7 +685,7 @@ static CommandCost CmdRailTrackHelper(TileIndex tile, uint32 flags, uint32 p1, u
*/ */
CommandCost CmdBuildRailroadTrack(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) CommandCost CmdBuildRailroadTrack(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{ {
return CmdRailTrackHelper(tile, flags, p1, CLRBIT(p2, 7)); return CmdRailTrackHelper(tile, flags, p1, ClrBit(p2, 7));
} }
/** Build rail on a stretch of track. /** Build rail on a stretch of track.
@ -895,7 +895,7 @@ static bool CheckSignalAutoFill(TileIndex &tile, Trackdir &trackdir, int &signal
if (IsDiagonalTrackdir(trackdir)) { if (IsDiagonalTrackdir(trackdir)) {
signal_ctr++; signal_ctr++;
/* Ensure signal_ctr even so X and Y pieces get signals */ /* Ensure signal_ctr even so X and Y pieces get signals */
CLRBIT(signal_ctr, 0); ClrBit(signal_ctr, 0);
} }
return true; return true;

View File

@ -194,7 +194,7 @@ static inline TrackBits GetCrossingRailBits(TileIndex tile)
static inline void UnbarCrossing(TileIndex t) static inline void UnbarCrossing(TileIndex t)
{ {
assert(GetRoadTileType(t) == ROAD_TILE_CROSSING); assert(GetRoadTileType(t) == ROAD_TILE_CROSSING);
CLRBIT(_m[t].m4, 5); ClrBit(_m[t].m4, 5);
} }
static inline void BarCrossing(TileIndex t) static inline void BarCrossing(TileIndex t)

View File

@ -481,7 +481,7 @@ CommandCost CmdSendRoadVehToDepot(TileIndex tile, uint32 flags, uint32 p1, uint3
* Now we change the setting to apply the new one and let the vehicle head for the same depot. * Now we change the setting to apply the new one and let the vehicle head for the same depot.
* Note: the if is (true for requesting service == true for ordered to stop in depot) */ * Note: the if is (true for requesting service == true for ordered to stop in depot) */
if (flags & DC_EXEC) { if (flags & DC_EXEC) {
CLRBIT(v->current_order.flags, OFB_PART_OF_ORDERS); ClrBit(v->current_order.flags, OFB_PART_OF_ORDERS);
TOGGLEBIT(v->current_order.flags, OFB_HALT_IN_DEPOT); TOGGLEBIT(v->current_order.flags, OFB_HALT_IN_DEPOT);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR); InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
} }
@ -1657,7 +1657,7 @@ again:
* For drive-through stops, only do it if the vehicle stopped here */ * For drive-through stops, only do it if the vehicle stopped here */
if (IsStandardRoadStopTile(v->tile) || HasBit(v->u.road.state, RVS_IS_STOPPING)) { if (IsStandardRoadStopTile(v->tile) || HasBit(v->u.road.state, RVS_IS_STOPPING)) {
rs->FreeBay(HasBit(v->u.road.state, RVS_USING_SECOND_BAY)); rs->FreeBay(HasBit(v->u.road.state, RVS_USING_SECOND_BAY));
CLRBIT(v->u.road.state, RVS_IS_STOPPING); ClrBit(v->u.road.state, RVS_IS_STOPPING);
} }
if (IsStandardRoadStopTile(v->tile)) rs->SetEntranceBusy(false); if (IsStandardRoadStopTile(v->tile)) rs->SetEntranceBusy(false);
} }

View File

@ -1009,7 +1009,7 @@ CommandCost CmdSendShipToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p
* Now we change the setting to apply the new one and let the vehicle head for the same depot. * Now we change the setting to apply the new one and let the vehicle head for the same depot.
* Note: the if is (true for requesting service == true for ordered to stop in depot) */ * Note: the if is (true for requesting service == true for ordered to stop in depot) */
if (flags & DC_EXEC) { if (flags & DC_EXEC) {
CLRBIT(v->current_order.flags, OFB_PART_OF_ORDERS); ClrBit(v->current_order.flags, OFB_PART_OF_ORDERS);
TOGGLEBIT(v->current_order.flags, OFB_HALT_IN_DEPOT); TOGGLEBIT(v->current_order.flags, OFB_HALT_IN_DEPOT);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR); InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
} }

View File

@ -276,7 +276,7 @@ static void QuerySignEditWndProc(Window *w, WindowEvent *e)
break; break;
case WE_DESTROY: case WE_DESTROY:
CLRBIT(_no_scroll, SCROLL_EDIT); ClrBit(_no_scroll, SCROLL_EDIT);
break; break;
} }
} }

View File

@ -455,7 +455,7 @@ uint RoadStop::AllocateBay()
uint bay_nr = 0; uint bay_nr = 0;
while (!HasBit(status, bay_nr)) bay_nr++; while (!HasBit(status, bay_nr)) bay_nr++;
CLRBIT(status, bay_nr); ClrBit(status, bay_nr);
return bay_nr; return bay_nr;
} }
@ -466,7 +466,7 @@ uint RoadStop::AllocateBay()
void RoadStop::AllocateDriveThroughBay(uint nr) void RoadStop::AllocateDriveThroughBay(uint nr)
{ {
assert(nr < MAX_BAY_COUNT); assert(nr < MAX_BAY_COUNT);
CLRBIT(status, nr); ClrBit(status, nr);
} }
/** /**

View File

@ -262,7 +262,7 @@ static bool GenerateStationName(Station *st, TileIndex tile, int flag)
if (str <= 0x20) { if (str <= 0x20) {
if (str == M(STR_SV_STNAME_FOREST)) if (str == M(STR_SV_STNAME_FOREST))
str = M(STR_SV_STNAME_WOODS); str = M(STR_SV_STNAME_WOODS);
CLRBIT(free_names, str); ClrBit(free_names, str);
} }
} }
} }

View File

@ -122,7 +122,7 @@ CommandCost CmdAutofillTimetable(TileIndex tile, uint32 flags, uint32 p1, uint32
/* Start autofilling the timetable, which clears all the current /* Start autofilling the timetable, which clears all the current
* timings and clears the "timetable has started" bit. */ * timings and clears the "timetable has started" bit. */
SETBIT(v->vehicle_flags, VF_AUTOFILL_TIMETABLE); SETBIT(v->vehicle_flags, VF_AUTOFILL_TIMETABLE);
CLRBIT(v->vehicle_flags, VF_TIMETABLE_STARTED); ClrBit(v->vehicle_flags, VF_TIMETABLE_STARTED);
for (Order *order = GetVehicleOrder(v, 0); order != NULL; order = order->next) { for (Order *order = GetVehicleOrder(v, 0); order != NULL; order = order->next) {
order->wait_time = 0; order->wait_time = 0;
@ -132,7 +132,7 @@ CommandCost CmdAutofillTimetable(TileIndex tile, uint32 flags, uint32 p1, uint32
v->current_order.wait_time = 0; v->current_order.wait_time = 0;
v->current_order.travel_time = 0; v->current_order.travel_time = 0;
} else { } else {
CLRBIT(v->vehicle_flags, VF_AUTOFILL_TIMETABLE); ClrBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE);
} }
} }
@ -173,7 +173,7 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling)
} else if (v->cur_order_index == 0) { } else if (v->cur_order_index == 0) {
/* Otherwise if we're at the beginning and it already has a value, /* Otherwise if we're at the beginning and it already has a value,
* assume that autofill is finished and turn it off again. */ * assume that autofill is finished and turn it off again. */
CLRBIT(v->vehicle_flags, VF_AUTOFILL_TIMETABLE); ClrBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE);
} }
} }

View File

@ -1849,9 +1849,9 @@ void ClearTownHouse(Town *t, TileIndex tile)
/* Clear flags for houses that only may exist once/town. */ /* Clear flags for houses that only may exist once/town. */
if (hs->building_flags & BUILDING_IS_CHURCH) { if (hs->building_flags & BUILDING_IS_CHURCH) {
CLRBIT(t->flags12, TOWN_HAS_CHURCH); ClrBit(t->flags12, TOWN_HAS_CHURCH);
} else if (hs->building_flags & BUILDING_IS_STADIUM) { } else if (hs->building_flags & BUILDING_IS_STADIUM) {
CLRBIT(t->flags12, TOWN_HAS_STADIUM); ClrBit(t->flags12, TOWN_HAS_STADIUM);
} }
/* Do the actual clearing of tiles */ /* Do the actual clearing of tiles */
@ -2140,7 +2140,7 @@ static void UpdateTownGrowRate(Town *t)
} }
} }
CLRBIT(t->flags12, TOWN_IS_FUNDED); ClrBit(t->flags12, TOWN_IS_FUNDED);
if (_patches.town_growth_rate == 0 && t->fund_buildings_months == 0) return; if (_patches.town_growth_rate == 0 && t->fund_buildings_months == 0) return;
/** Towns are processed every TOWN_GROWTH_FREQUENCY ticks, and this is the /** Towns are processed every TOWN_GROWTH_FREQUENCY ticks, and this is the

View File

@ -50,7 +50,7 @@ static inline void SetFrontEngine(Vehicle *v)
static inline void ClearFrontEngine(Vehicle *v) static inline void ClearFrontEngine(Vehicle *v)
{ {
assert(v->type == VEH_TRAIN); assert(v->type == VEH_TRAIN);
CLRBIT(v->subtype, Train_Front); ClrBit(v->subtype, Train_Front);
} }
/** Check if a vehicle is an articulated part of an engine /** Check if a vehicle is an articulated part of an engine
@ -78,7 +78,7 @@ static inline void SetArticulatedPart(Vehicle *v)
static inline void ClearArticulatedPart(Vehicle *v) static inline void ClearArticulatedPart(Vehicle *v)
{ {
assert(v->type == VEH_TRAIN); assert(v->type == VEH_TRAIN);
CLRBIT(v->subtype, Train_Articulated_Part); ClrBit(v->subtype, Train_Articulated_Part);
} }
/** Check if a vehicle is a wagon /** Check if a vehicle is a wagon
@ -106,7 +106,7 @@ static inline void SetTrainWagon(Vehicle *v)
static inline void ClearTrainWagon(Vehicle *v) static inline void ClearTrainWagon(Vehicle *v)
{ {
assert(v->type == VEH_TRAIN); assert(v->type == VEH_TRAIN);
CLRBIT(v->subtype, Train_Wagon); ClrBit(v->subtype, Train_Wagon);
} }
/** Check if a vehicle is an engine (can be first in a train) /** Check if a vehicle is an engine (can be first in a train)
@ -134,7 +134,7 @@ static inline void SetTrainEngine(Vehicle *v)
static inline void ClearTrainEngine(Vehicle *v) static inline void ClearTrainEngine(Vehicle *v)
{ {
assert(v->type == VEH_TRAIN); assert(v->type == VEH_TRAIN);
CLRBIT(v->subtype, Train_Engine); ClrBit(v->subtype, Train_Engine);
} }
/** Check if a vehicle is a free wagon (got no engine in front of it) /** Check if a vehicle is a free wagon (got no engine in front of it)
@ -162,7 +162,7 @@ static inline void SetFreeWagon(Vehicle *v)
static inline void ClearFreeWagon(Vehicle *v) static inline void ClearFreeWagon(Vehicle *v)
{ {
assert(v->type == VEH_TRAIN); assert(v->type == VEH_TRAIN);
CLRBIT(v->subtype, Train_Free_Wagon); ClrBit(v->subtype, Train_Free_Wagon);
} }
/** Check if a vehicle is a multiheaded engine /** Check if a vehicle is a multiheaded engine
@ -190,7 +190,7 @@ static inline void SetMultiheaded(Vehicle *v)
static inline void ClearMultiheaded(Vehicle *v) static inline void ClearMultiheaded(Vehicle *v)
{ {
assert(v->type == VEH_TRAIN); assert(v->type == VEH_TRAIN);
CLRBIT(v->subtype, Train_Multiheaded); ClrBit(v->subtype, Train_Multiheaded);
} }
/** Check if an engine has an articulated part. /** Check if an engine has an articulated part.

View File

@ -208,7 +208,7 @@ void TrainConsistChanged(Vehicle* v)
/* wagon is powered */ /* wagon is powered */
SETBIT(u->u.rail.flags, VRF_POWEREDWAGON); // cache 'powered' status SETBIT(u->u.rail.flags, VRF_POWEREDWAGON); // cache 'powered' status
} else { } else {
CLRBIT(u->u.rail.flags, VRF_POWEREDWAGON); ClrBit(u->u.rail.flags, VRF_POWEREDWAGON);
} }
/* Do not count powered wagons for the compatible railtypes, as wagons always /* Do not count powered wagons for the compatible railtypes, as wagons always
@ -1458,10 +1458,10 @@ static void SwapTrainFlags(byte *swap_flag1, byte *swap_flag2)
byte flag2 = *swap_flag2; byte flag2 = *swap_flag2;
/* Clear the flags */ /* Clear the flags */
CLRBIT(*swap_flag1, VRF_GOINGUP); ClrBit(*swap_flag1, VRF_GOINGUP);
CLRBIT(*swap_flag1, VRF_GOINGDOWN); ClrBit(*swap_flag1, VRF_GOINGDOWN);
CLRBIT(*swap_flag2, VRF_GOINGUP); ClrBit(*swap_flag2, VRF_GOINGUP);
CLRBIT(*swap_flag2, VRF_GOINGDOWN); ClrBit(*swap_flag2, VRF_GOINGDOWN);
/* Reverse the rail-flags (if needed) */ /* Reverse the rail-flags (if needed) */
if (HasBit(flag1, VRF_GOINGUP)) { if (HasBit(flag1, VRF_GOINGUP)) {
@ -1620,7 +1620,7 @@ static void ReverseTrainDirection(Vehicle *v)
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
} }
CLRBIT(v->u.rail.flags, VRF_REVERSING); ClrBit(v->u.rail.flags, VRF_REVERSING);
} }
/** Reverse train. /** Reverse train.
@ -1907,7 +1907,7 @@ CommandCost CmdSendTrainToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32
* Now we change the setting to apply the new one and let the vehicle head for the same depot. * Now we change the setting to apply the new one and let the vehicle head for the same depot.
* Note: the if is (true for requesting service == true for ordered to stop in depot) */ * Note: the if is (true for requesting service == true for ordered to stop in depot) */
if (flags & DC_EXEC) { if (flags & DC_EXEC) {
CLRBIT(v->current_order.flags, OFB_PART_OF_ORDERS); ClrBit(v->current_order.flags, OFB_PART_OF_ORDERS);
TOGGLEBIT(v->current_order.flags, OFB_HALT_IN_DEPOT); TOGGLEBIT(v->current_order.flags, OFB_HALT_IN_DEPOT);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR); InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
} }
@ -2277,7 +2277,7 @@ static Track ChooseTrainTrack(Vehicle* v, TileIndex tile, DiagDirection enterdir
/* route found, is the train marked with "path not found" flag? */ /* route found, is the train marked with "path not found" flag? */
if (HasBit(v->u.rail.flags, VRF_NO_PATH_TO_DESTINATION)) { if (HasBit(v->u.rail.flags, VRF_NO_PATH_TO_DESTINATION)) {
/* clear the flag as the PF's problem was solved */ /* clear the flag as the PF's problem was solved */
CLRBIT(v->u.rail.flags, VRF_NO_PATH_TO_DESTINATION); ClrBit(v->u.rail.flags, VRF_NO_PATH_TO_DESTINATION);
/* can we also delete the "News" item somehow? */ /* can we also delete the "News" item somehow? */
} }
} }
@ -2553,8 +2553,8 @@ static byte AfterSetTrainPos(Vehicle *v, bool new_tile)
v->z_pos = GetSlopeZ(v->x_pos, v->y_pos); v->z_pos = GetSlopeZ(v->x_pos, v->y_pos);
if (new_tile) { if (new_tile) {
CLRBIT(v->u.rail.flags, VRF_GOINGUP); ClrBit(v->u.rail.flags, VRF_GOINGUP);
CLRBIT(v->u.rail.flags, VRF_GOINGDOWN); ClrBit(v->u.rail.flags, VRF_GOINGDOWN);
if (v->u.rail.track == TRACK_BIT_X || v->u.rail.track == TRACK_BIT_Y) { if (v->u.rail.track == TRACK_BIT_X || v->u.rail.track == TRACK_BIT_Y) {
/* Any track that isn't TRACK_BIT_X or TRACK_BIT_Y cannot be sloped. /* Any track that isn't TRACK_BIT_X or TRACK_BIT_Y cannot be sloped.
@ -3538,7 +3538,7 @@ void ConvertOldMultiheadToNew()
BEGIN_ENUM_WAGONS(u) { BEGIN_ENUM_WAGONS(u) {
const RailVehicleInfo *rvi = RailVehInfo(u->engine_type); const RailVehicleInfo *rvi = RailVehInfo(u->engine_type);
CLRBIT(u->subtype, 7); ClrBit(u->subtype, 7);
switch (u->subtype) { switch (u->subtype) {
case 0: /* TS_Front_Engine */ case 0: /* TS_Front_Engine */
if (rvi->railveh_type == RAILVEH_MULTIHEAD) SetMultiheaded(u); if (rvi->railveh_type == RAILVEH_MULTIHEAD) SetMultiheaded(u);

View File

@ -1485,8 +1485,8 @@ static uint32 VehicleEnter_TunnelBridge(Vehicle *v, TileIndex tile, int x, int y
} }
if (v->type == VEH_TRAIN) { if (v->type == VEH_TRAIN) {
v->u.rail.track = TRACK_BIT_WORMHOLE; v->u.rail.track = TRACK_BIT_WORMHOLE;
CLRBIT(v->u.rail.flags, VRF_GOINGUP); ClrBit(v->u.rail.flags, VRF_GOINGUP);
CLRBIT(v->u.rail.flags, VRF_GOINGDOWN); ClrBit(v->u.rail.flags, VRF_GOINGDOWN);
} else { } else {
v->u.road.state = RVSB_WORMHOLE; v->u.road.state = RVSB_WORMHOLE;
} }

View File

@ -218,7 +218,7 @@ static CommandCost ClearTile_Unmovable(TileIndex tile, byte flags)
if (IsStatue(tile)) { if (IsStatue(tile)) {
TownID town = GetStatueTownID(tile); TownID town = GetStatueTownID(tile);
CLRBIT(GetTown(town)->statues, _current_player); ClrBit(GetTown(town)->statues, _current_player);
InvalidateWindow(WC_TOWN_AUTHORITY, town); InvalidateWindow(WC_TOWN_AUTHORITY, town);
} }

View File

@ -163,7 +163,7 @@ void InitViewports()
void DeleteWindowViewport(Window *w) void DeleteWindowViewport(Window *w)
{ {
CLRBIT(_active_viewports, w->viewport - _viewports); ClrBit(_active_viewports, w->viewport - _viewports);
w->viewport->width = 0; w->viewport->width = 0;
w->viewport = NULL; w->viewport = NULL;
} }