possible bug in void BulldozeConfirm::think()

Bug #914462 reported by David Allwicher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Medium
Unassigned

Bug Description

src/wui/bulldozeconfirm:112

There is some rather strange code fragment:

        and (1 << Widelands::Building::PCap_Bulldoze)
<=> and (1 << 0)
<=> and (true)

maybe someone can explain this to me?

Revision history for this message
David Allwicher (aber) wrote :

nha? :)

Revision history for this message
Nicolai Hähnle (nha) wrote :

Should be bitwise and obviously, i.e. &. Some overzealous anti-& person replaced it incorrectly.

For the record, I oppose the use of the not, or, and and keywords (preferring !, ||, and &&), because the vast majority of the C++ using world sees it as more idiomatic.

Revision history for this message
SirVer (sirver) wrote : Re: [Bug 914462] Re: possible bug in void BulldozeConfirm::think()

>For the record, I oppose the use of the not, or, and and keywords
>(preferring !, ||, and &&), because the vast majority of the C++ using
>world sees it as more idiomatic.

Just to state another opinion: I personally find them easier to read and
the C++ community is notably slow to adapt new features in their
language, so I do not worry about this too much.
I agree that it is usually not worth replacing the && || and ! though,
for new code I feel everybody should suit his/herself.

  status triaged
  importance medium

Changed in widelands:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
David Allwicher (aber) wrote :

Sorry, I had not enough time to open my eyes an look properly. I was kinda confused, why someone would shift by zero.

Changed in widelands:
status: Triaged → Fix Committed
milestone: none → build17-rc1
Nasenbaer (nasenbaer)
Changed in widelands:
status: Fix Committed → Invalid
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Could you please elaborate why this was set to invalid? :)

Revision history for this message
Nasenbaer (nasenbaer) wrote :

Oh sorry, my fault... I must somehow mixed things up here... :)

Changed in widelands:
status: Invalid → Fix Committed
Revision history for this message
SirVer (sirver) wrote :

Released in build17-rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.