diff options
author | Hans Goudey <h.goudey@me.com> | 2022-05-30 18:46:32 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-05-30 18:46:44 +0300 |
commit | 3f9376851bca4e01296a98f68ad1d64462905b94 (patch) | |
tree | fd992870f029c9f99cfd0e5bd2163635a0b0c66d /source/blender/blenkernel/intern | |
parent | 3437cf155e7ca73cb96882ed5372f5baf2eac78a (diff) |
Cleanup: Clang tidy
Mostly duplicate includes, also use nullptr, and using default
member initializers.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/image_save.cc | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/volume.cc | 17 |
2 files changed, 9 insertions, 16 deletions
diff --git a/source/blender/blenkernel/intern/image_save.cc b/source/blender/blenkernel/intern/image_save.cc index 910ac15d1c5..6bfdaf9b522 100644 --- a/source/blender/blenkernel/intern/image_save.cc +++ b/source/blender/blenkernel/intern/image_save.cc @@ -107,7 +107,7 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts, if (opts->save_as_render) { /* Render/compositor output or user chose to save with render settings. */ - BKE_image_format_init_for_write(&opts->im_format, scene, NULL); + BKE_image_format_init_for_write(&opts->im_format, scene, nullptr); is_depth_set = true; if (!BKE_image_is_multiview(ima)) { /* In case multiview is disabled, @@ -188,7 +188,7 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts, } /* append UDIM marker if not present */ - if (ima->source == IMA_SRC_TILED && strstr(opts->filepath, "<UDIM>") == NULL) { + if (ima->source == IMA_SRC_TILED && strstr(opts->filepath, "<UDIM>") == nullptr) { int len = strlen(opts->filepath); STR_CONCAT(opts->filepath, len, ".<UDIM>"); } @@ -201,7 +201,7 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts, BKE_image_release_ibuf(ima, ibuf, lock); - return (ibuf != NULL); + return (ibuf != nullptr); } void BKE_image_save_options_update(ImageSaveOptions *opts, Image *image) @@ -210,7 +210,7 @@ void BKE_image_save_options_update(ImageSaveOptions *opts, Image *image) if (opts->save_as_render) { if (!opts->prev_save_as_render) { if (ELEM(image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { - BKE_image_format_init_for_write(&opts->im_format, opts->scene, NULL); + BKE_image_format_init_for_write(&opts->im_format, opts->scene, nullptr); } else { BKE_image_format_color_management_copy_from_scene(&opts->im_format, opts->scene); diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc index 307466d7dc9..82405830437 100644 --- a/source/blender/blenkernel/intern/volume.cc +++ b/source/blender/blenkernel/intern/volume.cc @@ -97,12 +97,7 @@ static struct VolumeFileCache { /* Cache Entry */ struct Entry { Entry(const std::string &filepath, const openvdb::GridBase::Ptr &grid) - : filepath(filepath), - grid_name(grid->getName()), - grid(grid), - is_loaded(false), - num_metadata_users(0), - num_tree_users(0) + : filepath(filepath), grid_name(grid->getName()), grid(grid) { } @@ -110,9 +105,7 @@ static struct VolumeFileCache { : filepath(other.filepath), grid_name(other.grid_name), grid(other.grid), - is_loaded(other.is_loaded), - num_metadata_users(0), - num_tree_users(0) + is_loaded(other.is_loaded) { } @@ -151,12 +144,12 @@ static struct VolumeFileCache { blender::Map<int, openvdb::GridBase::Ptr> simplified_grids; /* Has the grid tree been loaded? */ - mutable bool is_loaded; + mutable bool is_loaded = false; /* Error message if an error occurred while loading. */ std::string error_msg; /* User counting. */ - int num_metadata_users; - int num_tree_users; + int num_metadata_users = 0; + int num_tree_users = 0; /* Mutex for on-demand reading of tree. */ mutable std::mutex mutex; }; |