Re: [GD-Windows] forcing value to bool 'true' or 'false' (performance warning)
Brought to you by:
vexxed72
From: Rich <leg...@xm...> - 2002-04-23 01:04:21
|
In article <000901c1ea5a$ca4377e0$dc56533e@aurora>, =?iso-8859-1?Q?Ignacio_Casta=F1o?= <cas...@ya...> writes: > does somebody knows why msvc complains about a performance warning when > converting an integer into a bool value? Is there really any performance > hit? Well, the compiler will generate code to convert an int (4 bytes) to a bool (usually 1 byte), whether or not it matters for performance is dubious. You can eliminate the warning by doing 'bool p = i ? true : false;' -- Ask me about my upcoming book on Direct3D from Addison-Wesley! Direct3D Book <http://www.xmission.com/~legalize/book/> izfree: Open source tools for Windows Installer <http://izfree.sourceforge.net> |