Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

NogginBoink

Compiler warning I don't understand

This topic is 5310 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I can't understand why the compiler doesn't like this statement:
void CBox::SetDebugState(DWORD newState)
{
	m_CBOX_DRAW_WIREFRAME = ((newState || CBOX_DRAW_WIREFRAME) > 0);
}
  
I just want to set m_CBOX_DRAW_WIREFRAME to true or false, depending on the bitmask flags in newState. Logically, the expression makes sense to me, but the compiler warns: c:\path\cbox.cpp(307) : warning C4804: '>' : unsafe use of type 'bool' in operation What's that warning mean and how do I fix it? [edited by - NogginBoink on January 4, 2004 12:39:45 PM]

Share this post


Link to post
Share on other sites
Advertisement
DOH!

Never mind. I was using logical-or (||) instead of bitwise-or (|).

Changing to bitwise or (which is what I had intended to begin with) solved the problem.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!