Merge pull request #1196 from Allofich/warnings

Fix MSVC warnings
coverity_scan^2
scrawl 8 years ago committed by GitHub
commit 4c4ec6b108

@ -155,7 +155,7 @@ namespace ESMTerrain
osg::ref_ptr<osg::Vec4Array> colours) osg::ref_ptr<osg::Vec4Array> colours)
{ {
// LOD level n means every 2^n-th vertex is kept // LOD level n means every 2^n-th vertex is kept
size_t increment = 1 << lodLevel; size_t increment = static_cast<size_t>(1) << lodLevel;
osg::Vec2f origin = center - osg::Vec2f(size/2.f, size/2.f); osg::Vec2f origin = center - osg::Vec2f(size/2.f, size/2.f);

@ -23,7 +23,7 @@ osg::ref_ptr<IndexArrayType> createIndexBuffer(unsigned int flags, unsigned int
bool anyDeltas = (lodDeltas[Terrain::North] || lodDeltas[Terrain::South] || lodDeltas[Terrain::West] || lodDeltas[Terrain::East]); bool anyDeltas = (lodDeltas[Terrain::North] || lodDeltas[Terrain::South] || lodDeltas[Terrain::West] || lodDeltas[Terrain::East]);
size_t increment = 1 << lodLevel; size_t increment = static_cast<size_t>(1) << lodLevel;
assert(increment < verts); assert(increment < verts);
osg::ref_ptr<IndexArrayType> indices (new IndexArrayType(osg::PrimitiveSet::TRIANGLES)); osg::ref_ptr<IndexArrayType> indices (new IndexArrayType(osg::PrimitiveSet::TRIANGLES));
@ -75,7 +75,7 @@ osg::ref_ptr<IndexArrayType> createIndexBuffer(unsigned int flags, unsigned int
// South // South
size_t row = 0; size_t row = 0;
size_t outerStep = 1 << (lodDeltas[Terrain::South] + lodLevel); size_t outerStep = static_cast<size_t>(1) << (lodDeltas[Terrain::South] + lodLevel);
for (size_t col = 0; col < verts-1; col += outerStep) for (size_t col = 0; col < verts-1; col += outerStep)
{ {
indices->push_back(verts*col+row); indices->push_back(verts*col+row);

@ -1 +0,0 @@
#include "storage.hpp"

@ -48,7 +48,7 @@ FILE* TiXmlFOpen( const char* filename, const char* mode )
memset(wname, 0, sizeof(*wname) * (len + 1)); memset(wname, 0, sizeof(*wname) * (len + 1));
wchar_t wmode[32] = { 0 }; wchar_t wmode[32] = { 0 };
MultiByteToWideChar(CP_UTF8, 0, filename, len, wname, len); MultiByteToWideChar(CP_UTF8, 0, filename, static_cast<int>(len), wname, static_cast<int>(len));
MultiByteToWideChar(CP_UTF8, 0, mode, -1, wmode, sizeof(wmode) / sizeof(*wmode)); MultiByteToWideChar(CP_UTF8, 0, mode, -1, wmode, sizeof(wmode) / sizeof(*wmode));
#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) #if defined(_MSC_VER) && (_MSC_VER >= 1400 )

Loading…
Cancel
Save