osdep: add MP_FALLTHROUGH

This commit is contained in:
Kacper Michajłow 2023-01-29 13:28:08 +01:00 committed by Dudemanguy
parent 08cd7c1e29
commit 0a4b139ddf
4 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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();
}

View File

@ -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;