Warning fixes

This commit is contained in:
Robert Osfield
2013-11-22 10:27:20 +00:00
parent 4ca088dcf9
commit 63bd3be9cd
3 changed files with 18 additions and 18 deletions

View File

@@ -908,10 +908,11 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
for (j = 0; j < newwidth; j++) {
for (k = 0; k < components; k++) {
/* need to cast to double to hold large unsigned ints */
s[0] = ((double)*(const GLuint*)t +
(double)*(const GLuint*)(t+group_size) +
(double)*(const GLuint*)(t+ysize) +
(double)*(const GLuint*)(t+ysize+group_size))/4 + 0.5;
GLdouble buf = (double)*(const GLuint*)t +
(double)*(const GLuint*)(t+group_size) +
(double)*(const GLuint*)(t+ysize) +
(double)*(const GLuint*)(t+ysize+group_size);
s[0] = (GLuint)(buf/4.0 + 0.5);
s++; t += element_size;
}
@@ -925,12 +926,11 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
for (j = 0; j < newwidth; j++) {
for (k = 0; k < components; k++) {
/* need to cast to double to hold large unsigned ints */
GLdouble buf;
buf = (GLdouble)__GLU_SWAP_4_BYTES(t) +
(GLdouble)__GLU_SWAP_4_BYTES(t+group_size) +
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize) +
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size);
s[0] = (GLuint)(buf/4 + 0.5);
GLdouble buf = (GLdouble)__GLU_SWAP_4_BYTES(t) +
(GLdouble)__GLU_SWAP_4_BYTES(t+group_size) +
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize) +
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size);
s[0] = (GLuint)(buf/4.0 + 0.5);
s++; t += element_size;
}

View File

@@ -401,14 +401,14 @@ void DebugShadowMap::ViewData::init( ThisClass *st, osgUtil::CullVisitor *cv )
{
// view can be a slave that covers only a fraction of the screen
// so adjust debug hud location to proper viewport location
_viewportOrigin[0] += vp->x();
_viewportOrigin[1] += vp->y();
_viewportOrigin[0] += static_cast<unsigned short>(vp->x());
_viewportOrigin[1] += static_cast<unsigned short>(vp->y());
if( _viewportSize[0] > vp->width() - _viewportOrigin[0] )
_viewportSize[0] = vp->width() - _viewportOrigin[0];
if( _viewportSize[0] > (static_cast<unsigned short>(vp->width()) - _viewportOrigin[0]) )
_viewportSize[0] = static_cast<unsigned short>(vp->width()) - _viewportOrigin[0];
if( _viewportSize[1] > vp->height() - _viewportOrigin[1] )
_viewportSize[1] = vp->height() - _viewportOrigin[1];
if( _viewportSize[1] > (static_cast<unsigned short>(vp->height()) - _viewportOrigin[1]) )
_viewportSize[1] = static_cast<unsigned short>(vp->height()) - _viewportOrigin[1];
}
_orthoSize = st->_orthoSize;

View File

@@ -712,14 +712,14 @@ InteractiveImageHandler::InteractiveImageHandler(osg::Image* image, osg::Texture
double width = _camera->getViewport()->width();
double height = _camera->getViewport()->height();
resize(width, height);
resize(static_cast<int>(width), static_cast<int>(height));
}
}
bool InteractiveImageHandler::mousePosition(osgViewer::View* view, osg::NodeVisitor* nv, const osgGA::GUIEventAdapter& ea, int& x, int &y) const
{
if (!view) return false;
osgUtil::LineSegmentIntersector::Intersections intersections;
bool foundIntersection = (nv==0) ? view->computeIntersections(ea, intersections) :
view->computeIntersections(ea, nv->getNodePath(), intersections);