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:
authorHans Goudey <h.goudey@me.com>2020-08-19 04:46:29 +0300
committerHans Goudey <h.goudey@me.com>2020-08-19 04:47:00 +0300
commit349eebd7d1459fa2525850751040963899ef7535 (patch)
treeeb1db9c00555f8827fa3bd49afb744a1ada1ea6d /source/blender/editors/interface/interface_region_color_picker.c
parentffa8e7579916609b4ddd4dda031cf2a3a7eaefb1 (diff)
UI Code Quality: Use LISTBASE_FOREACH in interface directory
I only skipped a few loops in the monstrous ui_handle_menu_event function. Also, I only changed variable names where necessary to prevent redeclarations. Differential Revision: https://developer.blender.org/D8586
Diffstat (limited to 'source/blender/editors/interface/interface_region_color_picker.c')
-rw-r--r--source/blender/editors/interface/interface_region_color_picker.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_region_color_picker.c b/source/blender/editors/interface/interface_region_color_picker.c
index 0d1b483716e..8bc0f18886b 100644
--- a/source/blender/editors/interface/interface_region_color_picker.c
+++ b/source/blender/editors/interface/interface_region_color_picker.c
@@ -183,7 +183,6 @@ static void ui_update_color_picker_buts_rgb(uiBut *from_but,
ColorPicker *cpicker,
const float rgb[3])
{
- uiBut *bt;
float *hsv = cpicker->color_data;
/* Convert from RGB to HSV in perceptually linear space. */
@@ -196,7 +195,7 @@ static void ui_update_color_picker_buts_rgb(uiBut *from_but,
/* this updates button strings,
* is hackish... but button pointers are on stack of caller function */
- for (bt = block->buttons.first; bt; bt = bt->next) {
+ LISTBASE_FOREACH (uiBut *, bt, &block->buttons) {
if (bt->custom_data != cpicker) {
continue;
}
@@ -849,9 +848,7 @@ static int ui_colorpicker_small_wheel_cb(const bContext *UNUSED(C),
}
if (add != 0.0f) {
- uiBut *but;
-
- for (but = block->buttons.first; but; but = but->next) {
+ LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
if (but->type == UI_BTYPE_HSVCUBE && but->active == NULL) {
uiPopupBlockHandle *popup = block->handle;
float rgb[3];