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:
authorSybren A. Stüvel <sybren@blender.org>2019-09-17 13:15:49 +0300
committerSybren A. Stüvel <sybren@blender.org>2019-09-17 15:09:42 +0300
commita3c8afc7cd9add80c353497d70dad3cd234d3adf (patch)
tree5a2b2f436227f32643df967596a44f9e3b1f5de7 /source/blender/alembic
parentc25f5a375e6c7469ee55a300a92eac362a46f697 (diff)
Cleanup: Alembic: use pointers instead of references when passing progress variables
Using pointers instead of references when passing progress variables makes the C++ code more in line with the C code (as it doesn't transform pointer parameters to reference parameters). Also makes it easier to spot when a common Blender pattern is implemented incorrectly (fix will be in the next commit).
Diffstat (limited to 'source/blender/alembic')
-rw-r--r--source/blender/alembic/intern/abc_exporter.cc6
-rw-r--r--source/blender/alembic/intern/abc_exporter.h2
-rw-r--r--source/blender/alembic/intern/alembic_capi.cc2
3 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc
index a7549cc1f47..94263f61518 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -263,7 +263,7 @@ void AbcExporter::getFrameSet(unsigned int nr_of_samples, std::set<double> &fram
}
}
-void AbcExporter::operator()(float &progress, bool &was_canceled)
+void AbcExporter::operator()(float *progress, bool *was_canceled)
{
std::string scene_name;
@@ -332,10 +332,10 @@ void AbcExporter::operator()(float &progress, bool &was_canceled)
size_t i = 0;
for (; begin != end; ++begin) {
- progress = (++i / size);
+ *progress = (++i / size);
if (G.is_break) {
- was_canceled = true;
+ *was_canceled = true;
break;
}
diff --git a/source/blender/alembic/intern/abc_exporter.h b/source/blender/alembic/intern/abc_exporter.h
index e6a7a3fc7f4..cc8d9a75765 100644
--- a/source/blender/alembic/intern/abc_exporter.h
+++ b/source/blender/alembic/intern/abc_exporter.h
@@ -104,7 +104,7 @@ class AbcExporter {
AbcExporter(Main *bmain, const char *filename, ExportSettings &settings);
~AbcExporter();
- void operator()(float &progress, bool &was_canceled);
+ void operator()(float *progress, bool *was_canceled);
protected:
void getShutterSamples(unsigned int nr_of_samples,
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index 9ace0a8faa9..f9dc688c159 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -261,7 +261,7 @@ static void export_startjob(void *customdata, short *stop, short *do_update, flo
const int orig_frame = CFRA;
data->was_canceled = false;
- exporter(*data->progress, data->was_canceled);
+ exporter(progress, &data->was_canceled);
if (CFRA != orig_frame) {
CFRA = orig_frame;