Dear Robert,
I started our first build of the 3.4 branch, and I got a number of compiler
warnings which are fixed by attached diff.
Apart from the casts that are made explicit, I added a virtual destructor
in the TextGlyph class. Since it has virtual functions, I think it should
have a virtual destructor as you cannot control what will happen in
inheriting implementations of the virtual functions, and you need to give
the developer of inheriting classes the freedom to implement a destructor.
Another solution would be to make all functions non-virtual.
This patch is also directly applicable in the trunk without modifications.
With this patch, I get a flawless compile of the code.
Cheers,
Kristofer
--
*Dr. Kristofer Tingdahl**Chief Executive Officer*
*______________________________*
*dGB Earth Sciences*Phone:+31 53 4315155Skype:dgbtingdahlE-mail:
[email protected]:dgbes.com & opendtect.org
*______________________________*
Index: include/osgText/Text
===================================================================
--- include/osgText/Text (revision 15027)
+++ include/osgText/Text (working copy)
@@ -318,6 +318,7 @@
GlyphQuads();
GlyphQuads(const GlyphQuads& gq);
+ virtual ~GlyphQuads() { }
void initGlyphQuads();
void initGPUBufferObjects();
Index: src/osg/Image.cpp
===================================================================
--- src/osg/Image.cpp (revision 15027)
+++ src/osg/Image.cpp (working copy)
@@ -1950,13 +1950,13 @@
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[1] *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;
}
}
Index: src/osgPlugins/3ds/ReaderWriter3DS.cpp
===================================================================
--- src/osgPlugins/3ds/ReaderWriter3DS.cpp (revision 15027)
+++ src/osgPlugins/3ds/ReaderWriter3DS.cpp (working copy)
@@ -1340,7 +1340,7 @@
// rebuild the texture with alpha channel (rescale according to
map amount)
for (int i=0, j=0; i<n; i+=4, j+=nc)
{
- img_data[i] = img_data[i+1] = img_data[i+2] = img_data[i+3] =
one_minus_factor + orig_img_data[j]*factor;
+ img_data[i] = img_data[i+1] = img_data[i+2] = img_data[i+3] =
(unsigned char)(one_minus_factor + orig_img_data[j]*factor);
}
osg_image->setImage(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());
Index: src/osgPlugins/lua/LuaScriptEngine.cpp
===================================================================
--- src/osgPlugins/lua/LuaScriptEngine.cpp (revision 15027)
+++ src/osgPlugins/lua/LuaScriptEngine.cpp (working copy)
@@ -140,7 +140,7 @@
osgDB::VectorBaseSerializer* vs =
dynamic_cast<osgDB::VectorBaseSerializer*>(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 @@
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 @@
{
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);
}
}
}
Index: src/osgViewer/ViewerEventHandlers.cpp
===================================================================
--- src/osgViewer/ViewerEventHandlers.cpp (revision 15027)
+++ src/osgViewer/ViewerEventHandlers.cpp (working copy)
@@ -721,8 +721,8 @@
if (!view) return false;
if (_fullscreen)
{
- x = ea.getX();
- y = ea.getY();
+ x = (int) ea.getX();
+ y = (int) ea.getY();
return true;
}
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org