From 2c08bf1bd744bb8eb5986f1ccb3ae03e284170dc Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 18 Dec 2013 17:12:21 +0100 Subject: Reduce recursive config.h inclusions in headers In my opinion, config.h inclusions should be kept to a minimum. MPlayer code really liked including config.h everywhere, though, even in often used header files. Try to reduce this. --- audio/filter/af.c | 2 ++ audio/filter/af.h | 2 -- audio/filter/af_lavcac3enc.c | 2 +- audio/format.h | 2 +- common/msg.h | 7 ++++--- osdep/getch2.h | 2 -- osdep/glob.h | 1 - stream/stream.h | 1 - stream/stream_bluray.c | 1 + stream/stream_dvd.c | 1 + sub/img_convert.c | 1 + video/decode/lavc.h | 2 -- video/fmt-conversion.c | 6 ++++-- video/mp_image.h | 1 + video/out/x11_common.h | 2 -- video/sws_utils.c | 2 ++ 16 files changed, 18 insertions(+), 17 deletions(-) diff --git a/audio/filter/af.c b/audio/filter/af.c index dfe1666e0a..417dede971 100644 --- a/audio/filter/af.c +++ b/audio/filter/af.c @@ -22,6 +22,8 @@ #include #include +#include "common/common.h" + #include "options/m_option.h" #include "options/m_config.h" diff --git a/audio/filter/af.h b/audio/filter/af.h index 1e78c01718..d08560bece 100644 --- a/audio/filter/af.h +++ b/audio/filter/af.h @@ -23,8 +23,6 @@ #include #include -#include "config.h" - #include "options/options.h" #include "audio/format.h" #include "audio/chmap.h" diff --git a/audio/filter/af_lavcac3enc.c b/audio/filter/af_lavcac3enc.c index 4331122299..f0a174b475 100644 --- a/audio/filter/af_lavcac3enc.c +++ b/audio/filter/af_lavcac3enc.c @@ -32,7 +32,7 @@ #include #include -#include "config.h" +#include "common/common.h" #include "af.h" #include "audio/audio_buffer.h" #include "audio/fmt-conversion.h" diff --git a/audio/format.h b/audio/format.h index d21707e677..19118a7b59 100644 --- a/audio/format.h +++ b/audio/format.h @@ -25,7 +25,7 @@ #include #include -#include "config.h" + #include "bstr/bstr.h" #if BYTE_ORDER == BIG_ENDIAN diff --git a/common/msg.h b/common/msg.h index 7b93d831d8..8466e7e2b6 100644 --- a/common/msg.h +++ b/common/msg.h @@ -21,6 +21,10 @@ #include #include +#include +#include + +#include "compat/compiler.h" struct mp_log; @@ -131,9 +135,6 @@ extern int verbose; int mp_msg_test(int mod, int lev); bool mp_msg_test_log(struct mp_log *log, int lev); -#include "config.h" -#include "common/common.h" - // Note: using mp_msg_log or the MP_ERR/... macros is preferred. void mp_msg_va(int mod, int lev, const char *format, va_list va); void mp_msg(int mod, int lev, const char *format, ... ) PRINTF_ATTRIBUTE(3, 4); diff --git a/osdep/getch2.h b/osdep/getch2.h index 4dc3b29dce..76cedd9928 100644 --- a/osdep/getch2.h +++ b/osdep/getch2.h @@ -26,8 +26,6 @@ #include -#include "config.h" - /* Screen size. Initialized by load_termcap() and get_screen_size() */ extern int screen_width; extern int screen_height; diff --git a/osdep/glob.h b/osdep/glob.h index 2d23b3a075..f117725d63 100644 --- a/osdep/glob.h +++ b/osdep/glob.h @@ -20,7 +20,6 @@ #define MPLAYER_GLOB_H #include -#include "config.h" typedef struct { size_t gl_pathc; diff --git a/stream/stream.h b/stream/stream.h index 7d10eccd28..34a7b30733 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -19,7 +19,6 @@ #ifndef MPLAYER_STREAM_H #define MPLAYER_STREAM_H -#include "config.h" #include "common/msg.h" #include #include diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c index be7a846e56..3ee6aa46fe 100644 --- a/stream/stream_bluray.c +++ b/stream/stream_bluray.c @@ -37,6 +37,7 @@ #include "config.h" #include "talloc.h" +#include "common/common.h" #include "common/msg.h" #include "options/m_option.h" #include "stream.h" diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index b57e4d9e7e..ece9975e4d 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -27,6 +27,7 @@ #include "config.h" #include "talloc.h" +#include "common/common.h" #include "common/msg.h" #include diff --git a/sub/img_convert.c b/sub/img_convert.c index ce72f2c6d3..8c42c5ed4b 100644 --- a/sub/img_convert.c +++ b/sub/img_convert.c @@ -23,6 +23,7 @@ #include "talloc.h" +#include "common/common.h" #include "img_convert.h" #include "osd.h" #include "video/img_format.h" diff --git a/video/decode/lavc.h b/video/decode/lavc.h index c623700089..ead147ab18 100644 --- a/video/decode/lavc.h +++ b/video/decode/lavc.h @@ -5,8 +5,6 @@ #include -#include "config.h" - #include "demux/stheader.h" #include "video/mp_image.h" #include "video/hwdec.h" diff --git a/video/fmt-conversion.c b/video/fmt-conversion.c index 2dbbd026bc..e79ce4d29d 100644 --- a/video/fmt-conversion.c +++ b/video/fmt-conversion.c @@ -16,9 +16,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "common/msg.h" -#include "libavutil/avutil.h" #include +#include + +#include "config.h" +#include "common/msg.h" #include "video/img_format.h" #include "fmt-conversion.h" diff --git a/video/mp_image.h b/video/mp_image.h index dfb83b3bb1..c882a59caa 100644 --- a/video/mp_image.h +++ b/video/mp_image.h @@ -24,6 +24,7 @@ #include #include #include +#include "common/common.h" #include "common/msg.h" #include "csputils.h" #include "video/img_format.h" diff --git a/video/out/x11_common.h b/video/out/x11_common.h index 0b22681731..dedf85c257 100644 --- a/video/out/x11_common.h +++ b/video/out/x11_common.h @@ -24,8 +24,6 @@ #include #include -#include "config.h" - struct vo; struct mp_rect; diff --git a/video/sws_utils.c b/video/sws_utils.c index 5455c7d51b..28ec10cb6a 100644 --- a/video/sws_utils.c +++ b/video/sws_utils.c @@ -22,6 +22,8 @@ #include #include +#include "config.h" + #include "sws_utils.h" #include "common/common.h" -- cgit v1.2.3