[FFmpeg-devel] [PATCH] remove __attribute__((unused))
Reimar Döffinger
Reimar.Doeffinger
Mon May 14 16:12:53 CEST 2007
Hello,
On Sun, May 13, 2007 at 09:49:59PM +0200, Michael Niedermayer wrote:
> On Sun, May 13, 2007 at 06:51:01PM +0200, Reimar D?ffinger wrote:
> [...]
> > > > Index: libavcodec/h264.c
> > > > ===================================================================
> > > > --- libavcodec/h264.c (revision 9014)
> > > > +++ libavcodec/h264.c (working copy)
> > > > @@ -1800,7 +1800,7 @@
> > > > const int lt= src[-1-1*stride];
> > > > LOAD_TOP_EDGE
> > > > LOAD_LEFT_EDGE
> > > > - const __attribute__((unused)) int unu= l3;
> > > > + const int unu= l3;
> > >
> > > This and similar cases is to kill a warning about l3 (or whatever)
> > > being unused. The variable l3 is declared by the macro
> > > LOAD_LEFT_EDGE, but isn't used everywhere this macro is invoked. I
> > > think the proper solution is to put attribute_unused on all the
> > > variables declared by those macros.
> >
> > I tend to agree but this is for the maintainers to decide.
>
> iam ok with it ...
Like in attached patch?
> iam also ok with the patch
Applied.
Greetings,
Reimar D?ffinger
-------------- next part --------------
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 489fad4..03c88d8 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1733,22 +1733,22 @@ static void pred4x4_128_dc_c(uint8_t *src, uint8_t *topright, int stride){
#define LOAD_TOP_RIGHT_EDGE\
- const int t4= topright[0];\
- const int t5= topright[1];\
- const int t6= topright[2];\
- const int t7= topright[3];\
+ const int t4 attribute_unused= topright[0];\
+ const int t5 attribute_unused= topright[1];\
+ const int t6 attribute_unused= topright[2];\
+ const int t7 attribute_unused= topright[3];\
#define LOAD_LEFT_EDGE\
- const int l0= src[-1+0*stride];\
- const int l1= src[-1+1*stride];\
- const int l2= src[-1+2*stride];\
- const int l3= src[-1+3*stride];\
+ const int l0 attribute_unused= src[-1+0*stride];\
+ const int l1 attribute_unused= src[-1+1*stride];\
+ const int l2 attribute_unused= src[-1+2*stride];\
+ const int l3 attribute_unused= src[-1+3*stride];\
#define LOAD_TOP_EDGE\
- const int t0= src[ 0-1*stride];\
- const int t1= src[ 1-1*stride];\
- const int t2= src[ 2-1*stride];\
- const int t3= src[ 3-1*stride];\
+ const int t0 attribute_unused= src[ 0-1*stride];\
+ const int t1 attribute_unused= src[ 1-1*stride];\
+ const int t2 attribute_unused= src[ 2-1*stride];\
+ const int t3 attribute_unused= src[ 3-1*stride];\
static void pred4x4_down_right_c(uint8_t *src, uint8_t *topright, int stride){
const int lt= src[-1-1*stride];
@@ -1800,7 +1800,6 @@ static void pred4x4_vertical_right_c(uint8_t *src, uint8_t *topright, int stride
const int lt= src[-1-1*stride];
LOAD_TOP_EDGE
LOAD_LEFT_EDGE
- const attribute_unused int unu= l3;
src[0+0*stride]=
src[1+2*stride]=(lt + t0 + 1)>>1;
@@ -1823,7 +1822,6 @@ static void pred4x4_vertical_right_c(uint8_t *src, uint8_t *topright, int stride
static void pred4x4_vertical_left_c(uint8_t *src, uint8_t *topright, int stride){
LOAD_TOP_EDGE
LOAD_TOP_RIGHT_EDGE
- const attribute_unused int unu= t7;
src[0+0*stride]=(t0 + t1 + 1)>>1;
src[1+0*stride]=
@@ -1868,7 +1866,6 @@ static void pred4x4_horizontal_down_c(uint8_t *src, uint8_t *topright, int strid
const int lt= src[-1-1*stride];
LOAD_TOP_EDGE
LOAD_LEFT_EDGE
- const attribute_unused int unu= t3;
src[0+0*stride]=
src[2+1*stride]=(lt + l0 + 1)>>1;
More information about the ffmpeg-devel
mailing list