Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-01-07 03:38:08 +0300
committerCampbell Barton <campbell@blender.org>2022-01-07 06:16:26 +0300
commit3d3bc748849834ef74563deb603ab43859cffeeb (patch)
treede74ce4722b2cb032c22dbc090a15dd2e172c29b /source/blender/io/wavefront_obj
parentbb69c19f08ac681d4386325e4318ebfbef2e9531 (diff)
Cleanup: remove redundant const qualifiers for POD types
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
Diffstat (limited to 'source/blender/io/wavefront_obj')
-rw-r--r--source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh12
-rw-r--r--source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh34
-rw-r--r--source/blender/io/wavefront_obj/exporter/obj_export_nurbs.hh12
-rw-r--r--source/blender/io/wavefront_obj/exporter/obj_exporter.hh4
4 files changed, 30 insertions, 32 deletions
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
index c7ec7ec648f..3403d059068 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
@@ -91,22 +91,22 @@ class OBJWriter : NonMovable, NonCopyable {
*/
int write_smooth_group(const OBJMesh &obj_mesh_data,
int poly_index,
- const int last_poly_smooth_group) const;
+ int last_poly_smooth_group) const;
/**
* Write material name and material group of a polygon in the .OBJ file.
* \return #mat_nr of the polygon at the given index.
* \note It doesn't write to the material library.
*/
int16_t write_poly_material(const OBJMesh &obj_mesh_data,
- const int poly_index,
- const int16_t last_poly_mat_nr,
+ int poly_index,
+ int16_t last_poly_mat_nr,
std::function<const char *(int)> matname_fn) const;
/**
* Write the name of the deform group of a polygon.
*/
int16_t write_vertex_group(const OBJMesh &obj_mesh_data,
- const int poly_index,
- const int16_t last_poly_vertex_group) const;
+ int poly_index,
+ int16_t last_poly_vertex_group) const;
/**
* Write polygon elements with at least vertex indices, and conditionally with UV vertex
* indices and polygon normal indices. Also write groups: smooth, vertex, material.
@@ -138,7 +138,7 @@ class OBJWriter : NonMovable, NonCopyable {
/**
* \return Writer function with appropriate polygon-element syntax.
*/
- func_vert_uv_normal_indices get_poly_element_writer(const int total_uv_vertices) const;
+ func_vert_uv_normal_indices get_poly_element_writer(int total_uv_vertices) const;
/**
* Write one line of polygon indices as "f v1/vt1/vn1 v2/vt2/vn2 ...".
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh
index 5d9c08a288e..9a4dfe3efe3 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh
@@ -106,12 +106,12 @@ class OBJMesh : NonCopyable {
/**
* Return mat_nr-th material of the object. The given index should be zero-based.
*/
- const Material *get_object_material(const int16_t mat_nr) const;
+ const Material *get_object_material(int16_t mat_nr) const;
/**
* Returns a zero-based index of a polygon's material indexing into
* the Object's material slots.
*/
- int16_t ith_poly_matnr(const int poly_index) const;
+ int16_t ith_poly_matnr(int poly_index) const;
void ensure_mesh_normals() const;
void ensure_mesh_edges() const;
@@ -120,12 +120,12 @@ class OBJMesh : NonCopyable {
* Calculate smooth groups of a smooth-shaded object.
* \return A polygon aligned array of smooth group numbers.
*/
- void calc_smooth_groups(const bool use_bitflags);
+ void calc_smooth_groups(bool use_bitflags);
/**
* \return Smooth group of the polygon at the given index.
*/
- int ith_smooth_group(const int poly_index) const;
- bool is_ith_poly_smooth(const int poly_index) const;
+ int ith_smooth_group(int poly_index) const;
+ bool is_ith_poly_smooth(int poly_index) const;
/**
* Get object name as it appears in the outliner.
@@ -138,42 +138,42 @@ class OBJMesh : NonCopyable {
/**
* Get object's material (at the given index) name. The given index should be zero-based.
*/
- const char *get_object_material_name(const int16_t mat_nr) const;
+ const char *get_object_material_name(int16_t mat_nr) const;
/**
* Calculate coordinates of the vertex at the given index.
*/
- float3 calc_vertex_coords(const int vert_index, const float scaling_factor) const;
+ float3 calc_vertex_coords(int vert_index, float scaling_factor) const;
/**
* Calculate vertex indices of all vertices of the polygon at the given index.
*/
- Vector<int> calc_poly_vertex_indices(const int poly_index) const;
+ Vector<int> calc_poly_vertex_indices(int poly_index) const;
/**
* Calculate UV vertex coordinates of an Object.
*
* \note Also store the UV vertex indices in the member variable.
*/
void store_uv_coords_and_indices(Vector<std::array<float, 2>> &r_uv_coords);
- Span<int> calc_poly_uv_indices(const int poly_index) const;
+ Span<int> calc_poly_uv_indices(int poly_index) const;
/**
* Calculate polygon normal of a polygon at given index.
*
* Should be used for flat-shaded polygons.
*/
- float3 calc_poly_normal(const int poly_index) const;
+ float3 calc_poly_normal(int poly_index) const;
/**
* Calculate a polygon's polygon/loop normal indices.
* \param object_tot_prev_normals Number of normals of this Object written so far.
* \return Number of distinct normal indices.
*/
- std::pair<int, Vector<int>> calc_poly_normal_indices(const int poly_index,
- const int object_tot_prev_normals) const;
+ std::pair<int, Vector<int>> calc_poly_normal_indices(int poly_index,
+ int object_tot_prev_normals) const;
/**
* Calculate loop normals of a polygon at the given index.
*
* Should be used for smooth-shaded polygons.
*/
- void calc_loop_normals(const int poly_index, Vector<float3> &r_loop_normals) const;
+ void calc_loop_normals(int poly_index, Vector<float3> &r_loop_normals) const;
/**
* Find the index of the vertex group with the maximum number of vertices in a polygon.
* The index indices into the #Object.defbase.
@@ -181,17 +181,17 @@ class OBJMesh : NonCopyable {
* If two or more groups have the same number of vertices (maximum), group name depends on the
* implementation of #std::max_element.
*/
- int16_t get_poly_deform_group_index(const int poly_index) const;
+ int16_t get_poly_deform_group_index(int poly_index) const;
/**
* Find the name of the vertex deform group at the given index.
* The index indices into the #Object.defbase.
*/
- const char *get_poly_deform_group_name(const int16_t def_group_index) const;
+ const char *get_poly_deform_group_name(int16_t def_group_index) const;
/**
* Calculate vertex indices of an edge's corners if it is a loose edge.
*/
- std::optional<std::array<int, 2>> calc_loose_edge_vert_indices(const int edge_index) const;
+ std::optional<std::array<int, 2>> calc_loose_edge_vert_indices(int edge_index) const;
private:
/**
@@ -208,6 +208,6 @@ class OBJMesh : NonCopyable {
/**
* Set the final transform after applying axes settings and an Object's world transform.
*/
- void set_world_axes_transform(const eTransformAxisForward forward, const eTransformAxisUp up);
+ void set_world_axes_transform(eTransformAxisForward forward, eTransformAxisUp up);
};
} // namespace blender::io::obj
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_nurbs.hh b/source/blender/io/wavefront_obj/exporter/obj_export_nurbs.hh
index fe457f3c1c7..0c71c3cc09d 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_nurbs.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_nurbs.hh
@@ -47,28 +47,26 @@ class OBJCurve : NonCopyable {
* \param spline_index: Zero-based index of spline of interest.
* \return: Total vertices in a spline.
*/
- int total_spline_vertices(const int spline_index) const;
+ int total_spline_vertices(int spline_index) const;
/**
* Get coordinates of the vertex at the given index on the given spline.
*/
- float3 vertex_coordinates(const int spline_index,
- const int vertex_index,
- const float scaling_factor) const;
+ float3 vertex_coordinates(int spline_index, int vertex_index, float scaling_factor) const;
/**
* Get total control points of the NURBS spline at the given index. This is different than total
* vertices of a spline.
*/
- int total_spline_control_points(const int spline_index) const;
+ int total_spline_control_points(int spline_index) const;
/**
* Get the degree of the NURBS spline at the given index.
*/
- int get_nurbs_degree(const int spline_index) const;
+ int get_nurbs_degree(int spline_index) const;
private:
/**
* Set the final transform after applying axes settings and an Object's world transform.
*/
- void set_world_axes_transform(const eTransformAxisForward forward, const eTransformAxisUp up);
+ void set_world_axes_transform(eTransformAxisForward forward, eTransformAxisUp up);
};
} // namespace blender::io::obj
diff --git a/source/blender/io/wavefront_obj/exporter/obj_exporter.hh b/source/blender/io/wavefront_obj/exporter/obj_exporter.hh
index 1a193bf437f..a06898a21cf 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_exporter.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_exporter.hh
@@ -38,7 +38,7 @@ class OBJDepsgraph : NonMovable, NonCopyable {
bool needs_free_ = false;
public:
- OBJDepsgraph(const bContext *C, const eEvaluationMode eval_mode);
+ OBJDepsgraph(const bContext *C, eEvaluationMode eval_mode);
~OBJDepsgraph();
Depsgraph *get();
@@ -97,5 +97,5 @@ filter_supported_objects(Depsgraph *depsgraph, const OBJExportParams &export_par
*
* \return Whether the filepath is in #FILE_MAX limits.
*/
-bool append_frame_to_filename(const char *filepath, const int frame, char *r_filepath_with_frames);
+bool append_frame_to_filename(const char *filepath, int frame, char *r_filepath_with_frames);
} // namespace blender::io::obj