avfilter: replace fall-through comments

This commit is contained in:
Marvin Scholz
2026-02-17 21:03:27 +01:00
parent 938fa8b14c
commit 49f3620119
6 changed files with 27 additions and 22 deletions

View File

@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
@@ -1193,7 +1194,7 @@ int ff_default_query_formats(AVFilterContext *ctx)
break;
default:
av_assert2(!"Unreachable");
/* Intended fallthrough */
av_fallthrough;
case FF_FILTER_FORMATS_PASSTHROUGH:
case FF_FILTER_FORMATS_QUERY_FUNC:
case FF_FILTER_FORMATS_QUERY_FUNC2:

View File

@@ -23,6 +23,7 @@
* Convert between colorspaces.
*/
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/csp.h"
#include "libavutil/frame.h"
@@ -394,7 +395,7 @@ static int get_range_off(AVFilterContext *ctx, int *off,
s->did_warn_range = 1;
}
}
// fall-through
av_fallthrough;
case AVCOL_RANGE_MPEG:
*off = 16 << (depth - 8);
*y_rng = 219 << (depth - 8);

View File

@@ -22,6 +22,7 @@
#include <string.h>
#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavutil/cuda_check.h"
#include "libavutil/hwcontext.h"
@@ -283,7 +284,7 @@ static int conv_cuda_convert(AVFilterContext* ctx, AVFrame* out, AVFrame* in)
break;
case AV_PIX_FMT_YUV420P:
width = comp_id ? in->width / 2 : in->width;
/* fall-through */
av_fallthrough;
case AV_PIX_FMT_NV12:
height = comp_id ? in->height / 2 : in->height;
break;

View File

@@ -28,6 +28,7 @@
#include <cairo.h>
#include <stdbool.h>
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bswap.h"
@@ -633,7 +634,7 @@ next_token:
goto next_token;
}
/* fallthrough */
av_fallthrough;
default:
token->type = TOKEN_WORD;
@@ -859,7 +860,7 @@ static int vgs_parse_numeric_argument(
if (ret == 0)
break;
/* fallthrough */
av_fallthrough;
default:
vgs_log_invalid_token(log_ctx, parser, &token, "Expected numeric argument.");
@@ -1101,7 +1102,7 @@ static int vgs_parse_statement(
FAIL(EINVAL);
}
/* fallthrough */
av_fallthrough;
case PARAM_NUMERIC:
case PARAM_NUMERIC_COLOR:
@@ -1217,7 +1218,7 @@ static int vgs_parse_statement(
continue;
}
/* fallthrough */
av_fallthrough;
case PARAM_VAR_NAME: {
int var_idx = -1;

View File

@@ -379,14 +379,14 @@ static int lut_packed_16bits(AVFilterContext *ctx, void *arg, int jobnr, int nb_
switch (step) {
#if HAVE_BIGENDIAN
case 4: outrow[3] = av_bswap16(tab[3][av_bswap16(inrow[3])]); // Fall-through
case 3: outrow[2] = av_bswap16(tab[2][av_bswap16(inrow[2])]); // Fall-through
case 2: outrow[1] = av_bswap16(tab[1][av_bswap16(inrow[1])]); // Fall-through
case 4: outrow[3] = av_bswap16(tab[3][av_bswap16(inrow[3])]); av_fallthrough;
case 3: outrow[2] = av_bswap16(tab[2][av_bswap16(inrow[2])]); av_fallthrough;
case 2: outrow[1] = av_bswap16(tab[1][av_bswap16(inrow[1])]); av_fallthrough;
default: outrow[0] = av_bswap16(tab[0][av_bswap16(inrow[0])]);
#else
case 4: outrow[3] = tab[3][inrow[3]]; // Fall-through
case 3: outrow[2] = tab[2][inrow[2]]; // Fall-through
case 2: outrow[1] = tab[1][inrow[1]]; // Fall-through
case 4: outrow[3] = tab[3][inrow[3]]; av_fallthrough;
case 3: outrow[2] = tab[2][inrow[2]]; av_fallthrough;
case 2: outrow[1] = tab[1][inrow[1]]; av_fallthrough;
default: outrow[0] = tab[0][inrow[0]];
#endif
}
@@ -414,9 +414,9 @@ static int lut_packed_8bits(AVFilterContext *ctx, void *arg, int jobnr, int nb_j
outrow = outrow0 + i * out_linesize;
for (j = 0; j < w; j++) {
switch (step) {
case 4: outrow[3] = tab[3][inrow[3]]; // Fall-through
case 3: outrow[2] = tab[2][inrow[2]]; // Fall-through
case 2: outrow[1] = tab[1][inrow[1]]; // Fall-through
case 4: outrow[3] = tab[3][inrow[3]]; av_fallthrough;
case 3: outrow[2] = tab[2][inrow[2]]; av_fallthrough;
case 2: outrow[1] = tab[1][inrow[1]]; av_fallthrough;
default: outrow[0] = tab[0][inrow[0]];
}
outrow += step;

View File

@@ -35,6 +35,7 @@
#include "config_components.h"
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/ffmath.h"
@@ -1048,7 +1049,7 @@ static void rgbtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
case AV_PIX_FMT_GBRAP:
p = dstp[3] + x + y * dst_linesizep[3];
p[0] = a;
// fall-through
av_fallthrough;
case AV_PIX_FMT_GBRP:
p = dstp[0] + x + y * dst_linesize;
p[0] = g;
@@ -1063,7 +1064,7 @@ static void rgbtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
case AV_PIX_FMT_GBRAP16:
p16 = (uint16_t *)(dstp[3] + x*2 + y * dst_linesizep[3]);
p16[0] = a;
// fall-through
av_fallthrough;
case AV_PIX_FMT_GBRP9:
case AV_PIX_FMT_GBRP10:
case AV_PIX_FMT_GBRP12:
@@ -1214,7 +1215,7 @@ static void yuvtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
case AV_PIX_FMT_XV36:
case AV_PIX_FMT_XV48:
a = UINT16_MAX;
// fall-through
av_fallthrough;
case AV_PIX_FMT_AYUV64:
AV_WN16A(&dstp[0][i*8 + ayuv_map[Y]*2 + j*dst_linesizep[0]], y << desc->comp[0].shift);
AV_WN16A(&dstp[0][i*8 + ayuv_map[U]*2 + j*dst_linesizep[0]], u << desc->comp[1].shift);
@@ -1223,7 +1224,7 @@ static void yuvtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
break;
case AV_PIX_FMT_VUYX:
a = UINT8_MAX;
// fall-through
av_fallthrough;
case AV_PIX_FMT_UYVA:
case AV_PIX_FMT_VUYA:
case AV_PIX_FMT_AYUV:
@@ -1232,7 +1233,7 @@ static void yuvtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
break;
case AV_PIX_FMT_YUVA444P:
dstp[3][i + j*dst_linesizep[3]] = a;
// fall-through
av_fallthrough;
case AV_PIX_FMT_YUV444P:
case AV_PIX_FMT_YUVJ444P:
dstp[0][i + j*dst_linesizep[0]] = y;
@@ -1244,7 +1245,7 @@ static void yuvtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
case AV_PIX_FMT_YUVA444P12:
case AV_PIX_FMT_YUVA444P16:
AV_WN16A(&dstp[3][i*2 + j*dst_linesizep[3]], a);
// fall-through
av_fallthrough;
case AV_PIX_FMT_YUV444P9:
case AV_PIX_FMT_YUV444P10:
case AV_PIX_FMT_YUV444P12: