[fixed]Bogus comparisons?

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
mdeininger
Posts: 12
Joined: Tue Feb 23, 2010 12:27 pm
Location: Tübingen, Germany
Contact:

[fixed]Bogus comparisons?

Post by mdeininger »

Hey all, I was going through some other things and noticed a few weird comparisons in some of the inline methods in the irrlicht headers.

In particular, my compiler is complaining about signed/unsigned comparison (also float vs. integer comparisons). In particular:

Code: Select all

SColor.h:
	inline void SColorHSL::fromRGB(const SColor &color)
the code is comparing u32 and f32 in lines 515, 517 and 519.

also:

Code: Select all

SVertexManipulator.h:
		void operator()(video::S3DVertex& vertex) const
line 70, which is this:

Code: Select all

			vertex.Color = (vertex.Color.getAverage()>Threshold)?High:Low;
.... although i'm not sure why the compiler's complaining here, comparing u8 to u32 is legit...

anyway, i'd resolve and patch it myself but i'm not even sure what the first batch is supposed to be doing so i'd better not... any advice here?

merry hacking,
Magnus

EDIT: this was irrlicht 1.7.1, and the compiler that i'm using is borland's. comparing floats and integers with different sizes still seems a bit odd either way...
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

OK, fixed fixed those. Thanks for reporting.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
mdeininger
Posts: 12
Joined: Tue Feb 23, 2010 12:27 pm
Location: Tübingen, Germany
Contact:

Post by mdeininger »

awesome, thanks :)
Post Reply