diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2025-02-27 02:02:12 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2025-03-01 02:47:33 +0100 |
commit | 469b7a0ee444f208e8cc0570a9b9ba761d2f04c2 (patch) | |
tree | fe039894d0e5cf5dd7d635b67ffb97c3d3e4189b | |
parent | ace9f03a6c0a58b84a02701df1b6e5d5ac1d1b8e (diff) | |
download | ffmpeg-469b7a0ee444f208e8cc0570a9b9ba761d2f04c2.tar.gz |
doc/developer: Better {} style rule
This makes developer.texi consistent with tools/patcheck
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | doc/developer.texi | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/doc/developer.texi b/doc/developer.texi index a1bfe180c9..757e0f0ac1 100644 --- a/doc/developer.texi +++ b/doc/developer.texi @@ -179,18 +179,17 @@ int fields = ilace ? 2 : 1; @end example @item -No braces around single-line blocks: +Don't wrap single-line blocks in braces. Use braces only if there is an accompanying else statement. This keeps future code changes easier to keep track of. @example c, good // Good -if (bits_pixel == 24) +if (bits_pixel == 24) @{ avctx->pix_fmt = AV_PIX_FMT_BGR24; -else if (bits_pixel == 8) +@} else if (bits_pixel == 8) @{ avctx->pix_fmt = AV_PIX_FMT_GRAY8; -else @{ - av_log(avctx, AV_LOG_ERROR, "Invalid pixel format.\n"); +@} else return AVERROR_INVALIDDATA; -@} + @end example @item |