diff options
author | Pablo Barciela <[email protected]> | 2019-04-10 21:46:24 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-19 23:18:37 +0200 |
commit | d0034595d42dc8db1abff7dd8c29d0b5c2dbc299 (patch) | |
tree | d287a1f974531563f30278e465e52c46c3a3202c /libcaja-private | |
parent | 9089dd7acc02a75438f230f8346867607eaf492b (diff) | |
download | caja-d0034595d42dc8db1abff7dd8c29d0b5c2dbc299.tar.bz2 caja-d0034595d42dc8db1abff7dd8c29d0b5c2dbc299.tar.xz |
caja-icon-canvas-item: avoid 'cppcheck' warning
Fixes 'cppcheck' warning:
[libcaja-private/caja-icon-canvas-item.c:850]: (error) Uninitialized variable: real_text_height
Diffstat (limited to 'libcaja-private')
-rw-r--r-- | libcaja-private/caja-icon-canvas-item.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index 155fa788..1a35fda7 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -830,21 +830,20 @@ compute_text_rectangle (const CajaIconCanvasItem *item, text_rectangle.y0 = icon_rectangle.y1; text_rectangle.x1 = text_rectangle.x0 + text_width; - if (usage == BOUNDS_USAGE_FOR_LAYOUT) + switch (usage) { - real_text_height = text_height_for_layout; - } - else if (usage == BOUNDS_USAGE_FOR_ENTIRE_ITEM) - { - real_text_height = text_height_for_entire_text; - } - else if (usage == BOUNDS_USAGE_FOR_DISPLAY) - { - real_text_height = text_height; - } - else - { - g_assert_not_reached (); + case BOUNDS_USAGE_FOR_LAYOUT: + real_text_height = text_height_for_layout; + break; + case BOUNDS_USAGE_FOR_ENTIRE_ITEM: + real_text_height = text_height_for_entire_text; + break; + case BOUNDS_USAGE_FOR_DISPLAY: + real_text_height = text_height; + break; + default: + g_assert_not_reached (); + break; } text_rectangle.y1 = text_rectangle.y0 + real_text_height + LABEL_OFFSET / pixels_per_unit; |