Static Code Analysis [Game] Project

Attached to this file you will find output of MSVC’s static code analysis on [game] project.

This was performed on rev 844453274676d82c4d72bc90f2d0931c9fa912ff

If anyone is looking for cleanups to do, or you want to find out why something might be working differently than intended, let the analysis log guide you.


Can you run this again and give the output? It’s been almost a year.


core: cppcheck, game project -

external libs: cppcheck, external projects -

Based on 4bc983d7b756d235477eef8b7529ca (master, 01/09/2012)

try to use pvs-studio for static code analysis.

It’s paid. Any free, open-source, alternative?

[game] Project - rev: d3c902915b66fd6fa4a498f00150863cac95e394 - by using pvs-studio

Paste: po9txgq9vqp

Except pvs-studio thinks too many comparisons are “odd”…

An odd precise comparison: a == b. It’s probably better to use a comparison with defined precision: fabs(A - /emoticons/default_cool.png < Epsilon

If both variables are of the same datatype then a simple comparison (==) isn’t odd at all. There’s no need to complicate it. Where you run into problems is if you’re comparing a float to an int.

Actually, comparing 2 floats with == is incredibly unreliable unless the said floats have been modified exactly same way (123456789.012345f * 2.0f / 2.0f won’t always be 123456789.012345f). Floats are not precise. Of course, if the comparasment is for static values like INVALID_HEIGHT, then it’s perfectly fine.


Right I knew that but does Trinity really need to be that precise? I haven’t seen any example of Trinity doing something unexpected because a float comparison failed.

If you allow me…

Full stop.

I’m sure we had/have crashes and misbehavior because of floats comparison.

It’s not a matter of precision, it’s a matter of working and correct code.

(same thing happens with doubles)

Precision huh… may i summon the memory of falling from the terrain?

So that’s why my Bear is half underground in Stormwind? I thought that was just bad maps / vmaps from the extractors /emoticons/default_smile.png

All three of them.