Commit 54a1e8f2 authored by Jehan's avatar Jehan

libgimpwidgets: use g_return_if_reached() in unreachable code path.

This way, we get proper CRITICAL if ever there is a logic error (or in
this case, if we add new values to enums and forget to append them to
switch cases.
This will make these bugs much easier to debug if (when!) they happen.
parent 90037116
......@@ -466,6 +466,7 @@ gimp_color_select_init (GimpColorSelect *select)
break;
default:
/* Should not happen. */
g_return_if_reached ();
break;
}
end_channel = channel + 3;
......
......@@ -421,8 +421,10 @@ gimp_color_selector_set_channel (GimpColorSelector *selector,
break;
case GIMP_COLOR_SELECTOR_ALPHA:
/* Alpha channel does not change the color model. */
break;
default:
/* Should not happen. */
g_return_if_reached ();
break;
}
......@@ -508,6 +510,7 @@ gimp_color_selector_set_model (GimpColorSelector *selector,
break;
default:
/* Should not happen. */
g_return_if_reached ();
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment