From dc3f265803be91d79e7c4464509db29a131b8695 Mon Sep 17 00:00:00 2001 From: Jared Mulconry Date: Sun, 27 Nov 2016 15:16:19 +1100 Subject: [PATCH] Fixed build warnings on MSVC14 x64 in the write dumb source. --- tools/assimp_cmd/WriteDumb.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/assimp_cmd/WriteDumb.cpp b/tools/assimp_cmd/WriteDumb.cpp index 12f5bd25a..44b0c6926 100644 --- a/tools/assimp_cmd/WriteDumb.cpp +++ b/tools/assimp_cmd/WriteDumb.cpp @@ -292,14 +292,14 @@ uint32_t WriteBinaryTexture(const aiTexture* tex) len += Write(tex->mWidth); len += Write(tex->mHeight); - len += fwrite(tex->achFormatHint,1,4,out); + len += static_cast(fwrite(tex->achFormatHint,1,4,out)); if(!shortened) { if (!tex->mHeight) { - len += fwrite(tex->pcData,1,tex->mWidth,out); + len += static_cast(fwrite(tex->pcData,1,tex->mWidth,out)); } else { - len += fwrite(tex->pcData,1,tex->mWidth*tex->mHeight*4,out); + len += static_cast(fwrite(tex->pcData,1,tex->mWidth*tex->mHeight*4,out)); } } @@ -321,7 +321,7 @@ uint32_t WriteBinaryBone(const aiBone* b) if (shortened) { len += WriteBounds(b->mWeights,b->mNumWeights); } // else write as usual - else len += fwrite(b->mWeights,1,b->mNumWeights*sizeof(aiVertexWeight),out); + else len += static_cast(fwrite(b->mWeights,1,b->mNumWeights*sizeof(aiVertexWeight),out)); ChangeInteger(old,len); return len; @@ -368,13 +368,13 @@ uint32_t WriteBinaryMesh(const aiMesh* mesh) if (shortened) { len += WriteBounds(mesh->mVertices,mesh->mNumVertices); } // else write as usual - else len += fwrite(mesh->mVertices,1,12*mesh->mNumVertices,out); + else len += static_cast(fwrite(mesh->mVertices,1,12*mesh->mNumVertices,out)); } if (mesh->mNormals) { if (shortened) { len += WriteBounds(mesh->mNormals,mesh->mNumVertices); } // else write as usual - else len += fwrite(mesh->mNormals,1,12*mesh->mNumVertices,out); + else len += static_cast(fwrite(mesh->mNormals,1,12*mesh->mNumVertices,out)); } if (mesh->mTangents && mesh->mBitangents) { if (shortened) { @@ -382,8 +382,8 @@ uint32_t WriteBinaryMesh(const aiMesh* mesh) len += WriteBounds(mesh->mBitangents,mesh->mNumVertices); } // else write as usual else { - len += fwrite(mesh->mTangents,1,12*mesh->mNumVertices,out); - len += fwrite(mesh->mBitangents,1,12*mesh->mNumVertices,out); + len += static_cast(fwrite(mesh->mTangents,1,12*mesh->mNumVertices,out)); + len += static_cast(fwrite(mesh->mBitangents,1,12*mesh->mNumVertices,out)); } } for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n) { @@ -393,7 +393,7 @@ uint32_t WriteBinaryMesh(const aiMesh* mesh) if (shortened) { len += WriteBounds(mesh->mColors[n],mesh->mNumVertices); } // else write as usual - else len += fwrite(mesh->mColors[n],16*mesh->mNumVertices,1,out); + else len += static_cast(fwrite(mesh->mColors[n],16*mesh->mNumVertices,1,out)); } for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n) { if (!mesh->mTextureCoords[n]) @@ -405,7 +405,7 @@ uint32_t WriteBinaryMesh(const aiMesh* mesh) if (shortened) { len += WriteBounds(mesh->mTextureCoords[n],mesh->mNumVertices); } // else write as usual - else len += fwrite(mesh->mTextureCoords[n],12*mesh->mNumVertices,1,out); + else len += static_cast(fwrite(mesh->mTextureCoords[n],12*mesh->mNumVertices,1,out)); } // write faces. There are no floating-point calculations involved @@ -472,7 +472,7 @@ uint32_t WriteBinaryMaterialProperty(const aiMaterialProperty* prop) len += Write(prop->mDataLength); len += Write((unsigned int)prop->mType); - len += fwrite(prop->mData,1,prop->mDataLength,out); + len += static_cast(fwrite(prop->mData,1,prop->mDataLength,out)); ChangeInteger(old,len); return len; @@ -509,21 +509,21 @@ uint32_t WriteBinaryNodeAnim(const aiNodeAnim* nd) len += WriteBounds(nd->mPositionKeys,nd->mNumPositionKeys); } // else write as usual - else len += fwrite(nd->mPositionKeys,1,nd->mNumPositionKeys*sizeof(aiVectorKey),out); + else len += static_cast(fwrite(nd->mPositionKeys,1,nd->mNumPositionKeys*sizeof(aiVectorKey),out)); } if (nd->mRotationKeys) { if (shortened) { len += WriteBounds(nd->mRotationKeys,nd->mNumRotationKeys); } // else write as usual - else len += fwrite(nd->mRotationKeys,1,nd->mNumRotationKeys*sizeof(aiQuatKey),out); + else len += static_cast(fwrite(nd->mRotationKeys,1,nd->mNumRotationKeys*sizeof(aiQuatKey),out)); } if (nd->mScalingKeys) { if (shortened) { len += WriteBounds(nd->mScalingKeys,nd->mNumScalingKeys); } // else write as usual - else len += fwrite(nd->mScalingKeys,1,nd->mNumScalingKeys*sizeof(aiVectorKey),out); + else len += static_cast(fwrite(nd->mScalingKeys,1,nd->mNumScalingKeys*sizeof(aiVectorKey),out)); } ChangeInteger(old,len);