From c1d4ed7873bf51e271d30a92fcd595efdf994086 Mon Sep 17 00:00:00 2001 From: escherstair Date: Tue, 3 Sep 2019 07:55:27 +0200 Subject: [PATCH 1/9] prefer prefix ++/-- operators for non-primitive types --- code/AMF/AMFImporter_Postprocess.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AMF/AMFImporter_Postprocess.cpp b/code/AMF/AMFImporter_Postprocess.cpp index 37478d9ec..79b5e15e2 100644 --- a/code/AMF/AMFImporter_Postprocess.cpp +++ b/code/AMF/AMFImporter_Postprocess.cpp @@ -334,7 +334,7 @@ void AMFImporter::PostprocessHelper_SplitFacesByTextureID(std::list Date: Tue, 3 Sep 2019 07:56:37 +0200 Subject: [PATCH 2/9] prefer prefix ++/-- operators for non-primitive types --- code/X3D/X3DImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/X3D/X3DImporter.cpp b/code/X3D/X3DImporter.cpp index 365761cf6..dcf6092ca 100644 --- a/code/X3D/X3DImporter.cpp +++ b/code/X3D/X3DImporter.cpp @@ -1241,7 +1241,7 @@ void X3DImporter::MeshGeometry_AddTexCoord(aiMesh& pMesh, const std::vector::const_iterator it = pTexCoords.begin(); it != pTexCoords.end(); it++) + for(std::list::const_iterator it = pTexCoords.begin(); it != pTexCoords.end(); ++it) { texcoord_arr_copy.push_back(aiVector3D((*it).x, (*it).y, 0)); } From 53d795c1c923cb9fafb07389df68ea85e8518c03 Mon Sep 17 00:00:00 2001 From: escherstair Date: Tue, 3 Sep 2019 07:57:08 +0200 Subject: [PATCH 3/9] possible inefficient checking for 'tlist' emptiness --- code/X3D/X3DImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/X3D/X3DImporter.cpp b/code/X3D/X3DImporter.cpp index dcf6092ca..0d48d00b7 100644 --- a/code/X3D/X3DImporter.cpp +++ b/code/X3D/X3DImporter.cpp @@ -684,7 +684,7 @@ void X3DImporter::XML_ReadNode_GetAttrVal_AsArrVec2f(const int pAttrIdx, std::ve XML_ReadNode_GetAttrVal_AsListVec2f(pAttrIdx, tlist);// read as list // and copy to array - if(tlist.size() > 0) + if(!tlist.empty()) { pValue.reserve(tlist.size()); for ( std::list::iterator it = tlist.begin(); it != tlist.end(); ++it ) From 75993ad653d99c343b412d7b6059d919712a9529 Mon Sep 17 00:00:00 2001 From: escherstair Date: Tue, 3 Sep 2019 07:57:58 +0200 Subject: [PATCH 4/9] prefer prefix ++/-- operators for non-primitive types --- code/X3D/X3DImporter_Geometry3D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/X3D/X3DImporter_Geometry3D.cpp b/code/X3D/X3DImporter_Geometry3D.cpp index 9716f78d1..e12cbd3ab 100644 --- a/code/X3D/X3DImporter_Geometry3D.cpp +++ b/code/X3D/X3DImporter_Geometry3D.cpp @@ -230,7 +230,7 @@ void X3DImporter::ParseNode_Geometry3D_Cylinder() if(top) { - for(std::vector::iterator it = tcir.begin(); it != tcir.end(); it++) + for(std::vector::iterator it = tcir.begin(); it != tcir.end(); ++it) { (*it).y = height;// y - because circle made in oXZ. vlist.push_back(*it); From 33e71ee8df9327130ec5f91b4fe997ab502e0f46 Mon Sep 17 00:00:00 2001 From: escherstair Date: Tue, 3 Sep 2019 07:59:17 +0200 Subject: [PATCH 5/9] prefer prefix ++/-- operators for non-primitive types --- code/X3D/X3DImporter_Postprocess.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/X3D/X3DImporter_Postprocess.cpp b/code/X3D/X3DImporter_Postprocess.cpp index 8fcdbb9d6..59a085c74 100644 --- a/code/X3D/X3DImporter_Postprocess.cpp +++ b/code/X3D/X3DImporter_Postprocess.cpp @@ -89,7 +89,7 @@ aiMatrix4x4 X3DImporter::PostprocessHelper_Matrix_GlobalToCurrent() const void X3DImporter::PostprocessHelper_CollectMetadata(const CX3DImporter_NodeElement& pNodeElement, std::list& pList) const { // walk through childs and find for metadata. - for(std::list::const_iterator el_it = pNodeElement.Child.begin(); el_it != pNodeElement.Child.end(); el_it++) + for(std::list::const_iterator el_it = pNodeElement.Child.begin(); el_it != pNodeElement.Child.end(); ++el_it) { if(((*el_it)->Type == CX3DImporter_NodeElement::ENET_MetaBoolean) || ((*el_it)->Type == CX3DImporter_NodeElement::ENET_MetaDouble) || ((*el_it)->Type == CX3DImporter_NodeElement::ENET_MetaFloat) || ((*el_it)->Type == CX3DImporter_NodeElement::ENET_MetaInteger) || @@ -255,7 +255,7 @@ void X3DImporter::Postprocess_BuildMesh(const CX3DImporter_NodeElement& pNodeEle std::vector tarr; tarr.reserve(tnemesh.Vertices.size()); - for(std::list::iterator it = tnemesh.Vertices.begin(); it != tnemesh.Vertices.end(); it++) tarr.push_back(*it); + for(std::list::iterator it = tnemesh.Vertices.begin(); it != tnemesh.Vertices.end(); ++it) tarr.push_back(*it); *pMesh = StandardShapes::MakeMesh(tarr, static_cast(tnemesh.NumIndices));// create mesh from vertices using Assimp help. return;// mesh is build, nothing to do anymore. @@ -438,7 +438,7 @@ void X3DImporter::Postprocess_BuildMesh(const CX3DImporter_NodeElement& pNodeEle vec_copy.reserve(((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value.size()); for(std::list::const_iterator it = ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value.begin(); - it != ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value.end(); it++) + it != ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value.end(); ++it) { vec_copy.push_back(*it); } @@ -580,7 +580,7 @@ void X3DImporter::Postprocess_BuildMesh(const CX3DImporter_NodeElement& pNodeEle CX3DImporter_NodeElement_Set& tnemesh = *((CX3DImporter_NodeElement_Set*)&pNodeElement);// create alias for convenience // at first search for node and create mesh. - for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ++ch_it) { if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) { From ceacad237f3a5546820295cc7ef9f908e208dd35 Mon Sep 17 00:00:00 2001 From: escherstair Date: Tue, 3 Sep 2019 08:00:12 +0200 Subject: [PATCH 6/9] prefer prefix ++/-- operators for non-primitive types --- code/X3D/X3DImporter_Rendering.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/X3D/X3DImporter_Rendering.cpp b/code/X3D/X3DImporter_Rendering.cpp index b6cbb2499..fe54a7891 100644 --- a/code/X3D/X3DImporter_Rendering.cpp +++ b/code/X3D/X3DImporter_Rendering.cpp @@ -413,7 +413,7 @@ void X3DImporter::ParseNode_Rendering_IndexedTriangleSet() ne_alias.CoordIndex.clear(); int counter = 0; int32_t idx[3]; - for(std::vector::const_iterator idx_it = index.begin(); idx_it != index.end(); idx_it++) + for(std::vector::const_iterator idx_it = index.begin(); idx_it != index.end(); ++idx_it) { idx[counter++] = *idx_it; if (counter > 2) @@ -765,7 +765,7 @@ void X3DImporter::ParseNode_Rendering_TriangleFanSet() // assign indices for first triangle coord_num_first = 0; coord_num_prev = 1; - for(std::vector::const_iterator vc_it = ne_alias.VertexCount.begin(); vc_it != ne_alias.VertexCount.end(); vc_it++) + for(std::vector::const_iterator vc_it = ne_alias.VertexCount.begin(); vc_it != ne_alias.VertexCount.end(); ++vc_it) { if(*vc_it < 3) throw DeadlyImportError("TriangleFanSet. fanCount shall be greater than or equal to three."); From bbb1f6a1dcdefdb785caa2b884a91dd080ff9743 Mon Sep 17 00:00:00 2001 From: escherstair Date: Tue, 3 Sep 2019 08:01:05 +0200 Subject: [PATCH 7/9] prefer prefix ++/-- operators for non-primitive types --- contrib/gtest/test/gtest-param-test_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/gtest/test/gtest-param-test_test.cc b/contrib/gtest/test/gtest-param-test_test.cc index 8b278bb94..8aacfce72 100644 --- a/contrib/gtest/test/gtest-param-test_test.cc +++ b/contrib/gtest/test/gtest-param-test_test.cc @@ -215,7 +215,7 @@ TEST(IteratorTest, ParamIteratorConformsToForwardIteratorConcept) { // Verifies that prefix and postfix operator++() advance an iterator // all the same. it2 = it; - it++; + ++it; ++it2; EXPECT_TRUE(*it == *it2); } From e317fbfbb652c178b828faa967f0f997beed21c8 Mon Sep 17 00:00:00 2001 From: escherstair Date: Tue, 3 Sep 2019 08:01:56 +0200 Subject: [PATCH 8/9] prefer prefix ++/-- operators for non-primitive types --- test/unit/SceneDiffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/SceneDiffer.cpp b/test/unit/SceneDiffer.cpp index fb000db29..684d9fee6 100644 --- a/test/unit/SceneDiffer.cpp +++ b/test/unit/SceneDiffer.cpp @@ -123,7 +123,7 @@ void SceneDiffer::showReport() { return; } - for ( std::vector::iterator it = m_diffs.begin(); it != m_diffs.end(); it++ ) { + for ( std::vector::iterator it = m_diffs.begin(); it != m_diffs.end(); ++it ) { std::cout << *it << "\n"; } From c4ce8cec962daf2f6618485df703bb7392cfb652 Mon Sep 17 00:00:00 2001 From: escherstair Date: Tue, 3 Sep 2019 08:02:56 +0200 Subject: [PATCH 9/9] prefer prefix ++/-- operators for non-primitive types --- tools/assimp_qt_viewer/glview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/assimp_qt_viewer/glview.cpp b/tools/assimp_qt_viewer/glview.cpp index 97eba83a1..6ecdb0f4d 100644 --- a/tools/assimp_qt_viewer/glview.cpp +++ b/tools/assimp_qt_viewer/glview.cpp @@ -203,7 +203,7 @@ void CGLView::Matrix_NodeToRoot(const aiNode* pNode, aiMatrix4x4& pOutMatrix) } // multiply all matrices in reverse order - for ( std::list::reverse_iterator rit = mat_list.rbegin(); rit != mat_list.rend(); rit++) + for ( std::list::reverse_iterator rit = mat_list.rbegin(); rit != mat_list.rend(); ++rit) { pOutMatrix = pOutMatrix * (*rit); } @@ -729,7 +729,7 @@ void CGLView::FreeScene() { GLuint* id_tex = new GLuint[id_tex_size]; QMap::iterator it = mTexture_IDMap.begin(); - for(int idx = 0; idx < id_tex_size; idx++, it++) + for(int idx = 0; idx < id_tex_size; idx++, ++it) { id_tex[idx] = it.value(); }