[FFmpeg-devel] [PATCH] Fix warning when libav API users include avformat.h
Art Clarke
aclarke
Sat Apr 24 21:02:53 CEST 2010
This crept in during a checkin last week (sorry it took me so longer to
patch). Clipping method generates warnings because constants used can be
interpreted in different ways depending on your C compiler. The warning
shows up under GCC 4.2.4 and higher.
To reproduce the problem, include avformat.h in a program and compile your
program. The patch just clarifies that the numbers should be treated as
int64_t constants on the LHS of the if clause. Both constants are changed
to "LL" even though only the first generates the warnings for clarity.
- Art
[exec] cc1plus: warnings being treated as errors
[exec] In file included from /mnt/hudson/data/jobs/xuggle_
xuggler_quicktest/workspace/workingcopy/build/native/i686-pc-linux-gnu/captive/usr/local/include/libavutil/avutil.h:81,
[exec] from /mnt/hudson
/data/jobs/xuggle_xuggler_quicktest/workspace/workingcopy/build/native/i686-pc-linux-gnu/captive/usr/local/include/libavcodec/avcodec.h:33,
[exec] from /mnt/hudson
/data/jobs/xuggle_xuggler_quicktest/workspace/workingcopy/build/native/i686-pc-linux-gnu/captive/usr/local/include/libavformat/avformat.h:56,
[exec] from /mnt/hudson
/data/jobs/xuggle_xuggler_quicktest/workspace/workingcopy/build/native/i686-pc-linux-gnu/../../../csrc/com/xuggle/xuggler/io/FfmpegIncludes.h:25,
[exec] from
../../../../../../../../csrc/com/xuggle/xuggler/io/FfmpegIO.cpp:24:
[exec] /mnt/hudson/data/jobs/xuggle_xuggler_quicktest/workspace/workingcopy/build/native/i686-pc-linux-gnu/captive/usr/local/include/libavutil/common.h:154:
warning: this decimal constant is unsigned only in ISO C90
--
http://www.xuggle.com/
xu?ggle (z?' gl) v. To freely encode, decode, and experience audio and
video.
Use Xuggle to get the power of FFmpeg in Java.
-------------- next part --------------
Index: libavutil/common.h
===================================================================
--- libavutil/common.h (revision 22960)
+++ libavutil/common.h (working copy)
@@ -151,7 +151,7 @@
*/
static inline av_const int32_t av_clipl_int32(int64_t a)
{
- if ((a+2147483648) & ~2147483647) return (a>>63) ^ 2147483647;
+ if ((a+2147483648LL) & ~2147483647LL) return (a>>63) ^ 2147483647;
else return a;
}
More information about the ffmpeg-devel
mailing list