From 4b5e4904acfddd0ee8c308bb457cb71fbadffc65 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 18 Apr 2002 10:38:58 +0000 Subject: [PATCH] Fixed VisualStudio .NET warnings in TXP plugin. --- src/osgPlugins/txp/trpage_geom.cpp | 32 +++++++++++++------------- src/osgPlugins/txp/trpage_readbuf.cpp | 2 +- src/osgPlugins/txp/trpage_warchive.cpp | 4 ++-- src/osgPlugins/txp/trpage_writebuf.cpp | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/osgPlugins/txp/trpage_geom.cpp b/src/osgPlugins/txp/trpage_geom.cpp index 1ff1d479b..37faa7bda 100644 --- a/src/osgPlugins/txp/trpage_geom.cpp +++ b/src/osgPlugins/txp/trpage_geom.cpp @@ -144,9 +144,9 @@ void trpgGeometry::SetVertices(int num,const float64 *data) void trpgGeometry::AddVertex(DataType type,trpg3dPoint &pt) { if (type == FloatData) { - vertDataFloat.push_back(pt.x); - vertDataFloat.push_back(pt.y); - vertDataFloat.push_back(pt.z); + vertDataFloat.push_back(static_cast(pt.x)); + vertDataFloat.push_back(static_cast(pt.y)); + vertDataFloat.push_back(static_cast(pt.z)); } else { vertDataDouble.push_back(pt.x); vertDataDouble.push_back(pt.y); @@ -178,9 +178,9 @@ void trpgGeometry::SetNormals(int num,BindType bind,const float64 *data) void trpgGeometry::AddNormal(DataType type,trpg3dPoint &pt) { if (type == FloatData) { - normDataFloat.push_back(pt.x); - normDataFloat.push_back(pt.y); - normDataFloat.push_back(pt.z); + normDataFloat.push_back(static_cast(pt.x)); + normDataFloat.push_back(static_cast(pt.y)); + normDataFloat.push_back(static_cast(pt.z)); } else { normDataDouble.push_back(pt.x); normDataDouble.push_back(pt.y); @@ -270,8 +270,8 @@ void trpgGeometry::AddTexCoord(DataType type,trpg2dPoint &pt) trpgTexData *td = &texData[0]; if (type == FloatData) { - td->floatData.push_back(pt.x); - td->floatData.push_back(pt.y); + td->floatData.push_back(static_cast(pt.x)); + td->floatData.push_back(static_cast(pt.y)); } else { td->doubleData.push_back(pt.x); td->doubleData.push_back(pt.y); @@ -349,7 +349,7 @@ bool trpgGeometry::GetVertices(float32 *v) const v[i] = vertDataFloat[i]; else for (i=0;i(vertDataDouble[i]); return true; } bool trpgGeometry::GetVertices(float64 *v) const @@ -383,9 +383,9 @@ bool trpgGeometry::GetVertices(osg::Vec3* v) const { for (i=0;i(vertDataDouble[3*i+0]); + v[i].y() = static_cast(vertDataDouble[3*i+1]); + v[i].z() = static_cast(vertDataDouble[3*i+2]); } } return true; @@ -427,7 +427,7 @@ bool trpgGeometry::GetNormals(float32 *v) const v[i] = normDataFloat[i]; else for (i=0;i(normDataDouble[i]); return true; } bool trpgGeometry::GetNormals(float64 *v) const @@ -462,9 +462,9 @@ bool trpgGeometry::GetNormals(osg::Vec3* v) const { for (i=0;i(normDataDouble[3*i+0]); + v[i].y() = static_cast(normDataDouble[3*i+1]); + v[i].z() = static_cast(normDataDouble[3*i+2]); } } return true; diff --git a/src/osgPlugins/txp/trpage_readbuf.cpp b/src/osgPlugins/txp/trpage_readbuf.cpp index 6950b50f4..0308c6a03 100644 --- a/src/osgPlugins/txp/trpage_readbuf.cpp +++ b/src/osgPlugins/txp/trpage_readbuf.cpp @@ -55,7 +55,7 @@ bool trpgReadBuffer::Get(int64 &ret) if (!GetData((char *)&val,sizeof(int64))) return false; if (ness != cpuNess) - ret = trpg_byteswap_long(val); + ret = trpg_byteswap_llong(val); else ret = val; diff --git a/src/osgPlugins/txp/trpage_warchive.cpp b/src/osgPlugins/txp/trpage_warchive.cpp index 7ce18d1fe..e13801bb6 100644 --- a/src/osgPlugins/txp/trpage_warchive.cpp +++ b/src/osgPlugins/txp/trpage_warchive.cpp @@ -445,7 +445,7 @@ bool trpgwArchive::WriteTile(unsigned int x,unsigned int y,unsigned int lod, flo return false; } - int32 pos = tileFile->Pos(); + int32 pos = static_cast(tileFile->Pos()); if (!tileFile->Append(head,buf)) return false; // Keep track of the fact that this went here @@ -1031,7 +1031,7 @@ bool trpgwImageHelper::WriteToArchive(const trpgTexture &tex,char *data,trpgwApp // Get the current address addr.file = texFileIDs[texFileIDs.size()-1]; - addr.offset = texFile->Pos(); + addr.offset = static_cast(texFile->Pos()); // Write the data out to the archive. int totSize = tex.CalcTotalSize(); diff --git a/src/osgPlugins/txp/trpage_writebuf.cpp b/src/osgPlugins/txp/trpage_writebuf.cpp index 8f9fc5c00..33cf5eb11 100644 --- a/src/osgPlugins/txp/trpage_writebuf.cpp +++ b/src/osgPlugins/txp/trpage_writebuf.cpp @@ -131,7 +131,7 @@ void trpgMemWriteBuffer::Add(int32 val) void trpgMemWriteBuffer::Add(int64 val) { if (ness != cpuNess) - val = trpg_byteswap_long(val); + val = trpg_byteswap_llong(val); append(sizeof(int64),(const char *)&val); }