diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-06-01 15:49:26 +0200 |
---|---|---|
committer | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-06-01 15:49:26 +0200 |
commit | b42f9d836b4c0f7fbd4bdae1734021e2a09fdbe8 (patch) | |
tree | d73404c2fbacce379a57e2d03a6cd54558590859 /indra/llprimitive/lldaeloader.cpp | |
parent | cb3bd8865aa0f9fb8a247ea595cf1973057ba91f (diff) |
Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings
Diffstat (limited to 'indra/llprimitive/lldaeloader.cpp')
-rw-r--r-- | indra/llprimitive/lldaeloader.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index de5a2fe1fa..9bc6c7092f 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -258,7 +258,7 @@ LLModel::EModelStatus load_face_from_dom_triangles( // Don't share verts within the same tri, degenerate // - U32 indx_size = indices.size(); + U32 indx_size = static_cast<U32>(indices.size()); U32 verts_new_tri = indx_size % 3; if ((verts_new_tri < 1 || indices[indx_size - 1] != shared_index) && (verts_new_tri < 2 || indices[indx_size - 2] != shared_index)) @@ -732,7 +732,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac { //for each vertex if (j > 2) { - U32 size = verts.size(); + auto size = verts.size(); LLVolumeFace::VertexData v0 = verts[size-3]; LLVolumeFace::VertexData v1 = verts[size-1]; @@ -1098,7 +1098,7 @@ bool LLDAELoader::OpenFile(const std::string& filename) while (model_iter != mModelList.end()) { LLModel* mdl = *model_iter; - U32 material_count = mdl->mMaterialList.size(); + U32 material_count = static_cast<U32>(mdl->mMaterialList.size()); LL_INFOS() << "Importing " << mdl->mLabel << " model with " << material_count << " material references" << LL_ENDL; std::vector<std::string>::iterator mat_iter = mdl->mMaterialList.begin(); std::vector<std::string>::iterator end_iter = material_count > LIMIT_MATERIALS_OUTPUT @@ -1287,11 +1287,11 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do { //Get the children at this level daeTArray< daeSmartRef<daeElement> > children = pScene->getChildren(); - S32 childCount = children.getCount(); + auto childCount = children.getCount(); //Process any children that are joints //Not all children are joints, some could be ambient lights, cameras, geometry etc.. - for (S32 i = 0; i < childCount; ++i) + for (size_t i = 0; i < childCount; ++i) { domNode* pNode = daeSafeCast<domNode>(children[i]); if (pNode) @@ -1312,7 +1312,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do if ( pSkeletonRootNode ) { //Once we have the root node - start acccessing it's joint components - const int jointCnt = mJointMap.size(); + const int jointCnt = static_cast<int>(mJointMap.size()); JointMap :: const_iterator jointIt = mJointMap.begin(); //Loop over all the possible joints within the .dae - using the allowed joint list in the ctor. @@ -1453,9 +1453,9 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do if (t) { domListOfFloats& transform = t->getValue(); - S32 count = transform.getCount()/16; + auto count = transform.getCount()/16; - for (S32 k = 0; k < count; ++k) + for (size_t k = 0; k < count; ++k) { LLMatrix4 mat; @@ -1531,7 +1531,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do //with the skeleton are not stored in the same order as they are in the exported joint buffer. //This remaps the skeletal joints to be in the same order as the joints stored in the model. std::vector<std::string> :: const_iterator jointIt = model->mSkinInfo.mJointNames.begin(); - const int jointCnt = model->mSkinInfo.mJointNames.size(); + const int jointCnt = static_cast<int>(model->mSkinInfo.mJointNames.size()); for ( int i=0; i<jointCnt; ++i, ++jointIt ) { std::string lookingForJoint = (*jointIt).c_str(); @@ -1550,7 +1550,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do } } - U32 bind_count = model->mSkinInfo.mAlternateBindMatrix.size(); + auto bind_count = model->mSkinInfo.mAlternateBindMatrix.size(); if (bind_count > 0 && bind_count != jointCnt) { LL_WARNS("Mesh") << "Model " << model->mLabel << " has invalid joint bind matrix list." << LL_ENDL; @@ -1699,8 +1699,8 @@ void LLDAELoader::buildJointToNodeMappingFromScene( daeElement* pRoot ) if ( pScene ) { daeTArray< daeSmartRef<daeElement> > children = pScene->getChildren(); - S32 childCount = children.getCount(); - for (S32 i = 0; i < childCount; ++i) + auto childCount = children.getCount(); + for (size_t i = 0; i < childCount; ++i) { domNode* pNode = daeSafeCast<domNode>(children[i]); processJointToNodeMapping( pNode ); @@ -1745,8 +1745,8 @@ void LLDAELoader::processJointToNodeMapping( domNode* pNode ) void LLDAELoader::processChildJoints( domNode* pParentNode ) { daeTArray< daeSmartRef<daeElement> > childOfChild = pParentNode->getChildren(); - S32 childOfChildCount = childOfChild.getCount(); - for (S32 i = 0; i < childOfChildCount; ++i) + auto childOfChildCount = childOfChild.getCount(); + for (size_t i = 0; i < childOfChildCount; ++i) { domNode* pChildNode = daeSafeCast<domNode>( childOfChild[i] ); if ( pChildNode ) @@ -1847,7 +1847,7 @@ bool LLDAELoader::verifyController( domController* pController ) { sum += pVertexWeights->getVcount()->getValue()[i]; } - result = verifyCount( sum * inputs.getCount(), (domInt) pVertexWeights->getV()->getValue().getCount() ); + result = verifyCount( sum * static_cast<U32>(inputs.getCount()), (domInt) static_cast<int>(pVertexWeights->getV()->getValue().getCount()) ); } } @@ -1980,9 +1980,9 @@ void LLDAELoader::processJointNode( domNode* pNode, JointTransformMap& jointTran //Gather and handle the incoming nodes children daeTArray< daeSmartRef<daeElement> > childOfChild = pNode->getChildren(); - S32 childOfChildCount = childOfChild.getCount(); + auto childOfChildCount = childOfChild.getCount(); - for (S32 i = 0; i < childOfChildCount; ++i) + for (size_t i = 0; i < childOfChildCount; ++i) { domNode* pChildNode = daeSafeCast<domNode>( childOfChild[i] ); if ( pChildNode ) @@ -2192,8 +2192,8 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da //process children daeTArray< daeSmartRef<daeElement> > children = element->getChildren(); - int childCount = children.getCount(); - for (S32 i = 0; i < childCount; i++) + auto childCount = children.getCount(); + for (size_t i = 0; i < childCount; i++) { processElement(children[i],badElement, dae); } @@ -2568,7 +2568,7 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector<LLModel*>& mo ret->remapVolumeFaces(); } - volume_faces = remainder.size(); + volume_faces = static_cast<U32>(remainder.size()); models_out.push_back(ret); |