Re: [FFmpeg-devel] [PATCH] mem: Make function attribute usage consistent

2016-07-31 Thread Timothy Gu
On Sun, Jul 31, 2016 at 4:56 AM Michael Niedermayer 
wrote:

> On Sat, Jul 30, 2016 at 07:13:06PM -0700, Timothy Gu wrote:
> > ---
> >  libavutil/mem.h | 47 +--
> >  1 file changed, 37 insertions(+), 10 deletions(-)
>
> causes
> make fate-lossless-shorten
> to Abort
>

Patch dropped. This might be a GCC issue since I cannot reproduce it on gcc
(Debian 4.9.2-10) 4.9.2.

Timothy
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] mem: Make function attribute usage consistent

2016-07-31 Thread Michael Niedermayer
On Sat, Jul 30, 2016 at 07:13:06PM -0700, Timothy Gu wrote:
> ---
>  libavutil/mem.h | 47 +--
>  1 file changed, 37 insertions(+), 10 deletions(-)

causes
make fate-lossless-shorten
to Abort
--- ./tests/ref/fate/lossless-shorten   2016-07-28 11:52:04.762208148 +0200
+++ tests/data/fate/lossless-shorten2016-07-31 13:51:12.999819376 +0200
@@ -1 +0,0 @@
-da93c50961443b88fce416ae61c8ca8a
Test lossless-shorten failed. Look at tests/data/fate/lossless-shorten.err for 
details.
make: *** [fate-lossless-shorten] Error 134

can you reproduce or should i look into this more ?


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] mem: Make function attribute usage consistent

2016-07-30 Thread Timothy Gu
---
 libavutil/mem.h | 47 +--
 1 file changed, 37 insertions(+), 10 deletions(-)

diff --git a/libavutil/mem.h b/libavutil/mem.h
index 2f53b47..a6bb6b7 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -80,7 +80,9 @@
  * be allocated.
  * @see av_mallocz()
  */
-void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
+av_malloc_attrib
+av_alloc_size(1)
+void *av_malloc(size_t size);
 
 /**
  * Allocate a block of size * nmemb bytes with av_malloc().
@@ -90,7 +92,9 @@ void *av_malloc(size_t size) av_malloc_attrib 
av_alloc_size(1);
  * be allocated.
  * @see av_malloc()
  */
-av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t 
size)
+av_malloc_attrib
+av_alloc_size(1, 2)
+static inline void *av_malloc_array(size_t nmemb, size_t size)
 {
 if (!size || nmemb >= INT_MAX / size)
 return NULL;
@@ -115,7 +119,9 @@ av_alloc_size(1, 2) static inline void 
*av_malloc_array(size_t nmemb, size_t siz
  *  some libc implementations.
  * @see av_fast_realloc()
  */
-void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
+av_malloc_attrib
+av_alloc_size(2)
+void *av_realloc(void *ptr, size_t size);
 
 /**
  * Allocate or reallocate a block of memory.
@@ -125,6 +131,8 @@ void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
  * - It frees the input block in case of failure, thus avoiding the memory
  *   leak with the classic "buf = realloc(buf); if (!buf) return -1;".
  */
+av_malloc_attrib
+av_alloc_size(2, 3)
 void *av_realloc_f(void *ptr, size_t nelem, size_t elsize);
 
 /**
@@ -145,6 +153,7 @@ void *av_realloc_f(void *ptr, size_t nelem, size_t elsize);
  *  some libc implementations.
  */
 av_warn_unused_result
+av_alloc_size(2)
 int av_reallocp(void *ptr, size_t size);
 
 /**
@@ -164,7 +173,9 @@ int av_reallocp(void *ptr, size_t size);
  *  The situation is undefined according to POSIX and may crash with
  *  some libc implementations.
  */
-av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t 
size);
+av_malloc_attrib
+av_alloc_size(2, 3)
+void *av_realloc_array(void *ptr, size_t nmemb, size_t size);
 
 /**
  * Allocate or reallocate an array through a pointer to a pointer.
@@ -183,7 +194,8 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, 
size_t nmemb, size_t size)
  *  The situation is undefined according to POSIX and may crash with
  *  some libc implementations.
  */
-av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t 
size);
+av_alloc_size(2, 3)
+int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
 
 /**
  * Free a memory block which has been allocated with av_malloc(z)() or
@@ -203,7 +215,9 @@ void av_free(void *ptr);
  * @return Pointer to the allocated block, NULL if it cannot be allocated.
  * @see av_malloc()
  */
-void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
+av_malloc_attrib
+av_alloc_size(1)
+void *av_mallocz(size_t size);
 
 /**
  * Allocate a block of nmemb * size bytes with alignment suitable for all
@@ -215,7 +229,9 @@ void *av_mallocz(size_t size) av_malloc_attrib 
av_alloc_size(1);
  * @param size
  * @return Pointer to the allocated block, NULL if it cannot be allocated.
  */
-void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;
+av_malloc_attrib
+av_alloc_size(1, 2)
+void *av_calloc(size_t nmemb, size_t size);
 
 /**
  * Allocate a block of size * nmemb bytes with av_mallocz().
@@ -226,7 +242,9 @@ void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;
  * @see av_mallocz()
  * @see av_malloc_array()
  */
-av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t 
size)
+av_malloc_attrib
+av_alloc_size(1, 2)
+static inline void *av_mallocz_array(size_t nmemb, size_t size)
 {
 if (!size || nmemb >= INT_MAX / size)
 return NULL;
@@ -239,7 +257,8 @@ av_alloc_size(1, 2) static inline void 
*av_mallocz_array(size_t nmemb, size_t si
  * @return Pointer to a newly-allocated string containing a
  * copy of s or NULL if the string cannot be allocated.
  */
-char *av_strdup(const char *s) av_malloc_attrib;
+av_malloc_attrib
+char *av_strdup(const char *s);
 
 /**
  * Duplicate a substring of the string s.
@@ -249,7 +268,9 @@ char *av_strdup(const char *s) av_malloc_attrib;
  * @return Pointer to a newly-allocated string containing a
  * copy of s or NULL if the string cannot be allocated.
  */
-char *av_strndup(const char *s, size_t len) av_malloc_attrib;
+av_malloc_attrib
+av_alloc_size(2)
+char *av_strndup(const char *s, size_t len);
 
 /**
  * Duplicate the buffer p.
@@ -257,6 +278,8 @@ char *av_strndup(const char *s, size_t len) 
av_malloc_attrib;
  * @return Pointer to a newly allocated buffer containing a
  * copy of p or NULL if the buffer cannot be allocated.
  */
+av_malloc_attrib
+av_alloc_size(2)
 void *av_memdup(const void *p, size_t size);
 
 /**
@@ -368,6 +391,8 @@ void av_memcpy_backptr(uint8_t *dst, int back, int