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:
authorBastien Montagne <bastien@blender.org>2020-09-21 11:35:50 +0300
committerBastien Montagne <bastien@blender.org>2020-09-21 11:37:23 +0300
commit3bb53b0ee640e744219e2a38207d1fbc76ca2068 (patch)
treeb84afd5a022be12f02ce36c17e867fbdd0dcd266 /source/blender/editors
parent213445e3896922c2278fc7cdcb74d8ca13fa6a3e (diff)
Cleanup: Sculpt/Paint ED code: correct return constant types.
Mainly use false/true for bool, but also a few others. No change in behavior expected.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c26
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_2d.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c10
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c16
5 files changed, 29 insertions, 29 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index d2ae6912fc3..6bdc072ff64 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -275,13 +275,13 @@ static bool image_paint_poll_ex(bContext *C, bool check_tool)
Object *obact;
if (!image_paint_brush(C)) {
- return 0;
+ return false;
}
obact = CTX_data_active_object(C);
if ((obact && obact->mode & OB_MODE_TEXTURE_PAINT) && CTX_wm_region_view3d(C)) {
if (!check_tool || WM_toolsystem_active_tool_is_brush(C)) {
- return 1;
+ return true;
}
}
else {
@@ -291,12 +291,12 @@ static bool image_paint_poll_ex(bContext *C, bool check_tool)
ARegion *region = CTX_wm_region(C);
if ((sima->mode == SI_MODE_PAINT) && region->regiontype == RGN_TYPE_WINDOW) {
- return 1;
+ return true;
}
}
}
- return 0;
+ return false;
}
static bool image_paint_poll(bContext *C)
@@ -316,12 +316,12 @@ static bool image_paint_2d_clone_poll(bContext *C)
if (!CTX_wm_region_view3d(C) && image_paint_poll(C)) {
if (brush && (brush->imagepaint_tool == PAINT_TOOL_CLONE)) {
if (brush->clone.image) {
- return 1;
+ return true;
}
}
}
- return 0;
+ return false;
}
/************************ paint operator ************************/
@@ -769,13 +769,13 @@ bool get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy)
if (sima->mode == SI_MODE_PAINT) {
ARegion *region = CTX_wm_region(C);
ED_space_image_get_zoom(sima, region, zoomx, zoomy);
- return 1;
+ return true;
}
}
*zoomx = *zoomy = 1;
- return 0;
+ return false;
}
/************************ cursor drawing *******************************/
@@ -1211,13 +1211,13 @@ static bool texture_paint_toggle_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if (ob == NULL || ob->type != OB_MESH) {
- return 0;
+ return false;
}
if (!ob->data || ID_IS_LINKED(ob->data)) {
- return 0;
+ return false;
}
- return 1;
+ return true;
}
static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
@@ -1346,11 +1346,11 @@ static bool texture_paint_poll(bContext *C)
{
if (texture_paint_toggle_poll(C)) {
if (CTX_data_active_object(C)->mode & OB_MODE_TEXTURE_PAINT) {
- return 1;
+ return true;
}
}
- return 0;
+ return false;
}
bool image_texture_paint_poll(bContext *C)
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index d614c800350..78dc5fea2ce 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -1037,7 +1037,7 @@ static float paint_2d_ibuf_add_if(
paint_2d_ibuf_rgb_get(ibuf, x, y, inrgb);
}
else {
- return 0;
+ return 0.0f;
}
mul_v4_fl(inrgb, w);
@@ -1690,7 +1690,7 @@ void *paint_2d_new_stroke(bContext *C, wmOperator *op, int mode)
if (BKE_image_has_packedfile(s->image) && s->image->rr != NULL) {
BKE_report(op->reports, RPT_WARNING, "Packed MultiLayer files cannot be painted");
MEM_freeN(s);
- return 0;
+ return NULL;
}
s->num_tiles = BLI_listbase_count(&s->image->tiles);
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 6f115acc856..bc1080208a5 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -774,7 +774,7 @@ static bool project_paint_PickColor(
else {
// xi = (int)((uv[0]*ibuf->x) + 0.5f);
// yi = (int)((uv[1]*ibuf->y) + 0.5f);
- // if (xi < 0 || xi >= ibuf->x || yi < 0 || yi >= ibuf->y) return 0;
+ // if (xi < 0 || xi >= ibuf->x || yi < 0 || yi >= ibuf->y) return false;
/* wrap */
xi = mod_i((int)(uv[0] * ibuf->x), ibuf->x);
@@ -899,7 +899,7 @@ static bool project_bucket_point_occluded(const ProjPaintState *ps,
int isect_ret;
const bool do_clip = RV3D_CLIPPING_ENABLED(ps->v3d, ps->rv3d);
- /* we could return 0 for 1 face buckets, as long as this function assumes
+ /* we could return false for 1 face buckets, as long as this function assumes
* that the point its testing is only every originated from an existing face */
for (; bucketFace; bucketFace = bucketFace->next) {
@@ -2080,12 +2080,12 @@ static bool line_clip_rect2f(const rctf *cliprect,
if (fabsf(l1[0] - l2[0]) < PROJ_PIXEL_TOLERANCE) {
/* is the line out of range on its X axis? */
if (l1[0] < rect->xmin || l1[0] > rect->xmax) {
- return 0;
+ return false;
}
/* line is out of range on its Y axis */
if ((l1[1] < rect->ymin && l2[1] < rect->ymin) || (l1[1] > rect->ymax && l2[1] > rect->ymax)) {
- return 0;
+ return false;
}
/* this is a single point (or close to)*/
@@ -2124,7 +2124,7 @@ static bool line_clip_rect2f(const rctf *cliprect,
/* line inside rect */
if (ok1 && ok2) {
- return 1;
+ return true;
}
/* top/bottom */
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index b7e5a73cbb3..fa79bd8ee93 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -96,7 +96,7 @@ bool paint_convert_bb_to_rect(rcti *rect,
/* return zero if the bounding box has non-positive volume */
if (bb_min[0] > bb_max[0] || bb_min[1] > bb_max[1] || bb_min[2] > bb_max[2]) {
- return 0;
+ return false;
}
ED_view3d_ob_project_mat_get(rv3d, ob, projection_mat);
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 4a3babde5f3..b11bc3fa33d 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -217,12 +217,12 @@ static bool vertex_paint_poll_ex(bContext *C, bool check_tool)
ARegion *region = CTX_wm_region(C);
if (region->regiontype == RGN_TYPE_WINDOW) {
if (!check_tool || WM_toolsystem_active_tool_is_brush(C)) {
- return 1;
+ return true;
}
}
}
}
- return 0;
+ return false;
}
bool vertex_paint_poll(bContext *C)
@@ -253,11 +253,11 @@ static bool weight_paint_poll_ex(bContext *C, bool check_tool)
ARegion *region = CTX_wm_region(C);
if (ELEM(region->regiontype, RGN_TYPE_WINDOW, RGN_TYPE_HUD)) {
if (!check_tool || WM_toolsystem_active_tool_is_brush(C)) {
- return 1;
+ return true;
}
}
}
- return 0;
+ return false;
}
bool weight_paint_poll(bContext *C)
@@ -1399,12 +1399,12 @@ static bool paint_mode_toggle_poll_test(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if (ob == NULL || ob->type != OB_MESH) {
- return 0;
+ return false;
}
if (!ob->data || ID_IS_LINKED(ob->data)) {
- return 0;
+ return false;
}
- return 1;
+ return true;
}
void PAINT_OT_weight_paint_toggle(wmOperatorType *ot)
@@ -2757,7 +2757,7 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f
memset(ob->sculpt->mode.vpaint.previous_color, 0, sizeof(uint) * me->totloop);
}
- return 1;
+ return true;
}
static void do_vpaint_brush_calc_average_color_cb_ex(void *__restrict userdata,