[vlc-devel] [RFC 01/38] include/vlc_common: mark x{malloc, realloc, calloc, strdup} as deprecated

Filip Roséen filip at videolabs.io
Mon Jun 27 13:43:12 CEST 2016


--

Not sure if we really want to do this; given that it results in a shitload of
warnings about deprecation; but maybe that will force us to spend some more
time working on getting them removed from the codebase.

---
 include/vlc_common.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index 74171c5..7a83c72 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -889,7 +889,7 @@ static inline const char *vlc_pgettext_aux( const char *ctx, const char *id )
 /*****************************************************************************
  * Loosy memory allocation functions. Do not use in new code.
  *****************************************************************************/
-static inline void *xmalloc (size_t len)
+VLC_DEPRECATED static inline void *xmalloc (size_t len)
 {
     void *ptr = malloc (len);
     if (unlikely (ptr == NULL))
@@ -897,7 +897,7 @@ static inline void *xmalloc (size_t len)
     return ptr;
 }
 
-static inline void *xrealloc (void *ptr, size_t len)
+VLC_DEPRECATED static inline void *xrealloc (void *ptr, size_t len)
 {
     void *nptr = realloc (ptr, len);
     if (unlikely (nptr == NULL))
@@ -905,7 +905,7 @@ static inline void *xrealloc (void *ptr, size_t len)
     return nptr;
 }
 
-static inline void *xcalloc (size_t n, size_t size)
+VLC_DEPRECATED static inline void *xcalloc (size_t n, size_t size)
 {
     void *ptr = calloc (n, size);
     if (unlikely (ptr == NULL))
@@ -913,7 +913,7 @@ static inline void *xcalloc (size_t n, size_t size)
     return ptr;
 }
 
-static inline char *xstrdup (const char *str)
+VLC_DEPRECATED static inline char *xstrdup (const char *str)
 {
     char *ptr = strdup (str);
     if (unlikely(ptr == NULL))
-- 
2.9.0



More information about the vlc-devel mailing list