diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-09-07 17:12:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-09-07 17:23:25 +0300 |
commit | 0b2d1badecc48b5cbff5ec088b29c6e9acc5e1d0 (patch) | |
tree | 0283a5c819d1e709edfd0de814636aa83a9b1033 /source/blender/alembic/intern | |
parent | ab823176d31dc155645de733f1cd4fbd6ad74592 (diff) |
Cleanup: use post increment/decrement
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
Diffstat (limited to 'source/blender/alembic/intern')
-rw-r--r-- | source/blender/alembic/intern/abc_curves.cc | 26 | ||||
-rw-r--r-- | source/blender/alembic/intern/abc_customdata.cc | 34 | ||||
-rw-r--r-- | source/blender/alembic/intern/abc_exporter.cc | 16 | ||||
-rw-r--r-- | source/blender/alembic/intern/abc_hair.cc | 14 | ||||
-rw-r--r-- | source/blender/alembic/intern/abc_mesh.cc | 50 | ||||
-rw-r--r-- | source/blender/alembic/intern/abc_nurbs.cc | 18 | ||||
-rw-r--r-- | source/blender/alembic/intern/abc_object.cc | 16 | ||||
-rw-r--r-- | source/blender/alembic/intern/abc_transform.cc | 2 | ||||
-rw-r--r-- | source/blender/alembic/intern/abc_util.cc | 8 | ||||
-rw-r--r-- | source/blender/alembic/intern/alembic_capi.cc | 18 |
10 files changed, 101 insertions, 101 deletions
diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc index 13872618d74..50aa13bea4f 100644 --- a/source/blender/alembic/intern/abc_curves.cc +++ b/source/blender/alembic/intern/abc_curves.cc @@ -111,7 +111,7 @@ void AbcCurveWriter::do_write() const BPoint *point = nurbs->bp; - for (int i = 0; i < totpoint; ++i, ++point) { + for (int i = 0; i < totpoint; i++, point++) { copy_yup_from_zup(temp_vert.getValue(), point->vec); verts.push_back(temp_vert); weights.push_back(point->vec[3]); @@ -127,7 +127,7 @@ void AbcCurveWriter::do_write() const BezTriple *bezier = nurbs->bezt; /* TODO(kevin): store info about handles, Alembic doesn't have this. */ - for (int i = 0; i < totpoint; ++i, ++bezier) { + for (int i = 0; i < totpoint; i++, bezier++) { copy_yup_from_zup(temp_vert.getValue(), bezier->vec[1]); verts.push_back(temp_vert); widths.push_back(bezier->radius); @@ -144,7 +144,7 @@ void AbcCurveWriter::do_write() * cyclic since other software need those. */ - for (int i = 0; i < nurbs->orderu; ++i) { + for (int i = 0; i < nurbs->orderu; i++) { verts.push_back(verts[i]); } } @@ -156,7 +156,7 @@ void AbcCurveWriter::do_write() * require/expect them. */ knots.resize(num_knots + 2); - for (int i = 0; i < num_knots; ++i) { + for (int i = 0; i < num_knots; i++) { knots[i + 1] = nurbs->knotsu[i]; } @@ -316,7 +316,7 @@ void AbcCurveReader::read_curve_sample(Curve *cu, int knot_offset = 0; size_t idx = 0; - for (size_t i = 0; i < num_vertices->size(); ++i) { + for (size_t i = 0; i < num_vertices->size(); i++) { const int num_verts = (*num_vertices)[i]; Nurb *nu = static_cast<Nurb *>(MEM_callocN(sizeof(Nurb), "abc_getnurb")); @@ -357,7 +357,7 @@ void AbcCurveReader::read_curve_sample(Curve *cu, const int end = idx + num_verts; int overlap = 0; - for (int j = start, k = end - nu->orderu; j < nu->orderu; ++j, ++k) { + for (int j = start, k = end - nu->orderu; j < nu->orderu; j++, k++) { const Imath::V3f &p1 = (*positions)[j]; const Imath::V3f &p2 = (*positions)[k]; @@ -365,7 +365,7 @@ void AbcCurveReader::read_curve_sample(Curve *cu, break; } - ++overlap; + overlap++; } /* TODO: Special case, need to figure out how it coincides with knots. */ @@ -393,7 +393,7 @@ void AbcCurveReader::read_curve_sample(Curve *cu, nu->bp = static_cast<BPoint *>(MEM_callocN(sizeof(BPoint) * nu->pntsu, "abc_getnurb")); BPoint *bp = nu->bp; - for (int j = 0; j < nu->pntsu; ++j, ++bp, ++idx) { + for (int j = 0; j < nu->pntsu; j++, bp++, idx++) { const Imath::V3f &pos = (*positions)[idx]; if (do_radius) { @@ -418,7 +418,7 @@ void AbcCurveReader::read_curve_sample(Curve *cu, /* TODO: second check is temporary, for until the check for cycles is rock solid. */ if (periodicity == Alembic::AbcGeom::kPeriodic && (KNOTSU(nu) == knots->size() - 2)) { /* Skip first and last knots. */ - for (size_t i = 1; i < knots->size() - 1; ++i) { + for (size_t i = 1; i < knots->size() - 1; i++) { nu->knotsu[i - 1] = (*knots)[knot_offset + i]; } } @@ -476,7 +476,7 @@ Mesh *AbcCurveReader::read_mesh(Mesh *existing_mesh, if (same_topology) { Nurb *nurbs = static_cast<Nurb *>(curve->nurb.first); - for (curve_idx = 0; nurbs; nurbs = nurbs->next, ++curve_idx) { + for (curve_idx = 0; nurbs; nurbs = nurbs->next, curve_idx++) { const int num_in_alembic = (*num_vertices)[curve_idx]; const int num_in_blender = nurbs->pntsu; @@ -493,13 +493,13 @@ Mesh *AbcCurveReader::read_mesh(Mesh *existing_mesh, } else { Nurb *nurbs = static_cast<Nurb *>(curve->nurb.first); - for (curve_idx = 0; nurbs; nurbs = nurbs->next, ++curve_idx) { + for (curve_idx = 0; nurbs; nurbs = nurbs->next, curve_idx++) { const int totpoint = (*num_vertices)[curve_idx]; if (nurbs->bp) { BPoint *point = nurbs->bp; - for (int i = 0; i < totpoint; ++i, ++point, ++vertex_idx) { + for (int i = 0; i < totpoint; i++, point++, vertex_idx++) { const Imath::V3f &pos = (*positions)[vertex_idx]; copy_zup_from_yup(point->vec, pos.getValue()); } @@ -507,7 +507,7 @@ Mesh *AbcCurveReader::read_mesh(Mesh *existing_mesh, else if (nurbs->bezt) { BezTriple *bezier = nurbs->bezt; - for (int i = 0; i < totpoint; ++i, ++bezier, ++vertex_idx) { + for (int i = 0; i < totpoint; i++, bezier++, vertex_idx++) { const Imath::V3f &pos = (*positions)[vertex_idx]; copy_zup_from_yup(bezier->vec[1], pos.getValue()); } diff --git a/source/blender/alembic/intern/abc_customdata.cc b/source/blender/alembic/intern/abc_customdata.cc index 63887d36381..7f04bb77052 100644 --- a/source/blender/alembic/intern/abc_customdata.cc +++ b/source/blender/alembic/intern/abc_customdata.cc @@ -72,12 +72,12 @@ static void get_uvs(const CDStreamConfig &config, uvs.resize(config.totloop); /* Iterate in reverse order to match exported polygons. */ - for (int i = 0; i < num_poly; ++i) { + for (int i = 0; i < num_poly; i++) { MPoly ¤t_poly = polygons[i]; MLoopUV *loopuv = mloopuv_array + current_poly.loopstart + current_poly.totloop; - for (int j = 0; j < current_poly.totloop; ++j, ++cnt) { - --loopuv; + for (int j = 0; j < current_poly.totloop; j++, cnt++) { + loopuv--; uvidx[cnt] = cnt; uvs[cnt][0] = loopuv->uv[0]; @@ -90,14 +90,14 @@ static void get_uvs(const CDStreamConfig &config, std::vector<std::vector<uint32_t>> idx_map(config.totvert); int idx_count = 0; - for (int i = 0; i < num_poly; ++i) { + for (int i = 0; i < num_poly; i++) { MPoly ¤t_poly = polygons[i]; MLoop *looppoly = mloop + current_poly.loopstart + current_poly.totloop; MLoopUV *loopuv = mloopuv_array + current_poly.loopstart + current_poly.totloop; - for (int j = 0; j < current_poly.totloop; ++j) { - --looppoly; - --loopuv; + for (int j = 0; j < current_poly.totloop; j++) { + looppoly--; + loopuv--; Imath::V2f uv(loopuv->uv[0], loopuv->uv[1]); bool found_same = false; @@ -188,12 +188,12 @@ static void write_mcol(const OCompoundProperty &prop, Imath::C4f col; - for (int i = 0; i < config.totpoly; ++i) { + for (int i = 0; i < config.totpoly; i++) { MPoly *p = &polys[i]; MCol *cface = &cfaces[p->loopstart + p->totloop]; MLoop *mloop = &mloops[p->loopstart + p->totloop]; - for (int j = 0; j < p->totloop; ++j) { + for (int j = 0; j < p->totloop; j++) { cface--; mloop--; @@ -230,7 +230,7 @@ void write_custom_data(const OCompoundProperty &prop, const int active_layer = CustomData_get_active_layer(data, cd_data_type); const int tot_layers = CustomData_number_of_layers(data, cd_data_type); - for (int i = 0; i < tot_layers; ++i) { + for (int i = 0; i < tot_layers; i++) { void *cd_data = CustomData_get_layer_n(data, cd_data_type, i); const char *name = CustomData_get_layer_name(data, cd_data_type, i); @@ -268,11 +268,11 @@ static void read_uvs(const CDStreamConfig &config, unsigned int uv_index, loop_index, rev_loop_index; - for (int i = 0; i < config.totpoly; ++i) { + for (int i = 0; i < config.totpoly; i++) { MPoly &poly = mpolys[i]; unsigned int rev_loop_offset = poly.loopstart + poly.totloop - 1; - for (int f = 0; f < poly.totloop; ++f) { + for (int f = 0; f < poly.totloop; f++) { loop_index = poly.loopstart + f; rev_loop_index = rev_loop_offset - f; uv_index = (*indices)[loop_index]; @@ -368,14 +368,14 @@ static void read_custom_data_mcols(const std::string &iobject_full_name, * is why we have to check for indices->size() > 0 */ bool use_dual_indexing = is_facevarying && indices->size() > 0; - for (int i = 0; i < config.totpoly; ++i) { + for (int i = 0; i < config.totpoly; i++) { MPoly *poly = &mpolys[i]; MCol *cface = &cfaces[poly->loopstart + poly->totloop]; MLoop *mloop = &mloops[poly->loopstart + poly->totloop]; - for (int j = 0; j < poly->totloop; ++j, ++face_index) { - --cface; - --mloop; + for (int j = 0; j < poly->totloop; j++, face_index++) { + cface--; + mloop--; color_index = is_facevarying ? face_index : mloop->v; if (use_dual_indexing) { @@ -456,7 +456,7 @@ void read_custom_data(const std::string &iobject_full_name, const size_t num_props = prop.getNumProperties(); - for (size_t i = 0; i < num_props; ++i) { + for (size_t i = 0; i < num_props; i++) { const Alembic::Abc::PropertyHeader &prop_header = prop.getPropertyHeader(i); /* Read UVs according to convention. */ diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc index f19e0257b1b..9c1909b6022 100644 --- a/source/blender/alembic/intern/abc_exporter.cc +++ b/source/blender/alembic/intern/abc_exporter.cc @@ -197,12 +197,12 @@ AbcExporter::~AbcExporter() { /* Free xforms map */ m_xforms_type::iterator it_x, e_x; - for (it_x = m_xforms.begin(), e_x = m_xforms.end(); it_x != e_x; ++it_x) { + for (it_x = m_xforms.begin(), e_x = m_xforms.end(); it_x != e_x; it_x++) { delete it_x->second; } /* Free shapes vector */ - for (int i = 0, e = m_shapes.size(); i != e; ++i) { + for (int i = 0, e = m_shapes.size(); i != e; i++) { delete m_shapes[i]; } @@ -223,7 +223,7 @@ void AbcExporter::getShutterSamples(unsigned int nr_of_samples, double time_inc = (shutter_close - shutter_open) / nr_of_samples; /* sample between shutter open & close */ - for (int sample = 0; sample < nr_of_samples; ++sample) { + for (int sample = 0; sample < nr_of_samples; sample++) { double sample_time = shutter_open + time_inc * sample; double time = (frame_offset + sample_time) / time_factor; @@ -257,7 +257,7 @@ void AbcExporter::getFrameSet(unsigned int nr_of_samples, std::set<double> &fram getShutterSamples(nr_of_samples, false, shutter_samples); for (double frame = m_settings.frame_start; frame <= m_settings.frame_end; frame += 1.0) { - for (size_t j = 0; j < nr_of_samples; ++j) { + for (size_t j = 0; j < nr_of_samples; j++) { frames.insert(frame + shutter_samples[j]); } } @@ -331,7 +331,7 @@ void AbcExporter::operator()(float &progress, bool &was_canceled) const float size = static_cast<float>(frames.size()); size_t i = 0; - for (; begin != end; ++begin) { + for (; begin != end; begin++) { progress = (++i / size); if (G.is_break) { @@ -345,7 +345,7 @@ void AbcExporter::operator()(float &progress, bool &was_canceled) setCurrentFrame(m_bmain, frame); if (shape_frames.count(frame) != 0) { - for (int i = 0, e = m_shapes.size(); i != e; ++i) { + for (int i = 0, e = m_shapes.size(); i != e; i++) { m_shapes[i]->write(); } } @@ -355,14 +355,14 @@ void AbcExporter::operator()(float &progress, bool &was_canceled) } m_xforms_type::iterator xit, xe; - for (xit = m_xforms.begin(), xe = m_xforms.end(); xit != xe; ++xit) { + for (xit = m_xforms.begin(), xe = m_xforms.end(); xit != xe; xit++) { xit->second->write(); } /* Save the archive 's bounding box. */ Imath::Box3d bounds; - for (xit = m_xforms.begin(), xe = m_xforms.end(); xit != xe; ++xit) { + for (xit = m_xforms.begin(), xe = m_xforms.end(); xit != xe; xit++) { Imath::Box3d box = xit->second->bounds(); bounds.extendBy(box); } diff --git a/source/blender/alembic/intern/abc_hair.cc b/source/blender/alembic/intern/abc_hair.cc index b2489169856..38042bc7286 100644 --- a/source/blender/alembic/intern/abc_hair.cc +++ b/source/blender/alembic/intern/abc_hair.cc @@ -139,7 +139,7 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh, float normal[3]; Imath::V3f tmp_nor; - for (int p = 0; p < m_psys->totpart; ++p, ++pa) { + for (int p = 0; p < m_psys->totpart; p++, pa++) { /* underlying info for faces-only emission */ path = cache[p]; @@ -173,7 +173,7 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh, const int num = (pa->num_dmcache >= 0) ? pa->num_dmcache : pa->num; /* iterate over all faces to find a corresponding underlying UV */ - for (int n = 0; n < mesh->totface; ++n) { + for (int n = 0; n < mesh->totface; n++) { MFace *face = &mface[n]; MTFace *tface = mtface + n; unsigned int vtx[4]; @@ -183,7 +183,7 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh, vtx[3] = face->v4; bool found = false; - for (int o = 0; o < 4; ++o) { + for (int o = 0; o < 4; o++) { if (o > 2 && vtx[o] == 0) { break; } @@ -210,7 +210,7 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh, int steps = path->segments + 1; hvertices.push_back(steps); - for (k = 0; k < steps; ++k, ++path) { + for (k = 0; k < steps; k++, path++) { float vert[3]; copy_v3_v3(vert, path->co); mul_m4_v3(inv_mat, vert); @@ -240,7 +240,7 @@ void AbcHairWriter::write_hair_child_sample(Mesh *mesh, ChildParticle *pc = m_psys->child; - for (int p = 0; p < m_psys->totchild; ++p, ++pc) { + for (int p = 0; p < m_psys->totchild; p++, pc++) { path = cache[p]; if (part->from == PART_FROM_FACE && part->childtype != PART_CHILD_PARTICLES && mtface) { @@ -278,7 +278,7 @@ void AbcHairWriter::write_hair_child_sample(Mesh *mesh, int steps = path->segments + 1; hvertices.push_back(steps); - for (int k = 0; k < steps; ++k) { + for (int k = 0; k < steps; k++) { float vert[3]; copy_v3_v3(vert, path->co); mul_m4_v3(inv_mat, vert); @@ -286,7 +286,7 @@ void AbcHairWriter::write_hair_child_sample(Mesh *mesh, /* Convert Z-up to Y-up. */ verts.push_back(Imath::V3f(vert[0], vert[2], -vert[1])); - ++path; + path++; } } } diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc index 8728303923a..92de3547fd2 100644 --- a/source/blender/alembic/intern/abc_mesh.cc +++ b/source/blender/alembic/intern/abc_mesh.cc @@ -116,7 +116,7 @@ static void get_vertices(struct Mesh *mesh, std::vector<Imath::V3f> &points) MVert *verts = mesh->mvert; - for (int i = 0, e = mesh->totvert; i < e; ++i) { + for (int i = 0, e = mesh->totvert; i < e; i++) { copy_yup_from_zup(points[i].getValue(), verts[i].co); } } @@ -137,7 +137,7 @@ static void get_topology(struct Mesh *mesh, loop_counts.reserve(num_poly); /* NOTE: data needs to be written in the reverse order. */ - for (int i = 0; i < num_poly; ++i) { + for (int i = 0; i < num_poly; i++) { MPoly &poly = mpoly[i]; loop_counts.push_back(poly.totloop); @@ -145,7 +145,7 @@ static void get_topology(struct Mesh *mesh, MLoop *loop = mloop + poly.loopstart + (poly.totloop - 1); - for (int j = 0; j < poly.totloop; ++j, --loop) { + for (int j = 0; j < poly.totloop; j++, loop--) { poly_verts.push_back(loop->v); } } @@ -164,7 +164,7 @@ static void get_creases(struct Mesh *mesh, MEdge *edge = mesh->medge; - for (int i = 0, e = mesh->totedge; i < e; ++i) { + for (int i = 0, e = mesh->totedge; i < e; i++) { const float sharpness = static_cast<float>(edge[i].crease) * factor; if (sharpness != 0.0f) { @@ -185,7 +185,7 @@ static void get_vertex_normals(struct Mesh *mesh, std::vector<Imath::V3f> &norma MVert *verts = mesh->mvert; float no[3]; - for (int i = 0, e = mesh->totvert; i < e; ++i) { + for (int i = 0, e = mesh->totvert; i < e; i++) { normal_short_to_float_v3(no, verts[i].no); copy_yup_from_zup(normals[i].getValue(), no); } @@ -209,8 +209,8 @@ static void get_loop_normals(struct Mesh *mesh, std::vector<Imath::V3f> &normals int abc_index = 0; if (lnors) { - for (int i = 0, e = mesh->totpoly; i < e; ++i, ++mp) { - for (int j = mp->totloop - 1; j >= 0; --j, ++abc_index) { + for (int i = 0, e = mesh->totpoly; i < e; i++, mp++) { + for (int j = mp->totloop - 1; j >= 0; j--, abc_index++) { int blender_index = mp->loopstart + j; copy_yup_from_zup(normals[abc_index].getValue(), lnors[blender_index]); } @@ -219,20 +219,20 @@ static void get_loop_normals(struct Mesh *mesh, std::vector<Imath::V3f> &normals else { float no[3]; - for (int i = 0, e = mesh->totpoly; i < e; ++i, ++mp) { + for (int i = 0, e = mesh->totpoly; i < e; i++, mp++) { ml = mloop + mp->loopstart + (mp->totloop - 1); /* Flat shaded, use common normal for all verts. */ if ((mp->flag & ME_SMOOTH) == 0) { BKE_mesh_calc_poly_normal(mp, ml - (mp->totloop - 1), verts, no); - for (int j = 0; j < mp->totloop; --ml, ++j, ++abc_index) { + for (int j = 0; j < mp->totloop; ml--, j++, abc_index++) { copy_yup_from_zup(normals[abc_index].getValue(), no); } } else { /* Smooth shaded, use individual vert normals. */ - for (int j = 0; j < mp->totloop; --ml, ++j, ++abc_index) { + for (int j = 0; j < mp->totloop; ml--, j++, abc_index++) { normal_short_to_float_v3(no, verts[ml->v].no); copy_yup_from_zup(normals[abc_index].getValue(), no); } @@ -525,7 +525,7 @@ template<typename Schema> void AbcGenericMeshWriter::writeFaceSets(struct Mesh * getGeoGroups(me, geo_groups); std::map<std::string, std::vector<int32_t>>::iterator it; - for (it = geo_groups.begin(); it != geo_groups.end(); ++it) { + for (it = geo_groups.begin(); it != geo_groups.end(); it++) { OFaceSet face_set = schema.createFaceSet(it->first); OFaceSetSchema::Sample samp; samp.setFaces(Int32ArraySample(it->second)); @@ -615,7 +615,7 @@ void AbcGenericMeshWriter::getVelocities(struct Mesh *mesh, std::vector<Imath::V if (fss->meshVelocities) { float *mesh_vels = reinterpret_cast<float *>(fss->meshVelocities); - for (int i = 0; i < totverts; ++i) { + for (int i = 0; i < totverts; i++) { copy_yup_from_zup(vels[i].getValue(), mesh_vels); mesh_vels += 3; } @@ -631,7 +631,7 @@ void AbcGenericMeshWriter::getGeoGroups(struct Mesh *mesh, const int num_poly = mesh->totpoly; MPoly *polygons = mesh->mpoly; - for (int i = 0; i < num_poly; ++i) { + for (int i = 0; i < num_poly; i++) { MPoly ¤t_poly = polygons[i]; short mnr = current_poly.mat_nr; @@ -658,7 +658,7 @@ void AbcGenericMeshWriter::getGeoGroups(struct Mesh *mesh, std::vector<int32_t> faceArray; - for (int i = 0, e = mesh->totface; i < e; ++i) { + for (int i = 0, e = mesh->totface; i < e; i++) { faceArray.push_back(i); } @@ -707,7 +707,7 @@ static void assign_materials(Main *bmain, std::map<std::string, int>::const_iterator it = mat_index_map.begin(); int matcount = 0; - for (; it != mat_index_map.end(); ++it, ++matcount) { + for (; it != mat_index_map.end(); it++, matcount++) { if (!BKE_object_material_slot_add(bmain, ob)) { can_assign = false; break; @@ -723,7 +723,7 @@ static void assign_materials(Main *bmain, if (can_assign) { it = mat_index_map.begin(); - for (; it != mat_index_map.end(); ++it) { + for (; it != mat_index_map.end(); it++) { std::string mat_name = it->first; mat_iter = mat_map.find(mat_name.c_str()); @@ -770,7 +770,7 @@ static void read_mverts_interp(MVert *mverts, const float weight) { float tmp[3]; - for (int i = 0; i < positions->size(); ++i) { + for (int i = 0; i < positions->size(); i++) { MVert &mvert = mverts[i]; const Imath::V3f &floor_pos = (*positions)[i]; const Imath::V3f &ceil_pos = (*ceil_positions)[i]; @@ -801,7 +801,7 @@ void read_mverts(MVert *mverts, const P3fArraySamplePtr &positions, const N3fArraySamplePtr &normals) { - for (int i = 0; i < positions->size(); ++i) { + for (int i = 0; i < positions->size(); i++) { MVert &mvert = mverts[i]; Imath::V3f pos_in = (*positions)[i]; @@ -839,7 +839,7 @@ static void read_mpolys(CDStreamConfig &config, const AbcMeshData &mesh_data) unsigned int rev_loop_index = 0; unsigned int uv_index = 0; - for (int i = 0; i < face_counts->size(); ++i) { + for (int i = 0; i < face_counts->size(); i++) { const int face_size = (*face_counts)[i]; MPoly &poly = mpolys[i]; @@ -856,7 +856,7 @@ static void read_mpolys(CDStreamConfig &config, const AbcMeshData &mesh_data) /* NOTE: Alembic data is stored in the reverse order. */ rev_loop_index = loop_index + (face_size - 1); - for (int f = 0; f < face_size; ++f, ++loop_index, --rev_loop_index) { + for (int f = 0; f < face_size; f++, loop_index++, rev_loop_index--) { MLoop &loop = mloops[rev_loop_index]; loop.v = (*face_indices)[loop_index]; @@ -899,9 +899,9 @@ static void process_normals(CDStreamConfig &config, const AbcMeshData &mesh_data MPoly *mpoly = mesh->mpoly; int abc_index = 0; - for (int i = 0, e = mesh->totpoly; i < e; ++i, ++mpoly) { + for (int i = 0, e = mesh->totpoly; i < e; i++, mpoly++) { /* As usual, ABC orders the loops in reverse. */ - for (int j = mpoly->totloop - 1; j >= 0; --j, ++abc_index) { + for (int j = mpoly->totloop - 1; j >= 0; j--, abc_index++) { int blender_index = mpoly->loopstart + j; copy_zup_from_yup(lnors[blender_index], loop_normals[abc_index].getValue()); } @@ -1246,7 +1246,7 @@ void AbcMeshReader::assign_facesets_to_mpoly(const ISampleSelector &sample_sel, int current_mat = 0; - for (int i = 0; i < face_sets.size(); ++i) { + for (int i = 0; i < face_sets.size(); i++) { const std::string &grp_name = face_sets[i]; if (r_mat_map.find(grp_name) == r_mat_map.end()) { @@ -1292,7 +1292,7 @@ void AbcMeshReader::readFaceSetsSample(Main *bmain, Mesh *mesh, const ISampleSel ABC_INLINE MEdge *find_edge(MEdge *edges, int totedge, int v1, int v2) { - for (int i = 0, e = totedge; i < e; ++i) { + for (int i = 0, e = totedge; i < e; i++) { MEdge &edge = edges[i]; if (edge.v1 == v1 && edge.v2 == v2) { @@ -1419,7 +1419,7 @@ void AbcSubDReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelec MEdge *edges = mesh->medge; if (indices && sharpnesses) { - for (int i = 0, s = 0, e = indices->size(); i < e; i += 2, ++s) { + for (int i = 0, s = 0, e = indices->size(); i < e; i += 2, s++) { MEdge *edge = find_edge(edges, mesh->totedge, (*indices)[i], (*indices)[i + 1]); if (edge) { diff --git a/source/blender/alembic/intern/abc_nurbs.cc b/source/blender/alembic/intern/abc_nurbs.cc index c78cc4570c9..f2d0a9f1e16 100644 --- a/source/blender/alembic/intern/abc_nurbs.cc +++ b/source/blender/alembic/intern/abc_nurbs.cc @@ -74,7 +74,7 @@ AbcNurbsWriter::AbcNurbsWriter(Object *ob, Curve *curve = static_cast<Curve *>(m_object->data); size_t numNurbs = BLI_listbase_count(&curve->nurb); - for (size_t i = 0; i < numNurbs; ++i) { + for (size_t i = 0; i < numNurbs; i++) { std::stringstream str; str << m_name << '_' << i; @@ -106,7 +106,7 @@ static void get_knots(std::vector<float> &knots, const int num_knots, float *nu_ knots.push_back(0.0f); - for (int i = 0; i < num_knots; ++i) { + for (int i = 0; i < num_knots; i++) { knots.push_back(nu_knots[i]); } @@ -136,7 +136,7 @@ void AbcNurbsWriter::do_write() } size_t count = 0; - for (Nurb *nu = static_cast<Nurb *>(nulb->first); nu; nu = nu->next, ++count) { + for (Nurb *nu = static_cast<Nurb *>(nulb->first); nu; nu = nu->next, count++) { std::vector<float> knotsU; get_knots(knotsU, KNOTSU(nu), nu->knotsu); @@ -149,7 +149,7 @@ void AbcNurbsWriter::do_write() const BPoint *bp = nu->bp; - for (int i = 0; i < size; ++i, ++bp) { + for (int i = 0; i < size; i++, bp++) { copy_yup_from_zup(positions[i].getValue(), bp->vec); weights[i] = bp->vec[3]; } @@ -208,7 +208,7 @@ bool AbcNurbsReader::valid() const } std::vector<std::pair<INuPatchSchema, IObject>>::const_iterator it; - for (it = m_schemas.begin(); it != m_schemas.end(); ++it) { + for (it = m_schemas.begin(); it != m_schemas.end(); it++) { const INuPatchSchema &schema = it->first; if (!schema.valid()) { @@ -229,7 +229,7 @@ static bool set_knots(const FloatArraySamplePtr &knots, float *&nu_knots) const size_t num_knots = knots->size() - 2; nu_knots = static_cast<float *>(MEM_callocN(num_knots * sizeof(float), "abc_setsplineknotsu")); - for (size_t i = 0; i < num_knots; ++i) { + for (size_t i = 0; i < num_knots; i++) { nu_knots[i] = (*knots)[i + 1]; } @@ -243,7 +243,7 @@ void AbcNurbsReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSele std::vector<std::pair<INuPatchSchema, IObject>>::iterator it; - for (it = m_schemas.begin(); it != m_schemas.end(); ++it) { + for (it = m_schemas.begin(); it != m_schemas.end(); it++) { Nurb *nu = static_cast<Nurb *>(MEM_callocN(sizeof(Nurb), "abc_getnurb")); nu->flag = CU_SMOOTH; nu->type = CU_NURBS; @@ -281,7 +281,7 @@ void AbcNurbsReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSele BPoint *bp = nu->bp; float posw_in = 1.0f; - for (int i = 0; i < num_points; ++i, ++bp) { + for (int i = 0; i < num_points; i++, bp++) { const Imath::V3f &pos_in = (*positions)[i]; if (weights) { @@ -349,7 +349,7 @@ void AbcNurbsReader::getNurbsPatches(const IObject &obj) return; } - for (int i = 0; i < num_children; ++i) { + for (int i = 0; i < num_children; i++) { bool ok = true; IObject child(obj, obj.getChildHeader(i).getName()); diff --git a/source/blender/alembic/intern/abc_object.cc b/source/blender/alembic/intern/abc_object.cc index ebebbc0da1e..b05246371fa 100644 --- a/source/blender/alembic/intern/abc_object.cc +++ b/source/blender/alembic/intern/abc_object.cc @@ -195,14 +195,14 @@ static Imath::M44d blend_matrices(const Imath::M44d &m0, const Imath::M44d &m1, * the matrices manually. */ - for (int i = 0; i < 4; ++i) { - for (int j = 0; j < 4; ++j) { + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { mat0[i][j] = static_cast<float>(m0[i][j]); } } - for (int i = 0; i < 4; ++i) { - for (int j = 0; j < 4; ++j) { + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { mat1[i][j] = static_cast<float>(m1[i][j]); } } @@ -211,8 +211,8 @@ static Imath::M44d blend_matrices(const Imath::M44d &m0, const Imath::M44d &m1, Imath::M44d m; - for (int i = 0; i < 4; ++i) { - for (int j = 0; j < 4; ++j) { + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { m[i][j] = ret[i][j]; } } @@ -389,11 +389,11 @@ int AbcObjectReader::refcount() const void AbcObjectReader::incref() { - ++m_refcount; + m_refcount++; } void AbcObjectReader::decref() { - --m_refcount; + m_refcount--; BLI_assert(m_refcount >= 0); } diff --git a/source/blender/alembic/intern/abc_transform.cc b/source/blender/alembic/intern/abc_transform.cc index 08f8eb8bd8f..505acfc164a 100644 --- a/source/blender/alembic/intern/abc_transform.cc +++ b/source/blender/alembic/intern/abc_transform.cc @@ -122,7 +122,7 @@ Imath::Box3d AbcTransformWriter::bounds() { Imath::Box3d bounds; - for (int i = 0; i < m_children.size(); ++i) { + for (int i = 0; i < m_children.size(); i++) { Imath::Box3d box(m_children[i]->bounds()); bounds.extendBy(box); } diff --git a/source/blender/alembic/intern/abc_util.cc b/source/blender/alembic/intern/abc_util.cc index 2fc340f73ce..b6743c8b363 100644 --- a/source/blender/alembic/intern/abc_util.cc +++ b/source/blender/alembic/intern/abc_util.cc @@ -90,8 +90,8 @@ Imath::M44d convert_matrix(float mat[4][4]) { Imath::M44d m; - for (int i = 0; i < 4; ++i) { - for (int j = 0; j < 4; ++j) { + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { m[i][j] = mat[i][j]; } } @@ -226,8 +226,8 @@ void copy_m44_axis_swap(float dst_mat[4][4], float src_mat[4][4], AbcAxisSwapMod void convert_matrix(const Imath::M44d &xform, Object *ob, float r_mat[4][4]) { - for (int i = 0; i < 4; ++i) { - for (int j = 0; j < 4; ++j) { + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { r_mat[i][j] = static_cast<float>(xform[i][j]); } } diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc index dc525e0c46c..ffe58f7976f 100644 --- a/source/blender/alembic/intern/alembic_capi.cc +++ b/source/blender/alembic/intern/alembic_capi.cc @@ -129,7 +129,7 @@ static bool gather_objects_paths(const IObject &object, ListBase *object_paths) size_t children_claiming_this_object = 0; size_t num_children = object.getNumChildren(); - for (size_t i = 0; i < num_children; ++i) { + for (size_t i = 0; i < num_children; i++) { bool child_claims_this_object = gather_objects_paths(object.getChild(i), object_paths); children_claiming_this_object += child_claims_this_object ? 1 : 0; } @@ -211,7 +211,7 @@ static void find_iobject(const IObject &object, IObject &ret, const std::string IObject tmp = object; std::vector<std::string>::iterator iter; - for (iter = tokens.begin(); iter != tokens.end(); ++iter) { + for (iter = tokens.begin(); iter != tokens.end(); iter++) { IObject child = tmp.getChild(*iter); tmp = child; } @@ -452,7 +452,7 @@ static std::pair<bool, AbcObjectReader *> visit_object( AbcObjectReader::ptr_vector claiming_child_readers; AbcObjectReader::ptr_vector nonclaiming_child_readers; AbcObjectReader::ptr_vector assign_as_parent; - for (size_t i = 0; i < num_children; ++i) { + for (size_t i = 0; i < num_children; i++) { const IObject ichild = object.getChild(i); /* TODO: When we only support C++11, use std::tie() instead. */ @@ -704,7 +704,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa ISampleSelector sample_sel(0.0f); std::vector<AbcObjectReader *>::iterator iter; - for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) { + for (iter = data->readers.begin(); iter != data->readers.end(); iter++) { AbcObjectReader *reader = *iter; if (reader->valid()) { @@ -743,7 +743,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa } /* Setup parenthood. */ - for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) { + for (iter = data->readers.begin(); iter != data->readers.end(); iter++) { const AbcObjectReader *reader = *iter; const AbcObjectReader *parent_reader = reader->parent_reader; Object *ob = reader->object(); @@ -758,7 +758,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa /* Setup transformations and constraints. */ i = 0; - for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) { + for (iter = data->readers.begin(); iter != data->readers.end(); iter++) { AbcObjectReader *reader = *iter; reader->setupObjectTransform(0.0f); @@ -782,7 +782,7 @@ static void import_endjob(void *user_data) /* Delete objects on cancellation. */ if (data->was_cancelled) { - for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) { + for (iter = data->readers.begin(); iter != data->readers.end(); iter++) { Object *ob = (*iter)->object(); /* It's possible that cancellation occurred between the creation of @@ -804,7 +804,7 @@ static void import_endjob(void *user_data) lc = BKE_layer_collection_get_active(view_layer); - for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) { + for (iter = data->readers.begin(); iter != data->readers.end(); iter++) { Object *ob = (*iter)->object(); BKE_collection_object_add(data->bmain, lc->collection, ob); @@ -824,7 +824,7 @@ static void import_endjob(void *user_data) DEG_relations_tag_update(data->bmain); } - for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) { + for (iter = data->readers.begin(); iter != data->readers.end(); iter++) { AbcObjectReader *reader = *iter; reader->decref(); |