From 1fe7aa056b41bcf27d6c98f019a9f22d4fa026c4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 31 Jul 2015 10:54:13 +0000 Subject: [PATCH] From Kristofer Tingdahl, warning fixes. git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15030 16af8721-9629-0410-8352-f15c8da7e697 --- src/osg/Image.cpp | 14 +++++++------- src/osgPlugins/3ds/ReaderWriter3DS.cpp | 2 +- src/osgPlugins/lua/LuaScriptEngine.cpp | 6 +++--- src/osgViewer/ViewerEventHandlers.cpp | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/osg/Image.cpp b/src/osg/Image.cpp index 315955853..4fe84746e 100644 --- a/src/osg/Image.cpp +++ b/src/osg/Image.cpp @@ -1950,13 +1950,13 @@ void _writeColor(GLenum pixelFormat, T* data, float scale, const Vec4& c) switch(pixelFormat) { case(GL_DEPTH_COMPONENT): //intentionally fall through and execute the code for GL_LUMINANCE - case(GL_LUMINANCE): { (*data++) = c[0] * scale; } break; - case(GL_ALPHA): { (*data++) = c[3] * scale; } break; - case(GL_LUMINANCE_ALPHA): { (*data++) = c[0] * scale; (*data++) = c[3] * scale; } break; - case(GL_RGB): { (*data++) = c[0] *scale; (*data++) = c[1] *scale; (*data++) = c[2] *scale;} break; - case(GL_RGBA): { (*data++) = c[0] *scale; (*data++) = c[1] *scale; (*data++) = c[2] *scale; (*data++) = c[3] *scale;} break; - case(GL_BGR): { (*data++) = c[2] *scale; (*data++) = c[1] *scale; (*data++) = c[0] *scale;} break; - case(GL_BGRA): { (*data++) = c[2] *scale; (*data++) = c[1] *scale; (*data++) = c[0] *scale; (*data++) = c[3] *scale;} break; + case(GL_LUMINANCE): { (*data++) = (T)(c[0] * scale); } break; + case(GL_ALPHA): { (*data++) = (T)(c[3] * scale); } break; + case(GL_LUMINANCE_ALPHA): { (*data++) = (T)(c[0] * scale); (*data++) = (T)(c[3] * scale); } break; + case(GL_RGB): { (*data++) = (T)(c[0] *scale); (*data++) = (T)(c[1] *scale); (*data++) = (T)(c[2] *scale);} break; + case(GL_RGBA): { (*data++) = (T)(c[0] *scale); (*data++) = (T)(c[1] *scale); (*data++) = (T)(c[2] *scale); (*data++) = (T)(c[3] *scale);} break; + case(GL_BGR): { (*data++) = (T)(c[2] *scale); (*data++) = (T)(c[1] *scale); (*data++) = (T)(c[0] *scale);} break; + case(GL_BGRA): { (*data++) = (T)(c[2] *scale); (*data++) = (T)(c[1] *scale); (*data++) = (T)(c[0] *scale); (*data++) = (T)(c[3] *scale);} break; } } diff --git a/src/osgPlugins/3ds/ReaderWriter3DS.cpp b/src/osgPlugins/3ds/ReaderWriter3DS.cpp index 71867d8ed..3149a7ca4 100644 --- a/src/osgPlugins/3ds/ReaderWriter3DS.cpp +++ b/src/osgPlugins/3ds/ReaderWriter3DS.cpp @@ -1340,7 +1340,7 @@ ReaderWriter3DS::StateSetInfo ReaderWriter3DS::ReaderObject::createStateSet(Lib3 // rebuild the texture with alpha channel (rescale according to map amount) for (int i=0, j=0; isetImage(osg_image->s(),osg_image->t(),osg_image->r(), GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, img_data, osg::Image::USE_NEW_DELETE); opacity_map->setImage(osg_image.get()); diff --git a/src/osgPlugins/lua/LuaScriptEngine.cpp b/src/osgPlugins/lua/LuaScriptEngine.cpp index 916fe03f4..36e8e8da6 100644 --- a/src/osgPlugins/lua/LuaScriptEngine.cpp +++ b/src/osgPlugins/lua/LuaScriptEngine.cpp @@ -140,7 +140,7 @@ static int getContainerProperty(lua_State * _lua) osgDB::VectorBaseSerializer* vs = dynamic_cast(bs); if (vs) { - const void* dataPtr = vs->getElement(*object, index); + const void* dataPtr = vs->getElement(*object, (unsigned int) index); if (dataPtr) { SerializerScratchPad valuesp(vs->getElementType(), dataPtr, vs->getElementSize()); @@ -191,7 +191,7 @@ static int setContainerProperty(lua_State* _lua) SerializerScratchPad ssp; lse->getDataFromStack(&ssp, vs->getElementType(), 3); { - vs->setElement(*object, index, ssp.data); + vs->setElement(*object, (unsigned int) index, ssp.data); } } return 0; @@ -3808,7 +3808,7 @@ void LuaScriptEngine::pushValue(const osg::Matrixf& value) const { for(unsigned int c=0; c<4; ++c) { - lua_pushnumber(_lua, r*4+c); lua_pushinteger(_lua, value(r,c)); lua_settable(_lua, -3); + lua_pushnumber(_lua, r*4+c); lua_pushinteger(_lua, (lua_Integer) value(r,c)); lua_settable(_lua, -3); } } } diff --git a/src/osgViewer/ViewerEventHandlers.cpp b/src/osgViewer/ViewerEventHandlers.cpp index 9159788bc..41e02e1bc 100644 --- a/src/osgViewer/ViewerEventHandlers.cpp +++ b/src/osgViewer/ViewerEventHandlers.cpp @@ -721,8 +721,8 @@ bool InteractiveImageHandler::mousePosition(osgViewer::View* view, osg::NodeVisi if (!view) return false; if (_fullscreen) { - x = ea.getX(); - y = ea.getY(); + x = (int) ea.getX(); + y = (int) ea.getY(); return true; }