summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--osdep/compiler.h2
-rw-r--r--video/out/gpu/shader_cache.c2
-rw-r--r--video/out/opengl/context.c2
-rw-r--r--video/out/vo_gpu_next.c2
4 files changed, 5 insertions, 3 deletions
diff --git a/osdep/compiler.h b/osdep/compiler.h
index 99fc8f0c25..37431e60eb 100644
--- a/osdep/compiler.h
+++ b/osdep/compiler.h
@@ -6,9 +6,11 @@
#ifdef __GNUC__
#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format(printf, a1, a2)))
#define MP_NORETURN __attribute__((noreturn))
+#define MP_FALLTHROUGH __attribute__((fallthrough))
#else
#define PRINTF_ATTRIBUTE(a1, a2)
#define MP_NORETURN
+#define MP_FALLTHROUGH do {} while (0)
#endif
// Broken crap with __USE_MINGW_ANSI_STDIO
diff --git a/video/out/gpu/shader_cache.c b/video/out/gpu/shader_cache.c
index 302508b543..9eedb1cd07 100644
--- a/video/out/gpu/shader_cache.c
+++ b/video/out/gpu/shader_cache.c
@@ -699,7 +699,7 @@ static void add_uniforms(struct gl_shader_cache *sc, bstr *dst)
case RA_VARTYPE_INT:
case RA_VARTYPE_FLOAT:
assert(sc->ra->caps & RA_CAP_GLOBAL_UNIFORM);
- // fall through
+ MP_FALLTHROUGH;
case RA_VARTYPE_TEX:
// Vulkan requires explicitly assigning the bindings in the shader
// source. For OpenGL it's optional, but requires higher GL version
diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c
index 377b678cde..5ec1e487a9 100644
--- a/video/out/opengl/context.c
+++ b/video/out/opengl/context.c
@@ -261,7 +261,7 @@ bool ra_gl_ctx_submit_frame(struct ra_swapchain *sw, const struct vo_frame *fram
case FLUSH_AUTO:
if (frame->display_synced)
break;
- // fall through
+ MP_FALLTHROUGH;
case FLUSH_YES:
gl->Flush();
}
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index 8cb05d7704..f18ab3d9a4 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -1859,7 +1859,7 @@ static void update_render_options(struct vo *vo)
#else
MP_ERR(p, "Error diffusion dithering is not implemented.\n");
#endif
- // fall through
+ MP_FALLTHROUGH;
case DITHER_ORDERED:
case DITHER_FRUIT:
p->params.dither_params = &p->dither;