possible bug in void BulldozeConfirm::think()

Bug #914462 reported by David Allwicher on 2012-01-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
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?

David Allwicher (aber) wrote :

nha? :)

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.

>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
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) on 2012-01-12
Changed in widelands:
status: Fix Committed → Invalid
Hans Joachim Desserud (hjd) wrote :

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

Nasenbaer (nasenbaer) wrote :

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

Changed in widelands:
status: Invalid → Fix Committed
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  Edit
Everyone can see this information.

Other bug subscribers