You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
doc/developer: Better {} style rule
This makes developer.texi consistent with tools/patcheck Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -179,18 +179,17 @@ int fields = ilace ? 2 : 1;
|
|||||||
@end example
|
@end example
|
||||||
|
|
||||||
@item
|
@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
|
@example c, good
|
||||||
// Good
|
// Good
|
||||||
if (bits_pixel == 24)
|
if (bits_pixel == 24) @{
|
||||||
avctx->pix_fmt = AV_PIX_FMT_BGR24;
|
avctx->pix_fmt = AV_PIX_FMT_BGR24;
|
||||||
else if (bits_pixel == 8)
|
@} else if (bits_pixel == 8) @{
|
||||||
avctx->pix_fmt = AV_PIX_FMT_GRAY8;
|
avctx->pix_fmt = AV_PIX_FMT_GRAY8;
|
||||||
else @{
|
@} else
|
||||||
av_log(avctx, AV_LOG_ERROR, "Invalid pixel format.\n");
|
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
@}
|
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@item
|
@item
|
||||||
|
Reference in New Issue
Block a user