Re: [libav-devel] [PATCH] mov: Mark a variable as unused

2014-07-08 Thread Martin Storsjö

On Mon, 7 Jul 2014, James Almer wrote:


On 07/07/14 4:08 PM, Martin Storsjö wrote:

This silences a warning with gcc.
---
In my defense, clang didn't show this warning.
---
 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4a2d265..853c3e5 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -213,7 +213,7 @@ static int mov_metadata_loci(MOVContext *c, AVIOContext 
*pb, unsigned len)
 char language[4] = { 0 };
 char buf[100];
 uint16_t langcode = 0;
-double longitude, latitude, altitude;
+double longitude, latitude, av_unused(altitude);
 const char *key = location;

 if (len  4 + 2 + 1 + 1 + 4 + 4 + 4)


Why not just remove the variable altogether and do an avio_rb32() or 
avio_skip() after
latitude? Assuming avio_rb32() is needed at all to increase the pb pointer, 
that is.

It would remove an unnecessary division.


An extra division shouldn't really matter performance wise at this level, 
but sure, I can remove it.


// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] mov: Mark a variable as unused

2014-07-07 Thread Diego Biurrun
On Mon, Jul 07, 2014 at 10:08:26PM +0300, Martin Storsjö wrote:
 This silences a warning with gcc.
 ---
 In my defense, clang didn't show this warning.

:)

 ---
  libavformat/mov.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] mov: Mark a variable as unused

2014-07-07 Thread James Almer
On 07/07/14 4:08 PM, Martin Storsjö wrote:
 This silences a warning with gcc.
 ---
 In my defense, clang didn't show this warning.
 ---
  libavformat/mov.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libavformat/mov.c b/libavformat/mov.c
 index 4a2d265..853c3e5 100644
 --- a/libavformat/mov.c
 +++ b/libavformat/mov.c
 @@ -213,7 +213,7 @@ static int mov_metadata_loci(MOVContext *c, AVIOContext 
 *pb, unsigned len)
  char language[4] = { 0 };
  char buf[100];
  uint16_t langcode = 0;
 -double longitude, latitude, altitude;
 +double longitude, latitude, av_unused(altitude);
  const char *key = location;
  
  if (len  4 + 2 + 1 + 1 + 4 + 4 + 4)

Why not just remove the variable altogether and do an avio_rb32() or 
avio_skip() after 
latitude? Assuming avio_rb32() is needed at all to increase the pb pointer, 
that is.

It would remove an unnecessary division.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel