[FFmpeg-devel] [PATCH 1/4] targa: use named constants for flag values

Clément Bœsch ubitux at gmail.com
Mon Oct 8 07:49:48 CEST 2012


On Mon, Oct 08, 2012 at 12:41:18AM -0500, Bobby Bingham wrote:
> Signed-off-by: Bobby Bingham <uhmmmm at gmail.com>
> ---
>  libavcodec/targa.c | 4 ++--
>  libavcodec/targa.h | 5 +++++
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/targa.c b/libavcodec/targa.c
> index 339d7c4..e3d917e 100644
> --- a/libavcodec/targa.c
> +++ b/libavcodec/targa.c
> @@ -166,7 +166,7 @@ static int decode_frame(AVCodecContext *avctx,
>          av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
>          return -1;
>      }
> -    if(flags & 0x20){
> +    if(flags & TGA_TOPTOBOTTOM) {
>          dst = p->data[0];
>          stride = p->linesize[0];
>      }else{ //image is upside-down
> @@ -242,7 +242,7 @@ static int decode_frame(AVCodecContext *avctx,
>              }
>          }
>      }
> -    if(flags & 0x10){ // right-to-left, needs horizontal flip
> +    if(flags & TGA_RIGHTTOLEFT) { // right-to-left, needs horizontal flip
>          int x;
>          for(y = 0; y < h; y++){
>              void *line = &p->data[0][y * p->linesize[0]];
> diff --git a/libavcodec/targa.h b/libavcodec/targa.h
> index 158a5ea..8b22b16 100644
> --- a/libavcodec/targa.h
> +++ b/libavcodec/targa.h
> @@ -38,4 +38,9 @@ enum TargaCompr {
>      TGA_RLE    = 8, // flag pointing that data is RLE-coded
>  };
>  
> +enum TargaFlags {
> +	TGA_RIGHTTOLEFT = 0x10, // right-to-left (flipped horizontally)
> +	TGA_TOPTOBOTTOM = 0x20, // top-to-bottom (NOT flipped vertically)

You have tabs here, which won't pass push

> +}
> +

Does this compile without ';'?

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121008/b9d71a14/attachment.asc>


More information about the ffmpeg-devel mailing list