[FFmpeg-devel] [PATCH] ASSERT_LEVEL not defined spam

Josh joshf87 at live.com
Sat Jan 5 08:44:18 CET 2013


At least under MinGW with 3adb1f0 (master), I get a lot of noise about 
ASSERT_LEVEL not being defined at least with a simple './configure' I 
think the attached patch should cover it.

...
                  from libavfilter/af_aresample.c:29:
./libavutil/common.h: In function 'av_clip_c':
./libavutil/common.h:100:34: warning: "ASSERT_LEVEL" is not defined 
[-Wundef]
./libavutil/common.h: In function 'av_clip64_c':
./libavutil/common.h:117:34: warning: "ASSERT_LEVEL" is not defined 
[-Wundef]
./libavutil/common.h: In function 'av_clipf_c':
./libavutil/common.h:225:34: warning: "ASSERT_LEVEL" is not defined 
[-Wundef]
CC      libavfilter/af_asetnsamples.o
In file included from ./libavutil/avutil.h:238:0,
                  from ./libavutil/audio_fifo.h:30,
                  from libavfilter/af_asetnsamples.c:27:
./libavutil/common.h: In function 'av_clip_c':
./libavutil/common.h:100:34: warning: "ASSERT_LEVEL" is not defined 
[-Wundef]
./libavutil/common.h: In function 'av_clip64_c':
./libavutil/common.h:117:34: warning: "ASSERT_LEVEL" is not defined 
[-Wundef]
./libavutil/common.h: In function 'av_clipf_c':
./libavutil/common.h:225:34: warning: "ASSERT_LEVEL" is not defined 
[-Wundef]
...
-------------- next part --------------
diff --git a/libavutil/common.h b/libavutil/common.h
index 3adb1f0..778c757 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -97,7 +97,7 @@ av_const int av_log2_16bit(unsigned v);
  */
 static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
 {
-#if defined(HAVE_AV_CONFIG_H) && ASSERT_LEVEL >= 2
+#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
     if (amin > amax) abort();
 #endif
     if      (a < amin) return amin;
@@ -114,7 +114,7 @@ static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
  */
 static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, int64_t amax)
 {
-#if defined(HAVE_AV_CONFIG_H) && ASSERT_LEVEL >= 2
+#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
     if (amin > amax) abort();
 #endif
     if      (a < amin) return amin;
@@ -222,7 +222,7 @@ static av_always_inline int av_sat_dadd32_c(int a, int b)
  */
 static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
 {
-#if defined(HAVE_AV_CONFIG_H) && ASSERT_LEVEL >= 2
+#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
     if (amin > amax) abort();
 #endif
     if      (a < amin) return amin;


More information about the ffmpeg-devel mailing list