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
path: root/source
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2022-01-06 13:37:51 +0300
committerSybren A. Stüvel <sybren@blender.org>2022-01-06 13:41:03 +0300
commited3fecae8e5f6f542fcfe0d58e7275283c982b3a (patch)
treec710705b011d3af4bffe7d6f5e9f744bb1247c2b /source
parentf9aa6376f1a2b13ab12a77197257e9145f029792 (diff)
Cleanup: USD/ABC, remove `const` from pass-by-value params
Remove `const` from pass-by-value parameters in function declarations. The variables passed as parameters can never be modified by the function anyway, so declaring them as `const` is meaningless. Having the declaration there could confuse, especially as it suggests it does have a meaning, training people to write meaningless code.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_cachefile.h6
-rw-r--r--source/blender/io/alembic/ABC_alembic.h8
-rw-r--r--source/blender/io/alembic/intern/abc_reader_curves.h4
-rw-r--r--source/blender/io/alembic/intern/abc_reader_mesh.h8
-rw-r--r--source/blender/io/alembic/intern/abc_reader_object.h10
-rw-r--r--source/blender/io/alembic/intern/abc_reader_points.h2
-rw-r--r--source/blender/io/usd/intern/usd_reader_xform.h2
-rw-r--r--source/blender/io/usd/usd.h4
8 files changed, 21 insertions, 23 deletions
diff --git a/source/blender/blenkernel/BKE_cachefile.h b/source/blender/blenkernel/BKE_cachefile.h
index ac621bfdcb9..0ab814c2d94 100644
--- a/source/blender/blenkernel/BKE_cachefile.h
+++ b/source/blender/blenkernel/BKE_cachefile.h
@@ -50,9 +50,7 @@ bool BKE_cachefile_filepath_get(const struct Main *bmain,
const struct CacheFile *cache_file,
char r_filename[1024]);
-float BKE_cachefile_time_offset(const struct CacheFile *cache_file,
- const float time,
- const float fps);
+float BKE_cachefile_time_offset(const struct CacheFile *cache_file, float time, float fps);
/* Modifiers and constraints open and free readers through these. */
void BKE_cachefile_reader_open(struct CacheFile *cache_file,
@@ -69,7 +67,7 @@ void BKE_cachefile_reader_free(struct CacheFile *cache_file, struct CacheReader
*/
bool BKE_cache_file_uses_render_procedural(const struct CacheFile *cache_file,
struct Scene *scene,
- const int dag_eval_mode);
+ int dag_eval_mode);
#ifdef __cplusplus
}
diff --git a/source/blender/io/alembic/ABC_alembic.h b/source/blender/io/alembic/ABC_alembic.h
index 0b5e927f02f..c1f3add377b 100644
--- a/source/blender/io/alembic/ABC_alembic.h
+++ b/source/blender/io/alembic/ABC_alembic.h
@@ -115,16 +115,16 @@ void ABC_get_transform(struct CacheReader *reader,
struct Mesh *ABC_read_mesh(struct CacheReader *reader,
struct Object *ob,
struct Mesh *existing_mesh,
- const float time,
+ float time,
const char **err_str,
- const int read_flags,
+ int read_flags,
const char *velocity_name,
- const float velocity_scale);
+ float velocity_scale);
bool ABC_mesh_topology_changed(struct CacheReader *reader,
struct Object *ob,
struct Mesh *existing_mesh,
- const float time,
+ float time,
const char **err_str);
void ABC_CacheReader_incref(struct CacheReader *reader);
diff --git a/source/blender/io/alembic/intern/abc_reader_curves.h b/source/blender/io/alembic/intern/abc_reader_curves.h
index 4cfb50ac59e..e7e6fa9f0b2 100644
--- a/source/blender/io/alembic/intern/abc_reader_curves.h
+++ b/source/blender/io/alembic/intern/abc_reader_curves.h
@@ -52,9 +52,9 @@ class AbcCurveReader final : public AbcObjectReader {
*/
struct Mesh *read_mesh(struct Mesh *existing_mesh,
const Alembic::Abc::ISampleSelector &sample_sel,
- const int read_flag,
+ int read_flag,
const char *velocity_name,
- const float velocity_scale,
+ float velocity_scale,
const char **err_str) override;
void read_curve_sample(Curve *cu,
diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.h b/source/blender/io/alembic/intern/abc_reader_mesh.h
index 2e34ca8ded0..e78f2186eda 100644
--- a/source/blender/io/alembic/intern/abc_reader_mesh.h
+++ b/source/blender/io/alembic/intern/abc_reader_mesh.h
@@ -42,9 +42,9 @@ class AbcMeshReader final : public AbcObjectReader {
struct Mesh *read_mesh(struct Mesh *existing_mesh,
const Alembic::Abc::ISampleSelector &sample_sel,
- const int read_flag,
+ int read_flag,
const char *velocity_name,
- const float velocity_scale,
+ float velocity_scale,
const char **err_str) override;
bool topology_changed(Mesh *existing_mesh,
const Alembic::Abc::ISampleSelector &sample_sel) override;
@@ -75,9 +75,9 @@ class AbcSubDReader final : public AbcObjectReader {
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override;
struct Mesh *read_mesh(struct Mesh *existing_mesh,
const Alembic::Abc::ISampleSelector &sample_sel,
- const int read_flag,
+ int read_flag,
const char *velocity_name,
- const float velocity_scale,
+ float velocity_scale,
const char **err_str) override;
};
diff --git a/source/blender/io/alembic/intern/abc_reader_object.h b/source/blender/io/alembic/intern/abc_reader_object.h
index f1c07da0764..5b327a9ddd9 100644
--- a/source/blender/io/alembic/intern/abc_reader_object.h
+++ b/source/blender/io/alembic/intern/abc_reader_object.h
@@ -149,15 +149,15 @@ class AbcObjectReader {
virtual struct Mesh *read_mesh(struct Mesh *mesh,
const Alembic::Abc::ISampleSelector &sample_sel,
- const int read_flag,
+ int read_flag,
const char *velocity_name,
- const float velocity_scale,
+ float velocity_scale,
const char **err_str);
virtual bool topology_changed(Mesh *existing_mesh,
const Alembic::Abc::ISampleSelector &sample_sel);
/** Reads the object matrix and sets up an object transform if animated. */
- void setupObjectTransform(const float time);
+ void setupObjectTransform(float time);
void addCacheModifier();
@@ -168,13 +168,13 @@ class AbcObjectReader {
void incref();
void decref();
- void read_matrix(float r_mat[4][4], const float time, const float scale, bool &is_constant);
+ void read_matrix(float r_mat[4][4], float time, float scale, bool &is_constant);
protected:
/** Determine whether we can inherit our parent's XForm. */
void determine_inherits_xform();
};
-Imath::M44d get_matrix(const Alembic::AbcGeom::IXformSchema &schema, const float time);
+Imath::M44d get_matrix(const Alembic::AbcGeom::IXformSchema &schema, float time);
} // namespace blender::io::alembic
diff --git a/source/blender/io/alembic/intern/abc_reader_points.h b/source/blender/io/alembic/intern/abc_reader_points.h
index 105d1276f7a..2f91e07d26a 100644
--- a/source/blender/io/alembic/intern/abc_reader_points.h
+++ b/source/blender/io/alembic/intern/abc_reader_points.h
@@ -45,7 +45,7 @@ class AbcPointsReader final : public AbcObjectReader {
const Alembic::Abc::ISampleSelector &sample_sel,
int read_flag,
const char *velocity_name,
- const float velocity_scale,
+ float velocity_scale,
const char **err_str) override;
};
diff --git a/source/blender/io/usd/intern/usd_reader_xform.h b/source/blender/io/usd/intern/usd_reader_xform.h
index 587ac373a4f..7720a054772 100644
--- a/source/blender/io/usd/intern/usd_reader_xform.h
+++ b/source/blender/io/usd/intern/usd_reader_xform.h
@@ -46,7 +46,7 @@ class USDXformReader : public USDPrimReader {
void create_object(Main *bmain, double motionSampleTime) override;
void read_object_data(Main *bmain, double motionSampleTime) override;
- void read_matrix(float r_mat[4][4], const float time, const float scale, bool *r_is_constant);
+ void read_matrix(float r_mat[4][4], float time, float scale, bool *r_is_constant);
bool use_parent_xform() const
{
diff --git a/source/blender/io/usd/usd.h b/source/blender/io/usd/usd.h
index 2a036c3d398..16bd826ecdd 100644
--- a/source/blender/io/usd/usd.h
+++ b/source/blender/io/usd/usd.h
@@ -106,14 +106,14 @@ void USD_get_transform(struct CacheReader *reader, float r_mat[4][4], float time
struct Mesh *USD_read_mesh(struct CacheReader *reader,
struct Object *ob,
struct Mesh *existing_mesh,
- const float time,
+ float time,
const char **err_str,
int read_flag);
bool USD_mesh_topology_changed(struct CacheReader *reader,
struct Object *ob,
struct Mesh *existing_mesh,
- const float time,
+ float time,
const char **err_str);
struct CacheReader *CacheReader_open_usd_object(struct CacheArchiveHandle *handle,