[FFmpeg-cvslog] avutil: av_x_if_null: remove const for the return value.

Nicolas George git at videolan.org
Sat Dec 3 15:56:31 CET 2011


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Sat Dec  3 11:21:29 2011 +0100| [757cb3b46a5ae81c169a83975dc25040e7864475] | committer: Michael Niedermayer

avutil: av_x_if_null: remove const for the return value.

This is the usual weirdness with const/non-const pointers through a function.
See the prototype of strchr for a standard example.

The function had to be moved down, below the point where stdint.h is
indirectly included.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=757cb3b46a5ae81c169a83975dc25040e7864475
---

 libavutil/avutil.h |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index dd85875..85c7dbd 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -324,14 +324,6 @@ char av_get_picture_type_char(enum AVPictureType pict_type);
  * @}
  */
 
-/**
- * Return x default pointer in case p is NULL.
- */
-static inline const void *av_x_if_null(const void *p, const void *x)
-{
-    return p ? p : x;
-}
-
 #include "common.h"
 #include "error.h"
 #include "mathematics.h"
@@ -341,6 +333,14 @@ static inline const void *av_x_if_null(const void *p, const void *x)
 #include "pixfmt.h"
 
 /**
+ * Return x default pointer in case p is NULL.
+ */
+static inline void *av_x_if_null(const void *p, const void *x)
+{
+    return (void *)(intptr_t)(p ? p : x);
+}
+
+/**
  * @}
  * @}
  */



More information about the ffmpeg-cvslog mailing list