diff options
author | Hans Goudey <h.goudey@me.com> | 2022-06-23 02:58:25 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-06-23 02:58:25 +0300 |
commit | 1160a3a3f83cafda98e7bf6fb111bdacc5f28a63 (patch) | |
tree | b969f2508aac0cb59cd3fe81119dc1301a84bfb0 /source/blender/io | |
parent | d2a3b99ff7abb3d7deb30da4554b1cda6ff32766 (diff) |
Cleanup: Clang tidy
Mainly duplicate includes and else after return.
Diffstat (limited to 'source/blender/io')
-rw-r--r-- | source/blender/io/common/intern/path_util.cc | 4 | ||||
-rw-r--r-- | source/blender/io/usd/intern/usd_reader_mesh.cc | 8 | ||||
-rw-r--r-- | source/blender/io/usd/intern/usd_writer_volume.cc | 2 | ||||
-rw-r--r-- | source/blender/io/usd/tests/usd_imaging_test.cc | 6 |
4 files changed, 9 insertions, 11 deletions
diff --git a/source/blender/io/common/intern/path_util.cc b/source/blender/io/common/intern/path_util.cc index 902cf552bf0..18632b410f8 100644 --- a/source/blender/io/common/intern/path_util.cc +++ b/source/blender/io/common/intern/path_util.cc @@ -39,7 +39,7 @@ std::string path_reference(StringRefNull filepath, if (mode == PATH_REFERENCE_ABSOLUTE) { return filepath_abs; } - else if (mode == PATH_REFERENCE_RELATIVE) { + if (mode == PATH_REFERENCE_RELATIVE) { char rel_path[PATH_MAX]; BLI_strncpy(rel_path, filepath_abs, PATH_MAX); BLI_path_rel(rel_path, base_dst.c_str()); @@ -49,7 +49,7 @@ std::string path_reference(StringRefNull filepath, } return rel_path + 2; /* Skip blender's internal "//" prefix. */ } - else if (mode == PATH_REFERENCE_STRIP) { + if (mode == PATH_REFERENCE_STRIP) { return BLI_path_basename(filepath_abs); } BLI_assert_msg(false, "Invalid path reference mode"); diff --git a/source/blender/io/usd/intern/usd_reader_mesh.cc b/source/blender/io/usd/intern/usd_reader_mesh.cc index 36e1a40953c..46749b03169 100644 --- a/source/blender/io/usd/intern/usd_reader_mesh.cc +++ b/source/blender/io/usd/intern/usd_reader_mesh.cc @@ -87,11 +87,9 @@ static Material *find_existing_material( if (mat_iter != mat_map.end()) { return mat_iter->second; } - else { - /* We can't find the Blender material which was previously created for this USD - * material, which should never happen. */ - BLI_assert_unreachable(); - } + /* We can't find the Blender material which was previously created for this USD + * material, which should never happen. */ + BLI_assert_unreachable(); } } else { diff --git a/source/blender/io/usd/intern/usd_writer_volume.cc b/source/blender/io/usd/intern/usd_writer_volume.cc index 4126be6966a..6300e5c657c 100644 --- a/source/blender/io/usd/intern/usd_writer_volume.cc +++ b/source/blender/io/usd/intern/usd_writer_volume.cc @@ -100,7 +100,7 @@ std::optional<std::string> USDVolumeWriter::resolve_vdb_file(const Volume *volum vdb_file_path = construct_vdb_file_path(volume); if (!BKE_volume_save( - volume, usd_export_context_.bmain, NULL, vdb_file_path.value_or("").c_str())) { + volume, usd_export_context_.bmain, nullptr, vdb_file_path.value_or("").c_str())) { return std::nullopt; } } diff --git a/source/blender/io/usd/tests/usd_imaging_test.cc b/source/blender/io/usd/tests/usd_imaging_test.cc index 497319c59bd..5cd3c042e59 100644 --- a/source/blender/io/usd/tests/usd_imaging_test.cc +++ b/source/blender/io/usd/tests/usd_imaging_test.cc @@ -42,8 +42,8 @@ TEST_F(USDImagingTest, CapsuleAdapterTest) } pxr::UsdImagingCapsuleAdapter capsule_adapter; - pxr::VtValue points_value = capsule_adapter.GetMeshPoints(capsule.GetPrim(), - pxr::UsdTimeCode::Default()); + pxr::VtValue points_value = pxr::UsdImagingCapsuleAdapter::GetMeshPoints( + capsule.GetPrim(), pxr::UsdTimeCode::Default()); if (!points_value.IsHolding<pxr::VtArray<pxr::GfVec3f>>()) { FAIL() << "Mesh points value holding unexpected type."; return; @@ -52,7 +52,7 @@ TEST_F(USDImagingTest, CapsuleAdapterTest) pxr::VtArray<pxr::GfVec3f> points = points_value.Get<pxr::VtArray<pxr::GfVec3f>>(); EXPECT_FALSE(points.empty()); - pxr::VtValue topology_value = capsule_adapter.GetMeshTopology(); + pxr::VtValue topology_value = pxr::UsdImagingCapsuleAdapter::GetMeshTopology(); if (!topology_value.IsHolding<pxr::HdMeshTopology>()) { FAIL() << "Mesh topology value holding unexpected type."; |