diff options
author | Dalai Felinto <dalai@blender.org> | 2020-04-03 20:15:01 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2020-04-03 20:27:46 +0300 |
commit | d138cbfb47e379edc1ee915a8c6ff65b01f000d6 (patch) | |
tree | f4773ecce897c32eaf75295dd5f6a8e730d471ed /source/blender/editors/sculpt_paint/paint_ops.c | |
parent | b0c1184875d39abac4a65a5d20e263ea6d841009 (diff) |
Code Quality: Replace for loops with LISTBASE_FOREACH
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_ops.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index cc848b80bb3..d607b6a9d6f 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -397,7 +397,7 @@ static int palette_sort_exec(bContext *C, wmOperator *op) color_array = MEM_calloc_arrayN(totcol, sizeof(tPaletteColorHSV), __func__); /* Put all colors in an array. */ int t = 0; - for (PaletteColor *color = palette->colors.first; color; color = color->next) { + LISTBASE_FOREACH (PaletteColor *, color, &palette->colors) { float h, s, v; rgb_to_hsv(color->rgb[0], color->rgb[1], color->rgb[2], &h, &s, &v); col_elm = &color_array[t]; @@ -543,7 +543,7 @@ static int palette_join_exec(bContext *C, wmOperator *op) const int totcol = BLI_listbase_count(&palette_join->colors); if (totcol > 0) { - for (PaletteColor *color = palette_join->colors.first; color; color = color->next) { + LISTBASE_FOREACH (PaletteColor *, color, &palette_join->colors) { PaletteColor *palcol = BKE_palette_color_add(palette); if (palcol) { copy_v3_v3(palcol->rgb, color->rgb); |