From: Torsten Dreyer Date: Thu, 18 Nov 2010 11:08:16 +0000 (+0100) Subject: Purge some gcc and MSVC warnings X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=49f038b9d1ff61943d044d01632c33a31ac6840c;p=simgear.git Purge some gcc and MSVC warnings --- diff --git a/simgear/scene/material/Effect.cxx b/simgear/scene/material/Effect.cxx index d3344b58..e605f9f6 100644 --- a/simgear/scene/material/Effect.cxx +++ b/simgear/scene/material/Effect.cxx @@ -279,7 +279,7 @@ struct ColorMaskBuilder : PassAttributeBuilder ColorMask *mask = new ColorMask; Vec4 m = getColor(realProp); - mask->setMask(m.r(), m.g(), m.b(), m.a()); + mask->setMask(m.r() > 0.0, m.g() > 0.0, m.b() > 0.0, m.a() > 0.0); pass->setAttributeAndModes(mask); } }; diff --git a/simgear/scene/material/mipmap.cxx b/simgear/scene/material/mipmap.cxx index a64784b4..b3ddd02d 100644 --- a/simgear/scene/material/mipmap.cxx +++ b/simgear/scene/material/mipmap.cxx @@ -209,6 +209,7 @@ osg::Vec4::value_type computeComponent( int c, osg::Vec4 colors[2][2][2], bool c case PRODUCT: return computeProduct( c, colors, colorValid ); case MIN: return computeMin( c, colors, colorValid ); case MAX: return computeMax( c, colors, colorValid ); + default: break; } return 0; } @@ -230,7 +231,7 @@ osg::Vec4 computeColor( osg::Vec4 colors[2][2][2], bool colorValid[2][2][2], Mip void dumpMipmap( std::string n, int s, int t, int r, int c, unsigned char *d, const osg::Image::MipmapDataType &o ) { std::ofstream ofs( (n + ".dump").c_str() ); - for ( int i = 0; i < o.size()+1; ++i ) + for ( osg::Image::MipmapDataType::size_type i = 0; i < o.size()+1; ++i ) { ofs << s << " " << t << " " << r << std::endl; unsigned int offset = 0;