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:
authorCampbell Barton <campbell@blender.org>2022-06-09 14:26:48 +0300
committerCampbell Barton <campbell@blender.org>2022-06-09 14:26:48 +0300
commited159004739c7331640a88ab3c4fe25e33c8ebc0 (patch)
treeeb64fea11c4e88204aacb68f9708577fca8e90e0 /source/blender/editors/interface
parent8a6cbcf386a1833d2b76aa0afc8abf830493f190 (diff)
Cleanup: use const variables & arguments
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_draw.c4
-rw-r--r--source/blender/editors/interface/interface_eyedropper_color.c6
-rw-r--r--source/blender/editors/interface/interface_handlers.c3
3 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 18bad7949ee..d201820fbb6 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -130,7 +130,7 @@ void UI_draw_roundbox_4fv_ex(const rctf *rect,
void UI_draw_roundbox_3ub_alpha(
const rctf *rect, bool filled, float rad, const uchar col[3], uchar alpha)
{
- float colv[4] = {
+ const float colv[4] = {
((float)col[0]) / 255,
((float)col[1]) / 255,
((float)col[2]) / 255,
@@ -142,7 +142,7 @@ void UI_draw_roundbox_3ub_alpha(
void UI_draw_roundbox_3fv_alpha(
const rctf *rect, bool filled, float rad, const float col[3], float alpha)
{
- float colv[4] = {col[0], col[1], col[2], alpha};
+ const float colv[4] = {col[0], col[1], col[2], alpha};
UI_draw_roundbox_4fv_ex(rect, (filled) ? colv : NULL, NULL, 1.0f, colv, U.pixelsize, rad);
}
diff --git a/source/blender/editors/interface/interface_eyedropper_color.c b/source/blender/editors/interface/interface_eyedropper_color.c
index 895f8d0d840..241776fd761 100644
--- a/source/blender/editors/interface/interface_eyedropper_color.c
+++ b/source/blender/editors/interface/interface_eyedropper_color.c
@@ -329,7 +329,7 @@ void eyedropper_color_sample_fl(bContext *C, const int m_xy[2], float r_col[3])
ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_WINDOW, mval);
if (region) {
SpaceImage *sima = area->spacedata.first;
- int region_mval[2] = {mval[0] - region->winrct.xmin, mval[1] - region->winrct.ymin};
+ const int region_mval[2] = {mval[0] - region->winrct.xmin, mval[1] - region->winrct.ymin};
if (ED_space_image_color_sample(sima, region, region_mval, r_col, NULL)) {
return;
@@ -340,7 +340,7 @@ void eyedropper_color_sample_fl(bContext *C, const int m_xy[2], float r_col[3])
ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_WINDOW, mval);
if (region) {
SpaceNode *snode = area->spacedata.first;
- int region_mval[2] = {mval[0] - region->winrct.xmin, mval[1] - region->winrct.ymin};
+ const int region_mval[2] = {mval[0] - region->winrct.xmin, mval[1] - region->winrct.ymin};
if (ED_space_node_color_sample(bmain, snode, region, region_mval, r_col)) {
return;
@@ -351,7 +351,7 @@ void eyedropper_color_sample_fl(bContext *C, const int m_xy[2], float r_col[3])
ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_WINDOW, mval);
if (region) {
SpaceClip *sc = area->spacedata.first;
- int region_mval[2] = {mval[0] - region->winrct.xmin, mval[1] - region->winrct.ymin};
+ const int region_mval[2] = {mval[0] - region->winrct.xmin, mval[1] - region->winrct.ymin};
if (ED_space_clip_color_sample(sc, region, region_mval, r_col)) {
return;
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index b06361c7e28..11d4a440a68 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -7408,8 +7408,7 @@ static bool ui_numedit_but_CURVEPROFILE(uiBlock *block,
const float zoomy = BLI_rctf_size_y(&but->rect) / BLI_rctf_size_y(&profile->view_rect);
if (snap) {
- float d[2] = {mx - data->dragstartx, data->dragstarty};
-
+ const float d[2] = {mx - data->dragstartx, data->dragstarty};
if (len_squared_v2(d) < (9.0f * U.dpi_fac)) {
snap = false;
}