diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 03:25:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 04:32:54 +0300 |
commit | 7cb20d841da16d0bffb63154403267500e9941f5 (patch) | |
tree | ef6a5e0b4e1de2f055ad3c0b3d5bb073a237f182 /source/blender/io | |
parent | 4a78a2774bee655a54391cc8fafae2d20ead2bb0 (diff) |
Cleanup: follow our code style for float literals
Diffstat (limited to 'source/blender/io')
-rw-r--r-- | source/blender/io/alembic/exporter/abc_export_capi.cc | 2 | ||||
-rw-r--r-- | source/blender/io/alembic/intern/alembic_capi.cc | 2 | ||||
-rw-r--r-- | source/blender/io/alembic/tests/abc_matrix_test.cc | 70 | ||||
-rw-r--r-- | source/blender/io/usd/intern/usd_capi.cc | 2 | ||||
-rw-r--r-- | source/blender/io/usd/intern/usd_writer_light.cc | 2 |
5 files changed, 39 insertions, 39 deletions
diff --git a/source/blender/io/alembic/exporter/abc_export_capi.cc b/source/blender/io/alembic/exporter/abc_export_capi.cc index 892109dc578..7663d1790b6 100644 --- a/source/blender/io/alembic/exporter/abc_export_capi.cc +++ b/source/blender/io/alembic/exporter/abc_export_capi.cc @@ -236,7 +236,7 @@ bool ABC_export(Scene *scene, else { /* Fake a job context, so that we don't need NULL pointer checks while exporting. */ short stop = 0, do_update = 0; - float progress = 0.f; + float progress = 0.0f; blender::io::alembic::export_startjob(job, &stop, &do_update, &progress); blender::io::alembic::export_endjob(job); diff --git a/source/blender/io/alembic/intern/alembic_capi.cc b/source/blender/io/alembic/intern/alembic_capi.cc index eba7f64db02..026a11ca25e 100644 --- a/source/blender/io/alembic/intern/alembic_capi.cc +++ b/source/blender/io/alembic/intern/alembic_capi.cc @@ -709,7 +709,7 @@ bool ABC_import(bContext *C, else { /* Fake a job context, so that we don't need NULL pointer checks while importing. */ short stop = 0, do_update = 0; - float progress = 0.f; + float progress = 0.0f; import_startjob(job, &stop, &do_update, &progress); import_endjob(job); diff --git a/source/blender/io/alembic/tests/abc_matrix_test.cc b/source/blender/io/alembic/tests/abc_matrix_test.cc index fc5b645987e..c6d7245a52c 100644 --- a/source/blender/io/alembic/tests/abc_matrix_test.cc +++ b/source/blender/io/alembic/tests/abc_matrix_test.cc @@ -14,7 +14,7 @@ TEST(abc_matrix, CreateRotationMatrixY_YfromZ) float rot_x_mat[3][3]; float rot_y_mat[3][3]; float rot_z_mat[3][3]; - float euler[3] = {0.f, M_PI_4, 0.f}; + float euler[3] = {0.0f, M_PI_4, 0.0f}; /* Construct expected matrices */ float unit[3][3]; @@ -41,7 +41,7 @@ TEST(abc_matrix, CreateRotationMatrixZ_YfromZ) float rot_x_mat[3][3]; float rot_y_mat[3][3]; float rot_z_mat[3][3]; - float euler[3] = {0.f, 0.f, M_PI_4}; + float euler[3] = {0.0f, 0.0f, M_PI_4}; /* Construct expected matrices */ float unit[3][3]; @@ -150,25 +150,25 @@ TEST(abc_matrix, CopyM44AxisSwap_YfromZ) * above. This matrix was created by rotating a cube in Blender over * (X=10, Y=20, Z=30 degrees in XYZ order) and translating over (1, 2, 3) */ float input[4][4] = { - {0.81379765272f, 0.4698463380336f, -0.342020124197f, 0.f}, - {-0.44096961617f, 0.8825641274452f, 0.163175910711f, 0.f}, - {0.37852230668f, 0.0180283170193f, 0.925416588783f, 0.f}, - {1.f, 2.f, 3.f, 1.f}, + {0.81379765272f, 0.4698463380336f, -0.342020124197f, 0.0f}, + {-0.44096961617f, 0.8825641274452f, 0.163175910711f, 0.0f}, + {0.37852230668f, 0.0180283170193f, 0.925416588783f, 0.0f}, + {1.0f, 2.0f, 3.0f, 1.0f}, }; copy_m44_axis_swap(result, input, ABC_YUP_FROM_ZUP); /* Check the resulting rotation & translation. */ - float trans[4] = {1.f, 3.f, -2.f, 1.f}; + float trans[4] = {1.0f, 3.0f, -2.0f, 1.0f}; EXPECT_V4_NEAR(trans, result[3], 1e-5f); /* This matrix was created by rotating a cube in Blender over * (X=10, Y=30, Z=-20 degrees in XZY order) and translating over (1, 3, -2) */ float expect[4][4] = { - {0.813797652721f, -0.342020124197f, -0.469846338033f, 0.f}, - {0.378522306680f, 0.925416588783f, -0.018028317019f, 0.f}, - {0.440969616174f, -0.163175910711f, 0.882564127445f, 0.f}, - {1.f, 3.f, -2.f, 1.f}, + {0.813797652721f, -0.342020124197f, -0.469846338033f, 0.0f}, + {0.378522306680f, 0.925416588783f, -0.018028317019f, 0.0f}, + {0.440969616174f, -0.163175910711f, 0.882564127445f, 0.0f}, + {1.0f, 3.0f, -2.0f, 1.0f}, }; EXPECT_M4_NEAR(expect, result, 1e-5f); } @@ -182,10 +182,10 @@ TEST(abc_matrix, CopyM44AxisSwapWithScale_YfromZ) * (X=10, Y=20, Z=30 degrees in XYZ order), translating over (1, 2, 3), * and scaling by (4, 5, 6). */ float input[4][4] = { - {3.25519061088f, 1.8793853521347f, -1.368080496788f, 0.f}, - {-2.20484805107f, 4.4128208160400f, 0.815879583358f, 0.f}, - {2.27113389968f, 0.1081698983907f, 5.552499771118f, 0.f}, - {1.f, 2.f, 3.f, 1.f}, + {3.25519061088f, 1.8793853521347f, -1.368080496788f, 0.0f}, + {-2.20484805107f, 4.4128208160400f, 0.815879583358f, 0.0f}, + {2.27113389968f, 0.1081698983907f, 5.552499771118f, 0.0f}, + {1.0f, 2.0f, 3.0f, 1.0f}, }; copy_m44_axis_swap(result, input, ABC_YUP_FROM_ZUP); @@ -194,10 +194,10 @@ TEST(abc_matrix, CopyM44AxisSwapWithScale_YfromZ) * (X=10, Y=30, Z=-20 degrees in XZY order), translating over (1, 3, -2) * and scaling over (4, 6, 5). */ float expect[4][4] = { - {3.255190610885f, -1.368080496788f, -1.879385352134f, 0.f}, - {2.271133899688f, 5.552499771118f, -0.108169898390f, 0.f}, - {2.204848051071f, -0.815879583358f, 4.412820816040f, 0.f}, - {1.f, 3.f, -2.f, 1.f}, + {3.255190610885f, -1.368080496788f, -1.879385352134f, 0.0f}, + {2.271133899688f, 5.552499771118f, -0.108169898390f, 0.0f}, + {2.204848051071f, -0.815879583358f, 4.412820816040f, 0.0f}, + {1.0f, 3.0f, -2.0f, 1.0f}, }; EXPECT_M4_NEAR(expect, result, 1e-5f); } @@ -209,10 +209,10 @@ TEST(abc_matrix, CopyM44AxisSwap_ZfromY) /* This matrix was created by rotating a cube in Blender over * (X=10, Y=30, Z=-20 degrees in XZY order) and translating over (1, 3, -2) */ float input[4][4] = { - {0.813797652721f, -0.342020124197f, -0.469846338033f, 0.f}, - {0.378522306680f, 0.925416588783f, -0.018028317019f, 0.f}, - {0.440969616174f, -0.163175910711f, 0.882564127445f, 0.f}, - {1.f, 3.f, -2.f, 1.f}, + {0.813797652721f, -0.342020124197f, -0.469846338033f, 0.0f}, + {0.378522306680f, 0.925416588783f, -0.018028317019f, 0.0f}, + {0.440969616174f, -0.163175910711f, 0.882564127445f, 0.0f}, + {1.0f, 3.0f, -2.0f, 1.0f}, }; copy_m44_axis_swap(result, input, ABC_ZUP_FROM_YUP); @@ -220,10 +220,10 @@ TEST(abc_matrix, CopyM44AxisSwap_ZfromY) /* This matrix was created by rotating a cube in Blender over * (X=10, Y=20, Z=30 degrees in XYZ order) and translating over (1, 2, 3) */ float expect[4][4] = { - {0.813797652721f, 0.469846338033f, -0.342020124197f, 0.f}, - {-0.44096961617f, 0.882564127445f, 0.163175910711f, 0.f}, - {0.378522306680f, 0.018028317019f, 0.925416588783f, 0.f}, - {1.f, 2.f, 3.f, 1.f}, + {0.813797652721f, 0.469846338033f, -0.342020124197f, 0.0f}, + {-0.44096961617f, 0.882564127445f, 0.163175910711f, 0.0f}, + {0.378522306680f, 0.018028317019f, 0.925416588783f, 0.0f}, + {1.0f, 2.0f, 3.0f, 1.0f}, }; EXPECT_M4_NEAR(expect, result, 1e-5f); @@ -237,10 +237,10 @@ TEST(abc_matrix, CopyM44AxisSwapWithScale_ZfromY) * (X=10, Y=30, Z=-20 degrees in XZY order), translating over (1, 3, -2) * and scaling over (4, 6, 5). */ float input[4][4] = { - {3.2551906108f, -1.36808049678f, -1.879385352134f, 0.f}, - {2.2711338996f, 5.55249977111f, -0.108169898390f, 0.f}, - {2.2048480510f, -0.81587958335f, 4.412820816040f, 0.f}, - {1.f, 3.f, -2.f, 1.f}, + {3.2551906108f, -1.36808049678f, -1.879385352134f, 0.0f}, + {2.2711338996f, 5.55249977111f, -0.108169898390f, 0.0f}, + {2.2048480510f, -0.81587958335f, 4.412820816040f, 0.0f}, + {1.0f, 3.0f, -2.0f, 1.0f}, }; copy_m44_axis_swap(result, input, ABC_ZUP_FROM_YUP); @@ -249,10 +249,10 @@ TEST(abc_matrix, CopyM44AxisSwapWithScale_ZfromY) * (X=10, Y=20, Z=30 degrees in XYZ order), translating over (1, 2, 3), * and scaling by (4, 5, 6). */ float expect[4][4] = { - {3.25519061088f, 1.879385352134f, -1.36808049678f, 0.f}, - {-2.2048480510f, 4.412820816040f, 0.81587958335f, 0.f}, - {2.27113389968f, 0.108169898390f, 5.55249977111f, 0.f}, - {1.f, 2.f, 3.f, 1.f}, + {3.25519061088f, 1.879385352134f, -1.36808049678f, 0.0f}, + {-2.2048480510f, 4.412820816040f, 0.81587958335f, 0.0f}, + {2.27113389968f, 0.108169898390f, 5.55249977111f, 0.0f}, + {1.0f, 2.0f, 3.0f, 1.0f}, }; EXPECT_M4_NEAR(expect, result, 1e-5f); diff --git a/source/blender/io/usd/intern/usd_capi.cc b/source/blender/io/usd/intern/usd_capi.cc index 7b375689543..12fc04e2142 100644 --- a/source/blender/io/usd/intern/usd_capi.cc +++ b/source/blender/io/usd/intern/usd_capi.cc @@ -225,7 +225,7 @@ bool USD_export(bContext *C, else { /* Fake a job context, so that we don't need NULL pointer checks while exporting. */ short stop = 0, do_update = 0; - float progress = 0.f; + float progress = 0.0f; blender::io::usd::export_startjob(job, &stop, &do_update, &progress); blender::io::usd::export_endjob(job); diff --git a/source/blender/io/usd/intern/usd_writer_light.cc b/source/blender/io/usd/intern/usd_writer_light.cc index b6a81c973d2..f77c51c22ec 100644 --- a/source/blender/io/usd/intern/usd_writer_light.cc +++ b/source/blender/io/usd/intern/usd_writer_light.cc @@ -99,7 +99,7 @@ void USDLightWriter::do_write(HierarchyContext &context) usd_intensity = light->energy; } else { - usd_intensity = light->energy / 100.f; + usd_intensity = light->energy / 100.0f; } usd_light.CreateIntensityAttr().Set(usd_intensity, timecode); |