From 059a32654e660ac9dcfd9a31a8436fce6042c66f Mon Sep 17 00:00:00 2001 From: Jared Mulconry Date: Sun, 24 Sep 2017 19:29:43 +1000 Subject: [PATCH] Addressed warnings generated on MSVC across x86 and x64. --- code/MMDImporter.cpp | 2 +- code/glTF2Exporter.cpp | 2 +- samples/SimpleOpenGL/CMakeLists.txt | 5 +++++ samples/SimpleTexturedOpenGL/CMakeLists.txt | 5 +++++ tools/assimp_view/stdafx.h | 1 - 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/code/MMDImporter.cpp b/code/MMDImporter.cpp index 84797cb..c40978c 100644 --- a/code/MMDImporter.cpp +++ b/code/MMDImporter.cpp @@ -118,7 +118,7 @@ void MMDImporter::InternReadFile(const std::string &file, aiScene *pScene, // Get the file-size and validate it, throwing an exception when fails fileStream.seekg(0, fileStream.end); - size_t fileSize = fileStream.tellg(); + size_t fileSize = static_cast(fileStream.tellg()); fileStream.seekg(0, fileStream.beg); if (fileSize < sizeof(pmx::PmxModel)) { diff --git a/code/glTF2Exporter.cpp b/code/glTF2Exporter.cpp index 12642a9..4ed8f20 100644 --- a/code/glTF2Exporter.cpp +++ b/code/glTF2Exporter.cpp @@ -741,7 +741,7 @@ void glTF2Exporter::MergeMeshes() for (unsigned int n = 0; n < mAsset->nodes.Size(); ++n) { Ref node = mAsset->nodes.Get(n); - unsigned int nMeshes = node->meshes.size(); + unsigned int nMeshes = static_cast(node->meshes.size()); //skip if it's 1 or less meshes per node if (nMeshes > 1) { diff --git a/samples/SimpleOpenGL/CMakeLists.txt b/samples/SimpleOpenGL/CMakeLists.txt index 52c994b..455cbd8 100644 --- a/samples/SimpleOpenGL/CMakeLists.txt +++ b/samples/SimpleOpenGL/CMakeLists.txt @@ -16,6 +16,11 @@ IF ( NOT GLUT_FOUND ) ENDIF ( MSVC ) ENDIF ( NOT GLUT_FOUND ) +if ( MSVC ) + ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) + ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) +endif ( MSVC ) + INCLUDE_DIRECTORIES( ${Assimp_SOURCE_DIR}/include ${Assimp_SOURCE_DIR}/code diff --git a/samples/SimpleTexturedOpenGL/CMakeLists.txt b/samples/SimpleTexturedOpenGL/CMakeLists.txt index 6c34acd..1b206af 100644 --- a/samples/SimpleTexturedOpenGL/CMakeLists.txt +++ b/samples/SimpleTexturedOpenGL/CMakeLists.txt @@ -11,6 +11,11 @@ IF ( NOT GLUT_FOUND ) ENDIF ( MSVC ) ENDIF ( NOT GLUT_FOUND ) +if ( MSVC ) + ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) + ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) +endif ( MSVC ) + INCLUDE_DIRECTORIES( ${Assimp_SOURCE_DIR}/include ${Assimp_SOURCE_DIR}/code diff --git a/tools/assimp_view/stdafx.h b/tools/assimp_view/stdafx.h index 3c78d38..35104d4 100644 --- a/tools/assimp_view/stdafx.h +++ b/tools/assimp_view/stdafx.h @@ -23,7 +23,6 @@ #define _WIN32_IE 0x0600 // Ändern Sie dies in den geeigneten Wert für andere Versionen von IE. #endif -#define WIN32_LEAN_AND_MEAN // Selten verwendete Teile der Windows-Header nicht einbinden. // Windows-Headerdateien: #include -- 2.7.4