www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Yet another slap on the hand by implicit bool to int conversions

Andrej Mitrovic Wrote:

 if (mmioRead(hmmio, cast(LPSTR)&drum, DRUM.sizeof) != DRUM.sizeof)

How would you catch this bug: if (mmioRead(hmmio, cast(LPSTR)&iFormat, DRUM.sizeof) != DRUM.sizeof) If you didn't notice what you converted the code to, you probably forgot what's going on in this code. It has not that many braces to get lost in them.
Jun 20 2011