From 7681089abc66712e844c01220918690d75c8941d Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 15 Oct 2016 21:30:02 +0200 Subject: [PATCH] C++11-Combat: last replacements of std::to_string. --- code/StringUtils.h | 3 ++- code/X3DExporter.cpp | 1 + code/X3DImporter.cpp | 16 ++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/code/StringUtils.h b/code/StringUtils.h index 99352ebfb..15f7db2e7 100644 --- a/code/StringUtils.h +++ b/code/StringUtils.h @@ -43,6 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include #include @@ -103,7 +104,7 @@ float ai_strtof( const char *begin, const char *end ) { std::string token( begin, len ); val = static_cast< float >( ::atof( token.c_str() ) ); } - + return val; } diff --git a/code/X3DExporter.cpp b/code/X3DExporter.cpp index 05128880f..cb6a6740f 100644 --- a/code/X3DExporter.cpp +++ b/code/X3DExporter.cpp @@ -10,6 +10,7 @@ // Header files, Assimp. #include "Exceptional.h" +#include "StringUtils.h" #include #include diff --git a/code/X3DImporter.cpp b/code/X3DImporter.cpp index a552af169..878017dd4 100644 --- a/code/X3DImporter.cpp +++ b/code/X3DImporter.cpp @@ -795,7 +795,7 @@ void X3DImporter::GeometryHelper_Make_Arc2D(const float pStartAngle, const float { Throw_ArgOutOfRange( "GeometryHelper_Make_Arc2D.pStartAngle" ); } - if ( ( pEndAngle < -AI_MATH_TWO_PI_F ) || ( pEndAngle > AI_MATH_TWO_PI_F ) ) + if ( ( pEndAngle < -AI_MATH_TWO_PI_F ) || ( pEndAngle > AI_MATH_TWO_PI_F ) ) { Throw_ArgOutOfRange( "GeometryHelper_Make_Arc2D.pEndAngle" ); } @@ -1078,8 +1078,8 @@ void X3DImporter::MeshGeometry_AddColor(aiMesh& pMesh, const std::list& // check indices array count. if(pColors.size() < pMesh.mNumVertices) { - throw DeadlyImportError("MeshGeometry_AddColor2. Colors count(" + std::to_string(pColors.size()) + ") can not be less than Vertices count(" + - std::to_string(pMesh.mNumVertices) + ")."); + throw DeadlyImportError("MeshGeometry_AddColor2. Colors count(" + to_string(pColors.size()) + ") can not be less than Vertices count(" + + to_string(pMesh.mNumVertices) + ")."); } // create list with colors for every vertex. col_tgt_arr.resize(pMesh.mNumVertices); @@ -1096,8 +1096,8 @@ void X3DImporter::MeshGeometry_AddColor(aiMesh& pMesh, const std::list& // check indices array count. if(pColorIdx.size() < pMesh.mNumFaces) { - throw DeadlyImportError("MeshGeometry_AddColor2. Colors indices count(" + std::to_string(pColorIdx.size()) + - ") can not be less than Faces count(" + std::to_string(pMesh.mNumFaces) + ")."); + throw DeadlyImportError("MeshGeometry_AddColor2. Colors indices count(" + to_string(pColorIdx.size()) + + ") can not be less than Faces count(" + to_string(pMesh.mNumFaces) + ")."); } // create list with colors for every vertex using faces indices. col_tgt_arr.resize(pMesh.mNumFaces); @@ -1116,8 +1116,8 @@ void X3DImporter::MeshGeometry_AddColor(aiMesh& pMesh, const std::list& // check indices array count. if(pColors.size() < pMesh.mNumFaces) { - throw DeadlyImportError("MeshGeometry_AddColor2. Colors count(" + std::to_string(pColors.size()) + ") can not be less than Faces count(" + - std::to_string(pMesh.mNumFaces) + ")."); + throw DeadlyImportError("MeshGeometry_AddColor2. Colors count(" + to_string(pColors.size()) + ") can not be less than Faces count(" + + to_string(pMesh.mNumFaces) + ")."); } // create list with colors for every vertex using faces indices. col_tgt_arr.resize(pMesh.mNumFaces); @@ -1273,7 +1273,7 @@ void X3DImporter::MeshGeometry_AddTexCoord(aiMesh& pMesh, const std::list