소스 검색

Silencing compile warnings during build, all little stuff like uint to size_t or BOOL to bool.

Nicholas Woodfield 7 년 전
부모
커밋
458a7ae801
4개의 변경된 파일9개의 추가작업 그리고 9개의 파일을 삭제
  1. 2 2
      code/D3MFImporter.cpp
  2. 3 3
      code/DefaultIOSystem.cpp
  3. 3 3
      code/glTF2Exporter.cpp
  4. 1 1
      include/assimp/metadata.h

+ 2 - 2
code/D3MFImporter.cpp

@@ -115,10 +115,10 @@ public:
         // import the metadata
         // import the metadata
         if ( !mMetaData.empty() ) {
         if ( !mMetaData.empty() ) {
             const size_t numMeta( mMetaData.size() );
             const size_t numMeta( mMetaData.size() );
-            scene->mMetaData = aiMetadata::Alloc( numMeta );
+            scene->mMetaData = aiMetadata::Alloc(static_cast<unsigned int>( numMeta ) );
             for ( size_t i = 0; i < numMeta; ++i ) {
             for ( size_t i = 0; i < numMeta; ++i ) {
                 aiString val( mMetaData[ i ].value );
                 aiString val( mMetaData[ i ].value );
-                scene->mMetaData->Set( i, mMetaData[ i ].name, val );
+                scene->mMetaData->Set(static_cast<unsigned int>( i ), mMetaData[ i ].name, val );
             }
             }
         }
         }
 
 

+ 3 - 3
code/DefaultIOSystem.cpp

@@ -76,7 +76,7 @@ bool DefaultIOSystem::Exists( const char* pFile) const
 #ifdef _WIN32
 #ifdef _WIN32
     wchar_t fileName16[PATHLIMIT];
     wchar_t fileName16[PATHLIMIT];
 
 
-    bool isUnicode = IsTextUnicode(pFile, static_cast<int>(strlen(pFile)), NULL);
+    bool isUnicode = IsTextUnicode(pFile, static_cast<int>(strlen(pFile)), NULL) != 0;
     if (isUnicode) {
     if (isUnicode) {
 
 
         MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, pFile, -1, fileName16, PATHLIMIT);
         MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, pFile, -1, fileName16, PATHLIMIT);
@@ -110,7 +110,7 @@ IOStream* DefaultIOSystem::Open( const char* strFile, const char* strMode)
     FILE* file;
     FILE* file;
 #ifdef _WIN32
 #ifdef _WIN32
     wchar_t fileName16[PATHLIMIT];
     wchar_t fileName16[PATHLIMIT];
-    bool isUnicode = IsTextUnicode(strFile, static_cast<int>(strlen(strFile)), NULL );
+    bool isUnicode = IsTextUnicode(strFile, static_cast<int>(strlen(strFile)), NULL) != 0;
     if (isUnicode) {
     if (isUnicode) {
         MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, strFile, -1, fileName16, PATHLIMIT);
         MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, strFile, -1, fileName16, PATHLIMIT);
         std::string mode8(strMode);
         std::string mode8(strMode);
@@ -158,7 +158,7 @@ inline static void MakeAbsolutePath (const char* in, char* _out)
 {
 {
     ai_assert(in && _out);
     ai_assert(in && _out);
 #if defined( _MSC_VER ) || defined( __MINGW32__ )
 #if defined( _MSC_VER ) || defined( __MINGW32__ )
-    bool isUnicode = IsTextUnicode(in, static_cast<int>(strlen(in)), NULL);
+    bool isUnicode = IsTextUnicode(in, static_cast<int>(strlen(in)), NULL) != 0;
     if (isUnicode) {
     if (isUnicode) {
         wchar_t out16[PATHLIMIT];
         wchar_t out16[PATHLIMIT];
         wchar_t in16[PATHLIMIT];
         wchar_t in16[PATHLIMIT];

+ 3 - 3
code/glTF2Exporter.cpp

@@ -638,11 +638,11 @@ void ExportSkin(Asset& mAsset, const aiMesh* aimesh, Ref<Mesh>& meshRef, Ref<Buf
     Mesh::Primitive& p = meshRef->primitives.back();
     Mesh::Primitive& p = meshRef->primitives.back();
     Ref<Accessor> vertexJointAccessor = ExportData(mAsset, skinRef->id, bufferRef, aimesh->mNumVertices, vertexJointData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT);
     Ref<Accessor> vertexJointAccessor = ExportData(mAsset, skinRef->id, bufferRef, aimesh->mNumVertices, vertexJointData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT);
     if ( vertexJointAccessor ) {
     if ( vertexJointAccessor ) {
-        unsigned int offset = vertexJointAccessor->bufferView->byteOffset;
-        unsigned int bytesLen = vertexJointAccessor->bufferView->byteLength;
+        size_t offset = vertexJointAccessor->bufferView->byteOffset;
+        size_t bytesLen = vertexJointAccessor->bufferView->byteLength;
         unsigned int s_bytesPerComp= ComponentTypeSize(ComponentType_UNSIGNED_SHORT);
         unsigned int s_bytesPerComp= ComponentTypeSize(ComponentType_UNSIGNED_SHORT);
         unsigned int bytesPerComp = ComponentTypeSize(vertexJointAccessor->componentType);
         unsigned int bytesPerComp = ComponentTypeSize(vertexJointAccessor->componentType);
-        unsigned int s_bytesLen = bytesLen * s_bytesPerComp / bytesPerComp;
+        size_t s_bytesLen = bytesLen * s_bytesPerComp / bytesPerComp;
         Ref<Buffer> buf = vertexJointAccessor->bufferView->buffer;
         Ref<Buffer> buf = vertexJointAccessor->bufferView->buffer;
         uint8_t* arrys = new uint8_t[s_bytesLen];
         uint8_t* arrys = new uint8_t[s_bytesLen];
         unsigned int i = 0;
         unsigned int i = 0;

+ 1 - 1
include/assimp/metadata.h

@@ -149,7 +149,7 @@ struct aiMetadata {
             mValues[ i ].mType = rhs.mValues[ i ].mType;
             mValues[ i ].mType = rhs.mValues[ i ].mType;
             switch ( rhs.mValues[ i ].mType ) {
             switch ( rhs.mValues[ i ].mType ) {
             case AI_BOOL:
             case AI_BOOL:
-                mValues[ i ].mData = new bool( rhs.mValues[i].mData );
+                mValues[ i ].mData = new bool( *(static_cast<bool*>( rhs.mValues[i].mData )) );
                 break;
                 break;
             case AI_INT32: {
             case AI_INT32: {
                 int32_t v;
                 int32_t v;