Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler warning fixes for Visual Studio 2010 #571

Merged
merged 4 commits into from
Nov 15, 2017

Conversation

SNiLD
Copy link
Contributor

@SNiLD SNiLD commented Nov 15, 2017

No description provided.

#ifndef OGRE_HAS_CXX11_EXPLICIT_CONVERSION_OPERATORS
# pragma warning ( push )
# pragma warning ( disable: 4800 )
#endif
return (bool)mDataStream;
Copy link
Member

@paroj paroj Nov 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think mDataStream != 0 would be a better fix instead of using the pragmas and associated compiler checks for fixing C4800.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I'll try this.

@@ -66,7 +66,11 @@ namespace Ogre

bool TerrainLodManager::isOpen() const
{
#ifndef OGRE_HAS_CXX11_EXPLICIT_CONVERSION_OPERATORS
return mDataStream != 0;
Copy link
Member

@paroj paroj Nov 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, this should have been mDataStream.get() != 0; as SharedPtr lacks a != operator for ptr. Also you can drop the ifdefs as this method will also work with OGRE_HAS_CXX11_EXPLICIT_CONVERSION_OPERATORS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll change it. I wonder why it compiled without warnings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I drop the new OGRE_HAS_CXX11_EXPLICIT_CONVERSION_OPERATORS define as well since it's no longer needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@@ -361,6 +361,10 @@ namespace Ogre {
*/
virtual ResourcePtr getByHandle(ResourceHandle handle);

#ifndef OGRE_HAS_CXX11_EXPLICIT_CONVERSION_OPERATORS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you missed this part

@paroj paroj merged commit 11492da into OGRECave:master Nov 15, 2017
@SNiLD SNiLD deleted the vs2010-compiler-warnings branch November 16, 2017 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants