diff options
author | Hans Goudey <h.goudey@me.com> | 2022-06-10 11:29:35 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-06-10 11:29:35 +0300 |
commit | 6a11cd036cefd99689866ddd8f63861f9383766a (patch) | |
tree | c3ebdfc383cb77c08364c6cffab5fe6adee75a32 /source/blender/editors/sculpt_paint | |
parent | aebca2bd652dd7434a3026882c0b6584422eb718 (diff) |
Cleanup: Clang tidy
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.cc | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_automasking.cc | 22 |
2 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.cc b/source/blender/editors/sculpt_paint/paint_image.cc index e326d385593..56cd4751881 100644 --- a/source/blender/editors/sculpt_paint/paint_image.cc +++ b/source/blender/editors/sculpt_paint/paint_image.cc @@ -272,7 +272,7 @@ static bool image_paint_poll_ex(bContext *C, bool check_tool) SpaceImage *sima = CTX_wm_space_image(C); if (sima) { - if (sima->image != NULL && + if (sima->image != nullptr && (ID_IS_LINKED(sima->image) || ID_IS_OVERRIDE_LIBRARY(sima->image))) { return false; } diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc b/source/blender/editors/sculpt_paint/sculpt_automasking.cc index 94417defe48..bb101717c9b 100644 --- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc +++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc @@ -44,8 +44,8 @@ #include "bmesh.h" -#include <math.h> -#include <stdlib.h> +#include <cmath> +#include <cstdlib> using blender::IndexRange; @@ -57,7 +57,7 @@ AutomaskingCache *SCULPT_automasking_active_cache_get(SculptSession *ss) if (ss->filter_cache) { return ss->filter_cache->automasking; } - return NULL; + return nullptr; } bool SCULPT_is_automasking_mode_enabled(const Sculpt *sd, @@ -170,13 +170,13 @@ static bool sculpt_automasking_is_constrained_by_radius(Brush *br) return false; } -typedef struct AutomaskFloodFillData { +struct AutomaskFloodFillData { float *automask_factor; float radius; bool use_radius; float location[3]; char symm; -} AutomaskFloodFillData; +}; static bool automask_floodfill_cb( SculptSession *ss, int from_v, int to_v, bool UNUSED(is_duplicate), void *userdata) @@ -197,7 +197,7 @@ static float *SCULPT_topology_automasking_init(Sculpt *sd, Object *ob, float *au if (BKE_pbvh_type(ss->pbvh) == PBVH_FACES && !ss->pmap) { BLI_assert_msg(0, "Topology masking: pmap missing"); - return NULL; + return nullptr; } const int totvert = SCULPT_vertex_count_get(ss); @@ -212,7 +212,7 @@ static float *SCULPT_topology_automasking_init(Sculpt *sd, Object *ob, float *au const float radius = ss->cache ? ss->cache->radius : FLT_MAX; SCULPT_floodfill_add_active(sd, ob, ss, &flood, radius); - AutomaskFloodFillData fdata = {0}; + AutomaskFloodFillData fdata = {nullptr}; fdata.automask_factor = automask_factor; fdata.radius = radius; @@ -232,12 +232,12 @@ static float *sculpt_face_sets_automasking_init(Sculpt *sd, Object *ob, float *a Brush *brush = BKE_paint_brush(&sd->paint); if (!SCULPT_is_automasking_enabled(sd, ss, brush)) { - return NULL; + return nullptr; } if (BKE_pbvh_type(ss->pbvh) == PBVH_FACES && !ss->pmap) { BLI_assert_msg(0, "Face Sets automasking: pmap missing"); - return NULL; + return nullptr; } int tot_vert = SCULPT_vertex_count_get(ss); @@ -262,7 +262,7 @@ float *SCULPT_boundary_automasking_init(Object *ob, if (!ss->pmap) { BLI_assert_msg(0, "Boundary Edges masking: pmap missing"); - return NULL; + return nullptr; } const int totvert = SCULPT_vertex_count_get(ss); @@ -327,7 +327,7 @@ AutomaskingCache *SCULPT_automasking_cache_init(Sculpt *sd, Brush *brush, Object const int totvert = SCULPT_vertex_count_get(ss); if (!SCULPT_is_automasking_enabled(sd, ss, brush)) { - return NULL; + return nullptr; } AutomaskingCache *automasking = (AutomaskingCache *)MEM_callocN(sizeof(AutomaskingCache), |