gsk: Remove unnecessary G_GNUC_FALLTHROUGH
In GSK the following pattern is used four times:
```
switch (self->filter)
{
default:
g_assert_not_reached ();
G_GNUC_FALLTHROUGH;
case GSK_GPU_BLIT_LINEAR:
filter = GL_LINEAR;
break;
case GSK_GPU_BLIT_NEAREST:
filter = GL_NEAREST;
break;
}
```
The G_GNUC_FALLTHROUGH macro is not required. When G_DISABLE_ASSERT
is defined the body of the `default` case is empty, thus there is
no need. When G_DISABLE_ASSERT is not defined the body of the `default`
case contains g_assert_not_reached() thus it won't fallthrough.
This resolves the following:
```
[221/1379] Compiling C object gsk/libgsk.a.p/gpu_gskgpublitop.c.o
[...]
error: fallthrough annotation in unreachable code [-Werror,-Wimplicit-fallthrough]
1 error generated.
```
This commit is contained in:
@@ -85,7 +85,6 @@ gsk_gpu_blit_op_vk_command (GskGpuOp *op,
|
||||
{
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case GSK_GPU_BLIT_LINEAR:
|
||||
filter = VK_FILTER_LINEAR;
|
||||
break;
|
||||
@@ -160,7 +159,6 @@ gsk_gpu_blit_op_gl_command (GskGpuOp *op,
|
||||
{
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case GSK_GPU_BLIT_LINEAR:
|
||||
filter = GL_LINEAR;
|
||||
break;
|
||||
|
||||
@@ -563,7 +563,6 @@ extract_scale_from_transform (GskTransform *transform,
|
||||
{
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case GSK_TRANSFORM_CATEGORY_IDENTITY:
|
||||
case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
|
||||
*out_scale_x = 1.0f;
|
||||
|
||||
@@ -54,7 +54,6 @@ gsk_gpu_render_pass_type_to_vk_image_layout (GskRenderPassType type)
|
||||
{
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case GSK_RENDER_PASS_PRESENT:
|
||||
return VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
|
||||
case GSK_RENDER_PASS_OFFSCREEN:
|
||||
|
||||
Reference in New Issue
Block a user